From 5f14b954f45d7b83683384e36cb576772f1e0340 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 24 Feb 2018 15:50:10 -0500 Subject: [PATCH] chiptune: move some memory addresses around, probably in final locations --- asm_routines/dos33_routines.s | 2 +- asm_routines/lz4_decode.s | 2 +- chiptune_player/Makefile | 4 ++-- chiptune_player/chiptune_player.s | 36 ++++++++++++++++++++++++++++--- 4 files changed, 37 insertions(+), 7 deletions(-) diff --git a/asm_routines/dos33_routines.s b/asm_routines/dos33_routines.s index d96201c0..65bfc020 100644 --- a/asm_routines/dos33_routines.s +++ b/asm_routines/dos33_routines.s @@ -4,7 +4,7 @@ ; FIXME: make these a parameter ; filename -disk_buff EQU $2000 +disk_buff EQU $1C00 read_size EQU $4000 ; 16kB ;; For the disk-read code diff --git a/asm_routines/lz4_decode.s b/asm_routines/lz4_decode.s index 65484095..b1c699e7 100644 --- a/asm_routines/lz4_decode.s +++ b/asm_routines/lz4_decode.s @@ -36,7 +36,7 @@ ;COUNT EQU $06 ;DELTA EQU $08 -orgoff EQU $6000 ; offset of first unpacked byte +orgoff EQU $5C00 ; offset of first unpacked byte ;====================== ; LZ4 decode diff --git a/chiptune_player/Makefile b/chiptune_player/Makefile index 5915b4dd..f620ced2 100644 --- a/chiptune_player/Makefile +++ b/chiptune_player/Makefile @@ -6,7 +6,7 @@ PNG2GR = ../gr-utils/png2gr all: chiptune_player.dsk chiptune_player.dsk: CHIPTUNE_PLAYER OUT.0 - $(DOS33) -y chiptune_player.dsk BSAVE -a 0x1000 CHIPTUNE_PLAYER + $(DOS33) -y chiptune_player.dsk BSAVE -a 0x0C00 CHIPTUNE_PLAYER $(DOS33) -y chiptune_player.dsk SAVE B ./krw/INTRO2.KRW $(DOS33) -y chiptune_player.dsk SAVE B ./krw/CRMOROS.KRW $(DOS33) -y chiptune_player.dsk SAVE B ./krw/FIGHTING.KRW @@ -27,7 +27,7 @@ chiptune_player.dsk: CHIPTUNE_PLAYER OUT.0 CHIPTUNE_PLAYER: chiptune_player.o - ld65 -o CHIPTUNE_PLAYER chiptune_player.o -C ../linker_scripts/apple2_1000.inc + ld65 -o CHIPTUNE_PLAYER chiptune_player.o -C ../linker_scripts/apple2_c00.inc chiptune_player.o: chiptune_player.s \ ../asm_routines/mockingboard.s \ diff --git a/chiptune_player/chiptune_player.s b/chiptune_player/chiptune_player.s index 64698e6c..e6bc66b1 100644 --- a/chiptune_player/chiptune_player.s +++ b/chiptune_player/chiptune_player.s @@ -1,9 +1,12 @@ ; VMW Chiptune Player .include "zp.inc" + ; program is 4k, so from 0xc00 to 0x1C00 -LZ4_BUFFER EQU $2000 ; 16k for now, FIXME: expand -CHUNK_BUFFER EQU $6000 ; 10.5k, $2A00 +LZ4_BUFFER EQU $1C00 ; 16k for now, FIXME: expand +CHUNK_BUFFER EQU $5C00 ; $5C00 - $9600, 14k, $3A00 + ; trying not to hit DOS at 9600 + ; Reserve 3 chunks plus spare (14k) CHUNKSIZE EQU $3 ;============================= @@ -506,19 +509,46 @@ bloop22: jmp print_both_pages ; print, tail call + ;============================================== + ; plan: takes 256 50Hz to play a chunk + ; need to copy 14 256-byte blocks + ; PLAY A (copying C) + ; PLAY B (copying C) + ; PLAY D (decompressing A/B/C) + ;======================== + ; page copy + ;======================== +page_copy: + + ldx #$00 ; 2 +page_copy_loop: + lda $1000,x ; 4 + sta $1000,X ; 5 + inx ; 2 + bne page_copy_loop ; 2nt/3 + rts ; 6 + ;====================== + ; 2+14*256+6= 3592 ;========== ; filenames ;========== krw_file: + .asciiz "DEATH2.KRW" + .asciiz "DEMO4.KRW" + .asciiz "WAVE.KRW" + .asciiz "SDEMO.KRW" + .asciiz "SPUTNIK.KRW" + .asciiz "ROBOT.KRW" + .asciiz "LYRA2.KRW" + .asciiz "KORO.KRW" .asciiz "INTRO2.KRW" .asciiz "CRMOROS.KRW" .asciiz "CHRISTMAS.KRW" .asciiz "CAMOUFLAGE.KRW" .asciiz "FIGHTING.KRW" .asciiz "UNIVERSE.KRW" - .asciiz "TECHNO.KRW" ;=========