map: Added template maps for dungeon drawing
authorLukas Krickl <lukas@krickl.dev>
Tue, 16 Dec 2025 13:28:26 +0000 (14:28 +0100)
committerLukas Krickl <lukas@krickl.dev>
Tue, 16 Dec 2025 13:28:26 +0000 (14:28 +0100)
Added example of map draw loader

14 files changed:
makefile
maps/far_wall.inc [new file with mode: 0644]
maps/l1.inc [new file with mode: 0644]
maps/near_wall.inc [new file with mode: 0644]
maps/newat_wall.inc [new file with mode: 0644]
maps/spawn.inc [deleted file]
src/defs.s
src/levels.s
src/map.s
src/player.s
src/tiles.s
src/update.s
src/wram.s
tools/tmx2map.py

index 3c397fa22dd72e2d2c0aaefcaa74a33d65d76b6e..80c3fc5cc496a68b57f810cb67a58d2206c1702c 100644 (file)
--- a/makefile
+++ b/makefile
@@ -20,4 +20,6 @@ tiles:
 
 .PHONY: maps
 maps:
-       ./tools/tmx2map.py assets/maps/l1.tmx > maps/spawn.inc
+       ./tools/tmx2map.py assets/maps/near_wall.tmx 1 > maps/near_wall.inc
+       ./tools/tmx2map.py assets/maps/far_wall.tmx 1 > maps/far_wall.inc
+       ./tools/tmx2map.py assets/maps/l1.tmx > maps/l1.inc
diff --git a/maps/far_wall.inc b/maps/far_wall.inc
new file mode 100644 (file)
index 0000000..07fc901
--- /dev/null
@@ -0,0 +1,16 @@
+; this map was generated by tmx2map.py
+
+.db 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
+.db 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
+.db 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
+.db 0x0, 0x1, 0x2, 0x3, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x4, 0x5, 0x6, 0x7
+.db 0x10, 0x12, 0x12, 0x13, 0x0, 0x1, 0x2, 0x3, 0x11, 0x11, 0x11, 0x11, 0x4, 0x5, 0x6, 0x7, 0x14, 0x12, 0x12, 0x20
+.db 0x10, 0x12, 0x12, 0x12, 0x10, 0x12, 0x12, 0x13, 0x15, 0x21, 0x21, 0x16, 0x14, 0x12, 0x12, 0x20, 0x12, 0x12, 0x12, 0x20
+.db 0x10, 0x12, 0x12, 0x12, 0x10, 0x12, 0x12, 0x12, 0x10, 0x12, 0x12, 0x20, 0x12, 0x12, 0x12, 0x20, 0x12, 0x12, 0x12, 0x20
+.db 0x10, 0x12, 0x12, 0x12, 0x10, 0x12, 0x12, 0x23, 0x25, 0x22, 0x22, 0x26, 0x24, 0x12, 0x12, 0x20, 0x12, 0x12, 0x12, 0x20
+.db 0x10, 0x12, 0x12, 0x23, 0x30, 0x31, 0x32, 0x33, 0x17, 0x17, 0x5a, 0x17, 0x34, 0x35, 0x36, 0x37, 0x24, 0x12, 0x12, 0x20
+.db 0x30, 0x31, 0x32, 0x33, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x34, 0x35, 0x36, 0x37
+.db 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x17, 0x17, 0x17, 0x17
+.db 0x17, 0x17, 0x70, 0x71, 0x72, 0x73, 0x74, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17
+.db 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17
+.db 0x17, 0x17, 0x17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 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xb, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xb, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xb, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xb, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xa, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0x6
diff --git a/maps/near_wall.inc b/maps/near_wall.inc
new file mode 100644 (file)
index 0000000..8788c81
--- /dev/null
@@ -0,0 +1,16 @@
+; this map was generated by tmx2map.py
+
+.db 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
+.db 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
+.db 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11
+.db 0x0, 0x1, 0x2, 0x3, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x4, 0x5, 0x6, 0x7
+.db 0x10, 0x12, 0x12, 0x13, 0x15, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x16, 0x14, 0x12, 0x12, 0x20
+.db 0x10, 0x12, 0x12, 0x12, 0x10, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x20, 0x12, 0x12, 0x12, 0x20
+.db 0x10, 0x12, 0x12, 0x12, 0x10, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x20, 0x12, 0x12, 0x12, 0x20
+.db 0x10, 0x12, 0x12, 0x12, 0x10, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x20, 0x12, 0x12, 0x12, 0x20
+.db 0x10, 0x12, 0x12, 0x23, 0x25, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x26, 0x24, 0x12, 0x12, 0x20
+.db 0x30, 0x31, 0x32, 0x33, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x34, 0x35, 0x36, 0x37
+.db 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x17, 0x17, 0x17, 0x17
+.db 0x17, 0x17, 0x70, 0x71, 0x72, 0x73, 0x74, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17
+.db 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17
+.db 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17
diff --git a/maps/newat_wall.inc b/maps/newat_wall.inc
new file mode 100644 (file)
index 0000000..9a0e205
--- /dev/null
@@ -0,0 +1,16 @@
+; this map was generated by tmx2map.py
+
+.db 0x9, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0xd, 0x5
+.db 0xb, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xb, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xb, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xb, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xb, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xb, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xb, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0xf, 0x7
+.db 0xb, 0xf, 0x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e, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0xe, 0x6
index 2fa99ce890ab3cbf6f19408a3de90690a8fd95ff..cc2879d5ba7ffae03f4b4c5b5644e01011a59882 100644 (file)
 #define MAP_H 14
 #define MAP_TILES (MAP_W * MAP_H)
 
