mirror of
https://github.com/lscharen/iigs-game-engine.git
synced 2024-06-12 13:29:30 +00:00
Checkpoint
This commit is contained in:
parent
7a6c4e5ff4
commit
5883de1f71
|
@ -170,3 +170,36 @@ _ScanlineBG0XPos
|
||||||
jne :loop
|
jne :loop
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
; Unrolled copy routine to move BankTable entries into BNK_ADDR position. This is a bit different than the
|
||||||
|
; other routines, because we don't need to put values into the code fields, but just copy one-byte values
|
||||||
|
; into an internal array in bank 00 space. The reason for this is because the code sequence
|
||||||
|
;
|
||||||
|
; lda #ADDR
|
||||||
|
; tcs
|
||||||
|
; plb
|
||||||
|
;
|
||||||
|
; Take only 9 cycles, but the alternative is slower
|
||||||
|
;
|
||||||
|
; pea #$BBBB
|
||||||
|
; plb
|
||||||
|
; plb = 13 cycles
|
||||||
|
;
|
||||||
|
; If for some reason it becimes important to preserve the accumulator, or save the 208 bytes of
|
||||||
|
; bank 00 memory, then we can change it. The advantage right now is that updating the array can
|
||||||
|
; be done 16-bits at a time and without having to chunk up the writes across multiple banks. This
|
||||||
|
; is quite a bit faster than the other routines.
|
||||||
|
CopyTableToBankBytes
|
||||||
|
|
||||||
|
tsx ; save the stack
|
||||||
|
sei
|
||||||
|
jmp $0000
|
||||||
|
|
||||||
|
lda: 2,y
|
||||||
|
pha
|
||||||
|
lda: 0,y
|
||||||
|
pha
|
||||||
|
bottom
|
||||||
|
txs ; restore the stack
|
||||||
|
cli ; turn interrupts back on
|
||||||
|
rts
|
||||||
|
|
|
@ -5,10 +5,12 @@
|
||||||
DP_ADDR equ entry_1-base+1 ; offset to patch in the direct page for dynamic tiles
|
DP_ADDR equ entry_1-base+1 ; offset to patch in the direct page for dynamic tiles
|
||||||
BG1_ADDR equ entry_2-base+1 ; offset to patch in the Y-reg for BG1 (dp),y addressing
|
BG1_ADDR equ entry_2-base+1 ; offset to patch in the Y-reg for BG1 (dp),y addressing
|
||||||
STK_ADDR equ entry_3-base+1 ; offset to patch in the stack (SHR) right edge address
|
STK_ADDR equ entry_3-base+1 ; offset to patch in the stack (SHR) right edge address
|
||||||
|
BNK_ADDR equ entry_0-base+1 ; offset to patch in the address of a Bank 0 memory location to load the bank register
|
||||||
|
|
||||||
DP_ENTRY equ entry_1-base
|
DP_ENTRY equ entry_1-base
|
||||||
TWO_LYR_ENTRY equ entry_2-base
|
TWO_LYR_ENTRY equ entry_2-base
|
||||||
ONE_LYR_ENTRY equ entry_3-base
|
ONE_LYR_ENTRY equ entry_3-base
|
||||||
|
BANK_ENTRY equ entry_0-base
|
||||||
|
|
||||||
CODE_ENTRY_OPCODE equ entry_jmp-base
|
CODE_ENTRY_OPCODE equ entry_jmp-base
|
||||||
CODE_ENTRY equ entry_jmp-base+1 ; low byte of the page-aligned jump address
|
CODE_ENTRY equ entry_jmp-base+1 ; low byte of the page-aligned jump address
|
||||||
|
@ -66,6 +68,9 @@ BankPatchNum equ *-BankPatches
|
||||||
; the code is assembled on a page boundary to help with alignment
|
; the code is assembled on a page boundary to help with alignment
|
||||||
ds \,$00 ; pad to the next page boundary
|
ds \,$00 ; pad to the next page boundary
|
||||||
base
|
base
|
||||||
|
entry_0 lda #0000 ; Used to set per-scanline bank register
|
||||||
|
tcs
|
||||||
|
plb
|
||||||
entry_1 ldx #0000 ; Used for LDA 00,x addressing (Dynamic Tiles)
|
entry_1 ldx #0000 ; Used for LDA 00,x addressing (Dynamic Tiles)
|
||||||
entry_2 ldy #0000 ; Used for LDA (00),y addressing (Second Layer; BG1)
|
entry_2 ldy #0000 ; Used for LDA (00),y addressing (Second Layer; BG1)
|
||||||
entry_3 lda #0000 ; Sets screen address (right edge)
|
entry_3 lda #0000 ; Sets screen address (right edge)
|
||||||
|
|
|
@ -245,8 +245,8 @@ BuildBank
|
||||||
plb
|
plb
|
||||||
plb
|
plb
|
||||||
|
|
||||||
; Change the patched value to one of DP_ENTRY, TWO_LYR_ENTRY or ONE_LYR_ENTRY based on the capabilities
|
; Change the patched value to one of BANK_ENTRY, DP_ENTRY, TWO_LYR_ENTRY or ONE_LYR_ENTRY based
|
||||||
; that the engine needs.
|
; on the capabilities that the engine needs.
|
||||||
|
|
||||||
lda #DP_ENTRY
|
lda #DP_ENTRY
|
||||||
sta :entryOffset
|
sta :entryOffset
|
||||||
|
|
Loading…
Reference in New Issue
Block a user