milestones.asm
romh-acking_return-of-mario-bros-fds-en/asm/milestones.asm
arch nes.cpu

////////////////////////////////////
// Nagatanien: Hundred K Milestone
////////////////////////////////////

table "asm/tbl/koopa screen.tbl"

//-------------------
// Name printing relocation
//-------------------

// todo
// if name contains a space, increment the PPU indexer
// this prevents a trailing whitespace between the name and comma.

// Remove "ーーーーー" (name)
//org $15437; base $AE2C
//jmp $ae49

org $15442; base $AE37; fill $12, $ea
org $15442; base $AE37

Name2Loop:
dey
dex
lda $c03e,y
sta $b18d,x
cpx #$00
bne Name2Loop

// Remove "くん" (suffix)
org $15432
nop
nop
nop

////////////////////////////////////
// Nagatanien: Hundred K Milestone
////////////////////////////////////

table "asm/tbl/milestone normal.tbl"

//おぬでとう　ーーーーーくん
// GREAT JOB! (Red)
// YOU GOT 100,000 POINTS

// 0x7189: Where the other part of that congratulations text is.

org $15747
db $20,$C2,$03,$46,$47,$4A
db $20,$C5,$56,$4B
db $20,$DB,$03,$4C,$46,$47
db $20,$E2,$03,$48,$49,$4D
db $20,$E5,$46,$4E
db $20,$EB,$50," "
db $20,$FB,$03,$4F,$48,$49
db $21,$02,$03,$46,$47,$4D
db $21,$05,$47," "
table "asm/tbl/milestone red.tbl"
db $21,$0c,$09,"Good job!"
table "asm/tbl/milestone normal.tbl"
db $21,$15,$46," "
db $21,$1B,$03,$4F,$46,$47
db $21,$22,$03,$48,$49,$4D
db $21,$25,$49," "
db $21,$2d,$06,"xxxxx,"
db $21,$33,$48," "
db $21,$3B,$03,$4F,$48,$49
db $21,$42,$19,$46,$47,$4D,"  you scored 100,000  "
db $21,$5B,$03,$4F,$46,$47
db $21,$62,$03,$48,$49,$4D
db $21,$65,$48," "
db $21,$6D,$06,"points"
db $21,$73,$48," "
db $21,$7B,$03,$4F,$48,$49
db $21,$82,$03,$46,$47,$4D
db $21,$85,$56," "
db $21,$9B,$03,$4F,$46,$47
db $21,$A2,$03,$48,$49,$50
db $21,$A5,$56,$51
db $21,$BB,$03,$52,$48,$49
db $21,$C2,$1C,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47
db $21,$E2,$1C,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$23,$00
db $20,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$23
db $20
db $20,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$23,$40
db $20,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$23,$60
db $20,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$23,$80
db $20,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$23,$A0


db $20,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$45,$44,$23,$C0,$48,$AA,$23,$C8,$01,$66,$23,$C9,$46,$05,$23,$CF,$02,$99,$66,$23,$D7,$02,$99,$66,$23,$D9,$46,$50,$23,$DF,$01,$9D,$23,$E0,$58,$AA,$23,$F8,$48,$0A,$FF

//-------------------
// Excess space
//-------------------
// There's also A LOT of spare bytes below "Sprite information"
db $ff,$ff,$ff

//MailInCodeString
db $21,$07,$13,"Mail in the code   "
db $21,$4D,$06,$00,$00,$00,$04,$00,$00
db $21,$87,$0D,"             ",$FF

//-------------------
// Sprite information
//-------------------

db $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0A,$0B,$00,$01,$0C,$0D,$0E,$0F,$01,$00,$03,$02,$05,$04,$07,$06,$09,$08,$0B,$0A,$01,$00,$0D,$0C,$0F,$0E,$00,$01,$10,$11,$12,$13,$01,$00,$11,$10,$13,$12,$FF

//-------------------
// Mail in code hardcoded pointer
//-------------------

// Adjust the hardcode pointer
org $1569D
lda #$36
sta $be60
lda #$b3
sta $be61

