From fc4833006111864ec208df1946a4a6ce8bc4cef9 Mon Sep 17 00:00:00 2001 From: Lucas Scharenbroich Date: Wed, 18 May 2022 22:49:14 -0500 Subject: [PATCH] Fix bug in tile rendering and tile sheet copying --- src/Tiles.s | 2 +- src/Tool.s | 1 + src/tiles/DirtyTileQueue.s | 1 - src/tiles/FastRenderer.s | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tiles.s b/src/Tiles.s index 125150e..aa0637c 100644 --- a/src/Tiles.s +++ b/src/Tiles.s @@ -5,7 +5,7 @@ ; A = low word _LoadTileSet sta tmp0 - stx tmp2 + stx tmp1 ldy #0 tyx :loop lda [tmp0],y diff --git a/src/Tool.s b/src/Tool.s index e08e555..86b28ea 100644 --- a/src/Tool.s +++ b/src/Tool.s @@ -242,6 +242,7 @@ TSPtr equ FirstParam tax lda TSPtr,s jsr _LoadTileSet + _TSExit #0;#4 ; Insert the GTE code diff --git a/src/tiles/DirtyTileQueue.s b/src/tiles/DirtyTileQueue.s index df9bdb2..b3cb0d2 100644 --- a/src/tiles/DirtyTileQueue.s +++ b/src/tiles/DirtyTileQueue.s @@ -86,7 +86,6 @@ _PopDirtyTile2 ; alternate entry point ; Bank = Tile Store ; D = Page 2 _PopDirtyTilesFast -; brk $EE ldx DP2_DIRTY_TILE_COUNT ; This is pre-multiplied by 2 bne pdtf_not_empty ; If there are no items, exit at_exit rts diff --git a/src/tiles/FastRenderer.s b/src/tiles/FastRenderer.s index 67d2518..780d319 100644 --- a/src/tiles/FastRenderer.s +++ b/src/tiles/FastRenderer.s @@ -13,9 +13,9 @@ NoSpriteFast lda TileStore+TS_CODE_ADDR_HIGH,x ; load the bank of the target code field line pha ; and put on the stack for later. Has TileStore bank in high byte. ldy TileStore+TS_CODE_ADDR_LOW,x ; load the address of the code field - lda TileStore+TS_TILE_ADDR,x ; load the address of this tile's data (pre-calculated) lda TileStore+TS_BASE_TILE_DISP,x ; go to the tile copy routine (just basics) stal nsf_patch+1 + lda TileStore+TS_TILE_ADDR,x ; load the address of this tile's data (pre-calculated) plb ; set the code field bank nsf_patch jmp $0000