![]() |
Routines |
Prev: 63157 | Up: Map | Next: 63267 |
Used by the routine at Handler_Interrupts.
|
||||
MusicThemeTune | 63195 | LD A,(65528) | Jump to MusicThemeTune_Housekeeping if *MusicOnOff is equal to 0. | |
63198 | CP 0 | |||
63200 | JR Z,MusicThemeTune_Housekeeping | |||
63202 | PUSH BC | Stash BC on the stack. | ||
63203 | LD A,(65160) | C=*InterruptCounter. | ||
63206 | LD C,A | |||
63207 | LD A,(65527) | A=*65527. | ||
63210 | AND C | Merge the bits from C. | ||
63211 | POP BC | Restore BC from the stack. | ||
63212 | JR NZ,MusicThemeTune_Housekeeping | Jump to MusicThemeTune_Housekeeping if {} is not zero. | ||
63214 | PUSH BC | Stash BC, DE and HL on the stack. | ||
63215 | PUSH DE | |||
63216 | PUSH HL | |||
63217 | LD HL,(65529) | HL=*MusicPointerThemeMusic. | ||
63220 | LD A,(HL) | Fetch a byte of music data and store it in A. | ||
Are we at the end?
|
||||
63221 | CP 255 | Jump to MusicResetThemeTune if the termination character (255) has been reached. | ||
63223 | JP Z,MusicResetThemeTune | |||
63226 | LD E,A | E=the music data byte from A. | ||
63227 | INC HL | Increment the music data pointer by one. | ||
63228 | LD A,(HL) | D=*HL. | ||
63229 | LD D,A | |||
63230 | INC HL | Increment music data pointer by one. | ||
63231 | LD A,(HL) | C=*HL. | ||
63232 | LD C,A | |||
63233 | INC HL | Increment music data pointer by one. | ||
63234 | LD A,(HL) | B=*HL. | ||
63235 | LD B,A | |||
63236 | INC HL | Increment the music data pointer by one and write it to *MusicPointerThemeMusic ready for the next interrupt generation. | ||
63237 | LD (65529),HL | |||
63240 | LD A,E | Jump to MusicThemeTune_NoNote if DE is zero. | ||
63241 | OR D | |||
63242 | JR Z,MusicThemeTune_NoNote | |||
63244 | CALL PlayWave1 | Call PlayWave1. | ||
MusicThemeTune_NoNote | 63247 | POP HL | Restore HL, DE and BC from the stack. | |
63248 | POP DE | |||
63249 | POP BC | |||
MusicThemeTune_Housekeeping | 63250 | POP AF | Restore AF and AF from the stack. | |
63251 | POP AF | |||
63252 | CALL 56 | Call MASK_INT. | ||
63255 | POP IY | Restore IY from the stack. | ||
63257 | EI | Enable interrupts. | ||
63258 | RET | Return. | ||
Resets the theme tune pointer back to the beginning of the data.
|
||||
MusicResetThemeTune | 63259 | LD HL,64000 | Write MelodyData_ThemeTune to *MusicPointerThemeMusic. | |
63262 | LD (65529),HL | |||
63265 | JR MusicThemeTune_NoNote | Jump to MusicThemeTune_NoNote. |
Prev: 63157 | Up: Map | Next: 63267 |