diff --git a/vaporlock/doubledouble/Makefile b/vaporlock/doubledouble/Makefile index 7f27802b..2f085188 100644 --- a/vaporlock/doubledouble/Makefile +++ b/vaporlock/doubledouble/Makefile @@ -23,7 +23,8 @@ DOUBLE: double.o ld65 -o DOUBLE double.o -C $(LINKERSCRIPTS)/apple2_1000.inc double.o: double.s \ - zp.inc + zp.inc hardware.inc pt3_lib_mockingboard_detect.s \ + pt3_lib_mockingboard_setup.s pt3_lib_detect_model.s ca65 -o double.o double.s -l double.lst ### diff --git a/vaporlock/doubledouble/double.s b/vaporlock/doubledouble/double.s index 9dab9830..80349c4d 100644 --- a/vaporlock/doubledouble/double.s +++ b/vaporlock/doubledouble/double.s @@ -5,10 +5,55 @@ .include "zp.inc" .include "hardware.inc" + +double: + + ;================================ + ; detect model + ;================================ + + jsr detect_appleii_model + + + ;=================== + ; 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: + ;================================ ; Clear screen and setup graphics ;================================ -double: jsr SETGR ; set lo-res 40x40 mode @@ -277,3 +322,8 @@ line_loop_it: bne line_loop_it rts + + + .include "pt3_lib_detect_model.s" +; .include "pt3_lib_mockingboard_setup.s" +; .include "pt3_lib_mockingboard_detect.s" diff --git a/vaporlock/doubledouble/hardware.inc b/vaporlock/doubledouble/hardware.inc index d065ba19..4ef078c4 100644 --- a/vaporlock/doubledouble/hardware.inc +++ b/vaporlock/doubledouble/hardware.inc @@ -5,6 +5,10 @@ EIGHTYSTORE = $C001 CLR80COL = $C00C SET80COL = $C00D +TBCOLOR = $C022 ; IIgs text foreground / background colors +CLOCKCTL = $C034 ; bits 0-3 are IIgs border color +NEWVIDEO = $C029 ; IIgs graphics modes + SET_GR = $C050 SET_TEXT= $C051 FULLGR = $C052 @@ -26,3 +30,5 @@ HPOSN = $F411 HPLOT0 = $F457 ; plot at (Y,X), (A) HGLIN = $F53A ; line to (X,A),(Y) +ROM_TEXT2COPY = $F962 ; iigs +ROM_MACHINEID = $FBB3 ; iigs diff --git a/vaporlock/doubledouble/zp.inc b/vaporlock/doubledouble/zp.inc index 898c3c0c..351a0a05 100644 --- a/vaporlock/doubledouble/zp.inc +++ b/vaporlock/doubledouble/zp.inc @@ -3,8 +3,13 @@ GBASL = $26 GBASH = $27 V2 = $2D +APPLEII_MODEL = $8B + HGRPAGE = $E6 -YPOS = $FE -TCOLOR = $FF +MB_VALUE = $F5 +MB_ADDR_L = $F6 +MB_ADDR_H = $F7 +YPOS = $FE +TCOLOR = $FF