![]() |
Routines |
| Prev: D3E2 | Up: Map | Next: D41E |
|
Used by the routine at find_screen.
The byte after the length is the room's attribute byte. Its bits 0 to 2 are the ink colour the whole room is drawn in, and its bits 3 to 7 pick one of the entries in room_size_tbl, which give the room's half-widths in x and y and the height of its floor. After this B counts the bytes that remain in the record, so that the lists that follow can end on it as well as on their own markers.
|
||||||||
| found_screen | D3F0 | LD B,(HL) | B = the record's length; HL on the attribute byte | |||||
| D3F1 | INC HL | |||||||
| D3F2 | LD A,(HL) | ink colour, BRIGHT, black paper: kept in $5BAD for fill_attr to paint the room with | ||||||
| D3F3 | AND $07 | |||||||
| D3F5 | OR $40 | |||||||
| D3F7 | LD ($5BAD),A | |||||||
| D3FA | PUSH DE | bits 3 to 7 index the size table | ||||||
| D3FB | EX DE,HL | |||||||
| D3FC | LD A,(DE) | |||||||
| D3FD | INC DE | |||||||
| D3FE | RRCA | |||||||
| D3FF | RRCA | |||||||
| D400 | RRCA | |||||||
| D401 | AND $1F | |||||||
| D403 | LD C,A | three bytes an entry in room_size_tbl | ||||||
| D404 | ADD A,A | |||||||
| D405 | ADD A,C | |||||||
| D406 | LD HL,room_size_tbl | |||||||
| D409 | CALL add_HL_A | |||||||
| D40C | LD A,(HL) | half-width in x into $5BAB, in y into $5BAC, and the floor height into $5BAE | ||||||
| D40D | INC HL | |||||||
| D40E | LD ($5BAB),A | |||||||
| D411 | LD A,(HL) | |||||||
| D412 | INC HL | |||||||
| D413 | LD ($5BAC),A | |||||||
| D416 | LD A,(HL) | |||||||
| D417 | LD ($5BAE),A | |||||||
| D41A | DEC B | the length counted itself and the attribute byte; HL on the list of backgrounds, DE on the next free record again | ||||||
| D41B | DEC B | |||||||
| D41C | EX DE,HL | |||||||
| D41D | POP DE | |||||||
| Prev: D3E2 | Up: Map | Next: D41E |