mist: improved IIgs support

thanks to 4am, this turns black backgrounds on and enables the
PAGE2 workaround
This commit is contained in:
Vince Weaver 2020-07-23 10:58:22 -04:00
parent a6212fcfbf
commit a4b3c54caf
2 changed files with 47 additions and 0 deletions

View File

@ -8,7 +8,10 @@ CLR80COL = $C000 ; PAGE0/PAGE1 normal
SET80COL = $C001 ; PAGE0/PAGE1 switches PAGE0 in Aux instead
EIGHTYCOLOFF = $C00C
EIGHTYCOLON = $C00D
TBCOLOR = $C022 ; IIgs text foreground / background colors
NEWVIDEO = $C029 ; IIgs graphics modes
SPEAKER = $C030
CLOCKCTL = $C034 ; bits 0-3 are IIgs border color
SET_GR = $C050
SET_TEXT = $C051
FULLGR = $C052
@ -19,6 +22,12 @@ LORES = $C056 ; Enable LORES graphics
HIRES = $C057 ; Enable HIRES graphics
AN3 = $C05E ; Annunciator 3
PADDLE_BUTTON0 = $C061
PADDL0 = $C064
PTRIG = $C070
@ -34,8 +43,10 @@ VLINE = $F828 ;; VLINE A,$2D at Y
CLRSCR = $F832 ;; Clear low-res screen
CLRTOP = $F836 ;; clear only top of low-res screen
SETCOL = $F864 ;; COLOR=A
ROM_TEXT2COPY = $F962 ;; iigs
TEXT = $FB36
TABV = $FB5B ;; VTAB to A
ROM_MACHINEID = $FBB3 ;; iigs
BELL = $FBDD ;; ring the bell
BASCALC = $FBC1 ;;
VTAB = $FC22 ;; VTAB to CV
@ -52,6 +63,7 @@ COUT1 = $FDF0 ;; output A to screen
COLOR_BLACK = 0
COLOR_RED = 1
COLOR_DARKBLUE = 2

View File

@ -25,6 +25,41 @@ mist_start:
bit HIRES
bit FULLGR
;===================
; machine workarounds
;===================
; mostly IIgs
;===================
; thanks to 4am who provided this code from Total Replay
lda ROM_MACHINEID
cmp #$06
bne not_a_iigs
sec
jsr $FE1F ; check for IIgs
bcs not_a_iigs
; gr/text page2 handling broken on early IIgs models
; this enables the workaround
jsr ROM_TEXT2COPY ; set alternate display mode on IIgs
cli ; enable VBL interrupts
; also set background color to black instead of blue
lda NEWVIDEO
and #%00011111 ; bit 7 = 0 -> IIgs Apple II-compat video modes
; bit 6 = 0 -> IIgs 128K memory map same as IIe
; bit 5 = 0 -> IIgs DHGR is color, not mono
; bits 0-4 unchanged
sta NEWVIDEO
lda #$F0
sta TBCOLOR ; white text on black background
lda #$00
sta CLOCKCTL ; black border
sta CLOCKCTL ; set twice for VidHD
not_a_iigs:
;===================
; setup location
;===================