Prev: CA5A Up: Map Next: CB8D
CA5B: Display the intro screen and wait for the game to start
Used by the routines at C800 and DCF6.
CA5B CALL $E801 Clear the screen.
CA5E LD HL,$EFBC Print the intro screen UDGS. (EFBC)
CA61 CALL $ED06
CA64 LD HL,$EC26 Print the intro text. (EC26)
CA67 CALL $EEF1
CA6A LD DE,$0A07 Start at location 0A , 07.
CA6D LD A,$02 Start by drawing red on black.
CA6F PUSH DE Store DE and AF.
CA70 PUSH AF
CA71 LD BC,$0E01 Fill 00E columns and 1 row with this attribute.
CA74 CALL $E8BA
CA77 POP AF Restore AF and DE.
CA78 POP DE
CA79 INC E Move forward two columns.
CA7A INC E
CA7B INC A Move to the next ink colour?
CA7C CP $07 Have we reached white yet?
CA7E JR NZ,$CA6F No, so loop back and colour some more.
CA80 LD BC,$0012 Copy the intro screen's attributes.
CA83 LD DE,$5867
CA86 LD HL,$CA2B
CA89 LDIR
CA8B LD HL,$DA8A Switch to playing a tune.
CA8E LD (HL),$00
CA90 LD IY,$CA3D Point IY at the moving object data for the intro screen.
CA94 CALL $E54D Display moving objects, directly.
CA97 LD HL,$E6D9 Set the laser tick count (E6D9) to 7F (fire next loop).
CA9A LD (HL),$7F
CA9C INC HL Default to drawing the last bolt in black.
CA9D LD (HL),$00
CA9F LD HL,$EA05 Point HL at the theme tune. (EA05)
CAA2 LD ($CA57),HL Store it as the current one. (CA57).
CAA5 LD A,$12 Set 12 blocks in the tune.
CAA7 LD ($CA59),A
Loop round the theme tune blocks and play them.
CAAA LD HL,($CA57) Get the current theme tune block.
CAAD LD A,(HL) Load the pointer to the tune block into HL.
CAAE INC HL
CAAF LD H,(HL)
CAB0 LD L,A
CAB1 CALL $DB0B Play the tune.
CAB4 LD A,$FD Scan for 'A' - 'G' on the keyboard.
CAB6 IN A,($FE)
CAB8 BIT 2,A Was 'D' pressed?
CABA JP Z,$DB63 If so, move forward to define the keys.
Move the sprites on screen.
CABD LD IY,$CA43 Point IY at the moving object data for the intro screen.
CAC1 CALL $E59F Move the objects.
CAC4 CALL $EDA2 Rotate the colours on the main message.
CAC7 CALL $DA8D Play a note of the tune.
CACA CALL $DAFA Pause for one second.
CACD LD HL,($DA88) Have we reached the end of the tune block?
CAD0 LD A,(HL)
CAD1 CP $FF
CAD3 JR NZ,$CAEE Jump forward if not.
Reached the end of this tune block, move to the next one.
CAD5 LD HL,($CA57) Move onto the next tune block. (CA57)
CAD8 INC HL
CAD9 INC HL
CADA LD A,($CA59) Decrement the number of blocks left to play.
CADD DEC A
CADE AND A Are there no blocks left?
CADF JR NZ,$CAE6 If there are, then jump forward.
Reached the end of all tune blocks, start the tune from the beginning.
CAE1 LD A,$12 12 blocks left to play.
CAE3 LD HL,$EA05 Point back to the first block.
CAE6 LD ($CA57),HL
CAE9 LD ($CA59),A Set the number of blocks.
CAEC JR $CAAA Loop back to play more of the theme tune.
Flash the selected row on the title screen.
CAEE LD A,($CA5A) Put the current row in E.
CAF1 LD E,A
CAF2 LD D,$0A Always starting at column 00A.
CAF4 CALL $E8E3 Get the attribute at this location and put it in HL.
CAF7 EX DE,HL
CAF8 LD B,$0A Loop for 0A columns.
CAFA SET 7,(HL) Set the flash bit.
CAFC INC L Move to the next column.
CAFD DJNZ $CAFA Loop while there are more columns.
Detect Sinclair joystick.
CAFF LD A,$FD Scan for 'A' - 'G' on the keyboard.
CB01 IN A,($FE)
CB03 AND $02 Was 'D' pressed?
CB05 JR NZ,$CB1E Move forward if not.
CB07 LD A,($CA5A) Get the currently selected row to flash.
CB0A CP $0B Is it 00B?
CB0C JR Z,$CAB4 Jump back if is.
CB0E CALL $CB8D Otherwise change the option.
CB11 LD HL,$E9DB Change input to Sinclair joystick.
CB14 LD ($E9BA),HL
CB17 LD A,$0B Set 00B as the row to flash.
CB19 LD ($CA5A),A
CB1C JR $CAB4 Jump back.
Detect keyboard
CB1E LD A,$BF Scan for 'ENTER' - 'H' on the keyboard.
CB20 IN A,($FE)
CB22 LD B,A Remember this in B.
CB23 AND $04 Was 'K' pressed?
CB25 JR NZ,$CB3B Jump forward if not.
CB27 LD A,($CA5A) Get the currently selected row to flash.
CB2A CP $07 Is it 07?
CB2C JR Z,$CAB4 Jump back if it is.
CB2E CALL $CB8D Otherwise change the option.
CB31 LD HL,$F271 Change input to keyboard.
CB34 LD ($E9BA),HL
CB37 LD A,$07 Set 07 as the row to flash and jump back.
CB39 JR $CB19
Detect Kempston joystick
CB3B LD A,B Get the keys pressed earlier.
CB3C AND $08 Was 'J' pressed?
CB3E JR NZ,$CB55 Jump forward if not.
CB40 LD A,($CA5A) Get the currently selected row to flash.
CB43 CP $09 Is it 09?
CB45 JP Z,$CAB4 Jump back if it is.
CB48 CALL $CB8D Otherwise change the option.
CB4B LD HL,$E9C0 Change input to Kempston joystick.
CB4E LD ($E9BA),HL
CB51 LD A,$09 Set 09 as the row to flash and jump back.
CB53 JR $CB19
No change in input routine, check for another option.
CB55 LD A,$DF Scan 'P' - 'Y' on the keyboard.
CB57 IN A,($FE)
CB59 BIT 2,A Was 'I' pressed?
CB5B JP Z,$DCF6 If so, display the instructions.
CB5E CALL $CB9C Check if ENTER or FIRE was pressed.
CB61 JP NZ,$CAB4 Jump back if it it wasn't.
ENTER or FIRE was pressed. Time to start the game.
CB64 LD HL,$DA8A Stop the tune playing (DA8A).
CB67 RES 0,(HL)
CB69 LD IY,$CA53 Point IY at the laser movement for the intro screen (CA53)
CB6D CALL $E6F6 Update the laser.
CB70 CALL $DA8D Play the laser sound effect.
CB73 CALL $DAFA Pause for one second.
CB76 CALL $EDA2 Rotate the colours for the main message / laser.
CB79 LD IY,$CA43 Point IY at the moving object data for the intro screen.
CB7D CALL $E59F Move all objects.
CB80 LD A,($E6DA) Is the current laser colour 0?
CB83 AND A If not, loop back to redraw it.
CB84 JR NZ,$CB69
CB86 LD HL,$CA1E Print "Good luck" (CA1E) on screen and return.
CB89 CALL $DDE0
CB8C RET
Prev: CA5A Up: Map Next: CB8D