aboutsummaryrefslogtreecommitdiff
path: root/src/ppu
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-04-03 16:07:28 +0200
committerlonkaars <loek@pipeframe.xyz>2023-04-03 16:07:28 +0200
commit0545586aacc06add477b6df38cd50900698f6d9a (patch)
treeefb8d86dc1343cb093ec7f7828270830cea81499 /src/ppu
parent46bf4306575fa31fccaff19f0a592f8b40dd46cb (diff)
worky but janky integration done
Diffstat (limited to 'src/ppu')
-rw-r--r--src/ppu/consts.h4
-rw-r--r--src/ppu/stm.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/ppu/consts.h b/src/ppu/consts.h
index 917510f..4cdd428 100644
--- a/src/ppu/consts.h
+++ b/src/ppu/consts.h
@@ -25,9 +25,9 @@
/** @brief amount of bytes in command (16 + 16 bits) */
#define HH_PPU_COMMAND_BYTES 4
-/** @brief command buffer size (large enough to update entire screen + all fg sprites + aux + all palettes) */
+/** @brief command buffer size (large enough to update entire screen + all fg sprites + aux + all palettes + 16 for safety) */
#define HH_PPU_COMMAND_BUFFER_SIZE (HH_PPU_COMMAND_BYTES * \
- (HH_PPU_VRAM_FAM_SIZE + HH_PPU_VRAM_BAM_SIZE + HH_PPU_VRAM_AUX_SIZE + HH_PPU_VRAM_PAL_SIZE))
+ (HH_PPU_VRAM_FAM_SIZE + HH_PPU_VRAM_BAM_SIZE + HH_PPU_VRAM_AUX_SIZE + HH_PPU_VRAM_PAL_SIZE + 16))
#include "ppu/types.h"
diff --git a/src/ppu/stm.c b/src/ppu/stm.c
index 8334090..72e46ae 100644
--- a/src/ppu/stm.c
+++ b/src/ppu/stm.c
@@ -15,7 +15,7 @@ void hh_ppu_vram_dwrite(uint8_t* data, size_t size) {
HAL_SPI_Transmit(&hspi1, test, 4, HAL_MAX_DELAY);
// HAL_Delay(100);
}
- HAL_SPI_Transmit(&hspi1, (uint8_t[4]){ 0xff }, size, HAL_MAX_DELAY);
+ HAL_SPI_Transmit(&hspi1, (uint8_t[4]){ 0xff }, 4, HAL_MAX_DELAY);
// reset SPI
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_9, GPIO_PIN_RESET);