From a4b3c54cafd5af5b1dc07ee23a0c01bdd8113c03 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Thu, 23 Jul 2020 10:58:22 -0400 Subject: [PATCH] mist: improved IIgs support thanks to 4am, this turns black backgrounds on and enables the PAGE2 workaround --- mist/hardware.inc | 12 ++++++++++++ mist/mist_title.s | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/mist/hardware.inc b/mist/hardware.inc index 8d203e23..905b8dd8 100644 --- a/mist/hardware.inc +++ b/mist/hardware.inc @@ -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 diff --git a/mist/mist_title.s b/mist/mist_title.s index 86ad7be6..3e05dbf0 100644 --- a/mist/mist_title.s +++ b/mist/mist_title.s @@ -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 ;===================