Routines |
Prev: ED6F | Up: Map | Next: EDEF |
Used by the routines at GameOver_FlashOffset and Draw_GameOver.
|
||||
Sound_GameOver | EDD2 | LD A,($EDEF) | Return if *GameOver_X_Offset is not equal to 00. | |
EDD5 | CP $00 | |||
EDD7 | RET NZ | |||
EDD8 | PUSH BC | Stash BC and HL on the stack. | ||
EDD9 | PUSH HL | |||
EDDA | LD H,$02 | H=02. | ||
EDDC | LD BC,$03E8 | Set the repeat counter in BC to 03E8. | ||
Sound_GameOver_Loop | EDDF | LD A,(HL) | A=*HL. | |
EDE0 | INC HL | Increment HL by one. | ||
EDE1 | AND %00011000 | Keep only bits 3-4. | ||
EDE3 | OR %00000101 | Set bits 0, 2. | ||
EDE5 | OUT ($FE),A | Send to the speaker. | ||
EDE7 | DEC BC | Decrease the repeat counter by one. | ||
EDE8 | LD A,B | Jump back to Sound_GameOver_Loop until the repeat counter is zero. | ||
EDE9 | OR C | |||
EDEA | JR NZ,Sound_GameOver_Loop | |||
EDEC | POP HL | Restore HL and BC from the stack. | ||
EDED | POP BC | |||
EDEE | RET | Return. |
Prev: ED6F | Up: Map | Next: EDEF |