; maps to map property tile_bank0, tile_bank1, tile_bank2, tile_bank3
; note that tile_bank1 and tile_bank2 are 128 bytes each
; whereas bank0 and bank3 are 256 bytes
-.de map_tile_bank0_ptr, 2
-.de map_tile_bank1_ptr, 2
-.de map_tile_bank2_ptr, 2
-.de map_tile_bank3_ptr, 2
+.de map_tile_bank_table, 2
.de map_tile_id_table, 2
.de map_header_size, 0
; the map header is followed by MAP_W * MAP_H bytes
; where each tile has values and its current state. The map can be drawn from this.
l1:
- mapdef MAP_F_DO_FULL_REDRAW, map_r_nop, 0, l1_exits, bank8000, bank8800, bank8C00, bank9000, tile_id_table
+ mapdef MAP_F_DO_FULL_REDRAW, map_r_nop, 0, l1_exits, tile_banks_default, tile_id_table
#include "spawn.inc"
+tile_banks_default:
+ dw bank8000
+ dw bank8800
+ dw bank8C00
+ dw bank9000
+
l1_exits:
dw l1
dw l1
dw l1
l2:
- mapdef 0, map_r_nop, 0, l1_exits, bank8000, bank8800, bank8C00, bank9000, tile_id_table
+ mapdef 0, map_r_nop, 0, l1_exits, tile_banks_default, tile_id_table
#include "spawn.inc"
; inputs:
; de: map ptr
map_tile_banks_load:
- ld hl, map_tile_bank0_ptr
- add hl, de ; hl = bank0 ptr
+ ld hl, map_tile_bank_table
+ add hl, de
+
+ ld a, [hl+]
+ ld h, [hl]
+ ld l, a
+ ; hl = bank0 ptr
; load ptr
ld a, [hl+]