hgr_viewer: merge some of the code

This commit is contained in:
Vince Weaver 2023-02-21 20:38:34 -05:00
parent dc2601d020
commit 9959152370
26 changed files with 1084 additions and 433 deletions

View File

@ -94,7 +94,7 @@ water_line:
jsr random
; adc FRAME
adc FRAME
adc COUNT
and #$1F

View File

@ -14,12 +14,32 @@ color_green = 2
color_blue = 3
color_orange = 4
color_white = 5
work_buffer = $7000 ; work data area,$ from $7000-7fff
TXTCLR = $c050
MIXCLR = $c052
TXTPAGE1 = $c054
LORES = $c056
pageflg = $00
xc = $01
yc = $02
back = $03
evenc = $04
oddc = $05
screen_bit = $06
hptr = $07
cflag = $09
ptr = $0e
match_color = $10
add_coord_lo = $12
plot_coord_lo = $13
add_coord_ptr = $14 ; new coords are added at this point
plot_coord_ptr = $16 ; coords are read from this pointer and plotted
tmp = $18
;*******************************************************************************
;* FILL - flood fill with dither pattern. *
;* *
@ -43,17 +63,6 @@ LORES = $c056
;* Preserves X/Y registers. *
;*******************************************************************************
xc = $01
yc = $02
back = $03
evenc = $04
oddc = $05
match_color = $10
add_coord_lo = $12
plot_coord_lo = $13
add_coord_ptr = $14 ; new coords are added at this point
plot_coord_ptr = $16 ; coords are read from this pointer and plotted
tmp = $18
FILL:
txa
@ -201,13 +210,8 @@ PLT:
;* Preserves X/Y registers. *
;*******************************************************************************
;Clear variables
pageflg = $00
;xc = $01
;yc = $02
;back = $03
;evenc = $04
;oddc = $05
hptr = $07
DITHER1:
txa
@ -245,8 +249,6 @@ L691C:
;* *
;* Preserves X/Y registers. *
;*******************************************************************************
screen_bit = $06
cflag = $09
PLT1:
txa
@ -404,7 +406,7 @@ SCOPE:
;* Preserves X/Y registers. *
;*******************************************************************************
; Clear variables
ptr = $0e
INIT:
txa
@ -450,8 +452,8 @@ L6A17:
;* Preserves X/Y registers. *
;*******************************************************************************
;Clear variables
;xc = $00
;yc = $01
xc_scope = $00
yc_scope = $01
col_ctr = $02
row_ctr = $03
saved_byte_off = $04
@ -463,20 +465,23 @@ start_x = $09
;hptr = $0c
work_ptr = $0e
SCOPE1:
txa
pha
tya
pha
sec ; left edge is XC - 9
lda xc
lda xc_scope
sbc #9
sta xc
sta xc_scope
sta start_x
sec
lda yc ; top edge is YC - 11
lda yc_scope ; top edge is YC - 11
sbc #11
sta yc
sta yc_scope
lda #$00
sta work_ptr_lo
sta work_ptr
@ -500,14 +505,14 @@ SCOPE1:
RowLoop:
lda #38
sta col_ctr
ldx yc ; get the Y-coord
ldx yc_scope ; get the Y-coord
cpx #192 ; did we wrap off the top?
bcs OffEdge ; yes, bail
lda ytable_lo,X ; get the hi-res row base
sta hptr
lda ytable_hi,X
sta hptr+1
ldx xc ; get the X-coord
ldx xc_scope ; get the X-coord
cpx #140 ; did we wrap around to the left when subtracting?
bcc ScanPixel ; no, scan it
@ -588,8 +593,8 @@ L6ACE:
L6AD2:
sty work_ptr_lo
lda start_x ; reset X-coord
sta xc
inc yc ; advance to next row
sta xc_scope
inc yc_scope ; advance to next row
dec row_ctr ; are we done?
beq Scope2 ; yes, move to rendering
jmp RowLoop ; no, loop
@ -606,14 +611,14 @@ lr_ptr = $0e
Scope2:
lda #$01 ; left edge; 1-pixel boundary at sides
sta xc
sta xc_scope
lda #$00 ; no border at top
sta yc
sta yc_scope
sta saved_byte_off
sta work_ptr
lda #>work_buffer
sta work_ptr+1
ldx yc ; get lo-res screen row base
ldx yc_scope ; get lo-res screen row base
L6B12:
lda lr_ytable_lo,X
sta lr_ptr
@ -633,18 +638,18 @@ L6B2A:
sty saved_byte_off
tax ; put color value (0-15) in X
lda lr_color_map,X ; convert it to a lo-res color
ldy xc
ldy xc_scope
sta (lr_ptr),Y ; plot 2x2 pixel (two bytes wide)
iny
sta (lr_ptr),Y
iny
sty xc
sty xc_scope
cpy #39 ; end of row?
bne DrawLoLoop ; not yet, loop
lda #$01 ; reset X-coord
sta xc
inc yc ; advance to next row
ldx yc
sta xc_scope
inc yc_scope ; advance to next row
ldx yc_scope
cpx #23 ; done? (leaves 1-pixel boundary at bottom)
bne L6B12 ; no, loop
@ -757,10 +762,6 @@ ytable_lo:
; Clear variables
;xc = $01
;yc = $02
;back = $03
CLEAN:
txa
pha
@ -820,11 +821,6 @@ ytable_hi:
; Clear variables
;xc = $01
;yc = $02
;hptr = $07
;hptr_h = $08
NEG:
txa
pha

View File

