~nytpu/ankano unlisted

da58413a44ecdcd53d0e642e995156eb2b175aba — nytpu 7 months ago 5828c54
load font tiles in vram block 1 and don't hardcode vram locations
1 files changed, 17 insertions(+), 7 deletions(-)

M src/loop.asm
M src/loop.asm => src/loop.asm +17 -7
@@ 21,24 21,32 @@ EnterMainLoop::
	ldh [hCurROMBank], a
	ld [rROMB0], a

	ld de, GameTiles.bgTiles
	ld hl, $9000
	ld de, GameTiles.bg
	ld hl, _VRAM9000
INCLUDE "res/game_map.2bpp.pb16.size"
	ld bc, NB_PB16_BLOCKS
	PURGE NB_PB16_BLOCKS
	call pb16_unpack_block

	ld de, GameTiles.bgTileMap
	ld hl, $9800
	ld hl, _SCRN0
	ld bc, GameTiles.bgTileMapEnd - GameTiles.bgTileMap
	call LCDMemcpy

	ld de, GameTiles.spriteTiles
	ld hl, $8000
	ld de, GameTiles.sprites
	ld hl, _VRAM8000
INCLUDE "res/spritemap.2bpp.pb16.size"
	ld b, NB_PB16_BLOCKS
	PURGE NB_PB16_BLOCKS
	call pb16_unpack_block
	

	ld de, GameTiles.font
	ld hl, _VRAM8800
INCLUDE "res/font.2bpp.pb16.size"
	ld b, NB_PB16_BLOCKS
	PURGE NB_PB16_BLOCKS
	call pb16_unpack_block

	ld a, LCDCF_ON | LCDCF_BGON | LCDCF_BG9800 | LCDCF_BG8800
	ldh [rLCDC], a


@@ 64,10 72,12 @@ MainLoop:

SECTION "Gameplay Tiles", ROMX
GameTiles:
.bgTiles
.bg
INCBIN "res/game_map.2bpp.pb16"
.bgTileMap
INCBIN "res/game_map.2bpp.tilemap"
.bgTileMapEnd
.spriteTiles
.sprites
INCBIN "res/spritemap.2bpp.pb16"
.font
INCBIN "res/font.2bpp.pb16"