From: Lukas Krickl Date: Thu, 30 Oct 2025 11:43:25 +0000 (+0100) Subject: map: the map loader now draws maps correctly X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=0310b8958c7d03efd636aa0bc14659047c91a477;p=gbrg%2F.git map: the map loader now draws maps correctly --- diff --git a/src/levels.s b/src/levels.s index d7bc667..cd8bb8d 100644 --- a/src/levels.s +++ b/src/levels.s @@ -27,9 +27,9 @@ level_def_to_tile: l1: mapdef 0, map_r_nop, bank8000, bank8800, bank8C00, bank9000 - .db TPH, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS - .db TPH, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS - .db TPH, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS + .db TPH, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TPH, TPH + .db TPH, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TPH + .db TPH, TPH, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS @@ -37,9 +37,9 @@ l1: .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TFD, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS - .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS - .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS - .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS - .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS - .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS - .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TEH + .db TGS, TPH, TPH, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TPH, TGS, TGS, TGS, TPH, TPH + .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TPH + .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TPH + .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TPH + .db TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TPH + .db TGS, TGS, TGS, TPH, TPH, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TGS, TEH diff --git a/src/map.s b/src/map.s index 7bb3dea..e8afa88 100644 --- a/src/map.s +++ b/src/map.s @@ -136,28 +136,6 @@ map_tile_banks_load: ret - ; draw command for a single sub tile draw - ; top row -#macro map_advance_row_draw_top - ld a, [hl+] - inc a - ld [de], a - dec de - dec a - ld [de], a - dec de -#endmacro - -#macro map_advance_row_draw_bot - ld a, [hl+] - add a, 0x11 - ld [de], a - dec de - dec a - ld [de], a - dec de -#endmacro - ; draws a tile ; to the screen @@ -231,7 +209,7 @@ map_get_tile: @y_loop: add hl, de ; next row dec b - jr z, @y_loop REL + jr nz, @y_loop REL @skip_y_loop: ld de, t_size @@ -242,7 +220,7 @@ map_get_tile: @x_loop: add hl, de ; next tile over dec c - jr z, @x_loop REL + jr nz, @x_loop REL @skip_x_loop: ; hl = tile now @@ -258,7 +236,7 @@ map_get_tile: ; draws 16 tiles ; inputs: ; b: y position -map_draw_row: +map_draw_row: ld c, 0 map_draw_row_inc_c map_draw_row_inc_c diff --git a/src/tiles.s b/src/tiles.s index 7f178fa..4f1c9da 100644 --- a/src/tiles.s +++ b/src/tiles.s @@ -1,6 +1,6 @@ ; tile definitions -#define GFX_GRASS 0x00 +#define GFX_GRASS 0x48 #define GFX_PHIVE 0x4A #define GFX_EHIVE 0x4A #define GFX_FOOD 0x03