Routines |
Prev: 9305 | Up: Map | Next: 944E |
|
|||||
|
|||||
MainMenu | 933F | XOR A | Write 00 to; | ||
9340 | LD ($9B2B),A | ||||
9343 | LD ($9AB7),A | ||||
9346 | CALL $CB1E | Call CB1E. | |||
Zero the displayed score.
|
|||||
9349 | LD HL,$91AE | HL=91AE. | |||
934C | LD DE,$91AF | DE=91AF. | |||
934F | LD BC,$0005 | BC=0005. | |||
9352 | LD (HL),$30 | Write "0" to the first digit in Messaging_Score. | |||
9354 | LDIR | Copy the zero to the next five digits. | |||
Print the menu options.
|
|||||
9356 | CALL PrintString_Loop | Call PrintString_Loop. | |||
9359 | DEFB $00 | CLEAR SCREEN. | |||
935A | DEFB $10,$00 | INK: BLACK. | |||
935C | DEFB $11,$00 | PAPER: BLACK. | |||
935E | DEFB $16,$05,$07 | PRINT AT: 05, 07. | |||
9361 | DEFM "1 KEYBOARD" | ||||
936B | DEFB $16,$07,$07 | PRINT AT: 07, 07. | |||
936E | DEFM "2 KEMPSTON JOYSTICK" | ||||
9381 | DEFB $16,$09,$07 | PRINT AT: 09, 07. | |||
9384 | DEFM "3 INTERFACE TWO " | ||||
9394 | DEFB $16,$0B,$07 | PRINT AT: 0B, 07. | |||
9397 | DEFM "4 CURSOR JOYSTICK " | ||||
93A9 | DEFB $16,$0D,$07 | PRINT AT: 0D, 07. | |||
93AC | DEFM "5 REDEFINE KEYS" | ||||
93BB | DEFB $16,$12,$07 | PRINT AT: 12, 07. | |||
93BE | DEFM "0 START GAME" | ||||
93CA | DEFB $FF | Terminator. | |||
Display the header and footer messaging.
|
|||||
93CB | CALL Messaging_HeaderFooter | Call Messaging_HeaderFooter. | |||
Set the bright white colouring.
|
|||||
93CE | CALL SetAttributeBuffer_WhiteInk | Call SetAttributeBuffer_WhiteInk. | |||
Now begin setting up the dart pointer.
|
|||||
93D1 | LD HL,$0501 | Set the initial position of the dart pointer to HL (0501). | |||
93D4 | LD B,$04 | Set a counter in B for the width of the dart pointer. | |||
Clear the attributes of all possible positions of the dart pointer.
|
|||||
ClearDartPointerAttributePositions | 93D6 | PUSH BC | Stash the dart width counter and dart co-ordinates on the stack. | ||
93D7 | PUSH HL | ||||
93D8 | CALL ClearDartPointerAttributes | Call ClearDartPointerAttributes. | |||
93DB | POP HL | Restore the dart co-ordinates from the stack. | |||
93DC | INC H | Move down two rows (the height of the dart pointer). | |||
93DD | INC H | ||||
93DE | POP BC | Restore the dart width counter from the stack. | |||
93DF | DJNZ ClearDartPointerAttributePositions | Decrease the dart width counter by one and loop back to ClearDartPointerAttributePositions until the counter is zero. | |||
Initialise the dart pointer.
|
|||||
93E1 | LD DE,$0500 | Set the initial position of the dart pointer to DE (0500). | |||
93E4 | LD B,$04 | Set a counter in B for the width of the dart pointer. | |||
DrawDartPointer_Loop | 93E6 | PUSH BC | Stash the dart width counter and dart co-ordinates on the stack. | ||
93E7 | PUSH DE | ||||
93E8 | CALL MainMenu_PrintDartPointer | Call MainMenu_PrintDartPointer. | |||
93EB | POP DE | Restore the dart co-ordinates and dart width counter from the stack. | |||
93EC | POP BC | ||||
93ED | INC D | Increment D by two. | |||
93EE | INC D | ||||
93EF | DJNZ DrawDartPointer_Loop | Decrease the dart width counte by one and loop back to DrawDartPointer_Loop until the counter is zero. | |||
ColourDartPointerAttributes_Loop | 93F1 | CALL MainMenu_ColourDartPointer | Call MainMenu_ColourDartPointer. | ||
93F4 | CALL $965F | Call 965F. | |||
93F7 | PUSH AF | Stash AF on the stack. | |||
93F8 | POP AF | Restore AF from the stack. | |||
93F9 | JR Z,ColourDartPointerAttributes_Loop | Jump to ColourDartPointerAttributes_Loop if D is equal to 04. | |||
Has the player hit "Start Game"?
|
|||||
93FB | CP $30 | Jump to MainMenu_1 if "0" was not pressed (ASCII 30 is "0"). | |||
93FD | JR NZ,MainMenu_1 | ||||
A game was started...
|
|||||
93FF | CALL Sound_MenuTick | Call Sound_MenuTick. | |||
Consolidate the selected configs.
|
|||||
9402 | LD A,($99F6) | Write *DartPointer_Position to *ControlType. | |||
9405 | LD ($99F5),A | ||||
9408 | ADD A,A | D=05+(A*02). | |||
9409 | ADD A,$05 | ||||
940B | LD D,A | ||||
940C | LD E,$01 | E=01. | |||
940E | LD B,$3E | B=3E. | |||
MainMenu_0 | 9410 | PUSH BC | Stash BC and DE on the stack. | ||
9411 | PUSH DE | ||||
9412 | HALT | Halt operation (suspend CPU until the next interrupt). | |||
9413 | CALL MainMenu_PrintDartPointer | Call MainMenu_PrintDartPointer. | |||
9416 | POP HL | Restore HL from the stack. | |||
9417 | PUSH HL | Stash HL on the stack. | |||
9418 | INC L | Increment L by one. | |||
9419 | CALL MainMenu_ColourDartPointer_0 | Call MainMenu_ColourDartPointer_0. | |||
941C | POP DE | Restore DE from the stack. | |||
941D | PUSH DE | Stash DE on the stack. | |||
941E | CALL $9253 | Call 9253. | |||
9421 | POP DE | Restore DE from the stack. | |||
9422 | INC E | Increment E by one. | |||
9423 | POP BC | Restore BC from the stack. | |||
9424 | DJNZ MainMenu_0 | Decrease counter by one and loop back to MainMenu_0 until counter is zero. | |||
9426 | JP $94E6 | Jump to 94E6. | |||
MainMenu_1 | 9429 | CP $36 | Jump to ColourDartPointerAttributes_Loop if A is greater than (ASCII 36 is "6"). | ||
942B | JP NC,ColourDartPointerAttributes_Loop | ||||
942E | CP $30 | Jump to ColourDartPointerAttributes_Loop if A is less than (ASCII 30 is "0"). | |||
9430 | JP C,ColourDartPointerAttributes_Loop | ||||
9433 | SUB $31 | A-=31. | |||
9435 | PUSH AF | Stash AF on the stack. | |||
9436 | CALL ClearCurrentDartPointerAttributes | Call ClearCurrentDartPointerAttributes. | |||
9439 | CALL Sound_MenuTick | Call Sound_MenuTick. | |||
943C | POP AF | Restore AF from the stack. | |||
943D | LD ($99F6),A | Write A to *DartPointer_Position. | |||
9440 | CP $04 | Jump to ColourDartPointerAttributes_Loop if A is not equal to 04. | |||
9442 | JP NZ,ColourDartPointerAttributes_Loop | ||||
9445 | CALL Messaging_RedefineKeys | Call Messaging_RedefineKeys. | |||
9448 | CALL Debounce_CheckKeys | Call Debounce_CheckKeys. | |||
944B | JP MainMenu | Jump to MainMenu. |
Prev: 9305 | Up: Map | Next: 944E |