Hello. I'm trying to update my HDMA table in WRAM ($7FA100), however.....
I've got genuinely no idea why it isn't updating the table. Here's my initialization code (though I don't think it's relevant)...Also, $A100+COUNT does exactly what I want it to do. So....that's why I suspect something's wrong with my direct page address...
Please help, thanks
Code:
modGradient:
.EQU COUNT 1
php
phb
phd ;push flags, bank and dp register, since we're tinkering with them
lda #$7F
pha
plb ;got the new WRAM data bank (where the HDMA table is)
rep #$20
lda #$A100 ;direct page of the WRAM location
tcd
sep #$20
.REPT 6
ldx COUNT
dea
stx COUNT
.REDEF COUNT COUNT+2
.ENDR
pld
plb
plp
rts
.EQU COUNT 1
php
phb
phd ;push flags, bank and dp register, since we're tinkering with them
lda #$7F
pha
plb ;got the new WRAM data bank (where the HDMA table is)
rep #$20
lda #$A100 ;direct page of the WRAM location
tcd
sep #$20
.REPT 6
ldx COUNT
dea
stx COUNT
.REDEF COUNT COUNT+2
.ENDR
pld
plb
plp
rts
I've got genuinely no idea why it isn't updating the table. Here's my initialization code (though I don't think it's relevant)...Also, $A100+COUNT does exactly what I want it to do. So....that's why I suspect something's wrong with my direct page address...
Code:
InitHDMA:
.EQU FREERAM $7FA100 ;initialize HDMA table in WRAM
ldx #$0F
LVL1_HDMAINIT:
lda.w LVL1BLUE, X
sta FREERAM, X
dex
bpl LVL1_HDMAINIT
rts
LVL1BLUE:
.db $4F,$29 ;the table will be modified continuously via modGradient, needa put it in WRAM
.db $04,$2A
.db $04,$2B
.db $04,$2D
.db $04,$2E
.db $04,$2F
.db $04,$30
.db $00
.EQU FREERAM $7FA100 ;initialize HDMA table in WRAM
ldx #$0F
LVL1_HDMAINIT:
lda.w LVL1BLUE, X
sta FREERAM, X
dex
bpl LVL1_HDMAINIT
rts
LVL1BLUE:
.db $4F,$29 ;the table will be modified continuously via modGradient, needa put it in WRAM
.db $04,$2A
.db $04,$2B
.db $04,$2D
.db $04,$2E
.db $04,$2F
.db $04,$30
.db $00
Please help, thanks