![]() |
Routines |
| Prev: C27E | Up: Map | Next: C3BE |
|
Used by the routine at C6C2.
|
||||
| C2FD | LD A,(IX+$11) | If scanner is not moving down return | ||
| C300 | CP $01 | |||
| C302 | RET NZ | |||
| C303 | DEC (IX+$12) | Decrement state change counter | ||
| C306 | JP Z,$C313 | Jump to chenge state if counter is 0 | ||
| C309 | LD A,(IX+$01) | Increment y-position of scanner based on speed | ||
| C30C | ADD A,(IX+$10) | |||
| C30F | LD (IX+$01),A | |||
| C312 | RET | |||
|
Handle state change for SCANNER. This entry point is used by the routines at C213, C239 and C27E.
|
||||
| C313 | LD (IX+$12),$07 | Reset state change counter | ||
| C317 | LD A,(IX+$00) | Return if x-position bits2-0 is not 0 | ||
| C31A | AND $07 | |||
| C31C | OR A | |||
| C31D | RET NZ | |||
| C31E | RES 7,(IX+$09) | Set graphic data bit to select animated graphic data | ||
| C322 | LD (IX+$0F),$0B | Set height of sprite | ||
| C326 | LD A,(IX+$00) | Set A0AF to the x-position | ||
| C329 | LD ($A0AF),A | |||
| C32C | LD A,(IX+$01) | is y-position of scanner less than $18? | ||
| C32F | CP $18 | |||
| C331 | JP C,$C397 | Jump if so | ||
| C334 | CP $A0 | is y-position of scanner greater then $A0? | ||
| C336 | JP NC,$C3A0 | Jump if so | ||
| C339 | LD ($A0B0),A | Set A0B0 the y-position of scanner | ||
| C33C | LD A,(IX+$02) | Set A the direction of scanner | ||
| C33F | CALL $A503 | Computes into HL address position of scanner in tile type buffer | ||
| C342 | INC HL | Increment HL | ||
| C343 | CALL $D06C | Check if tile is wall | ||
| C346 | JP Z,$C397 | Jump if is a wall | ||
| C349 | INC HL | Increment HL | ||
| C34A | CALL $D06C | Check if tile is wall | ||
| C34D | JP Z,$C397 | Jump if is a wall | ||
| C350 | LD DE,$0060 | Point HL to the tile under the scanner | ||
| C353 | ADD HL,DE | |||
| C354 | CALL $D06C | Check if tile is wall | ||
| C357 | JP Z,$C3A0 | Jump if is a wall | ||
| C35A | DEC HL | Decrement HL | ||
| C35B | CALL $D06C | Check if tile is wall | ||
| C35E | JP Z,$C3A0 | Jump if is a wall | ||
| C361 | LD A,R | Set A a pseudo random number between 0-3 | ||
| C363 | AND $03 | |||
| C365 | CP $00 | is 0? | ||
| C367 | JP Z,$C397 | Jump to configure scanner to move down | ||
| C36A | CP $01 | is 1? | ||
| C36C | JP Z,$C387 | Jump to configure scanner to move left | ||
| C36F | CP $02 | is 2? | ||
| C371 | JP Z,$C377 | Jump to configure scanner to move right | ||
| C374 | JP $C3A0 | is 3? Jump to configure scanner to bump animation | ||
|
scanner will move right
|
||||
| C377 | LD (IX+$12),$08 | Reset state change counter | ||
| C37B | LD A,(IX+$11) | |||
| C37E | LD (IX+$11),$00 | Set moves horizontal | ||
| C382 | LD (IX+$02),$01 | Set direction right | ||
| C386 | RET | |||
|
scanner will move left
|
||||
| C387 | LD (IX+$12),$08 | Reset state change counter | ||
| C38B | LD A,(IX+$11) | |||
| C38E | LD (IX+$11),$00 | Set moves horizontal | ||
| C392 | LD (IX+$02),$00 | Set direction left | ||
| C396 | RET | |||
|
scanner will move down
|
||||
| C397 | LD (IX+$12),$07 | Reset state change counter | ||
| C39B | LD (IX+$11),$01 | Scanner moves down | ||
| C39F | RET | |||
|
scanner will bump (animation)
|
||||
| C3A0 | LD (IX+$02),$00 | scanner direction to left | ||
| C3A4 | LD (IX+$12),$06 | Reset state change counter | ||
| C3A8 | LD (IX+$0F),$10 | Set height of sprite | ||
| C3AC | LD (IX+$11),$02 | Set scanner moving up | ||
| C3B0 | LD HL,$8A5A | Set address for scanner bump animation | ||
| C3B3 | LD (IX+$04),L | |||
| C3B6 | LD (IX+$05),H | |||
| C3B9 | SET 7,(IX+$09) | Set enemy configuration to get static graphic data | ||
| C3BD | RET | |||
| Prev: C27E | Up: Map | Next: C3BE |