table MMXFont.txt MMXVWF: db $08,$05,$08,$08,$08,$08,$08,$08 ;80-87 db $08,$08,$08,$08,$08,$08,$07,$07 ;88-8F db $08,$08,$05,$08,$08,$07,$08,$07 ;90-97 db $08,$08,$08,$08,$08,$08,$08,$09 ;98-9F db $08,$08,$08,$08,$07,$06,$06,$06 ;A0-A7 db $06,$06,$06,$06,$04,$06,$07,$04 ;A8-AF db $07,$06,$06,$06,$06,$05,$06,$06 ;B0-B7 db $06,$08,$07,$07,$07,$06,$08,$04 ;B8-BF db $00,$00,$00,$00,$00,$00,$00,$00 ;C0-C7 (unused row) db $04,$07,$04,$04 ;C8-CB Text: %TextHeader($60,$03) %TextSetVWF(MMXVWF-$80) ;> Substract $80 since letters start at tile $80. %TextPortrait(4,KSSPortraits,10,$10,$04,$3D) %TextLockGame(1) %TextString($40,$08,$3F,"Mario ya esta aqui ! Esta") %TextString($40,$10,$3F,"viniendo de alla!") %TextConfirm($40,$19,$BE,$3F) %TextClear($60) %TextPortrait(4,KSSPortraits,14,$10,$04,$09) %TextString($40,$08,$3F,"Oh no! ¿Que podemos") %TextString($40,$10,$3F,"hacer?") %TextConfirm($40,$19,$BE,$3F) %TextClear($60) %TextPortrait(4,KSSPortraits,17,$10,$04,$05) %TextString($40,$08,$3F,"El no puede arruinar los planes") %TextString($40,$10,$3F,"de su Alteza!") %TextConfirm($40,$19,$BE,$3F) %TextClear($60) %TextPortrait(4,KSSPortraits,18,$10,$04,$07) %TextString($40,$08,$3F,"Su majestad Horacia, cuales") %TextString($40,$10,$3F,"son sus ordenes?") %TextConfirm($40,$19,$BE,$3F) %TextClear($60) %TextPortrait(4,KSSPortraits,04,$10,$04,$3D) %TextString($40,$08,$3F,"Preparense para atrapar") %TextString($40,$10,$3F,"a Mario! Aprovechen") %TextConfirm($40,$19,$BE,$3F) %TextClear($60) %TextPortrait(4,KSSPortraits,04,$10,$04,$3D) %TextString($40,$08,$3F,"la menor distraccion suya!") %TextConfirm($40,$19,$BE,$3F) %TextLockGame(0) %TextEnd() PlaySong: lda #$29 ;> Song number. sta $1DFB|!addr rtl ; / \ ; ;| CODE |; ; \ / ; !InitFlag = $0F5E|!addr !PtraitPtr = $0F5E|!addr+15 !WindowTime = $0F5E|!addr+19 !SFX = #$29 macro transferslot(slot, bytes, shift) lda.W #$7C00+(*256)+ sta $2116 lda !PtraitPtr sta $4302 clc : adc #$0200 sta !PtraitPtr lda.W # sta $4305 sty $420B endmacro init: stz !InitFlag stz !WindowTime rtl main: lda !InitFlag bmi BlankSpace_EndHDMA lda #$02 ;\ tsb $0D9F|!addr ;/ Enable SMW's windowing HDMA. lda !WindowTime inc #2 cmp #$31 bcc BlankSpace ;> Write text. lda #$32 sta !WindowTime php rep #$20 lda.w #Text ;\ sta $08 ; | ldy.b #Text>>16 ; | Dialogue (or monologue?) routine. sty $0A ; | ldx !SFX jsl SpritedText ;/ plp rtl ;> Open black space. BlankSpace: sta !WindowTime php asl : tax lda #$22 ;\ sta $41 ; | sta $42 ; | sta $44 ; | Layers' windowing configuration. lda #$20 ; | sta $43 ;/ rep #$20 lda #$FF00 ;\ - sta $04A0|!addr,x ; | Set black space's area. dex #2 : bpl - ;/ plp rtl .EndHDMA lda !WindowTime dec #2 beq + ;> Close black space. sta !WindowTime php asl : sta $00 rep #$20 ldx #$60 lda #$00FF ;\ - sta $04A0|!addr,x ; | Set black space's area. dex #2 cpx $00 bcs - ;/ plp rtl + stz $0D9F|!addr ;> End SMW's windowing HDMA. rtl .BlankSpace rep 22 : db $02,$10,$00 ;> Repeat this 22 times so depending on which one is accesed, the area will be a different length. db $01,$11,$0E ;> Normal game area. db $00 ; / \ ; ;| NMI ROUTINE FOR UPLOADING CHARACTER PORTRAIT |; ; \ / ; nmi: lda !InitFlag cmp #$03 beq + rtl + lda #$01 sta !InitFlag php rep #$20 ldy #$80 sty $2115 ;setup some DMA transfer info lda #$1801 sta $4300 ldy !PtraitPtr+2 sty $4304 ldy #$01 %transferslot(0, $0080, $00) %transferslot(1, $0080, $00) %transferslot(2, $0080, $00) %transferslot(3, $0080, $00) %transferslot(0, $0080, $40) %transferslot(1, $0080, $40) plp rtl