![]() |
Routines |
| Prev: BCE3 | Up: Map | Next: BD32 |
|
Used by the routine at DrawGameScreen.
Puts every cell of the map back to its initial type, by copying the upper four bits of each cell into the lower four bits.
|
||||
| ResetMap | BD13 | LD HL,$D355 | Point HL at the end of the map. | |
| BD16 | LD BC,$C515 | Point BC at Map. | ||
| BD19 | AND A | Find the size of the map... | ||
| BD1A | SBC HL,BC | |||
| BD1C | LD B,H | ...and keep it in BC. | ||
| BD1D | LD C,L | |||
| BD1E | LD HL,$C515 | Point HL at Map. | ||
| ResetMap_Cell | BD21 | LD A,(HL) | Fetch a cell. | |
| BD22 | AND $F0 | Keep the initial type. | ||
| BD24 | LD D,A | |||
| BD25 | RRA | Move it into the lower four bits... | ||
| BD26 | RRA | |||
| BD27 | RRA | |||
| BD28 | RRA | |||
| BD29 | OR D | ...and combine it with the original. | ||
| BD2A | LD (HL),A | Store the cell. | ||
| BD2B | INC HL | Move on to the next cell. | ||
| BD2C | DEC BC | Count down the size. | ||
| BD2D | LD A,C | Loop back until every cell has been reset. | ||
| BD2E | OR B | |||
| BD2F | JR NZ,ResetMap_Cell | |||
| BD31 | RET | Return. | ||
| Prev: BCE3 | Up: Map | Next: BD32 |