@ -12,7 +12,25 @@ all: hires_plain.dsk hires_jiskey.dsk
hires_special.dsk: HELLO HIRES_SPECIAL \
special/bbl.hgr.zx02 special/bbl2.hgr.zx02 \
special/grl.hgr.zx02 special/1bg.hgr.zx02 \
special/fup.hgr.zx02 special/witch.hgr.zx02
special/fup.hgr.zx02 special/witch.hgr.zx02 \
special/ob.hgr.zx02 special/bg2.hgr.zx02 \
special/oopb.hgr.zx02 special/ooc5.hgr.zx02 \
special/fze.hgr.zx02 special/fjj.hgr.zx02 \
special/dadz.hgr.zx02 special/mope_a2.hgr.zx02 \
special/lh.hgr.zx02 special/fcd.hgr.zx02 \
special/facd.hgr.zx02 special/fif.hgr.zx02 \
special/fif2.hgr.zx02 special/oo4.hgr.zx02 \
special/oo2.hgr.zx02 special/fwq.hgr.zx02 \
special/piz.hgr.zx02 special/cit.hgr.zx02 \
special/cel.hgr.zx02 special/mug.hgr.zx02 \
special/jis.hgr.zx02 special/ojm.hgr.zx02 \
special/nda.hgr.zx02 special/fri.hgr.zx02 \
special/win.hgr.zx02 special/bar.hgr.zx02 \
special/ani.hgr.zx02 special/gld.hgr.zx02 \
special/rnu.hgr.zx02 special/ooh.hgr.zx02 \
special/two.hgr.zx02 special/rug.hgr.zx02 \
special/ndz.hgr.zx02 special/crd.hgr.zx02 \
special/gfa.hgr.zx02 special/sxy.hgr.zx02
cp $(EMPTY_DISK) hires_special.dsk
$(DOS33) -y hires_special.dsk SAVE A HELLO
$(DOS33) -y hires_special.dsk BSAVE -a 0x0c00 HIRES_SPECIAL HIRES
@ -22,16 +40,82 @@ hires_special.dsk: HELLO HIRES_SPECIAL \
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/1bg.hgr.zx02 OBG.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/fup.hgr.zx02 FUP.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/witch.hgr.zx02 WITCH.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/ob.hgr.zx02 OB.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/bg2.hgr.zx02 BG2.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/oopb.hgr.zx02 OOPB.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/ooc5.hgr.zx02 OOC5.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/fze.hgr.zx02 FZE.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/fjj.hgr.zx02 FJJ.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/dadz.hgr.zx02 DADZ.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/mope_a2.hgr.zx02 MOPE.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/lh.hgr.zx02 LH.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/fcd.hgr.zx02 FCD.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/facd.hgr.zx02 FACD.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/fif.hgr.zx02 FIF.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/fif2.hgr.zx02 FIF2.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/oo4.hgr.zx02 OO4.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/oo2.hgr.zx02 OO2.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/fwq.hgr.zx02 FWQ.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/piz.hgr.zx02 PIZ.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/cit.hgr.zx02 CIT.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/cel.hgr.zx02 CEL.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/mug.hgr.zx02 MUG.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/quad.hgr.zx02 QUAD.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/gb.hgr.zx02 GB.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/jis.hgr.zx02 JIS.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/ojm.hgr.zx02 OJM.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/nda.hgr.zx02 NDA.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/fri.hgr.zx02 FRI.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/win.hgr.zx02 WIN.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/bar.hgr.zx02 BAR.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/ani.hgr.zx02 ANI.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/gld.hgr.zx02 GLD.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/rnu.hgr.zx02 RNU.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/ooh.hgr.zx02 OOH.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/two.hgr.zx02 TWO.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/rug.hgr.zx02 RUG.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/ndz.hgr.zx02 NDZ.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/crd.hgr.zx02 CRD.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/gfa.hgr.zx02 GFA.ZX02
$(DOS33) -y hires_special.dsk BSAVE -a 0xa000 ./special/sxy.hgr.zx02 SXY.ZX02
####
hires_plain.dsk: HELLO HIRES_PLAIN \
./plain/gp.hgr.zx02 ./plain/peddle.hgr.zx02
./plain/gp.hgr.zx02 ./plain/peddle.hgr.zx02 \
./plain/gp.hgr.zx02 ./plain/peddle3.hgr.zx02 \
./plain/45.hgr.zx02 ./plain/45b2d.hgr.zx02 \
./plain/45zoom.hgr.zx02 ./plain/zebra.hgr.zx02 \
./plain/Fm2JZOJWAAEVX0l_a2.hgr.zx02 \
./plain/FmH3w6vXwAAd1pF_a2.hgr.zx02 \
./plain/FULUd0EXEAgPCeG_a2.hgr.zx02 \
./plain/FllGu1OWIAAAG8O_a2.hgr.zx02 \
./plain/FpLVqVDaIAk9jtc_a2.hgr.zx02 \
./plain/FXeGzxKXgAEnsbj_a2.hgr.zx02 \
./plain/FmDIeJZXkAA4IiP_a2.hgr.zx02
cp $(EMPTY_DISK) hires_plain.dsk
$(DOS33) -y hires_plain.dsk SAVE A HELLO
$(DOS33) -y hires_plain.dsk BSAVE -a 0x0c00 HIRES_PLAIN HIRES
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/gp.hgr.zx02 GP.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/peddle.hgr.zx02 PEDDLE.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/peddle3.hgr.zx02 PEDDLE3.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/45.hgr.zx02 FORTY5.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/45b2d.hgr.zx02 FORTY5B2D.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/45zoom.hgr.zx02 FORTY5Z.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/zebra.hgr.zx02 ZEB.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/Fm2JZOJWAAEVX0l_a2.hgr.zx02 FM2J.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/FmH3w6vXwAAd1pF_a2.hgr.zx02 FMH3.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/FULUd0EXEAgPCeG_a2.hgr.zx02 FULU.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/FllGu1OWIAAAG8O_a2.hgr.zx02 FLLG.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/FpLVqVDaIAk9jtc_a2.hgr.zx02 FPLV.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/FXeGzxKXgAEnsbj_a2.hgr.zx02 FXEG.ZX02
$(DOS33) -y hires_plain.dsk BSAVE -a 0xa000 ./plain/FmDIeJZXkAA4IiP_a2.hgr.zx02 FMDI.ZX02
####
@ -46,6 +130,8 @@ hires_jiskey.dsk: HELLO HIRES_JISKEY \
$(DOS33) -y hires_jiskey.dsk BSAVE -a 0xa000 ./jiskey/mona.hgr.zx02 MONA.ZX02
$(DOS33) -y hires_jiskey.dsk BSAVE -a 0xa000 ./jiskey/gw.hgr.zx02 GW.ZX02
$(DOS33) -y hires_jiskey.dsk BSAVE -a 0xa000 ./jiskey/skull.hgr.zx02 SKULL.ZX02
$(DOS33) -y hires_jiskey.dsk BSAVE -a 0xa000 ./jiskey/uw.hgr.zx02 UW.ZX02
####
@ -53,7 +139,7 @@ hires_jiskey.dsk: HELLO HIRES_JISKEY \
HIRES_SPECIAL: hires_special.o
ld65 -o HIRES_SPECIAL hires_special.o -C ../../linker_scripts/apple2_c00.inc
hires_special.o: hires_special.s zx02_optim.s \
hires_special.o: hires_special.s hires_main.s zx02_optim.s \
zp.inc hardware.inc
ca65 -o hires_special.o hires_special.s -l hires_special.lst
@ -62,7 +148,7 @@ hires_special.o: hires_special.s zx02_optim.s \
HIRES_PLAIN: hires_plain.o
ld65 -o HIRES_PLAIN hires_plain.o -C ../../linker_scripts/apple2_c00.inc
hires_plain.o: hires_plain.s \
hires_plain.o: hires_plain.s hires_main.s zx02_optim.s \
zp.inc hardware.inc
ca65 -o hires_plain.o hires_plain.s -l hires_plain.lst

