@asar !allow_continue = !yes ; If you change this, remember to change the message. It's near the bottom. if read1($00FFD5) == $23 sa1rom org read2($FFFC) JML intro ; no autoclean to prevent fucking up the entire sa1 patch introreturn = read3(read2($FFFC)+1) else org $008023 ; random location in the init routine, doesn't really matter where (this code re-initializes everything anyways) autoclean JML intro ; you may want to change .return: if you change this introreturn: endif ;usage: 16bit A 8bit XY, shreds A and X macro memcpy_to_reg(dst, src, count) LDA.w #&255*256|$00 STA $4320 LDA.w # STA $4322 LDX.b #/65536 STX $4324 LDA # STA $4325 LDX #$04 STX $420B endmacro macro memcpy_to_word_reg(dst, src, count) LDA.w #&255*256|$01 STA $4320 LDA.w # STA $4322 LDX.b #/65536 STX $4324 LDA # STA $4325 LDX #$04 STX $420B endmacro macro memset_to_reg(dst, src_loc, count) LDA.w #&255*256|$08 STA $4320 LDA.w # STA $4322 LDX.b #/65536 STX $4324 LDA # STA $4325 LDX #$04 STX $420B endmacro !yes = 1 !no = 0 freecode prot data intro: REP #$FF XCE SEP #$34 STZ $4200 STZ $420B STZ $420C STZ $2140 STZ $2141 STZ $2142 STZ $2143 LDA #$80 STA $2100 REP #$20 db $A9 ; LDA #$xx .zero: dw $0000 TCD LDA #$01FF TCS SEP #$28 LDA #$FF CLC ADC #$FF CMP #$64 CLD BEQ .doit .return: LDA #$80 STA $2100 STZ $4200 REP #$30 JML introreturn .doit PHB ; B is known zero, apparently cleared on reset. SMW doesn't initialize it. PHK PLB STZ $2101 STZ $2105 STZ $2106 STZ $2107 STZ $2108 STZ $2109 STZ $210A STZ $210B STZ $210C STZ $210D STZ $210D STZ $210E STZ $210E STZ $210F STZ $210F STZ $2110 STZ $2110 STZ $2111 STZ $2111 STZ $2112 STZ $2112 STZ $2113 STZ $2113 STZ $2114 STZ $2114 STZ $211A STZ $2123 STZ $2124 STZ $2125 STZ $2126 STZ $2127 STZ $2128 STZ $2129 STZ $212A STZ $212B STZ $212C STZ $212D STZ $212E STZ $212F STZ $2130 STZ $2131 STZ $2132 STZ $2133 REP #$20 if !allow_continue LDY #$01 STY $4200 ; Auto joypad read endif LDY #$E0 STY $2132 ; Background color LDY #$04 STY $210B ; Layer 1 tile data location LDY #$01 STY $212C ; Main/subscreen designation (L1 main, none sub) LDY #$30 STY $2130 ; CGADSUB LDY #$FF STY $210E STY $210E LDY #$00 STY $2115 STZ $2116 %memcpy_to_reg($2118, tilemap, tilemap_end-tilemap) LDY #$80 STY $2115 STZ $2116 %memset_to_reg($2119, .zero, tilemap_end-tilemap) LDA #$4000 STA $2116 %memcpy_to_word_reg($2118, tiles, tiles_end-tiles) SEP #$20 STZ $00 STZ $01 JSR .wai LDY #$0F STY $2100 LDA #$01 STA $00 STZ $01 BRA .setpal .loop: JSR .wai DEC $00 BNE .nopal LDA #$18 STA $00 .setpal: INC $01 LDA $01 CMP #$03 BNE + LDA #$00 STA $01 + ASL TAX LDA #$00 STA $2121 STZ $2122 STZ $2122 LDY #$06 - LDA .palette,x STA $2122 DEY INX BNE - .nopal if !allow_continue - LDA $4212 LSR BCS - LDA $4218 AND #$10 BEQ .loop PLB JMP .return else BRA .loop endif .palette: ; must repeat twice dw $6AE9,$7FF9,$7FD0 dw $6AE9,$7FF9,$7FD0 .wai: - BIT $4212 BMI - - BIT $4212 BPL - RTS freedata data: tiles: incbin smasfont.bin .end tilemap: table smasfont.tbl ;Allowed characters: 0-9 A-Z . , * - ? & : @ ;There is no lowercase. @ is the copyright symbol. db " " db " " db " " db " " db " " db " Warning: It is a serious " db " " db " crime to use emulators that " db " " db " have not been updated " db " " db " since 2007. " db " " db " " db " This hack does not work " db " " db " correctly in ZSNES. " db " " db " " db " Press R to continue, " db " " db " but do so at your own risk. " db " " db " " db " " db " " db " " db " " .end your_tilemap_table_has_wrong_length = 0 fillbyte 1/cos(tilemap+896-.end)+your_tilemap_table_has_wrong_length