Make waitvsync available on apple2

This commit is contained in:
Colin Leroy-Mira
2025-05-27 16:22:37 +02:00
committed by Oliver Schmidt
parent d3ef3e1b62
commit a9ab23ad51
2 changed files with 27 additions and 8 deletions

View File

@@ -3,11 +3,13 @@
;
; void waitvsync (void);
;
.ifdef __APPLE2ENH__
.export _waitvsync
.import ostype
.ifndef __APPLE2ENH__
.import machinetype
.endif
.include "apple2.inc"
_waitvsync:
@@ -15,18 +17,27 @@ _waitvsync:
bmi iigs ; $8x
bvs iic ; $4x
.ifndef __APPLE2ENH__
bit machinetype ; IIe/enh?
bmi :+
lda #$FF ; ][+ Unsupported
tax
rts
.endif
: bit RDVBLBAR
bpl :- ; Blanking
: bit RDVBLBAR
bmi :- ; Drawing
rts
bpl out
; Apple IIgs TechNote #40, VBL Signal
iigs: bit RDVBLBAR
bmi iigs ; Blanking
: bit RDVBLBAR
bpl :- ; Drawing
rts
bmi out
; Apple IIc TechNote #9, Detecting VBL
iic: php
@@ -42,6 +53,6 @@ iic: php
bit DISVBL
: sta IOUDISON ; IIc Tech Ref Man: The firmware normally leaves IOUDIS on.
plp
out: lda #$00
tax
rts
.endif ; __APPLE2ENH__