View File

@ -2,128 +2,25 @@
;
; by deater (Vince Weaver) <vince@deater.net>
.include "zp.inc"
.include "hardware.inc"
.include "hires_main.s"
hires_start:
MAX_FILES = 6
;===================
; Init RTS disk code
;===================
jsr rts_init
;===================
; set graphics mode
;===================
jsr HOME
bit HIRES
bit FULLGR
bit SET_GR
bit PAGE0
;===================
; Load graphics
;===================
load_loop:
;=============================
lda #<grl_filename
sta OUTL
lda #>grl_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
lda #<witch_filename
sta OUTL
lda #>witch_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
;=============================
lda #<mona_filename
sta OUTL
lda #>mona_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
;=============================
lda #<gw_filename
sta OUTL
lda #>gw_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
;=============================
lda #<skull_filename
sta OUTL
lda #>skull_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
jmp load_loop
;==========================
; Load Image
;===========================
load_image:
jsr opendir_filename ; open and read entire file into memory
; size in ldsizeh:ldsizel (f1/f0)
comp_data = $a000
out_addr = $2000
jsr full_decomp
rts
.align $100
.include "wait_keypress.s"
.include "zx02_optim.s"
.include "rts.s"
filenames_high:
.byte >grl_filename
.byte >witch_filename
.byte >mona_filename
.byte >gw_filename
.byte >skull_filename
.byte >uw_filename
filenames_low:
.byte <grl_filename
.byte <witch_filename
.byte <mona_filename
.byte <gw_filename
.byte <skull_filename
.byte <uw_filename
; filename to open is 30-character Apple text:
grl_filename: ; .byte "GRL.ZX02",0
@ -146,3 +43,8 @@ skull_filename: ; .byte "SKULL.ZX02",0
.byte 'S'|$80,'K'|$80,'U'|$80,'L'|$80,'L'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
uw_filename: ; .byte "UW.ZX02",0
.byte 'U'|$80,'W'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00

View File

@ -0,0 +1,95 @@
; VMW Productions HIRES/ZX02 image viewer
;
; by deater (Vince Weaver) <vince@deater.net>
.include "zp.inc"
.include "hardware.inc"
WHICH = $E0
hires_start:
;===================
; Init RTS disk code
;===================
jsr rts_init
;===================
; set graphics mode
;===================
jsr HOME
bit HIRES
bit FULLGR
bit SET_GR
bit PAGE0
lda #0
sta WHICH
;===================
; Load graphics
;===================
load_loop:
;=============================
ldx WHICH
lda filenames_low,X
sta OUTL
lda filenames_high,X
sta OUTH
jsr load_image
wait_until_keypress:
lda KEYPRESS ; 4
bpl wait_until_keypress ; 3
bit KEYRESET ; clear the keyboard buffer
cmp #$88 ; left button
bne inc_which
dec WHICH
bpl which_ok
ldx #(MAX_FILES-1)
bne store_which ; bra
inc_which:
inc WHICH
ldx WHICH
cpx #MAX_FILES
bcc which_ok ; blt
ldx #0
store_which:
stx WHICH
which_ok:
jmp load_loop
;==========================
; Load Image
;===========================
load_image:
jsr opendir_filename ; open and read entire file into memory
; size in ldsizeh:ldsizel (f1/f0)
comp_data = $a000
out_addr = $2000
jsr full_decomp
rts
.include "zx02_optim.s"
.include "rts.s"
;

View File

