From bb5f5c3aec98e5aee84cb0a1a7643f551dfb96c7 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 17 Feb 2018 22:45:17 -0500 Subject: [PATCH] chiptune: read data from disk --- asm_routines/dos33_routines.s | 19 +-- chiptune_player/Makefile | 4 +- chiptune_player/chiptune_player.s | 42 +++--- chiptune_player/zp.inc | 218 ++++++++++++++++-------------- 4 files changed, 153 insertions(+), 130 deletions(-) diff --git a/asm_routines/dos33_routines.s b/asm_routines/dos33_routines.s index 3a93b3cb..8788ab7f 100644 --- a/asm_routines/dos33_routines.s +++ b/asm_routines/dos33_routines.s @@ -1,16 +1,17 @@ ; File I/O routines based on sample code in ; "Beneath Apple DOS" by Don Worth and Pieter Lechner -; FIXME: make this a parameter +; FIXME: make these a parameter disk_buff EQU $6000 +read_size EQU $2A00 ; (3*256*14) ;; For the disk-read code -RWTSH EQU $F1 -RWTSL EQU $F0 -DOSBUFH EQU $EF -DOSBUFL EQU $EE -FILEMH EQU $ED -FILEML EQU $EC +;RWTSH EQU $F1 +;RWTSL EQU $F0 +;DOSBUFH EQU $EF +;DOSBUFL EQU $EE +;FILEMH EQU $ED +;FILEML EQU $EC ;; DOS Constants OPEN EQU $01 @@ -220,10 +221,10 @@ dos33_read: sta (FILEML),y ldy #6 ; point to number of bytes to read - lda #$00 + lda #>read_size sta (FILEML),y ; we want to read 255 bytes iny - lda #$2a + lda #CHUNK_BUFFER - sta INH - lda #chip_title sta GBASH - ; Load offscreen + ; Load image lda #<$400 sta BASL lda #>$400 @@ -130,6 +114,28 @@ mockingboard_found: jsr load_rle_gr + ;=========================== + ; init pointer to the music + ;=========================== + + jsr read_file + + lda #>CHUNK_BUFFER + sta INH + lda #