org $18365
lda #$36
sta $be60
lda #$b3
sta $be61

//-------------------
// Relocated hardcoded PPU location of where "mail in" text is
//-------------------

org $154B5; base $AEAA
LDA #$21
STA $B336
LDA #$28
STA $B337

////////////////////////////////////
// Nagatanien: 200 K Milestone
////////////////////////////////////



// Top text
org $18310

// Big text
org $185b8
//Big text pointer:
org $18426


//-------------------
// Removal
//-------------------


// Remove hardcoded "くん" writing. (pronoun)
org $18343; base $7B16; fill $0D, $ea


//-------------------
// Relocate
//-------------------

// Remove hardcoded "ーーーーー" (name)
org $18275; base $7A48; fill $12, $ea
org $18275
NameLoop:
DEY
DEX
LDA $C03E,y
STA $7e00,x
CPX #$00
BNE NameLoop

//-------------------
// Relocate name
//-------------------

org $18624

//-------------------
// Tilemaps we care about
//-------------------

db $21,$05,$46," "
db $21,$0b,$08,"       ,"
db $21,$13,$48," "
db $21,$1B,$03,$4F,$46,$47
db $21,$22,$03,$48,$49,$4D

db $21,$25,$42," "
db $21,$27,$17,"you scored 200,000     "
db $21,$3B,$03,$4F,$48,$49
db $21,$42,$03,$46,$47,$4D
db $21,$45,$48," "
db $21,$4D,$06,"points"
db $21,$53,$48," "
db $21,$5b,$03,$4F,$46,$47
db $21,$62,$03,$48,$49,$50

//-------------------
// Tilemaps we care don't care about
//-------------------

db $21,$65,$56,$51,$21,$7B,$03,$52,$48,$49,$21,$82,$1D,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$46,$47,$71,$21,$A2,$1C,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$48,$49,$21,$C0,$01,$72,$21,$D8,$01,$70,$21,$ED,$01,$71,$22,$04,$01,$72,$22,$09,$01,$70,$22,$3B,$04,$71,$81,$81,$58,$22,$4F,$01,$72,$22,$54,$01,$70,$22,$5E,$02,$3C,$9E,$22,$7D,$03,$98,$99,$9A,$22,$85,$01,$71,$22,$8C,$48,$94,$22,$9D,$03,$61,$60,$62,$22,$A1,$01,$72,$22,$AC,$01,$61,$22,$AD,$46,$60,$22,$B3,$01,$62,$22,$BA,$06,$70,$81,$81,$61,$60,$62,$22,$C0,$02,$94,$94,$22,$C8,$05,$71,$81,$81,$81,$61,$22,$CD,$46,$60,$22,$D3,$01,$62,$22,$DD,$03,$61,$60,$62,$22,$E0,$05,$82,$82,$96,$96,$D7,$22,$EC,$01,$61,$22,$ED,$46,$60,$22,$F3,$01,$62,$22,$FD,$03,$61,$60,$62,$23,$00,$05,$82,$80,$82,$82,$82,$23,$08,$44,$94,$23,$0C,$01,$61,$23,$0D,$46,$60,$23,$13,$01,$62,$23,$14,$44,$94,$23,$1D,$03,$61,$60,$62,$23,$20,$08,$82,$80,$60,$60,$62,$94,$94,$94,$23,$28,$44,$97,$23,$2C,$01,$61,$23,$2D,$46,$60,$23,$33,$05,$62,$39,$3A,$3B,$95,$23,$3D,$03,$61,$60,$62,$23,$40,$08,$82,$80,$60,$60,$62,$90,$90,$90,$23,$48,$44,$97,$23,$4C,$01,$61,$23,$4D,$44,$60,$23,$51,$0F,$9C,$9B,$5E,$39,$3A,$3B,$95,$82,$82,$82,$81,$81,$61,$60,$62,$23,$60,$08,$82,$80,$60,$60,$62,$91,$91,$91,$23,$68,$44,$97,$23,$6C,$01,$61,$23,$6D,$44,$60,$23,$71,$0F,$62,$97,$97,$39,$3A,$3B,$95,$82,$82,$82,$81,$81,$61,$60,$62,$23,$80,$08,$82,$80,$60,$60,$62,$92,$92,$92,$23,$88,$44,$97,$23,$8C,$01,$61,$23,$8D,$44,$60,$23,$91,$0F,$62,$97,$97,$39,$3A,$3B,$95,$82,$82,$82,$94,$94,$93,$60,$62,$23,$A0,$47,$3C,$23,$A7,$01,$90,$23,$A8,$44,$97,$23,$AC,$01,$93,$23,$AD,$44,$9B,$23,$B1,$0F,$5E,$97,$97,$39,$3A,$3B,$95,$82,$82,$82,$90,$90,$90,$60,$62,$23,$C0,$09,$43,$5F,$53,$5C,$5C,$53,$53,$1C,$47,$23,$C9,$46,$00,$23,$CF,$02,$D1,$47,$23,$D1,$46,$00,$23,$D7,$09,$11,$34,$05,$05,$35,$05,$05,$35,$8D,$23,$E0,$0F,$00,$03,$03,$C0,$00,$30,$0C,$A8,$A3,$23,$30,$AA,$AA,$00,$0C,$23,$EF,$47,$AA,$23,$F6,$02,$A0,$AA,$23,$F8,$48,$0A,$FF