@ -1,82 +1,41 @@
; VMW Productions HIRES viewer
;
; by deater (Vince Weaver) <vince@deater.net>
; Some nice hires images
.include "zp.inc"
.include "hardware.inc"
.include "hires_main.s"
hires_start:
MAX_FILES = 14
;===================
; Init RTS disk code
;===================
filenames_low:
.byte <gp_filename
.byte <peddle_filename
.byte <peddle3_filename
.byte <forty5_filename
.byte <forty5b_filename
.byte <forty5z_filename
.byte <zeb_filename
.byte <fm2j_filename
.byte <fmh3_filename
.byte <fulu_filename
.byte <fllg_filename
.byte <fplv_filename
.byte <fxeg_filename
.byte <fmdi_filename
jsr rts_init
filenames_high:
.byte >gp_filename
.byte >peddle_filename
.byte >peddle3_filename
.byte >forty5_filename
.byte >forty5b_filename
.byte >forty5z_filename
.byte >zeb_filename
.byte >fm2j_filename
.byte >fmh3_filename
.byte >fulu_filename
.byte >fllg_filename
.byte >fplv_filename
.byte >fxeg_filename
.byte >fmdi_filename
;===================
; set graphics mode
;===================
jsr HOME
bit HIRES
bit FULLGR
bit SET_GR
bit PAGE0
;===================
; Load graphics
;===================
load_loop:
;=============================
lda #<gp_filename
sta OUTL
lda #>gp_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
lda #<peddle_filename
sta OUTL
lda #>peddle_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
jmp load_loop
;==========================
; Load Image
;===========================
load_image:
jsr opendir_filename ; open and read entire file into memory
; size in ldsizeh:ldsizel (f1/f0)
comp_data = $a000
out_addr = $2000
jsr full_decomp
rts
.align $100
.include "wait_keypress.s"
.include "zx02_optim.s"
.include "rts.s"
; filename to open is 30-character Apple text:
@ -87,3 +46,53 @@ gp_filename: ; .byte "GP.ZX02",0
peddle_filename: ; .byte "PEDDLE.ZX02",0
.byte 'P'|$80,'E'|$80,'D'|$80,'D'|$80,'L'|$80,'E'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
peddle3_filename: ; .byte "PEDDLE3.ZX02",0
.byte 'P'|$80,'E'|$80,'D'|$80,'D'|$80,'L'|$80,'E'|$80,'3'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
forty5_filename: ; .byte "45.ZX02",0
.byte 'F'|$80,'O'|$80,'R'|$80,'T'|$80,'Y'|$80,'5'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
forty5b_filename: ; .byte "45B2D.ZX02",0
.byte 'F'|$80,'O'|$80,'R'|$80,'T'|$80,'Y'|$80,'5'|$80,'B'|$80,'2'|$80,'D'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
forty5z_filename: ; .byte "45Z.ZX02",0
.byte 'F'|$80,'O'|$80,'R'|$80,'T'|$80,'Y'|$80,'5'|$80,'Z'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
zeb_filename: ; .byte "ZEB.ZX02",0
.byte 'Z'|$80,'E'|$80,'B'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fm2j_filename: ; .byte "FM2J.ZX02",0
.byte 'F'|$80,'M'|$80,'2'|$80,'J'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fmh3_filename: ; .byte "FMH3.ZX02",0
.byte 'F'|$80,'M'|$80,'H'|$80,'3'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fulu_filename: ; .byte "FULU.ZX02",0
.byte 'F'|$80,'U'|$80,'L'|$80,'U'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fllg_filename: ; .byte "FLLG.ZX02",0
.byte 'F'|$80,'L'|$80,'L'|$80,'G'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fplv_filename: ; .byte "FPLV.ZX02",0
.byte 'F'|$80,'P'|$80,'L'|$80,'V'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fxeg_filename: ; .byte "FXEG.ZX02",0
.byte 'F'|$80,'X'|$80,'E'|$80,'G'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fmdi_filename: ; .byte "FMDI.ZX02",0
.byte 'F'|$80,'M'|$80,'D'|$80,'I'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00

View File

