![]() |
Routines |
| Prev: 8000 | Up: Map | Next: 80D1 |
|
|
||||||||||||||||||||
| GameInitialisation | 800A | LD HL,$5E00 | Write 00 to 2200 bytes starting from GameOptions. | |||||||||||||||||
| 800D | LD BC,$2200 | |||||||||||||||||||
| GameInitialisation_Loop | 8010 | LD (HL),$00 | ||||||||||||||||||
| 8012 | INC HL | |||||||||||||||||||
| 8013 | DEC BC | |||||||||||||||||||
| 8014 | LD A,C | |||||||||||||||||||
| 8015 | OR B | |||||||||||||||||||
| 8016 | JR NZ,GameInitialisation_Loop | |||||||||||||||||||
| 8018 | LD HL,$D347 | Write MainFont to FontPointer. | ||||||||||||||||||
| 801B | LD ($5E04),HL | |||||||||||||||||||
| 801E | CALL $9C23 | Call 9C23. | ||||||||||||||||||
| 8021 | CALL CreateWindow | Call CreateWindow. | ||||||||||||||||||
| 8024 | LD DE,$BA2A | DE=BA2A. | ||||||||||||||||||
| 8027 | CALL $B9BC | Call B9BC. | ||||||||||||||||||
| 802A | JR GameSelect_Loop | Jump to GameSelect_Loop. | ||||||||||||||||||
|
This entry point is used by the routine at F33E.
|
||||||||||||||||||||
| Game_Restart | 802C | CALL CreateWindow | Call CreateWindow. | |||||||||||||||||
| 802F | CALL HallOfFame | Call HallOfFame. | ||||||||||||||||||
| 8032 | CALL CreateWindow | Call CreateWindow. | ||||||||||||||||||
| GameSelect_Loop | 8035 | CALL GameMenu | Call GameMenu. | |||||||||||||||||
| 8038 | LD A,$F7 | Read from the keyboard;
|
||||||||||||||||||
| 803A | OUT ($FD),A | |||||||||||||||||||
| 803C | IN A,($FE) | |||||||||||||||||||
| 803E | CPL | Flip the bits. | ||||||||||||||||||
| 803F | LD E,A | E=A. | ||||||||||||||||||
| 8040 | LD A,($5E00) | A=GameOptions. | ||||||||||||||||||
| 8043 | LD ($5E7C),A | Write A to 5E7C. | ||||||||||||||||||
|
Handle 1UP selection.
|
||||||||||||||||||||
| GameSelect_CheckP1 | 8046 | BIT 0,E | Has key "1" been pressed? ("1 PLAYER GAME"). | |||||||||||||||||
| 8048 | JR Z,GameSelect_CheckP2 | If not jump to GameSelect_CheckP2. | ||||||||||||||||||
| 804A | RES 0,A | Set player count = 1. | ||||||||||||||||||
|
Handle 2UP selection.
|
||||||||||||||||||||
| GameSelect_CheckP2 | 804C | BIT 1,E | Has key "2" been pressed? ("2 PLAYER GAME"). | |||||||||||||||||
| 804E | JR Z,GameSelect_CheckKeyboard | If not jump to GameSelect_CheckKeyboard. | ||||||||||||||||||
| 8050 | SET 0,A | Set player count = 2. | ||||||||||||||||||
|
Handle Keyboard selection.
|
||||||||||||||||||||
| GameSelect_CheckKeyboard | 8052 | BIT 2,E | Has key "3" been pressed? ("3 KEYBOARD"). | |||||||||||||||||
| 8054 | JR Z,GameSelect_CheckKempston | If not jump to GameSelect_CheckKempston. | ||||||||||||||||||
| 8056 | AND %11111001 | Set control method = keyboard. | ||||||||||||||||||
|
Handle Kempston Joystick selection.
|
||||||||||||||||||||
| GameSelect_CheckKempston | 8058 | BIT 3,E | Has key "4" been pressed? ("4 KEMPSTON JOYSTICK"). | |||||||||||||||||
| 805A | JR Z,GameSelect_CheckCursor | If not jump to GameSelect_CheckCursor. | ||||||||||||||||||
| 805C | AND %11111001 | Strip out the control method bits. | ||||||||||||||||||
| 805E | OR %00000010 | Set control method = kempston. | ||||||||||||||||||
|
Handle Cursor Joystick selection.
|
||||||||||||||||||||
| GameSelect_CheckCursor | 8060 | BIT 4,E | Has key "5" been pressed? ("5 CURSOR JOYSTICK"). | |||||||||||||||||
| 8062 | JR Z,GameSelect_StartGame | If not jump to GameSelect_StartGame. | ||||||||||||||||||
| 8064 | AND %11111001 | Strip out the control method bits. | ||||||||||||||||||
| 8066 | OR %00000100 | Set control method = cursor. | ||||||||||||||||||
|
Handle starting a new game.
|
||||||||||||||||||||
| GameSelect_StartGame | 8068 | LD ($5E00),A | Store A at GameOptions. | |||||||||||||||||
| 806B | LD A,$EF | Read from the keyboard;
|
||||||||||||||||||
| 806D | OUT ($FD),A | |||||||||||||||||||
| 806F | IN A,($FE) | |||||||||||||||||||
| 8071 | CPL | Flip the bits. | ||||||||||||||||||
| 8072 | BIT 4,A | Has key "6" been pressed? ("6 START GAME"). | ||||||||||||||||||
| 8074 | JP NZ,StartGame | If so, jump to StartGame. | ||||||||||||||||||
| 8077 | LD A,($5E00) | C=GameOptions. | ||||||||||||||||||
| 807A | LD C,A | |||||||||||||||||||
| 807B | LD A,($5E7C) | A=5E7C. | ||||||||||||||||||
| 807E | XOR C | |||||||||||||||||||
| 807F | PUSH AF | Stash AF on the stack. | ||||||||||||||||||
| 8080 | BIT 0,A | |||||||||||||||||||
| 8082 | CALL NZ,$80FD | |||||||||||||||||||
| 8085 | POP AF | Restore AF from the stack. | ||||||||||||||||||
| 8086 | AND %00000110 | Keep only bits 1-2. | ||||||||||||||||||
| 8088 | JR Z,GameInitialisation_0 | |||||||||||||||||||
| 808A | LD DE,$BA9E | DE=BA9E. | ||||||||||||||||||
| 808D | LD A,C | A=C. | ||||||||||||||||||
| 808E | AND %00000110 | Keep only bits 1-2. | ||||||||||||||||||
| 8090 | LD L,A | Create an offset in HL. | ||||||||||||||||||
| 8091 | LD H,$00 | |||||||||||||||||||
| 8093 | ADD HL,DE | HL=BA9E + offset. | ||||||||||||||||||
| 8094 | LD E,(HL) | DE=address held at HL. | ||||||||||||||||||
| 8095 | INC HL | |||||||||||||||||||
| 8096 | LD D,(HL) | |||||||||||||||||||
| 8097 | CALL $B9BC | Call B9BC. | ||||||||||||||||||
|
Handle flashing each selection.
|
||||||||||||||||||||
| GameInitialisation_0 | 809A | LD HL,$810F | HL=GameSelection_Attributes+01 (i.e. ignoring "Game Selection" as it doesn't flash). | |||||||||||||||||
| 809D | LD A,($5E00) | C=GameOptions. | ||||||||||||||||||
| 80A0 | LD C,A | |||||||||||||||||||
| 80A1 | BIT 0,C | |||||||||||||||||||
| 80A3 | JR NZ,GameInitialisation_3 | |||||||||||||||||||
| 80A5 | CALL MenuAttributeSetUnset | |||||||||||||||||||
| MenuAttrHandler | 80A8 | LD B,$03 | B=03. | |||||||||||||||||
| 80AA | LD A,C | |||||||||||||||||||
| 80AB | RRCA | |||||||||||||||||||
| MenuAttrHandler_Loop | 80AC | AND %00000011 | ||||||||||||||||||
| 80AE | JR Z,GameInitialisation_2 | |||||||||||||||||||
| 80B0 | CALL MenuAttributeUnSetFirst | |||||||||||||||||||
| GameInitialisation_1 | 80B3 | DEC A | ||||||||||||||||||
| 80B4 | DJNZ MenuAttrHandler_Loop | |||||||||||||||||||
| 80B6 | JP GameSelect_Loop | Jump to GameSelect_Loop. | ||||||||||||||||||
| GameInitialisation_2 | 80B9 | CALL MenuAttributeSetFirst | Call MenuAttributeSetFirst. | |||||||||||||||||
| 80BC | JR GameInitialisation_1 | Jump to GameInitialisation_1. | ||||||||||||||||||
| GameInitialisation_3 | 80BE | CALL MenuAttributeUnsetSet | Call MenuAttributeUnsetSet. | |||||||||||||||||
| 80C1 | JR MenuAttrHandler | Jump to MenuAttrHandler. | ||||||||||||||||||
|
Set the first menu item, unset the second.
|
||||||||||||||||||||
| MenuAttributeSetUnset | 80C3 | SET 7,(HL) | Set the FLASH attribute for the menu attribute. | |||||||||||||||||
| 80C5 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| MenuAttributeUnSetFirst | 80C6 | RES 7,(HL) | Unset the FLASH attribute for the menu attribute. | |||||||||||||||||
| 80C8 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| 80C9 | RET | Return. | ||||||||||||||||||
|
Unset the first menu item, set the second.
|
||||||||||||||||||||
| MenuAttributeUnsetSet | 80CA | RES 7,(HL) | Unset the FLASH attribute for the menu attribute. | |||||||||||||||||
| 80CC | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| MenuAttributeSetFirst | 80CD | SET 7,(HL) | Set the FLASH attribute for the menu attribute. | |||||||||||||||||
| 80CF | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| 80D0 | RET | Return. | ||||||||||||||||||
| Prev: 8000 | Up: Map | Next: 80D1 |