mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2024-06-26 01:29:34 +00:00
149 lines
5.1 KiB
ArmAsm
149 lines
5.1 KiB
ArmAsm
|
; Collection of render function used when the engine is in "FAST" mode. In this mode
|
||
|
; there are no dynamic tile or two layer tiles enabled, so all of the tiles are comprised
|
||
|
; of PEA opcodes. These functions take advantage of this as the fact that masks are
|
||
|
; not needed to improve rendering speed.
|
||
|
;
|
||
|
; The following functions are defined here
|
||
|
;
|
||
|
; GenericOverAFast : Places data from tmp_sprite_data on top of the TileStore's tile
|
||
|
; GenericUnderAFast : Places the TileStore's tile on top of tmp_sprite_data
|
||
|
|
||
|
GenericOverAFast
|
||
|
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
|
||
|
tax
|
||
|
plb
|
||
|
|
||
|
]line equ 0
|
||
|
lup 8
|
||
|
ldal tiledata+{]line*4},x
|
||
|
and tmp_sprite_mask+{]line*4}
|
||
|
ora tmp_sprite_data+{]line*4}
|
||
|
sta: $0004+{]line*$1000},y
|
||
|
|
||
|
ldal tiledata+{]line*4}+2,x
|
||
|
and tmp_sprite_mask+{]line*4}+2
|
||
|
ora tmp_sprite_data+{]line*4}+2
|
||
|
sta: $0001+{]line*$1000},y
|
||
|
]line equ ]line+1
|
||
|
--^
|
||
|
|
||
|
plb
|
||
|
rts
|
||
|
|
||
|
GenericOverVFast
|
||
|
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
|
||
|
tax
|
||
|
plb
|
||
|
|
||
|
]src equ 7
|
||
|
]dest equ 0
|
||
|
lup 8
|
||
|
ldal tiledata+{]src*4},x
|
||
|
and tmp_sprite_mask+{]line*4}
|
||
|
ora tmp_sprite_data+{]line*4}
|
||
|
sta: $0004+{]line*$1000},y
|
||
|
|
||
|
ldal tiledata+{]src*4}+2,x
|
||
|
and tmp_sprite_mask+{]line*4}+2
|
||
|
ora tmp_sprite_data+{]line*4}+2
|
||
|
sta: $0001+{]line*$1000},y
|
||
|
]src equ ]src-1
|
||
|
]dest equ ]dest+1
|
||
|
--^
|
||
|
plb
|
||
|
rts
|
||
|
|
||
|
GenericOverZero
|
||
|
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
|
||
|
plb
|
||
|
|
||
|
]line equ 0
|
||
|
lup 8
|
||
|
lda tmp_sprite_data+{]line*4}
|
||
|
sta: $0004+{]line*$1000},y
|
||
|
|
||
|
lda tmp_sprite_data+{]line*4}+2
|
||
|
sta: $0001+{]line*$1000},y
|
||
|
]line equ ]line+1
|
||
|
--^
|
||
|
|
||
|
plb
|
||
|
rts
|
||
|
|
||
|
GenericUnderAFast
|
||
|
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
|
||
|
tax
|
||
|
plb
|
||
|
|
||
|
]line equ 0
|
||
|
lup 8
|
||
|
lda tmp_sprite_data+{]line*4}
|
||
|
andl tiledata+{]line*4}+32,x
|
||
|
oral tiledata+{]line*4}+32,x
|
||
|
sta: $0004+{]line*$1000},y
|
||
|
|
||
|
lda tmp_sprite_data+{]line*4}+2
|
||
|
andl tiledata+{]line*4}+32+2,x
|
||
|
oral tiledata+{]line*4}+32+2,x
|
||
|
sta: $0001+{]line*$1000},y
|
||
|
]line equ ]line+1
|
||
|
--^
|
||
|
|
||
|
plb
|
||
|
rts
|
||
|
|
||
|
GenericUnderVFast
|
||
|
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
|
||
|
tax
|
||
|
plb
|
||
|
|
||
|
]src equ 7
|
||
|
]dest equ 0
|
||
|
lup 8
|
||
|
lda tmp_sprite_data+{]line*4}
|
||
|
andl tiledata+{]src*4}+32,x
|
||
|
oral tiledata+{]src*4}+32,x
|
||
|
sta: $0004+{]line*$1000},y
|
||
|
|
||
|
lda tmp_sprite_data+{]line*4}+2
|
||
|
andl tiledata+{]src*4}+32+2,x
|
||
|
oral tiledata+{]src*4}+32+2,x
|
||
|
sta: $0001+{]line*$1000},y
|
||
|
]src equ ]src-1
|
||
|
]dest equ ]dest+1
|
||
|
--^
|
||
|
|
||
|
plb
|
||
|
rts
|
||
|
|
||
|
GenericUnderZero
|
||
|
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
|
||
|
plb
|
||
|
lda #0
|
||
|
|
||
|
]line equ 0
|
||
|
lup 8
|
||
|
sta: $0004+{]line*$1000},y
|
||
|
sta: $0001+{]line*$1000},y
|
||
|
]line equ ]line+1
|
||
|
--^
|
||
|
|
||
|
plb
|
||
|
rts
|