![]() |
Routines |
Prev: 24891 | Up: Map | Next: 25394 |
Used by the routine at SecurityCheck.
|
||||||||||||||||||||
Blank the 1UP, 2UP and HI scores.
|
||||||||||||||||||||
GameInitialisation | 25240 | LD HL,24329 | Write 0 to 11 bytes from HighScore_1 to 24339. | |||||||||||||||||
25243 | LD BC,2816 | |||||||||||||||||||
GameInitialisation_Loop | 25246 | LD (HL),C | ||||||||||||||||||
25247 | INC HL | |||||||||||||||||||
25248 | DJNZ GameInitialisation_Loop | |||||||||||||||||||
This calculates a "checksum" of the BEEPER routine. The expected value at the end is 0 and if Sound_Enable does not contain 0 then the game is muted.
|
||||||||||||||||||||
25250 | LD HL,949 | HL=BEEPER. | ||||||||||||||||||
25253 | LD B,67 | B=67 (counter). | ||||||||||||||||||
25255 | XOR A | A=0. | ||||||||||||||||||
Mute_Loop | 25256 | ADD A,(HL) | Add the byte at HL to A. | |||||||||||||||||
25257 | INC HL | Increment HL by one. | ||||||||||||||||||
25258 | DJNZ Mute_Loop | Decrease counter by one and loop back to Mute_Loop until counter is zero. | ||||||||||||||||||
25260 | ADD A,104 | A=A + 104. | ||||||||||||||||||
25262 | LD (24333),A | Store this number at Sound_Enable. | ||||||||||||||||||
25265 | XOR A | Write 0 to BORDCR. | ||||||||||||||||||
25266 | LD (23624),A | |||||||||||||||||||
This entry point is used by the routine at GameOver_1UP.
|
||||||||||||||||||||
Game_Restart | 25269 | DI | Disable interrupts. | |||||||||||||||||
25270 | LD SP,24320 | Set the stack pointer to SecurityCheck. | ||||||||||||||||||
25273 | CALL CreateWindow | Call CreateWindow. | ||||||||||||||||||
GameSelect_Loop | 25276 | CALL GameMenu | Call GameMenu. | |||||||||||||||||
25279 | LD A,247 | Read from the keyboard;
|
||||||||||||||||||
25281 | OUT (253),A | |||||||||||||||||||
25283 | IN A,(254) | |||||||||||||||||||
25285 | CPL | Flip the bits. | ||||||||||||||||||
25286 | LD E,A | E=A. | ||||||||||||||||||
25287 | LD A,(24332) | A=GameOptions. | ||||||||||||||||||
Handle 1UP selection.
|
||||||||||||||||||||
25290 | BIT 0,E | Has key "1" been pressed? ("1 PLAYER GAME"). | ||||||||||||||||||
25292 | JR Z,GameSelect_CheckP2 | If not jump to GameSelect_CheckP2. | ||||||||||||||||||
25294 | RES 0,A | Set player count = 1. | ||||||||||||||||||
Handle 2UP selection.
|
||||||||||||||||||||
GameSelect_CheckP2 | 25296 | BIT 1,E | Has key "2" been pressed? ("2 PLAYER GAME"). | |||||||||||||||||
25298 | JR Z,GameSelect_CheckKeyboard | If not jump to GameSelect_CheckKeyboard. | ||||||||||||||||||
25300 | SET 0,A | Set player count = 2. | ||||||||||||||||||
Handle Keyboard selection.
|
||||||||||||||||||||
GameSelect_CheckKeyboard | 25302 | BIT 2,E | Has key "3" been pressed? ("KEYBOARD"). | |||||||||||||||||
25304 | JR Z,GameSelect_CheckKempston | If not jump to GameSelect_CheckKempston. | ||||||||||||||||||
25306 | AND %11111001 | Keep only bits 0, 3-7. | ||||||||||||||||||
Handle Kempston Joystick selection.
|
||||||||||||||||||||
GameSelect_CheckKempston | 25308 | BIT 3,E | Has key "4" been pressed? ("KEMPSTON JOYSTICK"). | |||||||||||||||||
25310 | JR Z,GameSelect_CheckCursor | If not jump to GameSelect_CheckCursor. | ||||||||||||||||||
25312 | AND %11111001 | Keep only bits. | ||||||||||||||||||
25314 | OR %00000010 | Set bit 1. | ||||||||||||||||||
Handle Cursor Joystick selection.
|
||||||||||||||||||||
GameSelect_CheckCursor | 25316 | BIT 4,E | Has key "5" been pressed? ("CURSOR JOYSTICK"). | |||||||||||||||||
25318 | JR Z,GameSelect_CheckStart | If not jump to GameSelect_CheckStart. | ||||||||||||||||||
25320 | AND %11111001 | Keep only bits 0, 3-7. | ||||||||||||||||||
25322 | OR %00000100 | Set bit 2. | ||||||||||||||||||
GameSelect_CheckStart | 25324 | LD (24332),A | Store A at GameOptions. | |||||||||||||||||
"0" for "Start Game" is on a different port.
|
||||||||||||||||||||
25327 | LD A,239 | Read from the keyboard;
|
||||||||||||||||||
25329 | OUT (253),A | |||||||||||||||||||
25331 | IN A,(254) | |||||||||||||||||||
25333 | CPL | Flip the bits. | ||||||||||||||||||
Handle starting a new game.
|
||||||||||||||||||||
25334 | BIT 0,A | Has key "0" been pressed? ("START GAME"). | ||||||||||||||||||
25336 | JP NZ,StartGame | If so, jump to StartGame. | ||||||||||||||||||
Handle flashing each selection.
|
||||||||||||||||||||
25339 | LD HL,25439 | HL=GameSelection_Attributes+1 (i.e. ignoring "Game Selection" as it doesn't flash). | ||||||||||||||||||
25342 | LD A,(24332) | C=GameOptions. | ||||||||||||||||||
25345 | LD C,A | |||||||||||||||||||
25346 | BIT 0,C | If a 1UP game is selected, jump to MenuAttrHandleJoystick. | ||||||||||||||||||
25348 | JR NZ,MenuAttrHandleJoystick | |||||||||||||||||||
25350 | CALL MenuAttributeSetUnset | Call MenuAttributeSetUnset. | ||||||||||||||||||
MenuAttrHandler | 25353 | LD B,3 | B=3. | |||||||||||||||||
25355 | LD A,C | A=C. | ||||||||||||||||||
25356 | RRCA | |||||||||||||||||||
MenuAttrHandler_Loop | 25357 | AND %00000011 | Keep only bits 0-1. | |||||||||||||||||
25359 | JR Z,MenuAttrHandle2UP | |||||||||||||||||||
25361 | CALL MenuAttributeUnSetFirst | Call MenuAttributeUnSetFirst. | ||||||||||||||||||
GameInitialisation_0 | 25364 | DEC A | Decrease A by one. | |||||||||||||||||
25365 | DJNZ MenuAttrHandler_Loop | Decrease counter by one and loop back to MenuAttrHandler_Loop until counter is zero. | ||||||||||||||||||
25367 | JP GameSelect_Loop | Jump back to GameSelect_Loop. | ||||||||||||||||||
Handle flashing 2UP.
|
||||||||||||||||||||
MenuAttrHandle2UP | 25370 | CALL MenuAttributeSetFirst | Call MenuAttributeSetFirst. | |||||||||||||||||
25373 | JR GameInitialisation_0 | Jump to GameInitialisation_0. | ||||||||||||||||||
Handle flashing joystick.
|
||||||||||||||||||||
MenuAttrHandleJoystick | 25375 | CALL MenuAttributeUnsetSet | Call MenuAttributeUnsetSet. | |||||||||||||||||
25378 | JR MenuAttrHandler | Jump to MenuAttrHandler. | ||||||||||||||||||
Set the first menu item, unset the second.
|
||||||||||||||||||||
MenuAttributeSetUnset | 25380 | SET 7,(HL) | Set the FLASH attribute for the menu attribute. | |||||||||||||||||
25382 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
MenuAttributeUnSetFirst | 25383 | RES 7,(HL) | Unset the FLASH attribute for the menu attribute. | |||||||||||||||||
25385 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
25386 | RET | Return. | ||||||||||||||||||
Unset the first menu item, set the second.
|
||||||||||||||||||||
MenuAttributeUnsetSet | 25387 | RES 7,(HL) | Unset the FLASH attribute for the menu attribute. | |||||||||||||||||
25389 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
MenuAttributeSetFirst | 25390 | SET 7,(HL) | Set the FLASH attribute for the menu attribute. | |||||||||||||||||
25392 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
25393 | RET | Return. | ||||||||||||||||||
View the equivalent code in;
|
Prev: 24891 | Up: Map | Next: 25394 |