![]() |
Routines |
| Prev: 32778 | Up: Map | Next: 32977 |
|
Used by the routine at 62270.
|
||||||||||||||||||||
| Game_Restart | 32812 | CALL CreateWindow | Call CreateWindow. | |||||||||||||||||
| 32815 | CALL HallOfFame | Call HallOfFame. | ||||||||||||||||||
| 32818 | CALL CreateWindow | Call CreateWindow. | ||||||||||||||||||
|
This entry point is used by the routine at GameInitialisation.
|
||||||||||||||||||||
| GameSelect_Loop | 32821 | CALL GameMenu | Call GameMenu. | |||||||||||||||||
| 32824 | LD A,247 | Read from the keyboard;
|
||||||||||||||||||
| 32826 | OUT (253),A | |||||||||||||||||||
| 32828 | IN A,(254) | |||||||||||||||||||
| 32830 | CPL | Flip the bits. | ||||||||||||||||||
| 32831 | LD E,A | E=A. | ||||||||||||||||||
| 32832 | LD A,(24064) | A=GameOptions. | ||||||||||||||||||
| 32835 | LD (24188),A | Write A to 24188. | ||||||||||||||||||
|
Handle 1UP selection.
|
||||||||||||||||||||
| GameSelect_CheckP1 | 32838 | BIT 0,E | Has key "1" been pressed? ("1 PLAYER GAME"). | |||||||||||||||||
| 32840 | JR Z,GameSelect_CheckP2 | If not jump to GameSelect_CheckP2. | ||||||||||||||||||
| 32842 | RES 0,A | Set player count = 1. | ||||||||||||||||||
|
Handle 2UP selection.
|
||||||||||||||||||||
| GameSelect_CheckP2 | 32844 | BIT 1,E | Has key "2" been pressed? ("2 PLAYER GAME"). | |||||||||||||||||
| 32846 | JR Z,GameSelect_CheckKeyboard | If not jump to GameSelect_CheckKeyboard. | ||||||||||||||||||
| 32848 | SET 0,A | Set player count = 2. | ||||||||||||||||||
|
Handle Keyboard selection.
|
||||||||||||||||||||
| GameSelect_CheckKeyboard | 32850 | BIT 2,E | Has key "3" been pressed? ("3 KEYBOARD"). | |||||||||||||||||
| 32852 | JR Z,GameSelect_CheckKempston | If not jump to GameSelect_CheckKempston. | ||||||||||||||||||
| 32854 | AND %11111001 | Set control method = keyboard. | ||||||||||||||||||
|
Handle Kempston Joystick selection.
|
||||||||||||||||||||
| GameSelect_CheckKempston | 32856 | BIT 3,E | Has key "4" been pressed? ("4 KEMPSTON JOYSTICK"). | |||||||||||||||||
| 32858 | JR Z,GameSelect_CheckCursor | If not jump to GameSelect_CheckCursor. | ||||||||||||||||||
| 32860 | AND %11111001 | Strip out the control method bits. | ||||||||||||||||||
| 32862 | OR %00000010 | Set control method = kempston. | ||||||||||||||||||
|
Handle Cursor Joystick selection.
|
||||||||||||||||||||
| GameSelect_CheckCursor | 32864 | BIT 4,E | Has key "5" been pressed? ("5 CURSOR JOYSTICK"). | |||||||||||||||||
| 32866 | JR Z,GameSelect_StartGame | If not jump to GameSelect_StartGame. | ||||||||||||||||||
| 32868 | AND %11111001 | Strip out the control method bits. | ||||||||||||||||||
| 32870 | OR %00000100 | Set control method = cursor. | ||||||||||||||||||
|
Handle starting a new game.
|
||||||||||||||||||||
| GameSelect_StartGame | 32872 | LD (24064),A | Store A at GameOptions. | |||||||||||||||||
| 32875 | LD A,239 | Read from the keyboard;
|
||||||||||||||||||
| 32877 | OUT (253),A | |||||||||||||||||||
| 32879 | IN A,(254) | |||||||||||||||||||
| 32881 | CPL | Flip the bits. | ||||||||||||||||||
| 32882 | BIT 4,A | Has key "6" been pressed? ("6 START GAME"). | ||||||||||||||||||
| 32884 | JP NZ,StartGame | If so, jump to StartGame. | ||||||||||||||||||
| 32887 | LD A,(24064) | C=GameOptions. | ||||||||||||||||||
| 32890 | LD C,A | |||||||||||||||||||
| 32891 | LD A,(24188) | A=24188. | ||||||||||||||||||
| 32894 | XOR C | |||||||||||||||||||
| 32895 | PUSH AF | Stash AF on the stack. | ||||||||||||||||||
| 32896 | BIT 0,A | |||||||||||||||||||
| 32898 | CALL NZ,33021 | |||||||||||||||||||
| 32901 | POP AF | Restore AF from the stack. | ||||||||||||||||||
| 32902 | AND %00000110 | Keep only bits 1-2. | ||||||||||||||||||
| 32904 | JR Z,Game_Restart_0 | |||||||||||||||||||
| 32906 | LD DE,47774 | DE=47774. | ||||||||||||||||||
| 32909 | LD A,C | A=C. | ||||||||||||||||||
| 32910 | AND %00000110 | Keep only bits 1-2. | ||||||||||||||||||
| 32912 | LD L,A | Create an offset in HL. | ||||||||||||||||||
| 32913 | LD H,0 | |||||||||||||||||||
| 32915 | ADD HL,DE | HL=47774 + offset. | ||||||||||||||||||
| 32916 | LD E,(HL) | DE=address held at HL. | ||||||||||||||||||
| 32917 | INC HL | |||||||||||||||||||
| 32918 | LD D,(HL) | |||||||||||||||||||
| 32919 | CALL 47548 | Call 47548. | ||||||||||||||||||
|
Handle flashing each selection.
|
||||||||||||||||||||
| Game_Restart_0 | 32922 | LD HL,33039 | HL=GameSelection_Attributes+1 (i.e. ignoring "Game Selection" as it doesn't flash). | |||||||||||||||||
| 32925 | LD A,(24064) | C=GameOptions. | ||||||||||||||||||
| 32928 | LD C,A | |||||||||||||||||||
| 32929 | BIT 0,C | |||||||||||||||||||
| 32931 | JR NZ,Game_Restart_3 | |||||||||||||||||||
| 32933 | CALL MenuAttributeSetUnset | |||||||||||||||||||
| MenuAttrHandler | 32936 | LD B,3 | B=3. | |||||||||||||||||
| 32938 | LD A,C | |||||||||||||||||||
| 32939 | RRCA | |||||||||||||||||||
| MenuAttrHandler_Loop | 32940 | AND %00000011 | ||||||||||||||||||
| 32942 | JR Z,Game_Restart_2 | |||||||||||||||||||
| 32944 | CALL MenuAttributeUnSetFirst | |||||||||||||||||||
| Game_Restart_1 | 32947 | DEC A | ||||||||||||||||||
| 32948 | DJNZ MenuAttrHandler_Loop | |||||||||||||||||||
| 32950 | JP GameSelect_Loop | Jump to GameSelect_Loop. | ||||||||||||||||||
| Game_Restart_2 | 32953 | CALL MenuAttributeSetFirst | Call MenuAttributeSetFirst. | |||||||||||||||||
| 32956 | JR Game_Restart_1 | Jump to Game_Restart_1. | ||||||||||||||||||
| Game_Restart_3 | 32958 | CALL MenuAttributeUnsetSet | Call MenuAttributeUnsetSet. | |||||||||||||||||
| 32961 | JR MenuAttrHandler | Jump to MenuAttrHandler. | ||||||||||||||||||
|
Set the first menu item, unset the second.
|
||||||||||||||||||||
| MenuAttributeSetUnset | 32963 | SET 7,(HL) | Set the FLASH attribute for the menu attribute. | |||||||||||||||||
| 32965 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| MenuAttributeUnSetFirst | 32966 | RES 7,(HL) | Unset the FLASH attribute for the menu attribute. | |||||||||||||||||
| 32968 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| 32969 | RET | Return. | ||||||||||||||||||
|
Unset the first menu item, set the second.
|
||||||||||||||||||||
| MenuAttributeUnsetSet | 32970 | RES 7,(HL) | Unset the FLASH attribute for the menu attribute. | |||||||||||||||||
| 32972 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| MenuAttributeSetFirst | 32973 | SET 7,(HL) | Set the FLASH attribute for the menu attribute. | |||||||||||||||||
| 32975 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| 32976 | RET | Return. | ||||||||||||||||||
| Prev: 32778 | Up: Map | Next: 32977 |