Routines |
Prev: F9F4 | Up: Map | Next: FAE7 |
Used by the routine at EDF7.
|
||||
F9F5 | LD IX,$F9F0 | Point IX at the missile data. | ||
F9F9 | LD A,(IX+$00) | Is a missile firing? | ||
F9FC | CP $FF | |||
F9FE | JR NZ,$FA2A | Jump forward if it is. | ||
FA00 | CALL $B06D | Was 'fire' pressed? | ||
FA03 | OR A | |||
FA04 | RET Z | Return if it wasn't. | ||
'Fire' was pressed.
|
||||
FA05 | LD A,(IY+$05) | Get the x co-ordinate. | ||
FA08 | LD ($F9F0),A | Set this as the x co-ordinate of the missile. | ||
FA0B | LD A,(IY+$0A) | Get the y co-ordinate. | ||
FA0E | LD ($F9F1),A | Set this as the y co-ordinate of the missile. | ||
FA11 | CALL $F9A4 | Get the change values for the current direction. | ||
FA14 | LD A,(HL) | Get the change in x. | ||
FA15 | LD ($F9F2),A | Set this for the missile. | ||
FA18 | INC HL | Move to the next position in the table. | ||
FA19 | LD A,(HL) | Get the change in y. | ||
FA1A | LD ($F9F3),A | Set this for the missile. | ||
FA1D | LD BC,$FF0A | Play a "fire a missile" round. | ||
FA20 | LD DE,$0114 | |||
FA23 | LD HL,$1401 | |||
FA26 | CALL $E3D3 | |||
FA29 | RET | Return. | ||
A missile is in mid-fire, work out what to do with it.
|
||||
FA2A | LD BC,$F8B5 | Point BC at the bounds table. (F8B5) | ||
FA2D | CALL $EF35 | Update the missile's position. | ||
FA30 | LD A,$6D | Use the ID of the missle. (9118) | ||
FA32 | CALL $A83D | Draw it. | ||
FA35 | LD A,($F672) | Is the change in X and Y both 0? | ||
FA38 | LD B,A | |||
FA39 | LD A,($F673) | |||
FA3C | OR B | |||
FA3D | JR Z,$FA44 | Jump forward if it is. | ||
FA3F | LD (IX-$04),$FF | Signal that the missile is firing and return. | ||
FA43 | RET | |||
The missile is moving.
|
||||
FA44 | LD B,$0C | |||
FA46 | LD HL,$80A9 | Point HL at the lightning bolt position table. (80A9) | ||
FA49 | LD A,(HL) | Is the next lighting bolt inactive? | ||
FA4A | CP $FF | |||
FA4C | JR NZ,$FA56 | Jump forward if it isn't. | ||
FA4E | INC HL | Otherwise move to the next entry. | ||
FA4F | INC HL | |||
FA50 | INC HL | |||
FA51 | INC HL | |||
FA52 | INC HL | |||
FA53 | DJNZ $FA49 | Loop while there are still more lightning bolts to look at. | ||
FA55 | RET | Otherwise return. | ||
There is active lightning, did the missile hit it?
|
||||
FA56 | LD E,A | Put the lightning's x co-ordinate in E. | ||
FA57 | SUB (IX-$04) | Is it close enough to the missile? | ||
FA5A | SUB $08 | |||
FA5C | CP $F0 | |||
FA5E | JR C,$FA4E | If not, jump back to check the next lightning. | ||
FA60 | INC HL | Move to the next position in the buffer. | ||
FA61 | LD A,(HL) | Put the lightning's y co-ordinate in D. | ||
FA62 | LD D,A | |||
FA63 | DEC HL | Move back to the previous position in the buffer. | ||
FA64 | SUB (IX-$03) | Is the y co-ordinate close enough to the missile? | ||
FA67 | SUB $08 | |||
FA69 | CP $F0 | |||
FA6B | JR C,$FA4E | Jump back if it isn't. | ||
The missile has hit some lightning.
|
||||
FA6D | LD A,$FF | Signal there is no lightning here. | ||
FA6F | LD (HL),A | |||
FA70 | LD ($F9F0),A | Signal that the missile is no longer active. | ||
FA73 | INC HL | Move to the next place in the buffer. | ||
FA74 | INC HL | |||
FA75 | INC HL | |||
FA76 | INC HL | |||
FA77 | LD A,(HL) | Get the object ID for the lightning. | ||
FA78 | CP $6B | Is it 6B? (small lightning) | ||
FA7A | JR Z,$FA86 | Jump forward if it is. | ||
FA7C | LD A,$6B | Set the UDG to a small lightning bolt. (90D8) | ||
FA7E | CALL $FAF0 | Move the lightning bolts around. | ||
FA81 | CALL $FAF0 | |||
FA84 | JR $FAE3 | Jump forward to play the sound effect and return. | ||
The missile hit some small lightning.
|
||||
FA86 | LD A,($FAEF) | Flip the "regenerate lightning" bit. | ||
FA89 | XOR $01 | |||
FA8B | LD ($FAEF),A | |||
FA8E | JR NZ,$FAE3 | Skip the next bit of code if the bit is set. | ||
FA90 | LD DE,$42EE | Get bit 1 of R, to generate a random flag, that determines the lightning comes in at the top right or the bottom left. | ||
FA93 | LD A,R | |||
FA95 | AND $01 | |||
FA97 | JR NZ,$FA9C | |||
FA99 | LD DE,$AE02 | |||
FA9C | LD A,$38 | Set the UDG to a big lightning bolt. (8A78) | ||
FA9E | CALL $FAF0 | Move the lightning bolts around. | ||
FAA1 | LD HL,$F9F4 | Point HL at the number of asteroids left to hit. (F9F4) | ||
FAA4 | LD A,(HL) | Have we destroyed all of them already? | ||
FAA5 | OR A | |||
FAA6 | JR Z,$FAE3 | Jump forward if we have. | ||
FAA8 | DEC (HL) | Otherwise decrement the count of asteroids left to hit. | ||
FAA9 | JR NZ,$FAE3 | Jump forward if the count is not zero. | ||
The player has destroyed enough asteroids to win the sub-game.
|
||||
FAAB | LD A,$01 | Set the asteroids game as completed. | ||
FAAD | LD ($EC1C),A | |||
FAB0 | LD ($ECB3),A | Set the task completed. (EC5C) | ||
FAB3 | LD A,(IY-$1E) | Earn the player £100. | ||
FAB6 | ADD A,$01 | |||
FAB8 | DAA | |||
FAB9 | LD (IY-$1E),A | |||
FABC | LD A,($ECFE) | Add £100 to the grand total. | ||
FABF | ADD A,$01 | |||
FAC1 | DAA | |||
FAC2 | LD ($ECFE),A | |||
Play the "completed" sound effect.
|
||||
FAC5 | LD BC,$BE32 | Set the parameters for the first sound. | ||
FAC8 | LD HL,$0000 | |||
FACB | LD DE,$0A0A | |||
FACE | CALL $FAE7 | Play it. | ||
FAD1 | LD BC,$9664 | Set the parameters for the second sound. | ||
FAD4 | CALL $FAE7 | Play it. | ||
FAD7 | LD BC,$A532 | Set the parameters for the third sound. | ||
FADA | CALL $FAE7 | Play it. | ||
FADD | LD BC,$7D78 | Set the parameter for the fourth sound. | ||
FAE0 | CALL $FAE7 | Play it. | ||
This code is a common entry point if lightining was hit.
|
||||
FAE3 | CALL $F9C4 | Play the "hit lighting" sound effect and return. | ||
FAE6 | RET |
Prev: F9F4 | Up: Map | Next: FAE7 |