huh, well, heres it uploaded from my files
I change my layout every 4-5 months
PEA.w .Label-$01 ; push the real return address JSR SubGFX ; dw HorizDisp1,VertDisp1,Tilemap1,TileProps1,TileSize1 : db !TilesToDraw1 dw HorizDisp2,VertDisp2,Tilemap2,TileProps2,TileSize2 : db !TilesToDraw2 ;... .Label
SubGFX: REP #$20 ; PLA ; pull back the program bank value of the next byte after the JSR INC ; STA $08 ; and save it SEP #$20 ; JSL !GetDrawInfo ; or JSR if you're not using shared subroutines LDA $1602,x ; $1602,x is assumed to contain the sprite's current animation frame STA $4202 ; multiplicand A: current animation frame LDA #$0B ; multiplicand B: 0B, or 11 in decimal - each table contains 11 bytes STA $4203 ; REP #$20 ; LDA $08 ; STA $02 ; TYX ; OAM index -> X LDY $4216 ; load the value from the frame table (I could put this in 16-bit, but this allows for 23 frames anyway) LDA ($02),y ; bytes 1 and 2 -> $06 STA $06 ; $06 = pointer to horizontal displacement table INY ; INY ; LDA ($02),y ; bytes 3 and 4 -> $08 STA $08 ; $08 = pointer to vertical displacement table INY ; INY ; LDA ($02),y ; bytes 5 and 6 -> $0A STA $0A ; $0A = pointer to tilemap table INY ; INY ; LDA ($02),y ; bytes 7 and 8 -> $0C STA $0C ; $0C = pointer to tile properties table INY ; INY ; LDA ($02),y ; bytes 9 and 10 -> $0E STA $0E ; $0E = pointer to tile size table INY ; INY ; SEP #$20 ; LDA ($02),y ; byte 11 -> $05 STA $05 ; $05 = number of tiles to draw TAY ; starting index into Y .GFXLoop LDA $00 ; base X position CLC ; ADC ($06),y ; plus horizontal displacement STA $0300,x ; into first OAM slot LDA $01 ; base Y position CLC ; ADC ($08),y ; plus vertical displacement STA $0301,x ; into second OAM slot LDA ($0A),y ; tile number STA $0302,x ; into third OAM slot LDA ($0C),y ; tile properties (YX--CCCT) ORA $64 ; plus sprite priority settings STA $0303,x ; into fourth OAM slot PHX ; preserve OAM index TXA ; LSR #2 ; OAM index / 4 TAX ; LDA ($0E),y ; tile size STA $0460,x ; into tile size OAM slot PLX ; INX #4 ; increment the OAM index by 4 DEY ; decrement the pointer index BPL .GFXLoop ; if positive, there are more tiles to draw LDX $15E9 ; sprite index back into X LDA $05 ; $05 holds the number of tiles to draw LDY #$FF ; we already set the tile size, so use FF here JSL $81B7B3 ; finish the write to OAM RTS ;
; $029B51 VolcanoLotusFire: ; LDY ExSprOAMIndex,x ; LDA $171F,x ; SEC ; SBC $1A ; STA $00 ; LDA $1733,x ; SBC $1B ; BNE EraseExSpr ; LDA $1715,x ; SEC ; SBC $1C ; STA $01 ; LDA $1729,x ; SBC $1D ; BEQ .Continue ; BMI NoDraw ; BPL EraseExSpr ; .Continue ; LDA $00 ; STA $0200,y ; LDA $01 ; CMP #$F0 ; BCS NoDraw ; STA $0201,y ; LDA #$09 ; ORA $64 ; STA $0203,y ; LDA $14 ; LSR ; EOR $15E9 ; LSR ; LSR ; LDA #$A6 ; BCC SetTileNum ; LDA #$B6 ; SetTileNum: ; STA $0202,y ; TYA ; LSR ; LSR ; TAY ; LDA #$00 ; STA $0420,y ; NoDraw: ; LDA $9D ; BNE Return00 ; JSR ExSprPlayerInteract ; $02A3F6 JSR ExSprUpdateYPos ; $02B554 JSR ExSprUpdateXPos ; $02B560 LDA $13 ; AND #$03 ; BNE NoAccel ; LDA $173D,x ; CMP #$18 ; BPL NoAccel ; INC $173D,x ; NoAccel: ; LDA $173D,x ; BMI Return00 ; TXA ; ASL ; ASL ; ASL ; ADC $13 ; LDY #$08 ; AND #$08 ; BNE SetXSpeed ; LDY #$F8 ; SetXSpeed: ; TYA ; STA $1747,x ; Return00: ; RTS ; EraseExSpr: ; STZ $170B,x ; RTS ; ExSprOAMIndex: db $90,$94,$98,$9C,$A0,$A4,$A8,$AC ExSprPlayerInteract: LDA $13F9 ; EOR $1779,x ; BNE ReturnEPI ; JSL $03B664 ; JSR GetExSprClipping ; JSL $03B72B ; BCC ReturnEPI ; LDA $170B,x ; CMP #$0A ; BNE NotSmileyCoin ; SmileyCoinInteraction: ; JSL $05B34A ; INC $18E3 ; STZ $170B,x ; LDY #$03 ; .Loop ; LDA $17C0,y ; BEQ .FoundSmokeSlot ; DEY ; BPL .Loop ; INY ; .FoundSmokeSlot ; LDA #$05 ; STA $17C0,y ; LDA $171F,x ; STA $17C8,y ; LDA $1715,x ; STA $17C4,y ; LDA #$0A ; STA $17CC,y ; ExtendedSprShowScore: ; JSL $02AD34 ; LDA #$05 ; STA $16E1,y ; LDA $1715,x ; STA $16E7,y ; LDA $1729,x ; STA $16F9,y ; LDA $171F,x ; STA $16ED,y ; LDA $1733,x ; STA $16F3,y ; LDA #$30 ; STA $16FF,y ; LDA #$00 ; STA $1705,y ; ReturnEPI: ; RTS ; NotSmileyCoin: ; LDA $1490 ; BNE InvincibleToExSpr ; LDA $187A ; BEQ ExSprHurtPlayer ; PHX ; LDX $18DF ; LDA #$10 ; STA $163D,x ; LDA #$03 ; STA $1DFA ; LDA #$13 ; STA $1DFC ; LDA #$02 ; STA $C1,x ; STZ $187A ; STZ $0DC1 ; LDA #$C0 ; STA $7D ; STZ $7B ; LDY $157B,x ; LDA YoshiRunXSpeed,y ; STA $B5,x ; STZ $1593,x ; STZ $151B,x ; STZ $18AE ; LDA #$30 ; STA $1497 ; PLX ; RTS ; ExSprHurtPlayer: JSL $00F5B7 ; RTS ; InvincibleToExSpr: ; LDA $170B,x ; CMP #$04 ; BEQ .SkipShift ; LDA $171F,x ; SEC ; SBC #$04 ; STA $171F,x ; LDA $1733,x ; SBC #$00 ; STA $1733,x ; LDA $1715,x ; SEC ; SBC #$04 ; STA $1715,x ; LDA $1729,x ; SBC #$00 ; STA $1729,x ; .SkipShift ; LDA #$07 ; STA $176F,x ; LDA #$01 ; STA $170B,x ; RTS ; YoshiRunXSpeed: ; db $10,$F0 ; ExSprOAMIndex: db $90,$94,$98,$9C,$A0,$A4,$A8,$AC ExSprClipXOffset: db $17,$60,$03,$03,$04,$03,$04,$00 db $00,$00,$04,$03 ExSprClipYOffset: db $03,$03,$03,$03,$04,$03,$04,$00 db $00,$00,$02,$03 ExSprClipWidth: db $03,$03,$01,$01,$08,$01,$08,$00 db $00,$0F,$08,$01 ExSprClipHeight: db $01,$01,$01,$01,$08,$01,$08,$00 db $00,$0F,$0C,$01 UnknownData02A517: db $01,$01 GetExSprClipping: LDY $170B,x ; LDA $171F,x ; CLC ; ADC ExSprClipXOffset,y ; STA $04 ; LDA $1733,x ; ADC #$00 ; STA $0A ; LDA ExSprClipWidth,y ; STA $06 ; LDA $1715,x ; CLC ; ADC ExSprClipYOffset,y ; STA $05 ; LDA $1729,x ; ADC #$00 ; STA $0B ; LDA ExSprClipHeight,y ; STA $07 ; RTS ; ExSprUpdateYPos: TXA ; CLC ; ADC #$0A ; TAX ; JSR ExSprUpdateXPos ; LDX $15E9 ; RTS ; ExSprUpdateXPos: LDA $173D,x ; ASL #4 ; CLC ; ADC $1751,x ; STA $1751,x ; PHP ; LDY #$00 ; LDA $173D,x ; LSR #4 ; CMP #$08 ; BCC $03 ; ORA #$F0 ; DEY ; PLP ; ADC $1715,x ; STA $1715,x ; TYA ; ADC $1729,x ; STA $1729,x ; RTS ;
macro ezmvn(src,dest,bytes) ldx.w #<src> ldy.w #<dest> lda.w #<bytes> db $54 db <dest>/65536,<src>/65536 endmacro
macro color(value) lda.b #<value> sta $2122 lda.b #<value>/256 sta $2122 endmacro
JSL $01B44F
macro WriteToVRAM(srcbank, srcaddr, destaddr, datasize) PHP REP #$20 ; 16-bit A SEP #$10 ; 8-bit XY LDY #$80 ; STY $2115 ; increment after reading the high byte of the VRAM data write ($2119) LDA <destaddr> ; STA $2116 ; VRAM address LDA #$1801 ; STA $4320 ; 2 regs write once, $2118 LDA <srcaddr> ; STA $4322 ; set the lower two bytes of the source address LDY.b <srcbank> ; STY $4324 ; LDA <datasize> ; number of bytes to transfer STA $4325 ; LDY #$04 ; DMA channel 2 (TSB $420B messes stuff up...I wonder why?) STY $420B ; PLP ; endmacro macro WriteFromVRAM(destbank, destaddr, srcaddr, datasize) PHP REP #$20 ; 16-bit A SEP #$10 ; 8-bit XY LDY #$80 ; STY $2115 ; increment after reading the high byte of the VRAM data read ($213A) LDA <srcaddr> ; STA $2116 ; VRAM address LDA $2139 ; "dummy read" LDA #$3981 ; STA $4320 ; 2 regs write once, $2139 LDA <destaddr> ; STA $4322 ; set the lower two bytes of the destination address LDY.b <destbank> ; STY $4324 ; LDA <datasize> ; number of bytes to transfer STA $4325 ; LDY #$04 ; DMA channel 2 (TSB $420B messes stuff up...I wonder why?) STY $420B ; PLP ; endmacro macro WriteToCGRAM(srcbank, srcaddr, destaddr, datasize) PHP REP #$20 ; 16-bit A SEP #$10 ; 8-bit XY LDY <destaddr> ; STY $2121 ; LDA #$2202 ; STA $4320 ; 1 reg write twice, $2122 LDA <srcaddr> ; STA $4322 ; set the lower two bytes of the destination address LDY.b <srcbank> ; STY $4324 ; LDA <datasize> ; number of bytes to transfer STA $4325 ; LDY #$04 ; DMA channel 2 STY $420B ; PLP ; endmacro macro WriteFromCGRAM(srcaddr, destbank, destaddr, datasize) PHP REP #$20 ; 16-bit A SEP #$10 ; 8-bit XY LDY <srcaddr> ; STY $2121 ; LDA #$3B82 ; STA $4320 ; 1 reg write (read) twice, $213B LDA <destaddr> ; STA $4322 ; set the lower two bytes of the destination address LDY.b <destbank> ; STY $4324 ; LDA <datasize> ; number of bytes to transfer STA $4325 ; LDY #$04 ; DMA channel 2 STY $420B ; PLP ; endmacro
header lorom org $1337 wup: BRK BRK BRK BRK BRK BRK BRK BRK BRK STP STP STP STP BRL wup
header lorom org $1337 wup: BRK BRK BRK BRK BRK BRK BRK BRK BRK STP STP STP STP BRL wup
LDA #$Impossible_Request CMP #$jesus'_request ;Checks if request is possible. BNE Make_a_request_then ;If request does not equal impossible, then branch. RTL Make_a_request_then: LDA #$Request_Section STA #$Current_webpage ; Sets current webpage to http://www.smwcentral.net/?p=requests LDA #$Make_a_request STA #$Current_webpage ; Sets current webpage to requesting page. LDA #$Experienced_user STA #$Request ; Wait for someone with experience to take your request. LDA #$Passed_moderation STA #$Request RTL
LDA #$Impossible_Request CMP #$jesus'_request ;Checks if request is possible. BNE Make_a_request_then ;If request does not equal impossible, then branch. RTL Make_a_request_then: LDA #$Request_Section STA #$Current_webpage ; Sets current webpage to http://www.smwcentral.net/?p=requests LDA #$Make_a_request STA #$Current_webpage ; Sets current webpage to requesting page. LDA #$Experienced_user STA #$Request ; Wait for someone with experience to take your request. LDA #$Passed_moderation STA #$Request RTL