diff --git a/graphics/dgr_viewer/plain/Makefile b/graphics/dgr_viewer/plain/Makefile deleted file mode 100644 index a781dd6b..00000000 --- a/graphics/dgr_viewer/plain/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -include ../../../Makefile.inc - -ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -PNG_TO_DGR = ../../../utils/gr-utils/png2dgr -LINKER_SCRIPTS = ../../../linker_scripts -DOS33 = ../../../utils/dos33fs-utils/dos33 -EMPTY_DISK = ../../../empty_disk/empty.dsk -TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft - -all: dlores_plain.dsk - -#### - -DLORES: dlores_plain.o - ld65 -o DLORES dlores_plain.o -C $(LINKER_SCRIPTS)/apple2_1000.inc - -dlores_plain.o: dlores_plain.s ../dlores_main.s ../zx02_optim.s \ - ../zp.inc ../hardware.inc - ca65 -o dlores_plain.o dlores_plain.s -l dlores_plain.lst -#### - -HELLO: ../hello.bas - $(TOKENIZE) < ../hello.bas > HELLO - -#### - -dlores_plain.dsk: HELLO DLORES\ - myst.gr.main.zx02 myst.gr.aux.zx02\ - channelwood.gr.main.zx02 channelwood.gr.aux.zx02\ - selenetic.gr.main.zx02 selenetic.gr.aux.zx02\ - sworg_dgr.gr.main.zx02 sworg_dgr.gr.aux.zx02\ - dgr_test_bar.gr.main.zx02 dgr_test_bar.gr.aux.zx02 - cp $(EMPTY_DISK) dlores_plain.dsk - $(DOS33) -y dlores_plain.dsk SAVE A HELLO - $(DOS33) -y dlores_plain.dsk BSAVE -a 0x1000 DLORES - $(DOS33) -y dlores_plain.dsk BSAVE -a 0xa000 myst.gr.main.zx02 MYST.MAIN.ZX02 - $(DOS33) -y dlores_plain.dsk BSAVE -a 0xa000 myst.gr.aux.zx02 MYST.AUX.ZX02 - $(DOS33) -y dlores_plain.dsk BSAVE -a 0xa000 channelwood.gr.main.zx02 CHANNEL.MAIN.ZX02 - $(DOS33) -y dlores_plain.dsk BSAVE -a 0xa000 channelwood.gr.aux.zx02 CHANNEL.AUX.ZX02 - $(DOS33) -y dlores_plain.dsk BSAVE -a 0xa000 selenetic.gr.main.zx02 SELEN.MAIN.ZX02 - $(DOS33) -y dlores_plain.dsk BSAVE -a 0xa000 selenetic.gr.aux.zx02 SELEN.AUX.ZX02 - $(DOS33) -y dlores_plain.dsk BSAVE -a 0xa000 sworg_dgr.gr.main.zx02 SWORG.MAIN.ZX02 - $(DOS33) -y dlores_plain.dsk BSAVE -a 0xa000 sworg_dgr.gr.aux.zx02 SWORG.AUX.ZX02 - $(DOS33) -y dlores_plain.dsk BSAVE -a 0xa000 dgr_test_bar.gr.main.zx02 TEST.MAIN.ZX02 - $(DOS33) -y dlores_plain.dsk BSAVE -a 0xa000 dgr_test_bar.gr.aux.zx02 TEST.AUX.ZX02 -#### - -clean: - rm -f *~ *.o *.lst - diff --git a/vaporlock/doubledouble/Makefile b/vaporlock/doubledouble/Makefile index eafc0d1b..611097d7 100644 --- a/vaporlock/doubledouble/Makefile +++ b/vaporlock/doubledouble/Makefile @@ -25,10 +25,12 @@ DOUBLE: double.o double.o: double.s \ zp.inc hardware.inc pt3_lib_mockingboard_detect.s \ pt3_lib_mockingboard_setup.s pt3_lib_detect_model.s \ - zx02_optim.s \ + zx02_optim.s copy_400.s \ graphics/sworg_hgr.hgr.zx02 \ graphics/sworg_dhgr.aux.zx02 \ - graphics/sworg_dhgr.bin.zx02 + graphics/sworg_dhgr.bin.zx02 \ + graphics/sworg_dgr.main.zx02 \ + graphics/sworg_dgr.aux.zx02 ca65 -o double.o double.s -l double.lst ### diff --git a/vaporlock/doubledouble/copy_400.s b/vaporlock/doubledouble/copy_400.s new file mode 100644 index 00000000..d48384e3 --- /dev/null +++ b/vaporlock/doubledouble/copy_400.s @@ -0,0 +1,35 @@ + ;========================= + ; copy to 400 + ;========================= +copy_to_400: + + + ldx #119 +looper1: + lda $c00,X + sta $400,X + + lda $c80,X + sta $480,X + + lda $d00,X + sta $500,X + + lda $d80,X + sta $580,X + + lda $e00,X + sta $600,X + + lda $e80,X + sta $680,X + + lda $f00,X + sta $700,X + + lda $f80,X + sta $780,X + dex + bpl looper1 + + rts diff --git a/vaporlock/doubledouble/double.s b/vaporlock/doubledouble/double.s index 258df44a..08a7a817 100644 --- a/vaporlock/doubledouble/double.s +++ b/vaporlock/doubledouble/double.s @@ -15,9 +15,9 @@ double: jsr detect_appleii_model - ;=================== + ;====================== ; machine workarounds - ;=================== + ;====================== ; mostly IIgs ;=================== ; thanks to 4am who provided this code from Total Replay @@ -56,90 +56,58 @@ not_a_iigs: ;================================ jsr SETGR ; set lo-res 40x40 mode - + bit LORES ; set 80-store mode sta EIGHTYSTOREON ; PAGE2 selects AUX memory - bit PAGE1 - ;=================== - ; draw lo-res lines - - ldx #39 -draw_lores_lines: - txa - tay - jsr SETCOL - - lda #47 - sta V2 - lda #0 - jsr VLINE ; VLINE A,$2D at Y - - dex - bpl draw_lores_lines - - ; copy to 800 temporarily - ; yes this is a bit of a hack - - ldy #0 -cp_loop: - lda $400,Y - sta $800,Y - - lda $500,Y - sta $900,Y - - lda $600,Y - sta $A00,Y - - lda $700,Y - sta $B00,Y - - iny - bne cp_loop + ;========================================================= + ; load double lo-res image to $C00 and copy to MAIN:PAGE1 + ;========================================================= bit PAGE1 - ; copy to $400 in AUX + lda #image_dgr_main + sta ZX0_src+1 - bit PAGE2 ; $400 now maps to AUX:$400 + lda #$0c - ldy #0 -cp2_loop: - lda $800,Y - eor #$FF - sta $400,Y + jsr full_decomp - lda $900,Y - eor #$FF - sta $500,Y + jsr copy_to_400 - lda $A00,Y - eor #$FF - sta $600,Y + ;========================================================= + ; load double lo-res image to $C00 and copy to AUX:PAGE1 + ;========================================================= - lda $B00,Y - eor #$FF - sta $700,Y + bit PAGE2 ; map in AUX (80store) - iny - bne cp2_loop + lda #image_dgr_aux + sta ZX0_src+1 - bit PAGE1 + lda #$0c + jsr full_decomp + + jsr copy_to_400 ;======================================= ; load double hi-res image to MAIN:PAGE1 ;======================================= + bit HIRES ; need to do this for 80store to work + bit PAGE1 lda #image_dhgr_bin sta ZX0_src+1 - lda #$20 + lda #$20 jsr full_decomp @@ -198,8 +166,13 @@ double_loop: ; each line 65 cycles (25 hblank+40 bytes) -; 3 LINES 80-COL AN3 +; 3 LINES 80-COL TEXT AN3=0 PAGE=1 + nop + nop + + nop + nop sta SET80COL ; 4 bit SET_TEXT ; 4 @@ -208,58 +181,110 @@ double_loop: jsr delay_1552 -; 3 LINES 40-COL AN3 +; 3 LINES 40-COL TEXT AN3=0 PAGE=1 + nop + nop + + nop + nop sta CLR80COL ; 4 bit SET_TEXT ; 4 + jsr delay_1552 -; 3 LINES 40-col LORES AN3 +; 3 LINES 40-col LORES AN3=0 PAGE=1 - lda LORES ; 4 + nop + nop + + nop + nop + bit PAGE1 ; 4 bit SET_GR ; 4 + jsr delay_1552 -; 3 LINES 80-col DLORES AN3 +; 3 LINES 80-col DLORES AN3=0 PAGE=1 + nop + nop + + sta LORES sta SET80COL ; 4 sta CLRAN3 ; 4 + jsr delay_1552 -; 3 lines 40-col LORES - sta CLR80COL ; 4 - sta SETAN3 ; 4 ; doublehiresoff +; 3 LINES 80-col DLORES AN3=0 PAGE=1 + + nop + nop + + nop + nop + + nop + nop + + nop + nop + jsr delay_1552 -; 3 lines HIRES PAGE2 +; 3 lines HIRES 40-COL AN3=1 PAGE=2 + + sta CLR80COL sta HIRES ; 4 sta PAGE2 ; 4 + sta SETAN3 + jsr delay_1552 -; 3 lines Double-hires +; 3 lines Double-hires AN3=0 PAGE=1 + sta PAGE1 + bit HIRES sta SET80COL ; 4 ; set 80 column mode sta CLRAN3 ; 4 ; doublehireson + jsr delay_1552 ; 3 line Double-HIRES -; sta PAGE1 ; 4 - sta SET_GR ; 4 - sta SET_GR ; 4 + nop + nop + + nop + nop + + nop + nop + + nop + nop + jsr delay_1552 + jmp skip_vblank + +.align $100 ;================================== ; vblank = 4550 cycles - + ; -6 + ; 4544 ; Try X=226 Y=4 cycles=4545 + ; Try X=9 Y=89 cycles=4540 + skip_vblank: + + nop nop - ldy #4 ; 2 -loop3: ldx #226 ; 2 + ldy #89 ; 2 +loop3: ldx #9 ; 2 loop4: dex ; 2 bne loop4 ; 2nt/3 dey ; 2 @@ -276,10 +301,17 @@ loop4: dex ; 2 ; actually want 1552-12 (6 each for jsr/rts) ; 1540 ; Try X=15 Y=19 cycles=1540 + ; 1532 + ; Try X=1 Y=139 cycles=1530 + delay_1552: - ldy #19 ; 2 -loop5: ldx #15 ; 2 + nop + + + + ldy #139 ; 2 +loop5: ldx #1 ; 2 loop6: dex ; 2 bne loop6 ; 2nt/3 dey ; 2 @@ -295,9 +327,15 @@ loop6: dex ; 2 .include "zx02_optim.s" + .include "copy_400.s" + image_hgr: .incbin "graphics/sworg_hgr.hgr.zx02" image_dhgr_aux: .incbin "graphics/sworg_dhgr.aux.zx02" image_dhgr_bin: .incbin "graphics/sworg_dhgr.bin.zx02" +image_dgr_aux: + .incbin "graphics/sworg_dgr.aux.zx02" +image_dgr_main: + .incbin "graphics/sworg_dgr.main.zx02" diff --git a/vaporlock/doubledouble/graphics/Makefile b/vaporlock/doubledouble/graphics/Makefile index 715494bb..c659e16d 100644 --- a/vaporlock/doubledouble/graphics/Makefile +++ b/vaporlock/doubledouble/graphics/Makefile @@ -3,6 +3,7 @@ include ../../../Makefile.inc ZX02 = ~/research/6502_compression/zx02.git/build/zx02 PNG_TO_HGR = ../../../utils/hgr-utils/png2hgr PNG_TO_DHGR = ../../../utils/hgr-utils/png2dhgr +PNG_TO_DGR = ../../../utils/gr-utils/png2dgr LINKER_SCRIPTS = ../../../linker_scripts DOS33 = ../../../utils/dos33fs-utils/dos33 EMPTY_DISK = ../../../empty_disk/empty.dsk @@ -11,7 +12,9 @@ TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft all: \ sworg_hgr.hgr.zx02 \ sworg_dhgr.bin.zx02 \ - sworg_dhgr.aux.zx02 + sworg_dhgr.aux.zx02 \ + sworg_dgr.main.zx02 \ + sworg_dgr.aux.zx02 #### @@ -35,6 +38,21 @@ sworg_dhgr.bin.zx02: sworg_dhgr.BIN sworg_dhgr.BIN: sworg_dhgr.png $(PNG_TO_DHGR) sworg_dhgr.png sworg_dhgr +#### + +sworg_dgr.aux.zx02: sworg_dgr.aux + $(ZX02) sworg_dgr.aux sworg_dgr.aux.zx02 + +sworg_dgr.aux: sworg_dgr.png + $(PNG_TO_DGR) sworg_dgr.png sworg_dgr + +sworg_dgr.main.zx02: sworg_dgr.main + $(ZX02) sworg_dgr.main sworg_dgr.main.zx02 + +sworg_dgr.main: sworg_dgr.png + $(PNG_TO_DGR) sworg_dgr.png sworg_dgr + + ####