;PseudoASM
LDA $RAM ;
JSL Hex2Dec ; Hex -> Dec Routine
STA $Statusbar+2 ;Einer
TXA ; X->A
JSL Hex2Dec ; Hex -> Dec Routine
STA $Statusbar+1 ;Zehner
STX $Statusbar ;Hunderter
;PseudoASM
LDA $RAM ;
JSL Hex2Dec ; Hex -> Dec Routine
STA $Statusbar+2 ;Einer
TXA ; X->A
JSL Hex2Dec ; Hex -> Dec Routine
STA $Statusbar+1 ;Zehner
STX $Statusbar ;Hunderter
org $008F7E ;Write Coins
JSL MaxMP ;
NOP #2 ;
org $098020 ;Freespace
MaxMP:
STA $0F14 ;\Restore Hacked Bytes
STX $0F13 ;/
LDA $70036F ;Load Max MP from RAM
PHX ;X on Stack
JSL $00974C ;Hex -> Dec Routine
STA $7EE0F1+1 ;|Draw firsts
STX $7EE0F1 ;|draw tenths
PLX ;/X from Stack
RTL ;
STA $7EE0F1+1 ;|Draw firsts
STX $7EE0F1 ;|draw tenths
STA $7E00F1+1 ;|Draw ones
STX $7E00F1 ;|draw tens
STA $00F1+1 ;|Draw ones
STX $00F1 ;|draw tens
; Das steht irgendwo oben im Code
!maxmp = $70036F
[...]
LDA !maxmp
PHX
JSL $00974C
[...]
STA $0F1E+1 ;|Draw ones
STX $0F1E ;|draw tens
STA $0F1F ;|Draw ones
STX $0F1E ;|draw tens
header
lorom
;-----------------------------------------------------------------------
!MaxHP = $700366
!MaxMP = $70036F
!HPRAM = $7E0F42
!MPRAM = $7E0DA1
org $009E35 ;Routine for Powerups at Gamestart
JSL Initialization ;
NOP #1 ;
org $098000 ;Freespace
Initialization: ;Replace with Routine which gives HP and MP Start Values
STZ $19 ;\Restore Hacked Bytes
STZ $0DC2 ;/
LDA #50 ;\Current HP
STA !HPRAM ;/
LDA #50 ;\Maximum HP
STA !MaxHP ;/
LDA #10 ;\Current MP
STA !MPRAM ;/
LDA #10 ;\Maximum MP
STA !MaxMP ;/
RTL
;------------------------------------------------------------------------
org $008F7E ;write Coins
JSL DrawMP ;
NOP #2 ;
org $098020 ;Freespace
DrawMP:
STA $0F14 ;\Restore Hacked Bytes
STX $0F13 ;/
LDA !MPRAM ;|Load MP from RAM
PHX ;|X on Stack
JSL $00974C ;|Hex -> Dec Routine
STA $7E0F1B+1 ;|Draw firsts
STX $7E0F1B ;|draw tenths
PLX ;/X from Stack
RTL ;
;------------------------------------------------------------------------
org $008F7E ;Write Coins
JSL MaxMP ;
NOP #2 ;
org $098030 ;Freespace
MaxMP:
STA $0F14 ;\Restore Hacked Bytes
STX $0F13 ;/
LDA !MaxMP ;Load Max MP from RAM
PHX ;X on Stack
JSL $00974C ;Hex -> Dec Routine
STA $7E0F1E+1 ;|Draw firsts
STX $7E0F1E ;|draw tenths
PLX ;/X from Stack
RTL ;
;------------------------------------------------------------------------
org $008F7E ;Write Coins
JSL drawHP ;
NOP #2 ;
org $098040 ;Freespace
drawHP:
STA $0F14 ;\Restore Hacked Bytes
STX $0F13 ;/
LDA !HPRAM ;
JSL $00974C ; Hex -> Dec Routine
STA $7E0EFE+2 ;draw ones
TXA ; X->A
JSL $00974C ; Hex -> Dec Routine
STA $7E0EE2+1 ;draw tenths
STX $7E0EE2 ;draw hundeds
RTL ;
;------------------------------------------------------------------------
org $008F7E ;Write Coins
JSL MaxHP ;
NOP #2 ;
org $098050 ;Freespace
MaxHP:
STA $0F14 ;\Restore Hacked Bytes
STX $0F13 ;/
LDA $MaxHP ;
JSL $00974C ; Hex -> Dec Routine
STA $7E0EF2+2 ;draw ones
TXA ; X->A
JSL $00974C ; Hex -> Dec Routine
STA $7E0EF2+1 ;draw tenths
STX $7E0EF2 ;draw hundeds
RTL ;
;------------------------------------------------------------------------
org $008F7E ;write Coins
JSL DrawMP ;
NOP #2 ;
org $098020 ;Freespace
!freespace = $098000
org $038502
JSL Hijack1
org $04E383
JSL Hijack2
org $058555
JSL Hijack3
org !freespace
Hijack1:
[...]
RTL
Hijack2:
[...]
RTL
Hijack3:
[...]
RTL
!freespace = $098000
org $008F7E
JSL StatusBar
NOP #2
org !freespace
STA $0F14 ; Alter Code wiederhergestellt
STX $0F13
[Hier Code für "HP anzeigen"]
[Hier Code für "Max HP anzeigen"]
[Hier Code für "MP anzeigen"]
[Hier Code für "Max MP anzeigen"]
RTL
header
lorom
;-----------------------------------------------------------------------
!MaxHP = $700366
!MaxMP = $70036F
!HPRAM = $7E0F42
!MPRAM = $7E0DA1
!Freespace = $090200
org $009E35 ;Routine for Powerups at Gamestart
JSL Initialization
NOP #1
org $008F7E ;write Coins
JSL Statusbar ;
NOP #2
org !Freespace ;Freespace
;------------------------------------------------------------------------
Initialization: ;Replace with Routine which gives HP and MP Start Values
STZ $19 ;\Restore Hacked Bytes
STZ $0DC2 ;/
LDA #50 ;\Current HP
STA !HPRAM ;/
LDA #50 ;\Maximum HP
STA !MaxHP ;/
LDA #10 ;\Current MP
STA !MPRAM ;/
LDA #10 ;\Maximum MP
STA !MaxMP ;/
RTL
;------------------------------------------------------------------------
Statusbar:
STA $0F14 ;\Restore Hacked Bytes
STX $0F13 ;/
LDA !MPRAM ;Load MP from RAM
PHX ;X on Stack
JSL $00974C ;Hex -> Dec Routine
STA $7E0F1B+1 ;Draw firsts
STX $7E0F1B ;draw tenths
PLX ;X from Stack
LDA !MaxMP ;Load Max MP from RAM
PHX ;X on Stack
JSL $00974C ;Hex -> Dec Routine
STA $7E0F1E+1 ;Draw firsts
STX $7E0F1E ;draw tenths
PLX ;X from Stack
LDA !HPRAM ;Load HP from RAM
JSL $00974C ;Hex -> Dec Routine
STA $7E0EFE+2 ;draw ones
TXA ;X->A
JSL $00974C ;Hex -> Dec Routine
STA $7E0EE2+1 ;draw tenths
STX $7E0EE2 ;draw hundeds
LDA !MaxHP ;Load Max HP from RAM
JSL $00974C ;Hex -> Dec Routine
STA $7E0EF2+2 ;draw ones
TXA ;X->A
JSL $00974C ;Hex -> Dec Routine
STA $7E0EF2+1 ;draw tenths
STX $7E0EF2 ;draw hundeds
RTL
;------------------------------------------------------------------------
2B30C | $05:B10C | 399 bytes
The subroutine that displays the message from a message box. It handles the windowing HDMA, the stripe image upload, and things such as teleporting to the overworld after the intro screen.
$05B129/x2B329: [9C 9F 0D] Change to [EA EA EA] to prevent HDMA from getting disabled AFTER a message box has been displayed. Use with $05B296.
[...]
$05B296/x2B496: [8D] Change to [0C] to prevent HDMA from getting disabled WHILE a message box is being displayed. Use with $05B129.
header
lorom
org $05B10C
db $EA,$EA,$EA
org $05B10C
db $0C
LDA $40 ;\
ORA #$50 ; |Set the layer 3 bit of CGADDSUB
STA $40 ;/
LDA #$15
STA $212C
STA $212E
LDA #$0F
STA $212D
STA $212F
!FireXSpeed = $10 ; the X speed to spit the fireball
!FireYSpeed = $DD ; the Y speed to spit the fireball
FireXOffsetsLo:
db $06,$FA
FireXOffsetsHi:
db $00,$FF
!FireYOffsetLo = $03
!FireYOffsetHi = $00
SubFireSpit:
LDY #$07
ExSpriteLoop:
LDA $170B,y
BEQ FoundExSlot
DEY
BPL ExSpriteLoop
RTS
FoundExSlot:
LDA #$0B
STA $170B,y
LDA $E4,x
PHY
LDY $157C,x
CLC
ADC FireXOffsetsLo,y
PLY
STA $171F,y
LDA $14E0,x
PHY
LDY $157C,x
ADC FireXOffsetsHi,y
PLY
STA $1733,y
LDA $D8,x
CLC
ADC #!FireYOffsetLo
STA $1715,y
LDA $14D4,x
ADC #!FireYOffsetHi
STA $1729,y
LDA #!FireXSpeed
PHY
LDY $157C,x
BEQ $03
EOR #$FF
INC
PLY
STA $1747,y
LDA #!FireYSpeed
STA $173D,y
LDA #$FF
STA $176F,y
RTS