@ -1,132 +1,101 @@
; VMW Productions HIRES viewer
;
; by deater (Vince Weaver) <vince@deater.net>
; fancy images
.include "zp.inc"
.include "hardware.inc"
.include "hires_main.s"
hires_start:
MAX_FILES = 44
;===================
; Init RTS disk code
;===================
filenames_low:
.byte <bbl_filename
.byte <bbl2_filename
.byte <grl_filename
.byte <obg_filename
.byte <fup_filename
.byte <witch_filename
.byte <ob_filename
.byte <bg2_filename
.byte <oopb_filename
.byte <ooc5_filename
.byte <fze_filename
.byte <fjj_filename
.byte <dadz_filename
.byte <mope_filename
.byte <lh_filename
.byte <fcd_filename
.byte <facd_filename
.byte <fif_filename
.byte <fif2_filename
.byte <oo4_filename
.byte <oo2_filename
.byte <fwq_filename
.byte <piz_filename
.byte <cit_filename
.byte <cel_filename
.byte <mug_filename
.byte <quad_filename
.byte <gb_filename
.byte <jis_filename
.byte <ojm_filename
.byte <nda_filename
.byte <fri_filename
.byte <win_filename
.byte <bar_filename
.byte <ani_filename
.byte <gld_filename
.byte <rnu_filename
.byte <ooh_filename
.byte <two_filename
.byte <rug_filename
.byte <ndz_filename
.byte <crd_filename
.byte <gfa_filename
.byte <sxy_filename
jsr rts_init
filenames_high:
.byte >bbl_filename
.byte >bbl2_filename
.byte >grl_filename
.byte >obg_filename
.byte >fup_filename
.byte >witch_filename
.byte >ob_filename
.byte >bg2_filename
.byte >oopb_filename
.byte >ooc5_filename
.byte >fze_filename
.byte >fjj_filename
.byte >dadz_filename
.byte >mope_filename
.byte >lh_filename
.byte >fcd_filename
.byte >facd_filename
.byte >fif_filename
.byte >fif2_filename
.byte >oo4_filename
.byte >oo2_filename
.byte >fwq_filename
.byte >piz_filename
.byte >cit_filename
.byte >cel_filename
.byte >mug_filename
.byte >quad_filename
.byte >gb_filename
.byte >jis_filename
.byte >ojm_filename
.byte >nda_filename
.byte >fri_filename
.byte >win_filename
.byte >bar_filename
.byte >ani_filename
.byte >gld_filename
.byte >rnu_filename
.byte >ooh_filename
.byte >two_filename
.byte >rug_filename
.byte >ndz_filename
.byte >crd_filename
.byte >gfa_filename
.byte >sxy_filename
;===================
; set graphics mode
;===================
jsr HOME
bit HIRES
bit FULLGR
bit SET_GR
bit PAGE0
;===================
; Load graphics
;===================
load_loop:
;=============================
lda #<bbl_filename
sta OUTL
lda #>bbl_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
lda #<bbl2_filename
sta OUTL
lda #>bbl2_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
lda #<grl_filename
sta OUTL
lda #>grl_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
;=============================
lda #<obg_filename
sta OUTL
lda #>obg_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
lda #<fup_filename
sta OUTL
lda #>fup_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
;=============================
lda #<witch_filename
sta OUTL
lda #>witch_filename
sta OUTH
jsr load_image
jsr wait_until_keypress
;=============================
jmp load_loop
;==========================
; Load Image
;===========================
load_image:
jsr opendir_filename ; open and read entire file into memory
; size in ldsizeh:ldsizel (f1/f0)
comp_data = $a000
out_addr = $2000
jsr full_decomp
rts
.align $100
.include "wait_keypress.s"
.include "zx02_optim.s"
.include "rts.s"
; filename to open is 30-character Apple text:
@ -154,3 +123,155 @@ witch_filename: ; .byte "WITCH.ZX02",0
.byte 'W'|$80,'I'|$80,'T'|$80,'C'|$80,'H'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
ob_filename: ; .byte "OB.ZX02",0
.byte 'O'|$80,'B'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
bg2_filename: ; .byte "BG2.ZX02",0
.byte 'B'|$80,'G'|$80,'2'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
oopb_filename: ; .byte "OOPB.ZX02",0
.byte 'O'|$80,'O'|$80,'P'|$80,'B'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
ooc5_filename: ; .byte "OOC5.ZX02",0
.byte 'O'|$80,'O'|$80,'C'|$80,'5'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fze_filename: ; .byte "FZE.ZX02",0
.byte 'F'|$80,'Z'|$80,'E'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fjj_filename: ; .byte "FJJ.ZX02",0
.byte 'F'|$80,'J'|$80,'J'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
dadz_filename: ; .byte "DADZ.ZX02",0
.byte 'D'|$80,'A'|$80,'D'|$80,'Z'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
mope_filename: ; .byte "MOPE.ZX02",0
.byte 'M'|$80,'O'|$80,'P'|$80,'E'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
lh_filename: ; .byte "LH.ZX02",0
.byte 'L'|$80,'H'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fcd_filename: ; .byte "FCD.ZX02",0
.byte 'F'|$80,'C'|$80,'D'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
facd_filename: ; .byte "FACD.ZX02",0
.byte 'F'|$80,'A'|$80,'C'|$80,'D'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fif_filename: ; .byte "FIF.ZX02",0
.byte 'F'|$80,'I'|$80,'F'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fif2_filename: ; .byte "FIF2.ZX02",0
.byte 'F'|$80,'I'|$80,'F'|$80,'2'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
oo4_filename: ; .byte "OO4.ZX02",0
.byte 'O'|$80,'O'|$80,'4'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
oo2_filename: ; .byte "OO2.ZX02",0
.byte 'O'|$80,'O'|$80,'2'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fwq_filename: ; .byte "FWQ.ZX02",0
.byte 'F'|$80,'W'|$80,'Q'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
piz_filename: ; .byte "PIZ.ZX02",0
.byte 'P'|$80,'I'|$80,'Z'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
cit_filename: ; .byte "CIT.ZX02",0
.byte 'C'|$80,'I'|$80,'T'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
cel_filename: ; .byte "CEL.ZX02",0
.byte 'C'|$80,'E'|$80,'L'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
mug_filename: ; .byte "MUG.ZX02",0
.byte 'M'|$80,'U'|$80,'G'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
quad_filename: ; .byte "QUAD.ZX02",0
.byte 'Q'|$80,'U'|$80,'A'|$80,'D'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
gb_filename: ; .byte "GB.ZX02",0
.byte 'G'|$80,'B'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
jis_filename: ; .byte "JIS.ZX02",0
.byte 'J'|$80,'I'|$80,'S'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
ojm_filename: ; .byte "OJM.ZX02",0
.byte 'O'|$80,'J'|$80,'M'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
nda_filename: ; .byte "NDA.ZX02",0
.byte 'N'|$80,'D'|$80,'A'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
fri_filename: ; .byte "FRI.ZX02",0
.byte 'F'|$80,'R'|$80,'I'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
win_filename: ; .byte "WIN.ZX02",0
.byte 'W'|$80,'I'|$80,'N'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
bar_filename: ; .byte "BAR.ZX02",0
.byte 'B'|$80,'A'|$80,'R'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
ani_filename: ; .byte "ANI.ZX02",0
.byte 'A'|$80,'N'|$80,'I'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
gld_filename: ; .byte "GLD.ZX02",0
.byte 'G'|$80,'L'|$80,'D'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
rnu_filename: ; .byte "RNU.ZX02",0
.byte 'R'|$80,'N'|$80,'U'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
ooh_filename: ; .byte "OOH.ZX02",0
.byte 'O'|$80,'O'|$80,'H'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
two_filename: ; .byte "TWO.ZX02",0
.byte 'T'|$80,'W'|$80,'O'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
rug_filename: ; .byte "RUG.ZX02",0
.byte 'R'|$80,'U'|$80,'G'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
ndz_filename: ; .byte "NDZ.ZX02",0
.byte 'N'|$80,'D'|$80,'Z'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
crd_filename: ; .byte "CRD.ZX02",0
.byte 'C'|$80,'R'|$80,'D'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
gfa_filename: ; .byte "GFA.ZX02",0
.byte 'G'|$80,'F'|$80,'A'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00
sxy_filename: ; .byte "SXY.ZX02",0
.byte 'S'|$80,'X'|$80,'Y'|$80
.byte '.'|$80,'Z'|$80,'X'|$80,'0'|$80,'2'|$80,$00

View File

