Prev: 54F2 Up: Map Next: 55F0
55A0: Count down from 9 to 0
Continues from the routine at 81B4. Counts down from 9 to 0, giving the user a chance to set the input method and change the characters' names before the game starts.
BC 0100
DE 8100
HL 5B00
55A0 LDIR Copy 256 bytes from 5B00 to 8100
55A2 LD H,$58 INK 1: PAPER 1
55A4 LD B,$03
55A6 LD D,H
55A7 INC E
55A8 LD (HL),$09
55AC LD HL,$5C3B Reset bit 5 at 5C3B, ready for future keypresses
55AF RES 5,(HL)
55B1 EXX Point HL' at the last byte of the graphic data for the digit '9' in the ROM
55B2 LD HL,$3DCF
55B5 EXX
55B6 LD DE,$043C Wait approximately one second
55B9 DJNZ $55B9
55BE JR NZ,$55B9
55C0 LD HL,$59EC 59EC is the attribute file address where the bottom row of 'big pixels' will be drawn
55C3 LD DE,$FFD8 DE=-40
55C6 LD C,$08 There are 8 pixel rows per countdown digit
55C8 EXX
55C9 BIT 7,L Set the zero flag when HL' hits 3D7F
55CB LD A,(HL) Pick up a digit pixel row byte
55CC DEC HL Move HL' to the next pixel row up
55CE JP Z,$54E9 Start the game if we've already printed '0'
55D1 LD B,$08 There are 8 bits per pixel row
55D3 LD (HL),$09 INK 1: PAPER 1 (blue) for a reset pixel
55D5 RLCA Is this a reset pixel?
55D6 JR NC,$55DA Jump if so
55D8 LD (HL),$24 INK 4: PAPER 4 (green) for a set pixel
55DA INC HL Move HL along to the next attribute file address
55DB DJNZ $55D3 Jump back until all 8 'big pixels' have been drawn
55DD ADD HL,DE Move HL back 8 spaces and up one row of the attribute file
55DE DEC C Next pixel row
55DF JR NZ,$55C8 Jump back until all 8 pixel rows have been drawn
55E1 CALL $7154 Make a ticking sound effect
55E4 LD HL,$5C3B
55E7 BIT 5,(HL) Reset the zero flag if a key was pressed
55E9 RES 5,(HL) Reset bit 5 at 5C3B, ready for future keypresses
55EB JP NZ,$53B1 Jump if a key was pressed
55EE JR $55B6 Wait roughly one second, then print the next digit
Prev: 54F2 Up: Map Next: 55F0