//-------------------
// Extra space
//-------------------

db $ff

//-------------------
// Sprite data
//-------------------

db $8A,$61,$01,$88,$8A,$62,$01,$90,$8A,$63,$01,$98,$92,$64,$01,$88,$92,$65,$01,$90,$92,$66,$01,$98,$9A,$DF,$01,$88,$9A,$67,$01,$90,$9A,$68,$01,$98,$8A,$61,$00,$60,$8A,$62,$00,$68,$8A,$63,$00,$70,$92,$64,$00,$60,$92,$65,$00,$68,$92,$66,$00,$70,$9A,$FE,$00,$60,$9A,$67,$00,$68,$9A,$68,$00,$70,$CA,$81,$41,$D8,$CA,$80,$41,$E0,$CA,$7F,$41,$E8,$D2,$84,$41,$D8,$D2,$83,$41,$E0,$D2,$82,$41,$E8,$DA,$76,$41,$D8,$DA,$FE,$41,$E0,$DA,$FE,$41,$E8,$CA,$81,$40,$18,$CA,$80,$40,$20,$CA,$7F,$40,$28,$D2,$84,$40,$18,$D2,$83,$40,$20,$D2,$82,$40,$28,$DA,$76,$40,$18,$DA,$FE,$40,$20,$DA,$FE,$40,$28,$AA,$A7,$01,$40,$AA,$A8,$01,$48,$AA,$DF,$01,$50,$B2,$A9,$01,$40,$B2,$AF,$01,$48,$B2,$B0,$01,$50,$BA,$B1,$01,$40,$BA,$B2,$01,$48,$BA,$DF,$01,$50,$AA,$A7,$00,$A0,$AA,$A8,$00,$A8,$AA,$DF,$00,$B0,$B2,$A9,$00,$A0,$B2,$AF,$00,$A8,$B2,$B0,$00,$B0,$BA,$B1,$00,$A0,$BA,$B2,$00,$A8,$BA,$DF,$00,$B0,$FF

//-------------------
// More Sprite data
//-------------------

