add ApplyDarkLinkGraphics function

This commit is contained in:
scawful
2024-06-06 21:03:06 -04:00
parent 4bcf4fcab2
commit aa6a39a7da

View File

@@ -1679,27 +1679,24 @@ PLX
RTS RTS
;================================================================================================== ApplyDarkLinkGraphics:
; Sprite Draw Generated Data {
; -------------------------------------------------------------------------------------------------- PHX
; This is where the generated Data for the sprite go REP #$20 ; A = 16, XY = 8
;================================================================================================== LDX #$80 : STX $2100 ; turn the screen off (required)
.start_index LDX #$80 : STX $2115 ; Set the video port register every time we write it increase by 1
db $00, $0C LDA #$5000 : STA $2116 ; Destination of the DMA $5800 in vram <- this need to be divided by 2
.nbr_of_tiles LDA #$1801 : STA $4300 ; DMA Transfer Mode and destination register
db 11, 11 ; "001 => 2 registers write once (2 bytes: p, p+1)"
.x_offsets LDA.w #DarkLinkGraphics : STA $4302 ; Source address where you want gfx from ROM
dw 0, 16, 28, 28, 0, 0, 16, 16, 0, 16, -12, -12 LDX.b #DarkLinkGraphics>>16 : STX $4304
dw 22, 22, -5, -5, -3, 18, 0, 16, 0, 16, 0, 16 LDA #$2000 : STA $4305 ; Size of the transfer 4 sheets of $800 each
.y_offsets LDX #$01 : STX $420B ; Do the DMA
dw 7, 7, -9, 7, -16, 0, 0, -16, -19, -19, -9, 7 LDX #$0F : STX $2100 ; Turn the screen back on
dw 10, 26, 11, 27, -21, -21, -11, -11, 5, 5, 10, 10 SEP #$30
.chr PLX
db $E0, $E0, $C4, $E4, $C2, $E2, $E2, $C2, $C0, $C0, $C4, $E4 RTS
db $C4, $E4, $C4, $E4, $E6, $E6, $C8, $C8, $E8, $E8, $C6, $C6
.properties DarkLinkGraphics:
db $3D, $7D, $7D, $7D, $3B, $3B, $7B, $7B, $3D, $7D, $3D, $3D incbin dark_link.bin
db $7D, $7D, $3D, $3D, $3D, $7D, $3B, $7B, $3B, $7B, $3D, $7D }
.sizes
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02
db $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02, $02