Prev: CAA7 Up: Map Next: CB66
CACB: Draw the play area's frame
Used by the routines at draw_panel and menu.
From a 17-byte description at IX (frame_description for the game; the menu, menu, has its own). It draws the two sides, the two edges top and bottom, the four corner pieces with their colour patches, and the ornaments along the edges.
The description: +0 +1 and +2 +3 the screen addresses of the bottom of the left and right sides; +4 their height in rows (each row a byte of $66); +5 +6 and +7 +8 the screen addresses of the two horizontal edges (each two double lines of $FF bytes, with a two-row gap); +9 +A the corner list (four entries of seven bytes: the bitmap's place, the colour patch's place, the patch's width, height and attribute; the bitmaps follow one another from corner_bitmaps, frame_corners); +B the number of ornaments; +C +D their list (pairs: an x for the top and bottom edges, a y for the sides); +E the y of the bottom edge's ornaments (the top's is $BE); +F the x of the right side's (the left's is 0); +$10 the edges' width in bytes.
Input
IX The frame's description
draw_frame CACB LD L,(IX+$00) The two sides' addresses and height.
CACE LD H,(IX+$01)
CAD1 LD E,(IX+$02)
CAD4 LD D,(IX+$03)
CAD7 LD B,(IX+$04)
draw_frame_0 CADA LD (HL),$66 The sides, upwards, a $66 byte each row.
CADC LD A,$66
CADE LD (DE),A
CADF CALL line_up_hl
CAE2 CALL line_up_de
CAE5 DJNZ draw_frame_0
CAE7 LD L,(IX+$05) The two horizontal edges: two rows, a gap of two rows, two rows.
CAEA LD H,(IX+$06)
CAED LD E,(IX+$07)
CAF0 LD D,(IX+$08)
CAF3 CALL fill_edge_rows
CAF6 CALL fill_edge_rows
CAF9 DEC H
CAFA DEC H
CAFB DEC D
CAFC DEC D
CAFD CALL fill_edge_rows
CB00 CALL fill_edge_rows
CB03 LD DE,corner_bitmaps The corner bitmaps start at corner_bitmaps.
CB06 LD (box_x),DE
CB0A LD E,(IX+$09) Four corners: a bitmap, then its colour patch.
CB0D LD D,(IX+$0A)
CB10 LD B,$04
draw_frame_1 CB12 PUSH BC
CB13 CALL read_word
CB16 PUSH DE
CB17 LD DE,(box_x)
CB1B CALL draw_bitmap
CB1E LD (box_x),DE
CB22 POP DE
CB23 CALL read_word
CB26 CALL fill_attributes
CB29 POP BC
CB2A DJNZ draw_frame_1
CB2C LD B,(IX+$0B) Each ornament: one at its x on the bottom edge and one on the top.
CB2F LD E,(IX+$0C)
CB32 LD D,(IX+$0D)
draw_frame_2 CB35 PUSH BC
CB36 LD A,(DE)
CB37 LD L,A
CB38 LD H,(IX+$0E)
CB3B PUSH DE
CB3C LD DE,edge_ornament
CB3F CALL draw_bitmap
CB42 LD H,$BE
CB44 LD DE,edge_ornament
CB47 CALL draw_bitmap
CB4A POP DE
CB4B INC DE And one at its y on the left side and one on the right.
CB4C LD A,(DE)
CB4D LD H,A
CB4E LD L,$00
CB50 PUSH DE
CB51 LD DE,side_ornament
CB54 CALL draw_bitmap
CB57 LD L,(IX+$0F)
CB5A LD DE,side_ornament
CB5D CALL draw_bitmap
CB60 POP DE
CB61 INC DE
CB62 POP BC
CB63 DJNZ draw_frame_2
CB65 RET
Prev: CAA7 Up: Map Next: CB66