|
@ -3,6 +3,7 @@ |
|
|
#include <string.h> |
|
|
#include <string.h> |
|
|
|
|
|
|
|
|
#include "game.h" |
|
|
#include "game.h" |
|
|
|
|
|
#include "player.h" |
|
|
#include "sdk/hardware.h" |
|
|
#include "sdk/hardware.h" |
|
|
#include "vram.h" |
|
|
#include "vram.h" |
|
|
|
|
|
|
|
@ -30,7 +31,8 @@ void map_load(map_t *map) { |
|
|
rSCX = INIT_SCX; |
|
|
rSCX = INIT_SCX; |
|
|
rSCY = INIT_SCY; |
|
|
rSCY = INIT_SCY; |
|
|
|
|
|
|
|
|
// TODO: Update player state |
|
|
|
|
|
|
|
|
PLAYER.x = (MAP.spawn_x - MAP.camera_x) * 8; |
|
|
|
|
|
PLAYER.y = (MAP.spawn_y - MAP.camera_y) * 8; |
|
|
|
|
|
|
|
|
memcpy(VRAM_TILE_PTR(TILE_INDEX_BACKGROUND), (uint8_t *)MAP.tile_ptr, |
|
|
memcpy(VRAM_TILE_PTR(TILE_INDEX_BACKGROUND), (uint8_t *)MAP.tile_ptr, |
|
|
MAP.tile_size); |
|
|
MAP.tile_size); |
|
@ -56,12 +58,11 @@ void map_update(void) { |
|
|
pending_row_dest = 0; |
|
|
pending_row_dest = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// TODO: Make it work |
|
|
|
|
|
/* if (pending_col_dest != 0) { |
|
|
|
|
|
vram_enqueue_mem_xfer(pending_col_dest, &pending_col[0], |
|
|
|
|
|
sizeof pending_col); |
|
|
|
|
|
pending_col_dest = 0; |
|
|
|
|
|
} */ |
|
|
|
|
|
|
|
|
if (pending_col_dest != 0) { |
|
|
|
|
|
vram_enqueue_mem_xfer(XFER_TYPE_COL, pending_col_dest, &pending_col[0], |
|
|
|
|
|
sizeof pending_col); |
|
|
|
|
|
pending_col_dest = 0; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static void map_enqueue_row(uint16_t vram_ptr, int8_t x0, int8_t y0) { |
|
|
static void map_enqueue_row(uint16_t vram_ptr, int8_t x0, int8_t y0) { |
|
|