+#define RENDER_BUF_W 20
+#define RENDER_BUF_H 14
+#define RENDER_BUF_TILES (RENDER_BUF_W * RENDER_BUF_H)
+
   ; actor type enum
 .se 0
 .de ACT_T_NULL, 1
index 57eb1f5c9de0da9f12516304663e9f42c9af231b..e5da4d7424eb30f155a9581e7d1766a8e743fb08 100644 (file)
@@ -10,7 +10,7 @@
 
 l1:
        mapdef MAP_F_DO_FULL_REDRAW, map_r_nop, 0, tile_banks_default 
-#include "spawn.inc"
+#include "l1.inc"
 
 tile_banks_default:
        dw bank8000
index 9f382e0ff94b204a4f7dbfc1b01175b4c8a95d96..7d615fa509469558ba9a5130044574276bfd0f0f 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -33,11 +33,13 @@ map_load:
        call map_tile_banks_load
        pop de
        
-       call map_full_draw
 
        call lcd_on
        call vblank_wait
        call enableinterrupts
+       
+       call map_full_draw
+       call update_render
 
        ret
        
@@ -260,9 +262,24 @@ map_get_tile:
        ; draws a full map copy into the current map view buffer
        ; bsed on the current location the player is facing
        ; the map render buffer is then written to the screen
+       ; 1) load near or far wall into render_buffer (near if forward wall is on next tile)
+       ; 2) determine exits on all other walls forward
+       ; 3) draw exits in pre-determined locations
+       ; 4) set render state
        ; inputs:
        ;               [map]
+       ; returns:
+       ;               render_buffer: new map data to be drawn
+       ; transferts to redraw state
 map_full_draw:
+       ; draw template for now
+       ld de, far_wall
+       ld hl, render_buffer
+       ld bc, RENDER_BUF_TILES
+       call memcpy
+
+       ; 4) go to render state
+       call update_render
        ret
        
        ; nop map rotuine
index 869b5aba8652a8dcfdfce6f30c00e8cab12a8bef..ec430a9a72a7de15954dd8b18db2e16783b74c34 100644 (file)
@@ -78,7 +78,7 @@ player_handle_move:
                ld de, player
                call act_can_move
                ld de, player
-               call nz, act_move_forward
+               call nz, player_move_forward
 @not_up:
 
        ld b, DIRDOWN
@@ -88,7 +88,14 @@ player_handle_move:
                ld de, player
                call act_can_move
                ld de, player
-               call nz, act_move_back
+               call nz, player_move_back
 @not_down:
-       
        ret
+
+player_move_forward:
+       call act_move_forward
+       jp map_full_draw
+
+player_move_back:
+       call act_move_back
+       jp map_full_draw
index a9648dbe3d2897c43bd8da8c46cdad634255b67b..d00c3dd1ebaeeef931b2c4aa665ec6860df6a5e9 100644 (file)
@@ -4,3 +4,9 @@
        ; fallback tile 
 tile_null:
        tiledef 0, 0, 0, 0
+
+far_wall:
+#include "far_wall.inc"
+
+near_wall:
+#include "near_wall.inc"
index d97381799ae8cd90203e549b6df87c336aedbc51..6c04bfec06988a1f580793cf8ebe174123a2ee4c 100644 (file)
@@ -20,6 +20,61 @@ update_game:
 
   ret
        
+       ; draws a single tile
+       ; inputs:
+       ;               de: render_buffer
+       ;               hl: SCRN
+#macro update_render_draw
+       ld a, [de]
+       inc de
+       ld [hl+], a
+#endmacro
+
+update_render:
+       call disableinterrupts
+       ; TODO: this should be smooth...
+       ld b, RENDER_BUF_H ; loop counter
+       ld de, render_buffer
+       ld hl, SCRN0
+       call next_vblank_wait
+
+       ; copy buffer into SCRN0
+       ; TODO: we should do this off-screen in SCRN1 and then switch
+@render_loop:
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+       update_render_draw
+
+       call next_vblank_wait
+
+       push de
+       ld de, 12 ; next row
+       add hl, de
+       pop de
+
+       dec b
+       jp nz, @render_loop
+       
+       call enableinterrupts
+       ret
+       
 new_game:
        ld de, l1
        call map_load
index 9694cc1dbc359ac0e8905835fbcff42db171aa45..04239764dab0e370b844cfba70f3a6554ddef79a 100644 (file)
@@ -121,3 +121,5 @@ update_tile_vram: .adv 2
        
        ; ptr to last draw_tile_prep
 update_tile_ptr: .adv 2
+
+render_buffer: .adv RENDER_BUF_TILES
index 2d95728e1854ec212946285c523d167727fed3fe..5f156739a06f07403ac42e1983f4ebce07596d6c 100755 (executable)
@@ -7,7 +7,7 @@ TILE_SIZE = 8
 MAP_W = 20
 
 if len(sys.argv) < 2:
-       print("Usage: tmx2map.py <source>")
+       print("Usage: tmx2map.py <source> [tile_offset]")
        sys.exit(-1)
 
 
@@ -15,6 +15,9 @@ src = sys.argv[1]
 
 tile_offset = 97
 
+if len(sys.argv) > 2:
+       tile_offset = int(sys.argv[2])
+
 def print_bg_data(data):
        print("; this map was generated by tmx2map.py")
        split = data.split(",")