I'm trying to make this really sweet death animation for a boss. It involves a masking window on the sprite layer that covers the boss. I'm using HDMA with a RAM table to udate the window size so it looks like the boss fades away. At first I tried just writing to the left/right limit registers (2126/2127). That did nothing, however, so I checked regs.txt, which said these registers can not be written to outside of a blank.
I made an HDMA routine for it, thinking that H-blank would do. It still does nothing, however.
Code:
!StunTimer is what controls the size of the mask.
TL;DR: How do I write to 2126/2127?
I made an HDMA routine for it, thinking that H-blank would do. It still does nothing, however.
Code:
Code
REP #$20 ; > A 16 bit LDA #$2500 ;\ Register 2125, one register write once STA $4340 ;/ LDA #$A407 ;\ Location of table within bank STA $4342 ;/ LDY #$7F ;\ Source bank STY $4344 ;/ SEP #$20 ; > A 8 bit LDA #$10 ;\ Enable HDMA on channel 4 TSB $0D9F ;/ REP #$20 LDA #$2601 ; Register 2126, two registers write once STA $4350 LDA #$A410 STA $4352 LDY #$7F STY $4354 SEP #$20 LDA #$20 TSB $0D9F LDA $D8,x CLC ADC #$10 ; Start at this scanline STA $00 LSR A STA $7FA407 ;\ Scanline count STA $7FA409 ;/ LDA #$00 ;\ STA $7FA408 ; | No window on these scanlines STA $7FA40A ;/ LDA !StunTimer ;\ EOR #$7F ; | Window height LSR A ; | STA $7FA40B ;/ CLC : ADC $00 STA $01 LDA #$02 ;\ Enable the window on these scanlines STA $7FA40C ;/ LDA #$DF ;\ SEC : SBC $01 ; | STA $7FA40D ; | Disable the window for all scanlines below LDA #$00 ; | STA $7FA40E ;/ LDA #$00 ;\ End table STA $7FA40F ;/ LDA $00 LSR A STA $7FA410 STA $7FA413 LDA #$00 STA $7FA411 STA $7FA412 STA $7FA414 STA $7FA415 LDA $01 SEC : SBC $00 STA $7FA416 LDA $E4,x ;\ Window left position STA $7FA417 ;/ CLC : ADC #$20 ;\ Window width STA $7FA418 ;/ LDA #$DF SEC : SBC $01 STA $7FA419 LDA #$00 STA $7FA41A STA $7FA41B STA $7FA41C ; > End table LDA #$10 ;\ STA $212E ; | Only mask the sprite layer STA $212F ;/
!StunTimer is what controls the size of the mask.
TL;DR: How do I write to 2126/2127?
allow shy guy emojis in post footers you cowards!