mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-10-12 05:24:02 +00:00
dya: working 6-channels, at least I think so
This commit is contained in:
parent
b3ab064899
commit
7a83fa05af
@ -13,7 +13,7 @@ chiptune_dya.dsk: CHIPTUNE_PLAYER HELLO
|
|||||||
$(DOS33) -y chiptune_dya.dsk SAVE A HELLO
|
$(DOS33) -y chiptune_dya.dsk SAVE A HELLO
|
||||||
$(DOS33) -y chiptune_dya.dsk BSAVE -a 0x0800 CHIPTUNE_PLAYER
|
$(DOS33) -y chiptune_dya.dsk BSAVE -a 0x0800 CHIPTUNE_PLAYER
|
||||||
$(DOS33) -y chiptune_dya.dsk BSAVE -a 0x1c00 DOTD1.KRW
|
$(DOS33) -y chiptune_dya.dsk BSAVE -a 0x1c00 DOTD1.KRW
|
||||||
$(DOS33) -y chiptune_dya.dsk BSAVE -a 0x1c00 DOTD2.KRW
|
$(DOS33) -y chiptune_dya.dsk BSAVE -a 0xd100 DOTD2.KRW
|
||||||
|
|
||||||
HELLO: hello.bas
|
HELLO: hello.bas
|
||||||
../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO
|
../asoft_basic-utils/tokenize_asoft < hello.bas > HELLO
|
||||||
|
25
dya/README
Normal file
25
dya/README
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Horrible hack of the VMW chiptune player code to try to play a 6-channel file.
|
||||||
|
|
||||||
|
There's really not enough RAM to do things this way.
|
||||||
|
|
||||||
|
Proper solution is to write a real pt3 tracker.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Hacks:
|
||||||
|
Needs 10k+10k RAM for each KRW file (converted PT3)
|
||||||
|
Needs 14k+14k for buffers
|
||||||
|
Needs 4k for player
|
||||||
|
==================
|
||||||
|
52k RAM, more than we have on stock Apple II
|
||||||
|
|
||||||
|
We cheat and use language card which gives up 64k in theory.
|
||||||
|
|
||||||
|
The problem is we use interrupts, and the interrupt routine is
|
||||||
|
hard-coded to jump into the $F000 range. IIe/IIc might
|
||||||
|
be smart enough to handle this, but older machines are not.
|
||||||
|
|
||||||
|
Hack: copy the FXXX range into the language card so it doesn't
|
||||||
|
matter?
|
||||||
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
|||||||
; program is ~4k, so from 0xc00 to 0x1C00
|
; program is ~4k, so from 0xc00 to 0x1C00
|
||||||
LZ4_BUFFER EQU $1C00 ; $1C00 - $4400, 10k = $2800
|
LZ4_BUFFER EQU $1C00 ; $1C00 - $4400, 10k = $2800
|
||||||
DISK_BUFFER EQU $4400 ; for disk loading
|
DISK_BUFFER EQU $4400 ; for disk loading
|
||||||
|
LZ4_BUFFER2 EQU $D100 ; $D100 - $F900
|
||||||
UNPACK_BUFFER1 EQU $5000 ; $5000 - $8800, 14k, $3800
|
UNPACK_BUFFER1 EQU $5000 ; $5000 - $8800, 14k, $3800
|
||||||
UNPACK_BUFFER2 EQU $8800 ; $8800 - $C000, 14k, $3800
|
UNPACK_BUFFER2 EQU $8800 ; $8800 - $C000, 14k, $3800
|
||||||
; by using qkumba's RTS code
|
; by using qkumba's RTS code
|
||||||
@ -13,7 +14,7 @@ UNPACK_BUFFER2 EQU $8800 ; $8800 - $C000, 14k, $3800
|
|||||||
; $6000 - $C000 = 24k
|
; $6000 - $C000 = 24k
|
||||||
|
|
||||||
|
|
||||||
NUM_FILES EQU 2
|
NUM_FILES EQU 1
|
||||||
|
|
||||||
|
|
||||||
jmp chiptune_setup
|
jmp chiptune_setup
|
||||||
@ -33,6 +34,25 @@ chiptune_setup:
|
|||||||
|
|
||||||
jsr rts_init
|
jsr rts_init
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
copy_from_ff00:
|
||||||
|
lda $ff00,X
|
||||||
|
sta $6000,X
|
||||||
|
inx
|
||||||
|
bne copy_from_ff00
|
||||||
|
|
||||||
|
; Setup language card
|
||||||
|
lda $C08B ; 4
|
||||||
|
lda $C08B ; 4 ; RR C08B = read RAM/write RAM
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
copy_to_ff00:
|
||||||
|
lda $6000,X
|
||||||
|
sta $ff00,X
|
||||||
|
inx
|
||||||
|
bne copy_to_ff00
|
||||||
|
|
||||||
|
|
||||||
; init variables
|
; init variables
|
||||||
|
|
||||||
lda #0
|
lda #0
|
||||||
@ -264,6 +284,42 @@ new_song:
|
|||||||
sta OUTH
|
sta OUTH
|
||||||
jsr print_both_pages
|
jsr print_both_pages
|
||||||
|
|
||||||
|
;===========================
|
||||||
|
; Load 2nd file first
|
||||||
|
;===========================
|
||||||
|
; needs to be space-padded $A0 30-byte filename
|
||||||
|
; this is hard-coded for now
|
||||||
|
|
||||||
|
lda #<readfile_filename
|
||||||
|
sta namlo
|
||||||
|
lda #>readfile_filename
|
||||||
|
sta namhi
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
ldx #30 ; 30 chars
|
||||||
|
name_loop2:
|
||||||
|
lda filename2,Y
|
||||||
|
beq space_loop2
|
||||||
|
ora #$80
|
||||||
|
sta (namlo),Y
|
||||||
|
iny
|
||||||
|
dex
|
||||||
|
bne name_loop2
|
||||||
|
beq done_name_loop2
|
||||||
|
space_loop2:
|
||||||
|
lda #$a0 ; pad with ' '
|
||||||
|
sta (namlo),Y
|
||||||
|
iny
|
||||||
|
dex
|
||||||
|
bne space_loop2
|
||||||
|
|
||||||
|
done_name_loop2:
|
||||||
|
|
||||||
|
; open and read a file
|
||||||
|
; loads to whatever it was BSAVED at (default is $D100)
|
||||||
|
|
||||||
|
jsr read_file ; read KRW file from disk
|
||||||
|
|
||||||
|
|
||||||
;===========================
|
;===========================
|
||||||
; Load in KRW file
|
; Load in KRW file
|
||||||
@ -359,7 +415,24 @@ done_name_loop:
|
|||||||
sta $777
|
sta $777
|
||||||
sta $B77
|
sta $B77
|
||||||
|
|
||||||
; Point LZ4 src at proper place
|
|
||||||
|
; Point Second LZ4 src at proper place
|
||||||
|
|
||||||
|
ldy #0
|
||||||
|
lda #>(LZ4_BUFFER2+3)
|
||||||
|
sta LZ4_SRC2+1
|
||||||
|
lda #<(LZ4_BUFFER2+3)
|
||||||
|
sta LZ4_SRC2
|
||||||
|
|
||||||
|
lda (LZ4_SRC2),Y ; get header skip
|
||||||
|
clc
|
||||||
|
adc LZ4_SRC2
|
||||||
|
sta LZ4_SRC2
|
||||||
|
lda LZ4_SRC2+1
|
||||||
|
adc #0
|
||||||
|
sta LZ4_SRC2+1
|
||||||
|
|
||||||
|
; Point First LZ4 src at proper place
|
||||||
|
|
||||||
ldy #0
|
ldy #0
|
||||||
lda #>(LZ4_BUFFER+3)
|
lda #>(LZ4_BUFFER+3)
|
||||||
@ -398,11 +471,9 @@ done_name_loop:
|
|||||||
|
|
||||||
lda LZ4_SRC
|
lda LZ4_SRC
|
||||||
sta LZ4_SRC1
|
sta LZ4_SRC1
|
||||||
sta LZ4_SRC2
|
|
||||||
|
|
||||||
lda LZ4_SRC+1
|
lda LZ4_SRC+1
|
||||||
sta LZ4_SRC1+1
|
sta LZ4_SRC1+1
|
||||||
sta LZ4_SRC2+1
|
|
||||||
|
|
||||||
jsr setup_next_subsong
|
jsr setup_next_subsong
|
||||||
|
|
||||||
@ -673,7 +744,7 @@ krw_file:
|
|||||||
.include "../asm_routines/gr_fast_clear.s"
|
.include "../asm_routines/gr_fast_clear.s"
|
||||||
.include "../asm_routines/pageflip.s"
|
.include "../asm_routines/pageflip.s"
|
||||||
;.include "../asm_routines/gr_unrle.s"
|
;.include "../asm_routines/gr_unrle.s"
|
||||||
.include "../asm_routines/gr_setpage.s"
|
.include "gr_setpage.s"
|
||||||
.include "qkumba_rts.s"
|
.include "qkumba_rts.s"
|
||||||
.include "../asm_routines/gr_hlin.s"
|
.include "../asm_routines/gr_hlin.s"
|
||||||
.include "lz4_decode.s"
|
.include "lz4_decode.s"
|
||||||
|
12
dya/gr_setpage.s
Normal file
12
dya/gr_setpage.s
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
;==========================================================
|
||||||
|
; set_gr_page0
|
||||||
|
;==========================================================
|
||||||
|
;
|
||||||
|
set_gr_page0:
|
||||||
|
bit PAGE0 ; set page 0
|
||||||
|
bit LORES ; Lo-res graphics
|
||||||
|
bit TEXTGR ; mixed gr/text mode
|
||||||
|
bit SET_GR ; set graphics
|
||||||
|
rts
|
||||||
|
|
@ -1,3 +1,4 @@
|
|||||||
.asciiz "DOTD1.KRW"
|
.asciiz "DOTD1.KRW"
|
||||||
|
filename2:
|
||||||
.asciiz "DOTD2.KRW"
|
.asciiz "DOTD2.KRW"
|
||||||
|
|
||||||
|
32
dya/zp.inc
32
dya/zp.inc
@ -223,25 +223,25 @@ PTRIG EQU $C070
|
|||||||
|
|
||||||
;; BASIC ROUTINES
|
;; BASIC ROUTINES
|
||||||
|
|
||||||
NORMAL EQU $F273
|
;NORMAL EQU $F273
|
||||||
|
|
||||||
;; MONITOR ROUTINES
|
;; MONITOR ROUTINES
|
||||||
|
|
||||||
HLINE EQU $F819 ;; HLINE Y,$2C at A
|
;HLINE EQU $F819 ;; HLINE Y,$2C at A
|
||||||
VLINE EQU $F828 ;; VLINE A,$2D at Y
|
;VLINE EQU $F828 ;; VLINE A,$2D at Y
|
||||||
CLRSCR EQU $F832 ;; Clear low-res screen
|
;CLRSCR EQU $F832 ;; Clear low-res screen
|
||||||
CLRTOP EQU $F836 ;; clear only top of low-res screen
|
;CLRTOP EQU $F836 ;; clear only top of low-res screen
|
||||||
SETCOL EQU $F864 ;; COLOR=A
|
;SETCOL EQU $F864 ;; COLOR=A
|
||||||
TEXT EQU $FB36
|
;TEXT EQU $FB36
|
||||||
TABV EQU $FB5B ;; VTAB to A
|
;TABV EQU $FB5B ;; VTAB to A
|
||||||
BASCALC EQU $FBC1 ;;
|
;BASCALC EQU $FBC1 ;;
|
||||||
VTAB EQU $FC22 ;; VTAB to CV
|
;VTAB EQU $FC22 ;; VTAB to CV
|
||||||
HOME EQU $FC58 ;; Clear the text screen
|
;HOME EQU $FC58 ;; Clear the text screen
|
||||||
WAIT EQU $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
;WAIT EQU $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||||
SETINV EQU $FE80 ;; INVERSE
|
;SETINV EQU $FE80 ;; INVERSE
|
||||||
SETNORM EQU $FE84 ;; NORMAL
|
;SETNORM EQU $FE84 ;; NORMAL
|
||||||
COUT EQU $FDED ;; output A to screen
|
;COUT EQU $FDED ;; output A to screen
|
||||||
COUT1 EQU $FDF0 ;; output A to screen
|
;COUT1 EQU $FDF0 ;; output A to screen
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user