Prev: D44C Up: Map Next: D46B
D452: Read a foreground group: its type, count and first location
Used by the routine at zero_fg_obj_tail.
A group is a type byte followed by one location byte per object. The type byte's bits 3 to 7 index block_type_tbl, and its bits 0 to 2 are one less than the number of locations that follow. So one room record can scatter eight identical blocks in nine bytes.
Input
HL the group's first byte
next_fg_obj D452 LD A,(HL) C = how many of this type
D453 AND $07
D455 INC A
D456 LD C,A
D457 LD A,(HL) D = the first location; each type and location byte counts off B
D458 INC HL
D459 DEC B
D45A LD D,(HL)
D45B INC HL
D45C PUSH HL bits 3 to 7 of the type byte, already doubled by the RRCAs, index the word table at block_type_tbl
D45D RRCA
D45E RRCA
D45F AND $3E
D461 LD HL,block_type_tbl
D464 CALL add_HL_A
D467 LD A,(HL) HL = the type's template list
D468 INC HL
D469 LD H,(HL)
D46A LD L,A
Prev: D44C Up: Map Next: D46B