Prev: B258 Up: Map Next: B372
B339: Copy tile graphic into room graphic data
Used by the routine at B33E.
B339 LD SP,($A095) Recover SP
B33D RET
Copy tile graphic into room graphic data
Used by the routines at 947A, A89D and A915.
B33E LD ($A095),SP Save SP to temporal variable A095
B342 LD SP,$D962 Set SP to point to base address for mapping table of tile graphics and room graphic buffer
B345 POP HL Point HL to the address in the room graphic buffer for the tile
B346 POP DE Point DE to the tile graphics address
B347 LD A,L Jump back and return from routine if LSB of HL is $FF (end marker)
B348 INC A
B349 JP Z,$B339
B34C LD BC,$0020 Set BC to the increment in room graphics buffer of every byte copied Copy the eight bytes of the tile graphics data to the corresponent room graphic buffer location
B34F LD A,(DE) Copy byte 1, increment tile graphics address and room graphics address
B350 LD (HL),A
B351 INC DE
B352 ADD HL,BC
B353 LD A,(DE) Copy byte 2, increment tile graphics address and room graphics address
B354 LD (HL),A
B355 INC DE
B356 ADD HL,BC
B357 LD A,(DE) Copy byte 3, increment tile graphics address and room graphics address
B358 LD (HL),A
B359 INC DE
B35A ADD HL,BC
B35B LD A,(DE) Copy byte 4, increment tile graphics address and room graphics address
B35C LD (HL),A
B35D INC DE
B35E ADD HL,BC
B35F LD A,(DE) Copy byte 5, increment tile graphics address and room graphics address
B360 LD (HL),A
B361 INC DE
B362 ADD HL,BC
B363 LD A,(DE) Copy byte 6, increment tile graphics address and room graphics address
B364 LD (HL),A
B365 INC DE
B366 ADD HL,BC
B367 LD A,(DE) Copy byte 7, increment tile graphics address and room graphics address
B368 LD (HL),A
B369 INC DE
B36A ADD HL,BC
B36B LD A,(DE) Copy byte 8, increment tile graphics address and room graphics address
B36C LD (HL),A
B36D INC DE
B36E ADD HL,BC
B36F JP $B345 Jump back and copy the next tile
Prev: B258 Up: Map Next: B372