From 903b01daa1fc6f7693c77b91ba88fc5b8382bf49 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 30 Oct 2024 16:30:41 -0400 Subject: [PATCH] wipes: seeing if I can get some 4am wipes going --- graphics/hgr/wipes/Makefile | 37 +++ graphics/hgr/wipes/fx.hgr.bubbles.s | 19 ++ graphics/hgr/wipes/fx.hgr.precomputed.1bit.s | 60 ++++ graphics/hgr/wipes/graphics/Makefile | 21 ++ graphics/hgr/wipes/graphics/a2_dating.png | Bin 0 -> 19761 bytes graphics/hgr/wipes/hardware.inc | 102 ++++++ graphics/hgr/wipes/hello.bas | 4 + graphics/hgr/wipes/macros.hgr.s | 311 +++++++++++++++++++ graphics/hgr/wipes/macros.s | 19 ++ graphics/hgr/wipes/wait_keypress.s | 5 + graphics/hgr/wipes/wipe_test.s | 45 +++ graphics/hgr/wipes/zp.inc | 260 ++++++++++++++++ graphics/hgr/wipes/zx02_optim.s | 159 ++++++++++ 13 files changed, 1042 insertions(+) create mode 100644 graphics/hgr/wipes/Makefile create mode 100644 graphics/hgr/wipes/fx.hgr.bubbles.s create mode 100644 graphics/hgr/wipes/fx.hgr.precomputed.1bit.s create mode 100644 graphics/hgr/wipes/graphics/Makefile create mode 100644 graphics/hgr/wipes/graphics/a2_dating.png create mode 100644 graphics/hgr/wipes/hardware.inc create mode 100644 graphics/hgr/wipes/hello.bas create mode 100644 graphics/hgr/wipes/macros.hgr.s create mode 100644 graphics/hgr/wipes/macros.s create mode 100644 graphics/hgr/wipes/wait_keypress.s create mode 100644 graphics/hgr/wipes/wipe_test.s create mode 100644 graphics/hgr/wipes/zp.inc create mode 100644 graphics/hgr/wipes/zx02_optim.s diff --git a/graphics/hgr/wipes/Makefile b/graphics/hgr/wipes/Makefile new file mode 100644 index 00000000..e0f1a97d --- /dev/null +++ b/graphics/hgr/wipes/Makefile @@ -0,0 +1,37 @@ +include ../../../Makefile.inc + +DOS33 = ../../../utils/dos33fs-utils/dos33 +TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft +LINKER_SCRIPTS = ../../../linker_scripts +EMPTY_DISK = ../../../empty_disk + +all: wipes.dsk + +wipes.dsk: HELLO WIPE_TEST + cp $(EMPTY_DISK)/empty.dsk wipes.dsk + $(DOS33) -y wipes.dsk SAVE A HELLO + $(DOS33) -y wipes.dsk BSAVE -a 0x6000 WIPE_TEST + +### + +HELLO: hello.bas + $(TOKENIZE) < hello.bas > HELLO + +### + +WIPE_TEST: wipe_test.o + ld65 -o WIPE_TEST wipe_test.o -C $(LINKER_SCRIPTS)/apple2_6000.inc + +wipe_test.o: wipe_test.s \ + zp.inc hardware.inc wait_keypress.s zx02_optim.s \ + fx.hgr.bubbles.s \ + fx.hgr.precomputed.1bit.s \ + macros.s + ca65 -o wipe_test.o wipe_test.s -l wipe_test.lst + + +### + +clean: + rm -f *~ *.o *.lst HELLO WIPE_TEST + diff --git a/graphics/hgr/wipes/fx.hgr.bubbles.s b/graphics/hgr/wipes/fx.hgr.bubbles.s new file mode 100644 index 00000000..5dad9a6e --- /dev/null +++ b/graphics/hgr/wipes/fx.hgr.bubbles.s @@ -0,0 +1,19 @@ +;license:MIT +;(c) 2019-2020 by 4am/qkumba +; +;!cpu 6502 +;!to "build/FX.INDEXED/BUBBLES",plain +;*=$6000 + +; !source "src/fx/fx.hgr.precomputed.1bit.a" + .include "fx.hgr.precomputed.1bit.s" + + +; +FX_INITONCE_1BIT FXCodeFile, CoordinatesFile, Start +Start: +; jmp FXCode + +;FXCodeFile +; +PSTRING "HGR1" +;CoordinatesFile +; +PSTRING "BUBBLES.DATA" diff --git a/graphics/hgr/wipes/fx.hgr.precomputed.1bit.s b/graphics/hgr/wipes/fx.hgr.precomputed.1bit.s new file mode 100644 index 00000000..e3b610da --- /dev/null +++ b/graphics/hgr/wipes/fx.hgr.precomputed.1bit.s @@ -0,0 +1,60 @@ +;license:MIT +;(c) 2019-2024 by 4am +; + +;------------------------------------------------------------------------------ +; YE OLDE GRAND UNIFIED MEMORY MAP +; +; 0201..02C0 - hgrlo +; 02C1..02E8 - mirror_cols +; 02E9..0300 +; 0301..03C0 - hgrhi +; 03C1..03EE +; 6000..61FF - module-specific code ($200 max) +; 6200.. - shared FX code (loaded once by module-specific code) +; 85FE..B880 - Coordinates1Bit (8600 but dither variants clobber Coordinates1Bit-2) +; B881..BB00 +; BB01..BBC0 - hgrlomirror +; BBC1..BC00 +; BC01..BCC0 - hgr1himirror +; BCC1..BDA7 +; BDA8..BDFF - dithermasks +; BE00..BEFF - copymasks1bit +; BF00..BFFF - ProRWTS glue +; + +; !source "src/fx/macros.a" + .include "macros.s" + +;!macro FX_INITONCE_1BIT .CoordinatesFile, .Start { +;InitOnce +; bit .Start +; lda #$4C +; sta InitOnce + +; +LDADDR .CoordinatesFile +; ldx #>Coordinates1Bit +; jsr iLoadFXDATA + +; sec +; ror EndCoordinates1Bit +;} + +; same but also loading an FXCode file +;!macro FX_INITONCE_1BIT .FXCodeFile, .CoordinatesFile, .Start { +;InitOnce +; bit .Start +; lda #$4C +; sta InitOnce + +; +LDADDR .FXCodeFile +; ldx #>FXCode +; jsr iLoadFXCODE + +; +LDADDR .CoordinatesFile +; ldx #>Coordinates1Bit +; jsr iLoadFXDATA + +; sec +; ror EndCoordinates1Bit +;} diff --git a/graphics/hgr/wipes/graphics/Makefile b/graphics/hgr/wipes/graphics/Makefile new file mode 100644 index 00000000..c5f28d6f --- /dev/null +++ b/graphics/hgr/wipes/graphics/Makefile @@ -0,0 +1,21 @@ +include ../../../../Makefile.inc + +ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f +PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr +PNG2GR = ../../../../utils/gr-utils/png2gr +HGR_SPRITE = ../../../../utils/hgr-utils/hgr_make_sprite + +all: a2_dating.hgr.zx02 + +#### + +a2_dating.hgr.zx02: a2_dating.hgr + $(ZX02) a2_dating.hgr a2_dating.hgr.zx02 + +a2_dating.hgr: a2_dating.png + $(PNG_TO_HGR) a2_dating.png > a2_dating.hgr + +#### + +clean: + rm -f *~ *.zx02 diff --git a/graphics/hgr/wipes/graphics/a2_dating.png b/graphics/hgr/wipes/graphics/a2_dating.png new file mode 100644 index 0000000000000000000000000000000000000000..56ef1732714a7548fa6da40f0e9f0417b648f40e GIT binary patch literal 19761 zcmeIabyQqU(=R#%3lc1l3_ihw4})ufAOit{yABM&WpI~30>L#%kPsxey9R!1zTu7Q2`Rqmpi#LDN zJBy@=k;3l({*!bxGj=jF1-V){y#mQV6%lX>1W(`75s(ycJg)sKp-a#l}1){ zreb_O5`xQ~H>iGh9}6B82)>pnIv@dI2O99&YOhxo*lWYkoYWE2!2I(9}74J$1L z1ry&>R!%TCH#aq-fCxXAFgt{s>rMy?78VvR4leM)10dHEiYHwE@pan@AiNJKK|zA0 z0o)@*K_x`F?Ep|C+lh|y`}zY4GJX#g4IKmXJ{C3(lA(&=PE)A&&`{CQ(a?~&-pG6a z8X-E-6R%dIS;O4I^ED=u5F0O9w9)Yieg5SIi35|)3i%&>=pOpMD z>r-}4ZrYCcR`Y-JrUpu?HdwPdQM#sh{Ca0zse=aSrtgfwZ{MtV_JUTu( zJv+a+!*z%Auj>zF|AvbYiR&I38Y&v*9WIo6u6Mu*(a@iOF^I&KF^wG_(s23TCzgoL zENjD}g{bV2m^gmNeniK;NWXsv?KiUjXTSpfuaNx>>>s$M0l26r$j(D01c(6^MF}io z=By?r*s^iDReGO?=lC^BSZBV}g$3~s!H$Yz7YdSuMSeczxDp+<>ih{a{jU9j*7V#p zx{AcZw_w3^XNja>FW}eDp~ZwIp2}fKrcoHm_fntrqFcb3Y*onx_Pp5Xr1;oKy|CMT6$ zfu&|!<;oI)VI*0@hhSk%g=0z^7$E0mhMpOXI{o*p7Irr~VJmjltq$YGG z#GV)GDW1CzX9tZV4z2{3TsBB0)+R)l4HWoyx%Cil<)ttj>VNo6gO|u{sAZk2V+O}{ zUyj>C-*dWZDGtk^OaN{H1ehWf%@k+4%GG6KVpT_^OK)d&xj(z-G&EMX!4F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ga1sff7vhH{t?C3<^g-7t}sTs5PRImD2t|g`bh?nMSWpb*5>`%bRqqqFK1LzZ_`cxMhfC@%(5K2dyI2LU7I;4#cBKQXD@?oLgn$yi_qV5NFI&OuNM{q? zYh#UMxR3V}_gk$#g`7d*aHC}j2tN)g&cMRj`!*%6z?Sx~)S$K?cryV!iS*LI;>5K( zY#e=H-w8$ zS`rAh=_x!H0#+t;YBLyH_ep1ZH)dSP0cX}SQP1V^+F#pM+w32bsveTIn@GZ6ue`Z^ z!DX%M!R=Av{VAP)f9yukxma7{tui_4;dkgodY!50 zcKN+dr$)_Y9!?M3&Kn0YAC4aFpzk}998?lBc0WJ0c#qL}tM{CV(wknI?h3`)&j%!t ztFObPFHG7;YL#44dU%U6Ii2ts&O@xH=4Uvc7;&2p*`;7P&`R>p`SpZWI}rKh=qA7B qYuZq-^B75)Kg#)M@_J)KOusbJn2JpEHS#|?04k;Uyja30;C}%vT_s`w literal 0 HcmV?d00001 diff --git a/graphics/hgr/wipes/hardware.inc b/graphics/hgr/wipes/hardware.inc new file mode 100644 index 00000000..8eb76396 --- /dev/null +++ b/graphics/hgr/wipes/hardware.inc @@ -0,0 +1,102 @@ +; HARDWARE LOCATIONS + +KEYPRESS = $C000 +KEYRESET = $C010 + +; SOFT SWITCHES +CLR80COL = $C000 ; PAGE1/PAGE1 normal +SET80COL = $C001 ; PAGE1/PAGE2 switches PAGE1 in Aux instead +EIGHTYCOLOFF = $C00C +EIGHTYCOLON = $C00D +TBCOLOR = $C022 ; IIgs text fg/bg colors +NEWVIDEO = $C029 ; IIgs graphics modes +SPEAKER = $C030 +CLOCKCTL = $C034 ; bits 0-3 are IIgs border color +CYAREG = $C036 ; iigs motor detect and clock speed +SET_GR = $C050 +SET_TEXT = $C051 +FULLGR = $C052 +TEXTGR = $C053 +PAGE1 = $C054 +PAGE2 = $C055 +LORES = $C056 ; Enable LORES graphics +HIRES = $C057 ; Enable HIRES graphics +AN3 = $C05E ; Annunciator 3 + +PADDLE_BUTTON0 = $C061 +PADDL0 = $C064 +PTRIG = $C070 + +; APPLESOFT BASIC ROUTINES + +NORMAL = $F273 +HGR2 = $F3D8 +HGR = $F3E2 +BKGND0 = $F3F4 ; clear current page to A +HPOSN = $F411 ; (Y,X),(A) (values stores in HGRX,XH,Y) +HPLOT0 = $F457 ; plot at (Y,X), (A) +COLOR_SHIFT = $F47E +HLINRL = $F530 ; (X,A),(Y) +HGLIN = $F53A ; line to (X,A),(Y) +COLORTBL = $F6F6 + +; MONITOR ROUTINES + +HLINE = $F819 ; HLINE Y,$2C at A +VLINE = $F828 ; VLINE A,$2D at Y +CLRSCR = $F832 ; Clear low-res screen +CLRTOP = $F836 ; clear only top of low-res screen +GBASCALC= $F847 +SETCOL = $F864 ; COLOR=A +ROM_TEXT2COPY = $F962 ; iigs +TEXT = $FB36 +TABV = $FB5B ; VTAB to A +ROM_MACHINEID = $FBB3 ; iigs +BASCALC = $FBC1 ; +BELL = $FBDD ; ring the bell +VTAB = $FC22 ; VTAB to CV +HOME = $FC58 ; Clear the text screen +WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us +SETINV = $FE80 ; INVERSE +SETNORM = $FE84 ; NORMAL +COUT = $FDED ; output A to screen +COUT1 = $FDF0 ; output A to screen + + + + + + + +COLOR_BLACK = 0 +COLOR_RED = 1 +COLOR_DARKBLUE = 2 +COLOR_PURPLE = 3 +COLOR_DARKGREEN = 4 +COLOR_GREY = 5 +COLOR_MEDIUMBLUE = 6 +COLOR_LIGHTBLUE = 7 +COLOR_BROWN = 8 +COLOR_ORANGE = 9 +COLOR_GREY2 = 10 +COLOR_PINK = 11 +COLOR_LIGHTGREEN = 12 +COLOR_YELLOW = 13 +COLOR_AQUA = 14 +COLOR_WHITE = 15 + +COLOR_BOTH_BLACK = $00 +COLOR_BOTH_RED = $11 +COLOR_BOTH_DARKBLUE = $22 +COLOR_BOTH_DARKGREEN = $44 +COLOR_BOTH_GREY = $55 +COLOR_BOTH_MEDIUMBLUE = $66 +COLOR_BOTH_LIGHTBLUE = $77 +COLOR_BOTH_BROWN = $88 +COLOR_BOTH_ORANGE = $99 +COLOR_BOTH_PINK = $BB +COLOR_BOTH_LIGHTGREEN = $CC +COLOR_BOTH_YELLOW = $DD +COLOR_BOTH_AQUA = $EE +COLOR_BOTH_WHITE = $FF + diff --git a/graphics/hgr/wipes/hello.bas b/graphics/hgr/wipes/hello.bas new file mode 100644 index 00000000..f05a3fb4 --- /dev/null +++ b/graphics/hgr/wipes/hello.bas @@ -0,0 +1,4 @@ +5 HOME +10 PRINT "TESTING 4AM WIPE CODE FROM 4CADE" +60 PRINT:PRINT CHR$(4)"CATALOG" + diff --git a/graphics/hgr/wipes/macros.hgr.s b/graphics/hgr/wipes/macros.hgr.s new file mode 100644 index 00000000..f52af2e7 --- /dev/null +++ b/graphics/hgr/wipes/macros.hgr.s @@ -0,0 +1,311 @@ +;license:MIT +;(c) 2019-2022 by 4am +; + +;!ifndef _FX_MACROS_HGR_ { +.ifndef _FX_MACROS_HGR_ + +;!macro HGR_CALC { +.macro HGR_CACLC +; in: A = HGR row (0x00..0xBF) +; out: A/X clobbered +; Y preserved +; ($26) points to first byte of given HGR row on hi-res page 1 +; ($3C) points to same byte on hi-res page 2 +; based on 'Woz Recodes Hi-Res Address Calculations' +; Apple Assembly Line vol. 7 issue 3 (December 1986) +; http://www.txbobsc.com/aal/1986/aal8612.html#a9 + asl + tax + and #$F0 + bpl @calc1 + ora #$05 +@calc1 bcc @calc2 + ora #$0A +@calc2 asl + asl + sta $26 + txa + and #$0E + adc #$10 + asl $26 + rol + sta $27 + eor #$60 + sta $3d + lda $26 + sta $3c +;} +.endmacro + +;!macro HGR_ROW_CALC { +.macro HGR_ROW_CALC + asl + asl + asl +; +HGR_CALC + HGR_CALC +;} +.endmacro + +; /!\ C must be clear before using this macro +;!macro HGR_INC_WITHIN_BLOCK { +.macro HGR_INC_WITHIN_BLOCK + lda $27 + adc #$04 + sta $27 + eor #$60 + sta $3d +;} +.endmacro + +;!macro RESET_HGR_CALC { +.macro RESET_HGR_CALC + lda $27 + sec + sbc #$20 + sta $27 + eor #$60 + sta $3d +;} +.endmacro + +;!macro SWITCH_TO_MASKS .copy { +.macro SWITCH_TO_MASKS copy + lda #copy + sta CopyMaskAddr+1 +;} +.endmacro + +;!macro ROW_X_TO_BASE_ADDRESSES .src1, .src2, .dest1, .dest2 { +.macro ROW_X_TO_BAS_ADDRESSES src1, src2, dest1, dest2 + lda hgrlo, x + sta test_graphic + sta zx_src_h+1 + lda #$20 + jsr zx02_full_decomp + + jsr wait_until_keypress + + ;================================= + ; test wipe... + ;================================= +test_loop: + + jsr Start + + jsr wait_until_keypress + jmp test_loop + + + +test_graphic: + .incbin "graphics/a2_dating.hgr.zx02" + +.include "wait_keypress.s" +.include "zx02_optim.s" + +.include "fx.hgr.bubbles.s" diff --git a/graphics/hgr/wipes/zp.inc b/graphics/hgr/wipes/zp.inc new file mode 100644 index 00000000..b2289dd3 --- /dev/null +++ b/graphics/hgr/wipes/zp.inc @@ -0,0 +1,260 @@ +;================== +;================== +; Zero Page Usage +;================== +;================== + +; ZX0 decompression addresses + +ZX0_src = $00 +ZX0_dst = $02 +offset = $04 +bitr = $06 +pntr = $07 +WHICH_LOAD = $09 +CURRENT_DISK = $0A + +; Zero page monitor routines addresses +; We don't use the monitor but we use some of these anyway + +WNDLFT = $20 +WNDWDTH = $21 +WNDTOP = $22 +WNDBTM = $23 +CH = $24 +CV = $25 +GBASL = $26 +GBASH = $27 +BASL = $28 +BASH = $29 +H2 = $2C +V2 = $2D +MASK = $2E +COLOR = $30 +;INVFLG = $32 + +WHICH_TRACK = $54 + +;========================== +; $60-$6F unused currently +;========================== + + +;========================== +; $70-$7F for PT3 Player +;========================== + +AY_REGISTERS = $70 +A_FINE_TONE = $70 +A_COARSE_TONE = $71 +B_FINE_TONE = $72 +B_COARSE_TONE = $73 +C_FINE_TONE = $74 +C_COARSE_TONE = $75 +NOISE = $76 +ENABLE = $77 +PT3_MIXER_VAL = $77 +A_VOLUME = $78 +B_VOLUME = $79 +C_VOLUME = $7A +ENVELOPE_FINE = $7B +ENVELOPE_COARSE = $7C +ENVELOPE_SHAPE = $7D +PATTERN_L = $7E +PATTERN_H = $7F + +;============================ +; $80-$8D rest of pt3_player +;============================ + +PT3_TEMP = $80 +ORNAMENT_L = $81 +ORNAMENT_H = $82 +SAMPLE_L = $83 +SAMPLE_H = $84 +LOOP = $85 +MB_VALUE = $86 +MB_ADDR_L = $87 +MB_ADDR_H = $88 +DONE_PLAYING = $89 +DONE_SONG = $8A +APPLEII_MODEL = $8B +SOUND_STATUS = $8C + SOUND_DISABLED = $80 + SOUND_IN_LC = $01 ; $01 sound effects in language card + SOUND_MOCKINGBOARD = $02 ; mockingboard detected + +;============================= +; not sure why these are here +;============================= + +DISP_PAGE = $8D +DRAW_PAGE = $8E +TOTAL_RAM = $8F + +;============================= +; $90-$CF currently free +;============================= + +; for plasma? +;Table1 = $A0 ; 40 bytes ($28) A0-C7 +;Table2 = $C8 ; 40 bytes ($28) C8-EF + +;============================= +; $D0-$D9 = hgr move +;============================= +HGR_X1 = $D0 +HGR_X2 = $D1 +HGR_Y1 = $D2 +HGR_Y2 = $D3 +HGR_DEST= $D4 +BOARD_COUNT = $D5 + + +WHICH_SLOT = $DA ; from boot sector + + +;============================================== +; $E0-$EF use for common things, don't re-use +;============================================== +IRQ_COUNTDOWN = $E0 +SECOND_COUNTDOWN= $E1 +COUNT = $E2 +XSAVE = $E3 +TEMPY = $E4 +XPOS = $E5 ; gr_plot +YPOS = $E6 ; gr_plot +COLOR_MASK = $E7 ; gr_plot +FRAME = $E8 +FRAMEL = $E8 +FRAMEH = $E9 +BTC_L = $EA ; audio +BTC_H = $EB ; audio +MASKL = $EC ; gr_putsprite_mask +MASKH = $ED + +;============================================== +; $F0-$FB can re-use in each file +;============================================== + +; D'NI + +SPRITEY = $EE +SPRITEX = $EF +SPRITE_XSIZE = $F0 +SIN_COUNT = $F1 +NUMBER_HIGH = $F2 +NUMBER_LOW = $F3 +DRAW_NUMBER = $FA + +;OUT1 = $F0 +;OUT1H = $F1 +;OUT2 = $F2 +;OUT2H = $F3 +;COMPT1 = $F4 +;COMPT2 = $F5 +;PARAM1 = $F6 +;PARAM2 = $F7 +;PARAM3 = $F8 +;PARAM4 = $F9 +;GRLINE = $FA +;GRLINEH = $FB + + + +; Credits +BACKUP_OUTL = $F2 +BACKUP_OUTH = $F3 + + + +; PLASMACUBE +;OUT1 = $F0 +;OUT1H = $F1 +;OUT2 = $F2 +;OUT2H = $F3 +COMPT1 = $F4 +COMPT2 = $F5 +PARAM1 = $F6 +PARAM2 = $F7 +PARAM3 = $F8 +PARAM4 = $F9 +;GRLINE = $FA +;GRLINEH = $FB + +; PLASMA + +; CUBE +SAVEX = $F3 +SAVEY = $F4 +SUM = $F5 + +; CIRCLES/DRAW_BOXES +COLOR2 = $F3 +X1 = $F4 +X2 = $F5 +Y1 = $F6 +Y2 = $F7 +SCENE_COUNT = $F8 +LAST_TYPE = $F9 + +; lens +LENS_X = $F0 +LENS_Y = $F1 +XADD = $F2 +YADD = $F3 + +; rotozoom +NUM1L = $F0 +NUM1H = $F1 +NUM2L = $F2 +NUM2H = $F3 +RESULT = $F4 ; F5,F6,F7 +SCALE_I = $F8 +SCALE_F = $F9 +ANGLE = $FA + +; credits +SCROLL_X = $F0 + +; scroller +HGR_COPY_Y1 = $F1 +HGR_COPY_Y2 = $F2 +FIRE_COLOR = $F3 +SCROLL_LENGTH = $F4 +OFFSET = $F5 + + +;============================================== +; $FC-$FF we use for in/out pointers +;============================================== + +INL = $FC +INH = $FD +OUTL = $FE +OUTH = $FF + + +; read any file slot 6 version +; based on FASTLD6 and RTS copyright (c) Peter Ferrie 2011-2013,2018 + +; modified to assembled with ca64 -- vmw +; added code to patch it to run from current disk slot -- vmw + + + adrlo = $26 ; constant from boot prom + adrhi = $27 ; constant from boot prom + tmpsec = $3c ; constant from boot prom + reqsec = $3d ; constant from boot prom + sizelo = $44 + sizehi = $45 + secsize = $46 + + ldsizel = $f0 + ldsizeh = $f1 + namlo = $fb + namhi = $fc + step = $fd ; state for stepper motor + tmptrk = $fe ; temporary copy of current track + phase = $ff ; current phase for /seek + diff --git a/graphics/hgr/wipes/zx02_optim.s b/graphics/hgr/wipes/zx02_optim.s new file mode 100644 index 00000000..5eebc2e0 --- /dev/null +++ b/graphics/hgr/wipes/zx02_optim.s @@ -0,0 +1,159 @@ +; De-compressor for ZX02 files +; ---------------------------- +; +; Decompress ZX02 data (6502 optimized format), optimized for speed and size +; 138 bytes code, 58.0 cycles/byte in test file. +; +; Compress with: +; zx02 input.bin output.zx0 +; +; (c) 2022 DMSC +; Code under MIT license, see LICENSE file. + + +;ZP=$80 + +;offset = ZP+0 +;ZX0_src = ZP+2 +;ZX0_dst = ZP+4 +;bitr = ZP+6 +;pntr = ZP+7 + + ; Initial values for offset, source, destination and bitr +;zx0_ini_block: +; .byte $00, $00, comp_data, out_addr, $80 + +;-------------------------------------------------- +; Decompress ZX0 data (6502 optimized format) + +zx02_full_decomp: +; ; Get initialization block +; ldy #7 +; +;copy_init: lda zx0_ini_block-1, y +; sta offset-1, y +; dey +; bne copy_init + + + sta ZX0_dst+1 ; page to output to in A +zx_src_l: + ldy #$dd + sty ZX0_src +zx_src_h: + ldy #$dd + sty ZX0_src+1 + ldy #$80 + sty bitr + ldy #0 + sty offset + sty offset+1 + sty ZX0_dst ; always on even page + +; Decode literal: Ccopy next N bytes from compressed file +; Elias(length) byte[1] byte[2] ... byte[N] +decode_literal: + jsr get_elias + +cop0: lda (ZX0_src), y + inc ZX0_src + bne plus1 + inc ZX0_src+1 +plus1: sta (ZX0_dst),y + inc ZX0_dst + bne plus2 + inc ZX0_dst+1 +plus2: dex + bne cop0 + + asl bitr + bcs dzx0s_new_offset + +; Copy from last offset (repeat N bytes from last offset) +; Elias(length) + jsr get_elias +dzx0s_copy: + lda ZX0_dst + sbc offset ; C=0 from get_elias + sta pntr + lda ZX0_dst+1 + sbc offset+1 + sta pntr+1 + +cop1: + lda (pntr), y + inc pntr + bne plus3 + inc pntr+1 +plus3: sta (ZX0_dst),y + inc ZX0_dst + bne plus4 + inc ZX0_dst+1 +plus4: dex + bne cop1 + + asl bitr + bcc decode_literal + +; Copy from new offset (repeat N bytes from new offset) +; Elias(MSB(offset)) LSB(offset) Elias(length-1) +dzx0s_new_offset: + ; Read elias code for high part of offset + jsr get_elias + beq exit ; Read a 0, signals the end + ; Decrease and divide by 2 + dex + txa + lsr ; @ + sta offset+1 + + ; Get low part of offset, a literal 7 bits + lda (ZX0_src), y + inc ZX0_src + bne plus5 + inc ZX0_src+1 +plus5: + ; Divide by 2 + ror ; @ + sta offset + + ; And get the copy length. + ; Start elias reading with the bit already in carry: + ldx #1 + jsr elias_skip1 + + inx + bcc dzx0s_copy + +; Read an elias-gamma interlaced code. +; ------------------------------------ +get_elias: + ; Initialize return value to #1 + ldx #1 + bne elias_start + +elias_get: ; Read next data bit to result + asl bitr + rol ; @ + tax + +elias_start: + ; Get one bit + asl bitr + bne elias_skip1 + + ; Read new bit from stream + lda (ZX0_src), y + inc ZX0_src + bne plus6 + inc ZX0_src+1 +plus6: ;sec ; not needed, C=1 guaranteed from last bit + rol ;@ + sta bitr + +elias_skip1: + txa + bcs elias_get + ; Got ending bit, stop reading +exit: + rts