![]() |
Routines |
| Prev: A9A0 | Up: Map | Next: A9E4 |
|
This plots an exterior tile then advances DE' to the next column.
Used by the routines at plot_horizontal_tiles_common and plot_tile_then_advance.
|
||||||||||||
| plot_tile | A9AD | EXX | Unbank input registers | |||||||||
| A9AE | EX AF,AF' | Bank the tile index | ||||||||||
| A9AF | LD A,(HL) | Fetch a supertile index from map_buf | ||||||||||
|
Now map the tile index and supertile index into a tile pointer:
|
||||||||||||
| A9B0 | LD BC,$8590 | Point BC at exterior_tiles[0] | ||||||||||
| A9B3 | CP $2D | If supertile index <= 44 jump to plot_tile_chosen | ||||||||||
| A9B5 | JR C,plot_tile_chosen | |||||||||||
| A9B7 | LD BC,$8A18 | Point BC at exterior_tiles[145] | ||||||||||
| A9BA | CP $8B | If supertile index <= 138 or >= 204 jump to plot_tile_chosen | ||||||||||
| A9BC | JR C,plot_tile_chosen | |||||||||||
| A9BE | CP $CC | |||||||||||
| A9C0 | JR NC,plot_tile_chosen | |||||||||||
| A9C2 | LD BC,$90F8 | Point BC at exterior_tiles[365] | ||||||||||
| plot_tile_chosen | A9C5 | PUSH HL | Preserve the supertile pointer | |||||||||
| A9C6 | EX AF,AF' | Unbank the tile index | ||||||||||
| A9C7 | LD L,A | Point HL at BC[tile index] | ||||||||||
| A9C8 | LD H,$00 | |||||||||||
| A9CA | ADD HL,HL | |||||||||||
| A9CB | ADD HL,HL | |||||||||||
| A9CC | ADD HL,HL | |||||||||||
| A9CD | ADD HL,BC | |||||||||||
| A9CE | PUSH DE | Preserve the screen buffer pointer | ||||||||||
| A9CF | EX DE,HL | Transpose | ||||||||||
| A9D0 | LD BC,$0018 | Set the screen buffer stride to 24 | ||||||||||
| A9D3 | LD A,$08 | Set eight iterations | ||||||||||
|
Start loop
|
||||||||||||
| plot_tile_loop | A9D5 | EX AF,AF' | Preserve the loop counter | |||||||||
| A9D6 | LD A,(DE) | Copy a byte of tile | ||||||||||
| A9D7 | LD (HL),A | |||||||||||
| A9D8 | ADD HL,BC | Advance the destination pointer to the next row | ||||||||||
| A9D9 | INC E | Advance the source pointer | ||||||||||
| A9DA | EX AF,AF' | Restore the loop counter | ||||||||||
| A9DB | DEC A | ...loop | ||||||||||
| A9DC | JP NZ,plot_tile_loop | |||||||||||
| A9DF | POP DE | Restore the screen buffer pointer | ||||||||||
| A9E0 | INC DE | Advance the screen buffer pointer | ||||||||||
| A9E1 | POP HL | Restore the supertile pointer | ||||||||||
| A9E2 | EXX | Re-bank input registers | ||||||||||
| A9E3 | RET | Return | ||||||||||
| Prev: A9A0 | Up: Map | Next: A9E4 |