will wait for the next VBL interrupt and set the draw buffer to the
view buffer. The draw buffer is also changed to (drawbuffer xor 1).
-Set an address for a subroutine you want to call at every VBL by calling
-tgi_setvblhook(addr) or tgi_ioctl(5, addr).
-
<sect1>Extended memory drivers<p>
No extended memory drivers are currently available for the Lynx.
#define tgi_setframerate(rate) tgi_ioctl(3, (unsigned)(rate))
#define tgi_busy() tgi_ioctl(4, 0)
#define tgi_updatedisplay() tgi_ioctl(4, 1)
-#define tgi_setvblhook(addr) tgi_ioctl(5, (unsigned)(addr))
/* End of lynx.h */
#endif
noret: bra noret
+ .segment "CODE"
IRQStub:
phy
phx
; Double buffer IRQ stuff
DRAWPAGE: .res 1
SWAPREQUEST: .res 1
-VBLHOOK: .res 3
text_bitmap: .res 8*(1+20+1)+1
; 8 rows with (one offset-byte plus 20 character bytes plus one fill-byte) plus one 0-offset-byte
stz BGINDEX
stz DRAWPAGE
stz SWAPREQUEST
- lda #$60 ; rts op-code
- sta VBLHOOK
rts
;
; To update displays you can call tgi_ioctl(4, 1) it will wait for the
; next VBL interrupt and swap draw and view buffers.
-;
-; Set an address for a subroutine you want to call at every VBL
-; tgi_ioctl(5, hook)
CONTROL:
pha ; Almost all control routines succeed
lda #TGI_ERR_OK
sta ERROR
pla
- cmp #5
- bne ControlSwapRequest
-
- lda ptr1 ; Set IRQ routine to be called at VBL
- sta VBLHOOK+1
- lda ptr1+1
- sta VBLHOOK+2
- lda #$43 ; jmp op-code
- sta VBLHOOK
- rts
-ControlSwapRequest:
cmp #4
bne ControlFramerate
cmp #3
bne ControlTextBG
+ lda ptr1
cmp #75 ; Set framerate
beq rate75
cmp #60
jsr SETDRAWPAGE
stz SWAPREQUEST
@L0:
- jsr VBLHOOK
IRQEND:
clc
rts