Routines |
Prev: 36266 | Up: Map | Next: 36469 |
Used by the routine at 34574. First we move Eugene up or down, or change his direction.
|
||||
36344 | LD A,(32884) | Pick up the attribute of the last item drawn from 32884 | ||
36347 | OR A | Have all the items been collected? | ||
36348 | JR Z,36367 | Jump if so | ||
36350 | LD A,(32987) | Pick up Eugene's direction from 32987 | ||
36353 | OR A | Is Eugene moving downwards? | ||
36354 | JR Z,36367 | Jump if so | ||
36356 | LD A,(32988) | Pick up Eugene's pixel y-coordinate from 32988 | ||
36359 | DEC A | Decrement it (moving Eugene up) | ||
36360 | JR Z,36380 | Jump if Eugene has reached the top of the cavern | ||
36362 | LD (32988),A | Update Eugene's pixel y-coordinate at 32988 | ||
36365 | JR 36388 | |||
36367 | LD A,(32988) | Pick up Eugene's pixel y-coordinate from 32988 | ||
36370 | INC A | Increment it (moving Eugene down) | ||
36371 | CP 88 | Has Eugene reached the portal yet? | ||
36373 | JR Z,36380 | Jump if so | ||
36375 | LD (32988),A | Update Eugene's pixel y-coordinate at 32988 | ||
36378 | JR 36388 | |||
36380 | LD A,(32987) | Toggle Eugene's direction at 32987 | ||
36383 | XOR 1 | |||
36385 | LD (32987),A | |||
Now that Eugene's movement has been dealt with, it's time to draw him.
|
||||
36388 | LD A,(32988) | Pick up Eugene's pixel y-coordinate from 32988 | ||
36391 | AND 127 | Point DE at the entry in the screen buffer address lookup table at 33536 that corresponds to Eugene's y-coordinate | ||
36393 | RLCA | |||
36394 | LD E,A | |||
36395 | LD D,131 | |||
36397 | LD A,(DE) | Point HL at the address of Eugene's location in the screen buffer at 24576 | ||
36398 | OR 15 | |||
36400 | LD L,A | |||
36401 | INC DE | |||
36402 | LD A,(DE) | |||
36403 | LD H,A | |||
36404 | LD DE,32992 | Draw Eugene to the screen buffer at 24576 | ||
36407 | LD C,1 | |||
36409 | CALL 36852 | |||
36412 | JP NZ,36102 | Kill Willy if Eugene collided with him | ||
36415 | LD A,(32988) | Pick up Eugene's pixel y-coordinate from 32988 | ||
36418 | AND 120 | Point HL at the address of Eugene's location in the attribute buffer at 23552 | ||
36420 | RLCA | |||
36421 | OR 7 | |||
36423 | SCF | |||
36424 | RL A | |||
36426 | LD L,A | |||
36427 | LD A,0 | |||
36429 | ADC A,92 | |||
36431 | LD H,A | |||
36432 | LD A,(32884) | Pick up the attribute of the last item drawn from 32884 | ||
36435 | OR A | Set the zero flag if all the items have been collected | ||
36436 | LD A,7 | Assume we will draw Eugene with white INK | ||
36438 | JR NZ,36447 | Jump if there are items remaining to be collected | ||
36440 | LD A,(32957) | Pick up the value of the game clock at 32957 | ||
36443 | RRCA | Move bits 2-4 into bits 0-2 and clear the other bits; this value (which decreases by one on each pass through the main loop) will be Eugene's INK colour | ||
36444 | RRCA | |||
36445 | AND 7 | |||
36447 | LD (HL),A | Save the INK colour in the attribute buffer temporarily | ||
36448 | LD A,(32800) | Pick up the attribute byte of the background tile for the current cavern from 32800 | ||
36451 | AND 248 | Combine its PAPER colour with the chosen INK colour | ||
36453 | OR (HL) | |||
36454 | LD (HL),A | Set the attribute byte for the top-left cell of the sprite in the attribute buffer at 23552 | ||
36455 | LD DE,31 | Prepare DE for addition | ||
36458 | INC HL | Set the attribute byte for the top-right cell of the sprite in the attribute buffer at 23552 | ||
36459 | LD (HL),A | |||
36460 | ADD HL,DE | Set the attribute byte for the middle-left cell of the sprite in the attribute buffer at 23552 | ||
36461 | LD (HL),A | |||
36462 | INC HL | Set the attribute byte for the middle-right cell of the sprite in the attribute buffer at 23552 | ||
36463 | LD (HL),A | |||
36464 | ADD HL,DE | Set the attribute byte for the bottom-left cell of the sprite in the attribute buffer at 23552 | ||
36465 | LD (HL),A | |||
36466 | INC HL | Set the attribute byte for the bottom-right cell of the sprite in the attribute buffer at 23552 | ||
36467 | LD (HL),A | |||
36468 | RET |
Prev: 36266 | Up: Map | Next: 36469 |