![]() |
Routines |
| Prev: 7D35 | Up: Map | Next: 7D8D |
|
Used by the routine at main.
|
||||
| draw_door | 7D3B | LD A,$10 | Set INK = 1 (blue) | |
| 7D3D | RST $10 | |||
| 7D3E | LD A,$01 | |||
| 7D40 | RST $10 | |||
| 7D41 | LD A,$11 | Set PAPER = 6 (yellow) | ||
| 7D43 | RST $10 | |||
| 7D44 | LD A,$06 | |||
| 7D46 | RST $10 | |||
| 7D47 | LD A,($C34B) | Load var_door_x (door X) into self-modifying operand at var_door_col | ||
| 7D4A | LD ($7D35),A | |||
| 7D4D | LD L,$A1 | L = $A1 (door tile character) | ||
| 7D4F | LD C,$07 | C = 7 (rows to draw) | ||
| draw_door_0 | 7D51 | LD A,($7D35) | Load current column from var_door_col into A | |
| 7D54 | CALL print_door_col | Print one column of door tiles (print_door_col) | ||
| 7D57 | LD A,($7D35) | Increment var_door_col (advance column for next row) | ||
| 7D5A | INC A | |||
| 7D5B | LD ($7D35),A | |||
| 7D5E | DEC C | DEC C | ||
| 7D5F | JR NZ,draw_door_0 | Loop until all 7 rows drawn | ||
| 7D61 | LD A,($C34B) | Decrement var_door_x (move door one column left) | ||
| 7D64 | DEC A | |||
| 7D65 | LD ($C34B),A | |||
| 7D68 | LD A,($7D35) | Load updated column from var_door_col | ||
| 7D6B | CP $20 | If column == $20 (off left edge) → door_collision (collision check) | ||
| 7D6D | JP Z,door_collision | |||
| 7D70 | CP $FF | If column == $FF (wrapped) → draw_door_1 (reset to right edge) | ||
| 7D72 | JR Z,draw_door_1 | |||
| 7D74 | LD L,$80 | L = $80 (blank space, erase trailing column) | ||
| 7D76 | LD A,$11 | Set PAPER = 2 (red) for the floor strip | ||
| 7D78 | RST $10 | |||
| 7D79 | LD A,$02 | |||
| 7D7B | RST $10 | |||
| 7D7C | LD A,($7D35) | Print blank at old column — erases door trail | ||
| 7D7F | CALL print_door_col | |||
| 7D82 | JP door_collision | Jump to door_collision (collision check) | ||
| draw_door_1 | 7D85 | LD A,$1F | Reset door position to $1F (rightmost column) | |
| 7D87 | LD ($C34B),A | |||
| 7D8A | JP door_collision | |||
| Prev: 7D35 | Up: Map | Next: 7D8D |