@ -3,7 +3,8 @@ include ../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02
PNG_TO_HGR = ../../../utils/hgr-utils/png2hgr
all: grl.hgr.zx02 witch.hgr.zx02 mona.hgr.zx02 gw.hgr.zx02 skull.hgr.zx02
all: grl.hgr.zx02 witch.hgr.zx02 mona.hgr.zx02 gw.hgr.zx02 skull.hgr.zx02 \
uw.hgr.zx02
####
@ -40,6 +41,15 @@ skull.hgr: skull.png
skull.hgr.zx02: skull.hgr
$(ZX02) -f skull.hgr skull.hgr.zx02
###
uw.hgr: uw.png
$(PNG_TO_HGR) uw.png > uw.hgr
uw.hgr.zx02: uw.hgr
$(ZX02) -f uw.hgr uw.hgr.zx02
###

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -3,7 +3,43 @@ include ../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02
PNG_TO_HGR = ../../../utils/hgr-utils/png2hgr
all: gp.hgr.zx02 peddle.hgr.zx02
all: 45zoom.hgr.zx02 45b2d.hgr.zx02 45.hgr.zx02 \
gp.hgr.zx02 \
peddle.hgr.zx02 peddle3.hgr.zx02 \
zebra.hgr.zx02 \
Fm2JZOJWAAEVX0l_a2.hgr.zx02 \
FmH3w6vXwAAd1pF_a2.hgr.zx02 \
FULUd0EXEAgPCeG_a2.hgr.zx02 \
FllGu1OWIAAAG8O_a2.hgr.zx02 \
FpLVqVDaIAk9jtc_a2.hgr.zx02 \
FXeGzxKXgAEnsbj_a2.hgr.zx02 \
FmDIeJZXkAA4IiP_a2.hgr.zx02
####
45.hgr.zx02: 45.hgr
$(ZX02) 45.hgr 45.hgr.zx02
45.hgr: 45years1.png
$(PNG_TO_HGR) 45years1.png > 45.hgr
####
peddle3.hgr.zx02: peddle3.hgr
$(ZX02) peddle3.hgr peddle3.hgr.zx02
peddle3.hgr: peddle3.png
$(PNG_TO_HGR) peddle3.png > peddle3.hgr
####
45zoom.hgr.zx02: 45zoom.hgr
$(ZX02) 45zoom.hgr 45zoom.hgr.zx02
####
45b2d.hgr.zx02: 45b2d.hgr
$(ZX02) 45b2d.hgr 45b2d.hgr.zx02
####
@ -13,6 +49,77 @@ gp.hgr.zx02: gp.hgr
gp.hgr: gp.png
$(PNG_TO_HGR) gp.png > gp.hgr
####
zebra.hgr.zx02: zebra.hgr
$(ZX02) zebra.hgr zebra.hgr.zx02
zebra.hgr: zebra.png
$(PNG_TO_HGR) zebra.png > zebra.hgr
####
Fm2JZOJWAAEVX0l_a2.hgr.zx02: Fm2JZOJWAAEVX0l_a2.hgr
$(ZX02) Fm2JZOJWAAEVX0l_a2.hgr Fm2JZOJWAAEVX0l_a2.hgr.zx02
Fm2JZOJWAAEVX0l_a2.hgr: Fm2JZOJWAAEVX0l_a2.png
$(PNG_TO_HGR) Fm2JZOJWAAEVX0l_a2.png > Fm2JZOJWAAEVX0l_a2.hgr
####
FmH3w6vXwAAd1pF_a2.hgr.zx02: FmH3w6vXwAAd1pF_a2.hgr
$(ZX02) FmH3w6vXwAAd1pF_a2.hgr FmH3w6vXwAAd1pF_a2.hgr.zx02
FmH3w6vXwAAd1pF_a2.hgr: FmH3w6vXwAAd1pF_a2.png
$(PNG_TO_HGR) FmH3w6vXwAAd1pF_a2.png > FmH3w6vXwAAd1pF_a2.hgr
####
FULUd0EXEAgPCeG_a2.hgr.zx02: FULUd0EXEAgPCeG_a2.hgr
$(ZX02) FULUd0EXEAgPCeG_a2.hgr FULUd0EXEAgPCeG_a2.hgr.zx02
FULUd0EXEAgPCeG_a2.hgr: FULUd0EXEAgPCeG_a2.png
$(PNG_TO_HGR) FULUd0EXEAgPCeG_a2.png > FULUd0EXEAgPCeG_a2.hgr
####
FllGu1OWIAAAG8O_a2.hgr.zx02: FllGu1OWIAAAG8O_a2.hgr
$(ZX02) FllGu1OWIAAAG8O_a2.hgr FllGu1OWIAAAG8O_a2.hgr.zx02
FllGu1OWIAAAG8O_a2.hgr: FllGu1OWIAAAG8O_a2.png
$(PNG_TO_HGR) FllGu1OWIAAAG8O_a2.png > FllGu1OWIAAAG8O_a2.hgr
####
FpLVqVDaIAk9jtc_a2.hgr.zx02: FpLVqVDaIAk9jtc_a2.hgr
$(ZX02) FpLVqVDaIAk9jtc_a2.hgr FpLVqVDaIAk9jtc_a2.hgr.zx02
FpLVqVDaIAk9jtc_a2.hgr: FpLVqVDaIAk9jtc_a2.png
$(PNG_TO_HGR) FpLVqVDaIAk9jtc_a2.png > FpLVqVDaIAk9jtc_a2.hgr
####
FXeGzxKXgAEnsbj_a2.hgr.zx02: FXeGzxKXgAEnsbj_a2.hgr
$(ZX02) FXeGzxKXgAEnsbj_a2.hgr FXeGzxKXgAEnsbj_a2.hgr.zx02
FXeGzxKXgAEnsbj_a2.hgr: FXeGzxKXgAEnsbj_a2.png
$(PNG_TO_HGR) FXeGzxKXgAEnsbj_a2.png > FXeGzxKXgAEnsbj_a2.hgr
####
FmDIeJZXkAA4IiP_a2.hgr.zx02: FmDIeJZXkAA4IiP_a2.hgr
$(ZX02) FmDIeJZXkAA4IiP_a2.hgr FmDIeJZXkAA4IiP_a2.hgr.zx02
FmDIeJZXkAA4IiP_a2.hgr: FmDIeJZXkAA4IiP_a2.png
$(PNG_TO_HGR) FmDIeJZXkAA4IiP_a2.png > FmDIeJZXkAA4IiP_a2.hgr
####
peddle.hgr.zx02: peddle.hgr

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -4,7 +4,20 @@ ZX02 = ~/research/6502_compression/zx02.git/build/zx02
PNG_TO_HGR = ../../../utils/hgr-utils/png2hgr
all: bbl.hgr.zx02 bbl2.hgr.zx02 \
grl.hgr.zx02 1bg.hgr.zx02 fup.hgr.zx02 witch.hgr.zx02
grl.hgr.zx02 1bg.hgr.zx02 fup.hgr.zx02 witch.hgr.zx02 \
mope_a2.hgr.zx02 ob.hgr.zx02 bg2.hgr.zx02 \
oopb.hgr.zx02 ooc5.hgr.zx02 fze.hgr.zx02 \
fjj.hgr.zx02 dadz.hgr.zx02 lh.hgr.zx02 \
fcd.hgr.zx02 facd.hgr.zx02 fif.hgr.zx02 \
fif2.hgr.zx02 oo4.hgr.zx02 oo2.hgr.zx02 \
fwq.hgr.zx02 piz.hgr.zx02 cit.hgr.zx02 \
cel.hgr.zx02 mug.hgr.zx02 quad.hgr.zx02 \
gb.hgr.zx02 jis.hgr.zx02 ojm.hgr.zx02 \
nda.hgr.zx02 fri.hgr.zx02 win.hgr.zx02 \
bar.hgr.zx02 ani.hgr.zx02 gld.hgr.zx02 \
rnu.hgr.zx02 ooh.hgr.zx02 two.hgr.zx02 \
rug.hgr.zx02 ndz.hgr.zx02 crd.hgr.zx02 \
gfa.hgr.zx02 sxy.hgr.zx02
####
@ -47,6 +60,327 @@ witch.hgr.zx02: witch.hgr
witch.hgr: witch.png
$(PNG_TO_HGR) witch.png > witch.hgr
####
mope_a2.hgr.zx02: mope_a2.hgr
$(ZX02) mope_a2.hgr mope_a2.hgr.zx02
mope_a2.hgr: mope_a2.png
$(PNG_TO_HGR) mope_a2.png > mope_a2.hgr
####
ob.hgr.zx02: ob.hgr
$(ZX02) ob.hgr ob.hgr.zx02
ob.hgr: ob.png
$(PNG_TO_HGR) ob.png > ob.hgr
####
oopb.hgr.zx02: oopb.hgr
$(ZX02) oopb.hgr oopb.hgr.zx02
oopb.hgr: oopb.png
$(PNG_TO_HGR) oopb.png > oopb.hgr
####
ooc5.hgr.zx02: ooc5.hgr
$(ZX02) ooc5.hgr ooc5.hgr.zx02
ooc5.hgr: ooc5.png
$(PNG_TO_HGR) ooc5.png > ooc5.hgr
####
bg2.hgr.zx02: bg2.hgr
$(ZX02) bg2.hgr bg2.hgr.zx02
bg2.hgr: bg2.png
$(PNG_TO_HGR) bg2.png > bg2.hgr
####
fze.hgr.zx02: fze.hgr
$(ZX02) fze.hgr fze.hgr.zx02
fze.hgr: fze.png
$(PNG_TO_HGR) fze.png > fze.hgr
####
fjj.hgr.zx02: fjj.hgr
$(ZX02) fjj.hgr fjj.hgr.zx02
fjj.hgr: fjj.png
$(PNG_TO_HGR) fjj.png > fjj.hgr
####
dadz.hgr.zx02: dadz.hgr
$(ZX02) dadz.hgr dadz.hgr.zx02
dadz.hgr: dadz.png
$(PNG_TO_HGR) dadz.png > dadz.hgr
####
lh.hgr.zx02: lh.hgr
$(ZX02) lh.hgr lh.hgr.zx02
lh.hgr: lh.png
$(PNG_TO_HGR) lh.png > lh.hgr
####
fcd.hgr.zx02: fcd.hgr
$(ZX02) fcd.hgr fcd.hgr.zx02
fcd.hgr: fcd.png
$(PNG_TO_HGR) fcd.png > fcd.hgr
####
facd.hgr.zx02: facd.hgr
$(ZX02) facd.hgr facd.hgr.zx02
facd.hgr: facd.png
$(PNG_TO_HGR) facd.png > facd.hgr
####
fif.hgr.zx02: fif.hgr
$(ZX02) fif.hgr fif.hgr.zx02
fif.hgr: fif.png
$(PNG_TO_HGR) fif.png > fif.hgr
####
fif2.hgr.zx02: fif2.hgr
$(ZX02) fif2.hgr fif2.hgr.zx02
fif2.hgr: fif2.png
$(PNG_TO_HGR) fif2.png > fif2.hgr
####
oo4.hgr.zx02: oo4.hgr
$(ZX02) oo4.hgr oo4.hgr.zx02
oo4.hgr: oo4.png
$(PNG_TO_HGR) oo4.png > oo4.hgr
####
oo2.hgr.zx02: oo2.hgr
$(ZX02) oo2.hgr oo2.hgr.zx02
oo2.hgr: oo2.png
$(PNG_TO_HGR) oo2.png > oo2.hgr
####
fwq.hgr.zx02: fwq.hgr
$(ZX02) fwq.hgr fwq.hgr.zx02
fwq.hgr: fwq.png
$(PNG_TO_HGR) fwq.png > fwq.hgr
####
piz.hgr.zx02: piz.hgr
$(ZX02) piz.hgr piz.hgr.zx02
piz.hgr: piz.png
$(PNG_TO_HGR) piz.png > piz.hgr
####
cit.hgr.zx02: cit.hgr
$(ZX02) cit.hgr cit.hgr.zx02
cit.hgr: cit.png
$(PNG_TO_HGR) cit.png > cit.hgr
####
cel.hgr.zx02: cel.hgr
$(ZX02) cel.hgr cel.hgr.zx02
cel.hgr: cel.png
$(PNG_TO_HGR) cel.png > cel.hgr
####
mug.hgr.zx02: mug.hgr
$(ZX02) mug.hgr mug.hgr.zx02
mug.hgr: mug.png
$(PNG_TO_HGR) mug.png > mug.hgr
####
quad.hgr.zx02: quad.hgr
$(ZX02) quad.hgr quad.hgr.zx02
quad.hgr: quad.png
$(PNG_TO_HGR) quad.png > quad.hgr
####
gb.hgr.zx02: gb.hgr
$(ZX02) gb.hgr gb.hgr.zx02
gb.hgr: gb.png
$(PNG_TO_HGR) gb.png > gb.hgr
####
jis.hgr.zx02: jis.hgr
$(ZX02) jis.hgr jis.hgr.zx02
jis.hgr: jis.png
$(PNG_TO_HGR) jis.png > jis.hgr
####
ojm.hgr.zx02: ojm.hgr
$(ZX02) ojm.hgr ojm.hgr.zx02
ojm.hgr: ojm.png
$(PNG_TO_HGR) ojm.png > ojm.hgr
####
nda.hgr.zx02: nda.hgr
$(ZX02) nda.hgr nda.hgr.zx02
nda.hgr: nda.png
$(PNG_TO_HGR) nda.png > nda.hgr
####
fri.hgr.zx02: fri.hgr
$(ZX02) fri.hgr fri.hgr.zx02
fri.hgr: fri.png
$(PNG_TO_HGR) fri.png > fri.hgr
####
win.hgr.zx02: win.hgr
$(ZX02) win.hgr win.hgr.zx02
win.hgr: win.png
$(PNG_TO_HGR) win.png > win.hgr
####
bar.hgr.zx02: bar.hgr
$(ZX02) bar.hgr bar.hgr.zx02
bar.hgr: bar.png
$(PNG_TO_HGR) bar.png > bar.hgr
####
ani.hgr.zx02: ani.hgr
$(ZX02) ani.hgr ani.hgr.zx02
ani.hgr: ani.png
$(PNG_TO_HGR) ani.png > ani.hgr
####
gld.hgr.zx02: gld.hgr
$(ZX02) gld.hgr gld.hgr.zx02
gld.hgr: gld.png
$(PNG_TO_HGR) gld.png > gld.hgr
####
rnu.hgr.zx02: rnu.hgr
$(ZX02) rnu.hgr rnu.hgr.zx02
rnu.hgr: rnu.png
$(PNG_TO_HGR) rnu.png > rnu.hgr
####
ooh.hgr.zx02: ooh.hgr
$(ZX02) ooh.hgr ooh.hgr.zx02
ooh.hgr: ooh.png
$(PNG_TO_HGR) ooh.png > ooh.hgr
####
two.hgr.zx02: two.hgr
$(ZX02) two.hgr two.hgr.zx02
two.hgr: two.png
$(PNG_TO_HGR) two.png > two.hgr
####
rug.hgr.zx02: rug.hgr
$(ZX02) rug.hgr rug.hgr.zx02
rug.hgr: rug.png
$(PNG_TO_HGR) rug.png > rug.hgr
####
ndz.hgr.zx02: ndz.hgr
$(ZX02) ndz.hgr ndz.hgr.zx02
ndz.hgr: ndz.png
$(PNG_TO_HGR) ndz.png > ndz.hgr
####
crd.hgr.zx02: crd.hgr
$(ZX02) crd.hgr crd.hgr.zx02
crd.hgr: crd.png
$(PNG_TO_HGR) crd.png > crd.hgr
####
gfa.hgr.zx02: gfa.hgr
$(ZX02) gfa.hgr gfa.hgr.zx02
gfa.hgr: gfa.png
$(PNG_TO_HGR) gfa.png > gfa.hgr
####
sxy.hgr.zx02: sxy.hgr
$(ZX02) sxy.hgr sxy.hgr.zx02
sxy.hgr: sxy.png
$(PNG_TO_HGR) sxy.png > sxy.hgr
###
grl.hgr.zx02: grl.hgr
@ -56,5 +390,5 @@ grl.hgr.zx02: grl.hgr
clean:
rm -f *~ *.o *.lst
rm -f *~ *.o *.lst *.zx02