db $61,$62,$63,$64,$65,$66,$DF,$67,$68,$69,$6A,$6B,$6C,$6D,$6E,$DF,$6F,$70,$61,$71,$72,$73,$74,$75,$DF,$DF,$76,$77,$78,$79,$7A,$7B,$7C,$DF,$7D,$7E,$79,$78,$77,$7C,$7B,$7A,$7E,$7D,$DF,$63,$62,$61,$66,$65,$64,$68,$67,$DF,$6B,$6A,$69,$6E,$6D,$6C,$70,$6F,$DF,$6B,$6A,$69,$6E,$6D,$6C,$70,$6F,$DF,$81,$80,$7F,$84,$83,$82,$76,$DF,$DF,$87,$86,$85,$8A,$89,$88,$70,$DF,$DF,$81,$80,$7F,$84,$83,$82,$68,$67,$DF,$8D,$8C,$8B,$90,$8F,$8E,$7E,$7D,$DF,$8B,$8C,$8D,$8E,$8F,$90,$DF,$7D,$7E,$7F,$80,$81,$82,$83,$84,$DF,$DF,$76,$85,$86,$87,$88,$89,$8A,$DF,$6F,$70,$7F,$80,$81,$82,$83,$84,$DF,$67,$68,$9F,$A0,$A1,$A2,$A3,$A4,$A5,$A6,$DF,$A7,$A8,$DF,$A9,$AA,$AB,$AC,$AD,$DF,$9F,$A0,$A1,$A2,$A3,$A4,$DF,$AE,$DF,$A1,$A0,$9F,$A4,$A3,$A2,$DF,$A6,$A5,$DF,$A8,$A7,$AB,$AA,$A9,$DF,$AD,$AC,$A1,$A0,$9F,$A4,$A3,$A2,$DF,$AE,$DF,$A7,$A8,$DF,$A9,$AF,$B0,$B1,$B2,$DF,$9F,$A0,$DF,$B3,$B4,$B5,$B6,$B7,$DF,$DF,$A8,$A7,$B0,$AF,$A9,$DF,$B2,$B1,$DF,$A0,$9F,$B5,$B4,$B3,$DF,$B7,$B6,$00,$00,$00,$00,$F8,$30,$10,$30,$F0,$E0,$E0,$E0,$80,$C0,$F0,$F0,$F0,$E0,$00,$00,$00,$00,$00,$03,$03,$0F,$00,$02,$00,$00,$00,$00,$00,$00,$03,$1F,$00,$00,$00,$80,$E0,$F0,$F0,$48,$00,$00,$00,$00,$00,$00,$F0,$F8,$04,$1E,$00,$00,$07,$0F,$3F,$7F,$3F,$1F,$0F,$07,$04,$08,$08,$08,$88,$1C,$08,$00,$F0,$FC,$FE,$FE,$F8,$FC,$F8,$E0,$60,$60,$C0,$81,$34,$1F,$1F,$1F,$3F,$3C,$38,$78,$DF,$FF

db $5F,$1F,$3F,$3C,$00,$00,$F4,$F0,$F0,$F8,$FC,$3C,$1C,$1E,$F3,$F7,$F2,$F8,$FC,$3C,$00,$00,$00,$00,$00,$10,$18,$3B,$38,$38,$00,$1C,$1E,$0E,$04,$00,$00,$07,$00,$00,$00,$E0,$F8,$FC,$3C,$92,$00,$00,$00,$00,$00,$00,$FC,$FE,$31,$3F,$1C,$1E,$0F,$0F,$4F,$4F,$0F,$07,$03,$03,$06,$0C,$09,$0F,$12,$A7,$02,$00,$FC,$FE,$FC,$F0,$FE,$FF,$FE,$F8,$60,$C0,$83,$87,$7E,$7F,$7F,$07,$00,$00,$00,$00,$1F,$1F,$1F,$07,$00,$00,$00,$00,$F0,$F8,$FC,$FE,$F2,$60,$00,$00,$D2,$F0,$E0,$F0,$F0,$60


//-------------------
// Repoint sprite data
//-------------------

org $182CA
lda #$5e
sta $00
lda #$80

//-------------------
// Repoint more sprite data
//-------------------

//add #$15 to each
org $1840E
db $37,$81
db $40,$81
db $49,$81
db $52,$81
db $5B,$81
db $64,$81
db $6D,$81
db $76,$81
db $7F,$81
db $88,$81
db $91,$81
db $9A,$81
db $A3,$81
db $AC,$81
db $B5,$81
db $BE,$81

org $184DC
db $c7,$81
db $D0,$81
db $E2,$81
db $EB,$81
db $E2,$81
db $D0,$81

//-------------------
// Relocated hardcoded PPU location of where "mail in" text is
//-------------------

org $182E6; base $7AB9
LDA #$20
STA $B336
LDA #$e8
STA $B337
