Apple2: Dynamic IIe check on a2_lo_tgi
This commit is contained in:
committed by
Oliver Schmidt
parent
a9ab23ad51
commit
0122307399
@@ -8526,11 +8526,10 @@ if the mode is not supported due to lack of hardware.
|
|||||||
<ref id="pce.h" name="pce.h">/
|
<ref id="pce.h" name="pce.h">/
|
||||||
<tag/Declaration/
|
<tag/Declaration/
|
||||||
<tt>void waitvsync (void);</tt><newline>
|
<tt>void waitvsync (void);</tt><newline>
|
||||||
<tt>signed char waitvsync (void); /* For Apple II */</tt><newline>
|
|
||||||
<tag/Description/Wait for vertical sync, to reduce flickering.
|
<tag/Description/Wait for vertical sync, to reduce flickering.
|
||||||
<tag/Notes/<itemize>
|
<tag/Notes/<itemize>
|
||||||
<item>The function will return -1 when the feature is not supported,
|
<item>The function will silently fail when the feature is not
|
||||||
like on the Apple ][+.
|
supported, like on the Apple ][+.
|
||||||
</itemize>
|
</itemize>
|
||||||
<tag/Availability/Platforms served by the headers above
|
<tag/Availability/Platforms served by the headers above
|
||||||
(Atmos requires the VSync hack)
|
(Atmos requires the VSync hack)
|
||||||
|
|||||||
@@ -343,6 +343,9 @@ signed char __fastcall__ videomode (unsigned mode);
|
|||||||
** installed. Call with one of the VIDEOMODE_xx constants.
|
** installed. Call with one of the VIDEOMODE_xx constants.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void waitvsync (void);
|
||||||
|
/* Wait for start of next frame */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* End of apple2.h */
|
/* End of apple2.h */
|
||||||
|
|||||||
@@ -63,16 +63,5 @@ extern void a2e_lo_tgi[];
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/* Code */
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void waitvsync (void);
|
|
||||||
/* Wait for start of next frame */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* End of apple2enh.h */
|
/* End of apple2enh.h */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ Y2 := ptr4
|
|||||||
|
|
||||||
.byte $74, $67, $69 ; "tgi"
|
.byte $74, $67, $69 ; "tgi"
|
||||||
.byte TGI_API_VERSION ; TGI API version number
|
.byte TGI_API_VERSION ; TGI API version number
|
||||||
.addr $0000 ; Library reference
|
libref: .addr $0000 ; Library reference
|
||||||
.word 40 ; X resolution
|
.word 40 ; X resolution
|
||||||
.word 48 ; Y resolution
|
.word 48 ; Y resolution
|
||||||
.byte 16 ; Number of drawing colors
|
.byte 16 ; Number of drawing colors
|
||||||
@@ -93,6 +93,10 @@ Y2 := ptr4
|
|||||||
ERROR: .res 1 ; Error code
|
ERROR: .res 1 ; Error code
|
||||||
MIX: .res 1 ; 4 lines of text
|
MIX: .res 1 ; 4 lines of text
|
||||||
|
|
||||||
|
.ifndef __APPLE2ENH__
|
||||||
|
machinetype: .res 1
|
||||||
|
.endif
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
|
|
||||||
.rodata
|
.rodata
|
||||||
@@ -126,11 +130,15 @@ INIT:
|
|||||||
bit $C082 ; Switch in ROM
|
bit $C082 ; Switch in ROM
|
||||||
jsr SETGR
|
jsr SETGR
|
||||||
bit MIXCLR
|
bit MIXCLR
|
||||||
.ifdef __APPLE2ENH__
|
|
||||||
|
.ifndef __APPLE2ENH__
|
||||||
|
bit machinetype
|
||||||
|
bpl lc_in
|
||||||
|
.endif
|
||||||
|
|
||||||
sta IOUDISON
|
sta IOUDISON
|
||||||
bit DHIRESOFF
|
bit DHIRESOFF
|
||||||
.endif
|
lc_in: bit $C080 ; Switch in LC bank 2 for R/O
|
||||||
bit $C080 ; Switch in LC bank 2 for R/O
|
|
||||||
|
|
||||||
; Done, reset the error code
|
; Done, reset the error code
|
||||||
lda #TGI_ERR_OK
|
lda #TGI_ERR_OK
|
||||||
@@ -144,6 +152,16 @@ INIT:
|
|||||||
; most of the time.
|
; most of the time.
|
||||||
; Must set an error code: NO
|
; Must set an error code: NO
|
||||||
INSTALL:
|
INSTALL:
|
||||||
|
.ifndef __APPLE2ENH__
|
||||||
|
lda libref
|
||||||
|
ldx libref+1
|
||||||
|
sta ptr1
|
||||||
|
stx ptr1+1
|
||||||
|
ldy #$0
|
||||||
|
lda (ptr1),y
|
||||||
|
sta machinetype
|
||||||
|
bpl :+
|
||||||
|
.endif
|
||||||
; Fall through
|
; Fall through
|
||||||
|
|
||||||
; UNINSTALL routine. Is called before the driver is removed from memory. May
|
; UNINSTALL routine. Is called before the driver is removed from memory. May
|
||||||
|
|||||||
@@ -13,31 +13,28 @@
|
|||||||
.include "apple2.inc"
|
.include "apple2.inc"
|
||||||
|
|
||||||
_waitvsync:
|
_waitvsync:
|
||||||
|
.ifndef __APPLE2ENH__
|
||||||
|
bit machinetype ; IIe/enh?
|
||||||
|
bpl out ; No, silently fail
|
||||||
|
.endif
|
||||||
|
|
||||||
bit ostype
|
bit ostype
|
||||||
bmi iigs ; $8x
|
bmi iigs ; $8x
|
||||||
bvs iic ; $4x
|
bvs iic ; $4x
|
||||||
|
|
||||||
.ifndef __APPLE2ENH__
|
; Apple IIe
|
||||||
bit machinetype ; IIe/enh?
|
|
||||||
bmi :+
|
|
||||||
|
|
||||||
lda #$FF ; ][+ Unsupported
|
|
||||||
tax
|
|
||||||
rts
|
|
||||||
.endif
|
|
||||||
|
|
||||||
: bit RDVBLBAR
|
: bit RDVBLBAR
|
||||||
bpl :- ; Blanking
|
bpl :- ; Blanking
|
||||||
: bit RDVBLBAR
|
: bit RDVBLBAR
|
||||||
bmi :- ; Drawing
|
bmi :- ; Drawing
|
||||||
bpl out
|
rts
|
||||||
|
|
||||||
; Apple IIgs TechNote #40, VBL Signal
|
; Apple IIgs TechNote #40, VBL Signal
|
||||||
iigs: bit RDVBLBAR
|
iigs: bit RDVBLBAR
|
||||||
bmi iigs ; Blanking
|
bmi iigs ; Blanking
|
||||||
: bit RDVBLBAR
|
: bit RDVBLBAR
|
||||||
bpl :- ; Drawing
|
bpl :- ; Drawing
|
||||||
bmi out
|
rts
|
||||||
|
|
||||||
; Apple IIc TechNote #9, Detecting VBL
|
; Apple IIc TechNote #9, Detecting VBL
|
||||||
iic: php
|
iic: php
|
||||||
@@ -53,6 +50,4 @@ iic: php
|
|||||||
bit DISVBL
|
bit DISVBL
|
||||||
: sta IOUDISON ; IIc Tech Ref Man: The firmware normally leaves IOUDIS on.
|
: sta IOUDISON ; IIc Tech Ref Man: The firmware normally leaves IOUDIS on.
|
||||||
plp
|
plp
|
||||||
out: lda #$00
|
out: rts
|
||||||
tax
|
|
||||||
rts
|
|
||||||
|
|||||||
Reference in New Issue
Block a user