View File

@ -10,11 +10,12 @@ EMPTY_DISK = ../../empty_disk/empty.dsk
all: sound.dsk
sound.dsk: HELLO SOUND TINY
sound.dsk: HELLO SOUND TINY TEST_AUDIO
cp $(EMPTY_DISK) sound.dsk
$(DOS33) -y sound.dsk SAVE A HELLO
$(DOS33) -y sound.dsk BSAVE -a 0x1000 SOUND
$(DOS33) -y sound.dsk BSAVE -a 0x1000 TINY
$(DOS33) -y sound.dsk BSAVE -a 0x1000 TEST_AUDIO
###
@ -34,12 +35,21 @@ tiny.o: tiny.s
###
TEST_AUDIO: test_audio.o
ld65 -o TEST_AUDIO test_audio.o -C ../../linker_scripts/apple2_1000.inc
test_audio.o: test_audio.s audio.s
ca65 -o test_audio.o test_audio.s -l test_audio.lst
###
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
####
clean:
rm -f *~ *.o *.lst HELLO SOUND TINY
rm -f *~ *.o *.lst HELLO SOUND TINY TEST_AUDIO

View File

@ -6,67 +6,48 @@ SPEAKER= $C030
WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us
; zero page use
HALF_PERIOD = $FF
BTC_L = $FE
BTC_H = $FF
SAVEL = $FC
SAVEH = $FD
test_sound:
jsr tiny_sound_effect
test_audio:
; lda #$D0
; sta SAVEH
; lda #$00
; sta SAVEL
test_loop:
; lda SAVEH
; sta BTC_H
; lda SAVEL
; sta BTC_L
lda #<duck_sound
sta BTC_L
lda #>duck_sound
sta BTC_H
ldx #3
jsr play_audio
jsr wait_until_keypress
inc SAVEH
jmp test_loop
bob:
jmp bob
wait_until_keypress:
lda KEYPRESS
bpl wait_until_keypress
bit KEYRESET
lda KEYPRESS
bpl wait_until_keypress
bit KEYRESET
jmp test_sound
tiny_sound_effect:
ldy #0
freq_smc:
lda #$40
sta HALF_PERIOD
play_note:
loop_half_period:
lda $C030 ; 4 cycles
ldx HALF_PERIOD ; 3 cycles
loop_nops:
pha ; 4 cycles
plp ; 4 cycles
dex ; 2 cycles
bne loop_nops ; 3 cycles
; Testing duration loop
dey ; 2 cycles
bne loop_half_period ; 3 cycles
lsr freq_smc+1
lsr pattern
beq end
bcc skip_wait
wait_smc:
lda #80
jsr WAIT
skip_wait:
beq tiny_sound_effect ; bra
end:
rts
.include "audio.s"
pattern:
.byte $13
duck_sound:
.incbin "duck.btc"