Routines |
Prev: 56533 | Up: Map | Next: 56668 |
|
||||||||
Draws the scroll arrow (called from 58945), the spell 'charge' icons (called from 59130) or the energy bar (called from 59246)
|
||||||||
56612 | LD HL,(60241) | Get graphics address pointer from 38851 | ||||||
56615 | LD A,(HL) | Get the graphics address pointer low byte for the arrow (44966), the scroll charge icons (44775), or the energy bar (44787) | ||||||
56616 | INC HL | High byte of the graphics address pointer | ||||||
56617 | LD H,(HL) | |||||||
56618 | LD L,A | ...HL register pair now contains the graphics address pointer for the relevant graphic | ||||||
56619 | LD C,(HL) | Number of tiles that make up the graphic | ||||||
56620 | INC HL | Move graphics address pointer along to start of first tile graphic | ||||||
56621 | INC HL | |||||||
56622 | INC HL | |||||||
56623 | LD B,(HL) | Number of bytes in the graphics tile to draw | ||||||
56624 | INC HL | Move pointer to start of tile graphics | ||||||
56625 | LD (60126),DE | Store screen display address position | ||||||
Draw graphic tile on screen
|
||||||||
56629 | LD A,(HL) | Copy graphic byte onto screen: | ||||||
56630 | LD (DE),A | |||||||
56631 | INC HL | Move to next graphic byte | ||||||
56632 | LD A,D | Get pixel row | ||||||
56633 | AND 7 | |||||||
56635 | INC A | Move down to next pixel row | ||||||
56636 | CP 8 | Are we crossing a pixel/character boundary? | ||||||
56638 | JR C,56656 | ...If not, move down 1 pixel row and continue drawing the graphic | ||||||
56640 | LD A,D | ...If so, recalculate screen display address. Get high byte of screen address | ||||||
56641 | AND 248 | Reset the low 3 bits (pixel row number) to zero | ||||||
56643 | LD D,A | |||||||
56644 | LD A,E | Get the low byte of the screen address | ||||||
56645 | ADD A,32 | Increment column by 32 to move down to next screen row | ||||||
56647 | LD E,A | |||||||
56648 | JR NC,56657 | Crossing a 1/3 screen boundary? ...If not, skip next 3 instructions | ||||||
56650 | LD A,D | ...If so, adjust high byte of screen address accordingly | ||||||
56651 | ADD A,8 | |||||||
56653 | LD D,A | Store correct screen address high byte back in D register | ||||||
56654 | JR 56657 | |||||||
56656 | INC D | Move down 1 pixel row | ||||||
56657 | DJNZ 56629 | Repeat for all pixel rows of this graphics tile | ||||||
Continue to draw the remaining tiles in the graphic
|
||||||||
56659 | LD DE,(60126) | Retrieve screen display address | ||||||
56663 | INC E | Move right one character square | ||||||
56664 | DEC C | Decrement tile graphic counter | ||||||
56665 | JR NZ,56621 | If there are tiles left in the graphic, draw the next one. | ||||||
56667 | RET |
Prev: 56533 | Up: Map | Next: 56668 |