![]() |
Routines |
| Prev: 32778 | Up: Map | Next: 32977 |
|
Rebuilds the menu window, shows the hall of fame, then loops on the game selection keys until "6" starts a game.
|
||||||||||||||||||||
| Game_Restart | 32812 | CALL CreateWindow | Call CreateWindow. | |||||||||||||||||
| 32815 | CALL HallOfFame | Call HallOfFame. | ||||||||||||||||||
| 32818 | CALL CreateWindow | Call CreateWindow. | ||||||||||||||||||
|
Draw the menu, then read keys "1"-"5".
|
||||||||||||||||||||
| 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 | Store the key bits for the tests below. | ||||||||||||||||||
| 32832 | LD A,(24064) | Copy GameOptions to PreviousGameOptions. | ||||||||||||||||||
| 32835 | LD (24188),A | |||||||||||||||||||
|
Handle 1UP selection.
|
||||||||||||||||||||
| GameSelect_CheckP1 | 32838 | BIT 0,E | Jump to GameSelect_CheckP2 if "1" was not pressed. | |||||||||||||||||
| 32840 | JR Z,GameSelect_CheckP2 | |||||||||||||||||||
| 32842 | RES 0,A | Set a 1UP game. | ||||||||||||||||||
|
Handle 2UP selection.
|
||||||||||||||||||||
| GameSelect_CheckP2 | 32844 | BIT 1,E | Jump to GameSelect_CheckKeyboard if "2" was not pressed. | |||||||||||||||||
| 32846 | JR Z,GameSelect_CheckKeyboard | |||||||||||||||||||
| 32848 | SET 0,A | Set a 2UP game. | ||||||||||||||||||
|
Handle Keyboard selection.
|
||||||||||||||||||||
| GameSelect_CheckKeyboard | 32850 | BIT 2,E | Jump to GameSelect_CheckKempston if "3" was not pressed. | |||||||||||||||||
| 32852 | JR Z,GameSelect_CheckKempston | |||||||||||||||||||
| 32854 | AND %11111001 | Set the control method to keyboard. | ||||||||||||||||||
|
Handle Kempston Joystick selection.
|
||||||||||||||||||||
| GameSelect_CheckKempston | 32856 | BIT 3,E | Jump to GameSelect_CheckCursor if "4" was not pressed. | |||||||||||||||||
| 32858 | JR Z,GameSelect_CheckCursor | |||||||||||||||||||
| 32860 | AND %11111001 | Clear the control method bits. | ||||||||||||||||||
| 32862 | OR %00000010 | Set the control method to Kempston. | ||||||||||||||||||
|
Handle Cursor Joystick selection.
|
||||||||||||||||||||
| GameSelect_CheckCursor | 32864 | BIT 4,E | Jump to GameSelect_StartGame if "5" was not pressed. | |||||||||||||||||
| 32866 | JR Z,GameSelect_StartGame | |||||||||||||||||||
| 32868 | AND %11111001 | Clear the control method bits. | ||||||||||||||||||
| 32870 | OR %00000100 | Set the control method to cursor. | ||||||||||||||||||
|
Write the options back, then test "6" to start.
|
||||||||||||||||||||
| GameSelect_StartGame | 32872 | LD (24064),A | Write the updated options to 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 | Jump to StartGame if "6" was pressed. | ||||||||||||||||||
| 32884 | JP NZ,StartGame | |||||||||||||||||||
|
Queue a jingle if the player count or control method changed since the last pass.
|
||||||||||||||||||||
| 32887 | LD A,(24064) | Copy the current game options into C. | ||||||||||||||||||
| 32890 | LD C,A | |||||||||||||||||||
| 32891 | LD A,(24188) | Compare them with PreviousGameOptions. | ||||||||||||||||||
| 32894 | XOR C | |||||||||||||||||||
| 32895 | PUSH AF | Stash the changed-option flags on the stack. | ||||||||||||||||||
| 32896 | BIT 0,A | Call QueueMenuTune if the player count has changed. | ||||||||||||||||||
| 32898 | CALL NZ,QueueMenuTune | |||||||||||||||||||
| 32901 | POP AF | Restore the changed-option flags from the stack. | ||||||||||||||||||
| 32902 | AND %00000110 | Keep only the control method bits. | ||||||||||||||||||
| 32904 | JR Z,Game_Restart_FlashSelection | Jump to Game_Restart_FlashSelection if the control method is unchanged. | ||||||||||||||||||
|
Queue the jingle for the newly selected control method.
|
||||||||||||||||||||
| 32906 | LD DE,47774 | Set the tune table pointer to Menu_Tune_Table. | ||||||||||||||||||
| 32909 | LD A,C | Fetch the current game options. | ||||||||||||||||||
| 32910 | AND %00000110 | Keep only the control method bits. | ||||||||||||||||||
| 32912 | LD L,A | Create an offset in HL. | ||||||||||||||||||
| 32913 | LD H,0 | |||||||||||||||||||
| 32915 | ADD HL,DE | Point HL at the matching entry in Menu_Tune_Table. | ||||||||||||||||||
| 32916 | LD E,(HL) | Fetch the control-method jingle address. | ||||||||||||||||||
| 32917 | INC HL | |||||||||||||||||||
| 32918 | LD D,(HL) | |||||||||||||||||||
| 32919 | CALL QueueTune | Queue the control-method jingle. | ||||||||||||||||||
|
Flash the selected 1UP/ 2UP and control-method lines.
|
||||||||||||||||||||
| Game_Restart_FlashSelection | 32922 | LD HL,33039 | HL=GameSelection_Attributes_Options (the first selectable line, skipping the title). | |||||||||||||||||
| 32925 | LD A,(24064) | Copy the current game options into C. | ||||||||||||||||||
| 32928 | LD C,A | |||||||||||||||||||
| 32929 | BIT 0,C | Jump to Game_Restart_Flash2UP if this is a 2UP game. | ||||||||||||||||||
| 32931 | JR NZ,Game_Restart_Flash2UP | |||||||||||||||||||
| 32933 | CALL MenuAttributeSetUnset | Call MenuAttributeSetUnset. | ||||||||||||||||||
|
Flash the line for the selected control method and clear the other two.
|
||||||||||||||||||||
| MenuAttributeHandler | 32936 | LD B,3 | Set a control method counter in B for 3 loops. | |||||||||||||||||
| 32938 | LD A,C | Fetch the options and move the control bits into bits 0-1. | ||||||||||||||||||
| 32939 | RRCA | |||||||||||||||||||
| MenuAttributeHandler_Loop | 32940 | AND %00000011 | Keep only bits 0-1. | |||||||||||||||||
| 32942 | JR Z,Game_Restart_FlashControlMethod | Jump to Game_Restart_FlashControlMethod if this control method is selected. | ||||||||||||||||||
| 32944 | CALL MenuAttributeUnSetFirst | Call MenuAttributeUnSetFirst. | ||||||||||||||||||
| GameSelect_ReadOptions | 32947 | DEC A | Decrease the method bits and loop back to MenuAttributeHandler_Loop until all three lines are updated. | |||||||||||||||||
| 32948 | DJNZ MenuAttributeHandler_Loop | |||||||||||||||||||
| 32950 | JP GameSelect_Loop | Jump to GameSelect_Loop. | ||||||||||||||||||
|
Flash the selected control-method line.
|
||||||||||||||||||||
| Game_Restart_FlashControlMethod | 32953 | CALL MenuAttributeSetFirst | Call MenuAttributeSetFirst. | |||||||||||||||||
| 32956 | JR GameSelect_ReadOptions | Jump to GameSelect_ReadOptions. | ||||||||||||||||||
|
Flash the 2UP line, then handle the control methods.
|
||||||||||||||||||||
| Game_Restart_Flash2UP | 32958 | CALL MenuAttributeUnsetSet | Call MenuAttributeUnsetSet. | |||||||||||||||||
| 32961 | JR MenuAttributeHandler | Jump to MenuAttributeHandler. | ||||||||||||||||||
|
Flash this menu line and clear FLASH on the next.
|
||||||||||||||||||||
| MenuAttributeSetUnset | 32963 | SET 7,(HL) | Set the FLASH attribute for this menu line. | |||||||||||||||||
| 32965 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| MenuAttributeUnSetFirst | 32966 | RES 7,(HL) | Clear the FLASH attribute for this menu line. | |||||||||||||||||
| 32968 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| 32969 | RET | Return. | ||||||||||||||||||
|
Clear FLASH on this menu line and set it on the next.
|
||||||||||||||||||||
| MenuAttributeUnsetSet | 32970 | RES 7,(HL) | Clear the FLASH attribute for this menu line. | |||||||||||||||||
| 32972 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| MenuAttributeSetFirst | 32973 | SET 7,(HL) | Set the FLASH attribute for this menu line. | |||||||||||||||||
| 32975 | INC HL | Move onto the next menu attribute. | ||||||||||||||||||
| 32976 | RET | Return. | ||||||||||||||||||
| Prev: 32778 | Up: Map | Next: 32977 |