Prev: FB00 Up: Map Next: FBB9
FB09: Display Frame
Copies one frame of the picture held in the buffer at PictureBuffer to the screen: first the pixel rows, then the attributes from PictureBuffer_Attributes. Called by BASIC as "ins" (FB09) with the frame number POKEd into DisplayFrame_Number.
The routine works out the frame's row and column in the sheet from *DisplayFrame_Number and *DisplayFrame_PerRow, converts those to byte offsets with DisplayFrame_CalculateOffset, and copies *DisplayFrame_Height character rows of *DisplayFrame_LineWidth bytes from the buffer to the screen at *DisplayFrame_Column / *DisplayFrame_Row. It then copies the matching attributes from the buffer (offset by 1800) to the attribute file.
The values in the snapshot describe rows of 04 frames of 08 by 0A characters, copied to column 19 row 03 after line 60.
DisplayFrame FB09 DI Disable interrupts.
FB0A LD ($FF76),SP
FB0E LD SP,$FFBE
FB11 LD A,($FB03)
FB14 LD B,A
FB15 LD C,$01
FB17 LD A,($FB02)
FB1A DEC A
DisplayFrame_0 FB1B CP B
FB1C JR C,DisplayFrame_1
FB1E SUB B
FB1F INC C
FB20 JR DisplayFrame_0
DisplayFrame_1 FB22 INC A
FB23 LD B,A
FB24 LD HL,$FB04
FB27 XOR A
FB28 DEC B
FB29 JR Z,DisplayFrame_3
DisplayFrame_2 FB2B ADD A,(HL)
FB2C DJNZ DisplayFrame_2
DisplayFrame_3 FB2E LD B,C
FB2F LD C,A
FB30 LD HL,$FB05
FB33 XOR A
FB34 DEC B
FB35 JR Z,DisplayFrame_5
DisplayFrame_4 FB37 ADD A,(HL)
FB38 DJNZ DisplayFrame_4
DisplayFrame_5 FB3A LD L,A
FB3B CALL DisplayFrame_CalculateOffset
FB3E LD ($FBC5),HL
FB41 SLA H
FB43 SLA H
FB45 SLA H
FB47 LD BC,($FB00)
FB4B ADD HL,BC
FB4C EX DE,HL
FB4D LD A,($FB07)
FB50 LD L,A
FB51 LD A,($FB06)
FB54 LD C,A
FB55 CALL DisplayFrame_CalculateOffset
FB58 LD ($FBC3),HL
FB5B SLA H
FB5D SLA H
FB5F SLA H
FB61 LD BC,$4000
FB64 ADD HL,BC
FB65 EX DE,HL
FB66 LD A,($FB05)
FB69 LD B,A
DisplayFrame_6 FB6A PUSH BC
FB6B LD B,$00
DisplayFrame_7 FB6D LD A,($FB08)
FB70 LD C,A
FB71 PUSH HL
FB72 PUSH DE
FB73 LDIR
FB75 POP DE
FB76 POP HL
FB77 CALL ScrollWindow_NextLine
FB7A EX DE,HL
FB7B CALL ScrollWindow_NextLine
FB7E EX DE,HL
FB7F JR NZ,DisplayFrame_7
FB81 POP BC
FB82 DJNZ DisplayFrame_6
FB84 LD HL,($FBC5)
FB87 LD BC,($FB00)
FB8B ADD HL,BC
FB8C LD BC,$1800
FB8F ADD HL,BC
FB90 EX DE,HL
FB91 LD HL,($FBC3)
FB94 LD BC,$5800
FB97 ADD HL,BC
FB98 EX DE,HL
FB99 LD A,($FB05)
FB9C LD IYl,A
FB9E LD B,$00
DisplayFrame_8 FBA0 LD A,($FB08)
FBA3 LD C,A
FBA4 PUSH HL
FBA5 PUSH DE
FBA6 LDIR
FBA8 POP DE
FBA9 POP HL
FBAA LD C,$20
FBAC ADD HL,BC
FBAD EX DE,HL
FBAE ADD HL,BC
FBAF EX DE,HL
FBB0 DEC IYl
FBB2 JR NZ,DisplayFrame_8
FBB4 LD SP,($FF76)
FBB8 RET
Prev: FB00 Up: Map Next: FBB9