Prev: AB6B Up: Map Next: ABF9
ABA0: Zoombox
This animates the window buffer onto the screen using a zooming box effect.
Used by the routines at enter_room, screen_reset and reset_outdoors.
zoombox ABA0 LD A,$0C Initialise zoombox_x to 12
ABA2 LD ($AB66),A
ABA5 LD A,$08 Initialise zoombox_y to 8
ABA7 LD ($AB68),A
ABAA CALL choose_game_window_attributes Choose the game window attributes (the chosen attribute is returned in A)
ABAD LD H,A Duplicate attribute into both bytes of HL
ABAE LD L,A
ABAF LD ($5932),HL Set the attributes of the initial zoombox fill rectangle
ABB2 LD ($5952),HL
ABB5 XOR A Set zoombox_width and zoombox_height to zero
ABB6 LD ($AB67),A
ABB9 LD ($AB69),A
Start loop
Shrink X and grow width until X is 1
zoombox_0 ABBC LD HL,$AB66 Point HL at zoombox_x
ABBF LD A,(HL) Fetch it
ABC0 CP $01 Is it 1?
ABC2 JP Z,zoombox_1 Skip the next chunk if so
ABC5 DEC (HL) Decrement zoombox_x
ABC6 DEC A And the register copy too
ABC7 INC HL Point HL at zoombox_width
ABC8 INC (HL) Increment zoombox_width
ABC9 DEC HL Step back
Grow width until it's 22
zoombox_1 ABCA INC HL Point HL at zoombox_width
ABCB ADD A,(HL) Add width to x
ABCC CP $16 Did we hit 22?
ABCE JP NC,zoombox_2 Jump if not
ABD1 INC (HL) Increment zoombox_width
Shrink Y and grow height until Y is 1
zoombox_2 ABD2 INC HL Point HL at zoombox_y
ABD3 LD A,(HL) Fetch it
ABD4 CP $01 Is it 1?
ABD6 JP Z,zoombox_3 Skip the next chunk if so
ABD9 DEC (HL) Decrement zoombox_y
ABDA DEC A And the register copy too
ABDB INC HL Point HL at zoombox_height
ABDC INC (HL) Increment zoombox_height
ABDD DEC HL Step back
Grow height until it's 15
zoombox_3 ABDE INC HL Point HL at zoombox_height
ABDF ADD A,(HL) Add height to y
ABE0 CP $0F Did we hit 15?
ABE2 JP NC,zoombox_4 Jump if not
ABE5 INC (HL) Increment zoombox_height
zoombox_4 ABE6 CALL zoombox_fill Draw the zoombox contents
ABE9 CALL zoombox_draw_border Draw the zoombox border
ABEC LD HL,$AB67 Sum the width and height
ABEF LD A,($AB69)
ABF2 ADD A,(HL)
ABF3 CP $23 If it's less than 35 then ...loop
ABF5 JP C,zoombox_0
ABF8 RET Return
Prev: AB6B Up: Map Next: ABF9