mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-12 15:30:55 +00:00
chiptune: read data from disk
This commit is contained in:
parent
74e9595312
commit
bb5f5c3aec
@ -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 #<read_size
|
||||
sta (FILEML),y
|
||||
|
||||
ldy #8 ; buffer address
|
||||
|
@ -15,8 +15,8 @@ CHIPTUNE_PLAYER: chiptune_player.o
|
||||
|
||||
chiptune_player.o: chiptune_player.s \
|
||||
../asm_routines/mockingboard.s \
|
||||
../asm_routines/lzss_decompress.s \
|
||||
chip_title.inc
|
||||
../asm_routines/dos33_routines.s \
|
||||
chip_title.inc zp.inc
|
||||
ca65 -o chiptune_player.o chiptune_player.s -l chiptune_player.lst
|
||||
|
||||
clean:
|
||||
|
@ -55,16 +55,6 @@ mockingboard_found:
|
||||
jsr reset_ay_both
|
||||
jsr clear_ay_both
|
||||
|
||||
;===========================
|
||||
; init pointer to the music
|
||||
;===========================
|
||||
|
||||
lda #>CHUNK_BUFFER
|
||||
sta INH
|
||||
lda #<CHUNK_BUFFER
|
||||
sta INL
|
||||
lda #$0
|
||||
sta MB_CHUNK
|
||||
|
||||
;=========================
|
||||
; Setup Interrupt Handler
|
||||
@ -99,12 +89,6 @@ mockingboard_found:
|
||||
|
||||
; 4fe7 / 1e6 = .020s, 50Hz
|
||||
|
||||
;============================
|
||||
; Enable 6502 interrupts
|
||||
;============================
|
||||
;
|
||||
cli ; clear interrupt mask
|
||||
|
||||
|
||||
;============================
|
||||
; Setup Graphics
|
||||
@ -122,7 +106,7 @@ mockingboard_found:
|
||||
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 #<CHUNK_BUFFER
|
||||
sta INL
|
||||
lda #$0
|
||||
sta MB_CHUNK
|
||||
|
||||
|
||||
;============================
|
||||
; Enable 6502 interrupts
|
||||
;============================
|
||||
;
|
||||
cli ; clear interrupt mask
|
||||
|
||||
|
||||
|
||||
|
||||
;============================
|
||||
; Loop forever
|
||||
@ -237,7 +243,7 @@ done_interrupt:
|
||||
.include "../asm_routines/gr_offsets.s"
|
||||
.include "../asm_routines/text_print.s"
|
||||
.include "../asm_routines/mockingboard_a.s"
|
||||
.include "../asm_routines/lzss_decompress.s"
|
||||
;.include "../asm_routines/lzss_decompress.s"
|
||||
.include "../asm_routines/gr_fast_clear.s"
|
||||
.include "../asm_routines/pageflip.s"
|
||||
.include "../asm_routines/gr_unrle.s"
|
||||
|
@ -2,119 +2,135 @@
|
||||
|
||||
;; Zero page monitor routines addresses
|
||||
|
||||
WNDLFT EQU $20
|
||||
WNDWDTH EQU $21
|
||||
WNDTOP EQU $22
|
||||
WNDBTM EQU $23
|
||||
CH EQU $24
|
||||
CV EQU $25
|
||||
GBASL EQU $26
|
||||
GBASH EQU $27
|
||||
BASL EQU $28
|
||||
BASH EQU $29
|
||||
H2 EQU $2C
|
||||
V2 EQU $2D
|
||||
MASK EQU $2E
|
||||
COLOR EQU $30
|
||||
INVFLG EQU $32
|
||||
;WNDLFT EQU $20
|
||||
;WNDWDTH EQU $21
|
||||
;WNDTOP EQU $22
|
||||
;WNDBTM EQU $23
|
||||
CH EQU $24
|
||||
CV EQU $25
|
||||
GBASL EQU $26
|
||||
GBASH EQU $27
|
||||
BASL EQU $28
|
||||
BASH EQU $29
|
||||
;H2 EQU $2C
|
||||
;V2 EQU $2D
|
||||
;MASK EQU $2E
|
||||
COLOR EQU $30
|
||||
;INVFLG EQU $32
|
||||
|
||||
; More zero-page addresses
|
||||
; we try not to conflict with anything DOS, MONITOR or BASIC related
|
||||
|
||||
COLOR1 EQU $E0
|
||||
COLOR2 EQU $E1
|
||||
MATCH EQU $E2
|
||||
XX EQU $E3
|
||||
YY EQU $E4
|
||||
YADD EQU $E5
|
||||
LOOP EQU $E6
|
||||
MEMPTRL EQU $E7
|
||||
MEMPTRH EQU $E8
|
||||
NAMEL EQU $E9
|
||||
NAMEH EQU $EA
|
||||
NAMEX EQU $EB
|
||||
CHAR EQU $EC
|
||||
DISP_PAGE EQU $ED
|
||||
DRAW_PAGE EQU $EE
|
||||
|
||||
FIRST EQU $F0
|
||||
LASTKEY EQU $F1
|
||||
PADDLE_STATUS EQU $F2
|
||||
XPOS EQU $F3
|
||||
YPOS EQU $F4
|
||||
TEMP EQU $FA
|
||||
RUN EQU $FA
|
||||
TEMP2 EQU $FB
|
||||
TEMPY EQU $FB
|
||||
INL EQU $FC
|
||||
INH EQU $FD
|
||||
OUTL EQU $FE
|
||||
OUTH EQU $FF
|
||||
; dos33 zero page = 26-2f, 35-38, 3e 3f 40-4d
|
||||
; overlap applesoft 67-6a,6f,70,af,b0,ca-cd,d8
|
||||
|
||||
|
||||
;; Flying Routine Only
|
||||
RWTSL EQU $60
|
||||
RWTSH EQU $61
|
||||
DOSBUFL EQU $62
|
||||
DOSBUFH EQU $63
|
||||
FILEML EQU $64
|
||||
FILEMH EQU $65
|
||||
|
||||
TURNING EQU $60
|
||||
|
||||
|
||||
|
||||
;TURNING EQU $60
|
||||
;SCREEN_X EQU $61 ; not used?
|
||||
SCREEN_Y EQU $62
|
||||
ANGLE EQU $63
|
||||
HORIZ_SCALE_I EQU $64
|
||||
HORIZ_SCALE_F EQU $65
|
||||
FACTOR_I EQU $66
|
||||
FACTOR_F EQU $67
|
||||
DX_I EQU $68
|
||||
DX_F EQU $69
|
||||
SPACEX_I EQU $6A
|
||||
SPACEX_F EQU $6B
|
||||
CX_I EQU $6C
|
||||
CX_F EQU $6D
|
||||
DY_I EQU $6E
|
||||
DY_F EQU $6F
|
||||
SPACEY_I EQU $70
|
||||
SPACEY_F EQU $71
|
||||
CY_I EQU $72
|
||||
CY_F EQU $73
|
||||
TEMP_I EQU $74
|
||||
TEMP_F EQU $75
|
||||
DISTANCE_I EQU $76
|
||||
DISTANCE_F EQU $77
|
||||
SPACEZ_I EQU $78
|
||||
SPACEZ_F EQU $79
|
||||
DRAW_SPLASH EQU $7A
|
||||
SPEED EQU $7B
|
||||
SPLASH_COUNT EQU $7C
|
||||
OVER_LAND EQU $7D
|
||||
NUM1L EQU $7E
|
||||
NUM1H EQU $7F
|
||||
NUM2L EQU $80
|
||||
NUM2H EQU $81
|
||||
RESULT EQU $82 ; 83,84,85
|
||||
NEGATE EQU $86 ; UNUSED?
|
||||
LAST_SPACEX_I EQU $87
|
||||
LAST_SPACEY_I EQU $88
|
||||
LAST_MAP_COLOR EQU $89
|
||||
DRAW_SKY EQU $8A
|
||||
COLOR_MASK EQU $8B
|
||||
KEY_COUNT EQU $8C
|
||||
KEY_OFFSET EQU $8D
|
||||
DRAW_BLUE_SKY EQU $8E
|
||||
RANDOM_POINTER EQU $8F
|
||||
FRAME_COUNT EQU $90
|
||||
;SCREEN_Y EQU $62
|
||||
;ANGLE EQU $63
|
||||
;HORIZ_SCALE_I EQU $64
|
||||
;HORIZ_SCALE_F EQU $65
|
||||
;FACTOR_I EQU $66
|
||||
;FACTOR_F EQU $67
|
||||
;DX_I EQU $68
|
||||
;DX_F EQU $69
|
||||
;SPACEX_I EQU $6A
|
||||
;SPACEX_F EQU $6B
|
||||
;CX_I EQU $6C
|
||||
;CX_F EQU $6D
|
||||
;DY_I EQU $6E
|
||||
;DY_F EQU $6F
|
||||
;SPACEY_I EQU $70
|
||||
;SPACEY_F EQU $71
|
||||
;CY_I EQU $72
|
||||
;CY_F EQU $73
|
||||
;TEMP_I EQU $74
|
||||
;TEMP_F EQU $75
|
||||
;DISTANCE_I EQU $76
|
||||
;DISTANCE_F EQU $77
|
||||
;SPACEZ_I EQU $78
|
||||
;SPACEZ_F EQU $79
|
||||
;DRAW_SPLASH EQU $7A
|
||||
;SPEED EQU $7B
|
||||
;SPLASH_COUNT EQU $7C
|
||||
;OVER_LAND EQU $7D
|
||||
;NUM1L EQU $7E
|
||||
;NUM1H EQU $7F
|
||||
;NUM2L EQU $80
|
||||
;NUM2H EQU $81
|
||||
;RESULT EQU $82 ; 83,84,85
|
||||
;NEGATE EQU $86 ; UNUSED?
|
||||
;LAST_SPACEX_I EQU $87
|
||||
;LAST_SPACEY_I EQU $88
|
||||
;LAST_MAP_COLOR EQU $89
|
||||
;DRAW_SKY EQU $8A
|
||||
;COLOR_MASK EQU $8B
|
||||
;KEY_COUNT EQU $8C
|
||||
;KEY_OFFSET EQU $8D
|
||||
;DRAW_BLUE_SKY EQU $8E
|
||||
;RANDOM_POINTER EQU $8F
|
||||
;FRAME_COUNT EQU $90
|
||||
MB_VALUE EQU $91
|
||||
MB_CHUNK EQU $92
|
||||
MB_ADDRL EQU $91
|
||||
MB_ADDRH EQU $92
|
||||
DONE_PLAYING EQU $93
|
||||
MB_FRAME_DIFF EQU $94
|
||||
LZSS_RL EQU $95
|
||||
LZSS_RH EQU $96
|
||||
LZSS_COUNT EQU $97
|
||||
LZSS_MASK EQU $98
|
||||
LZSS_ENDL EQU $99
|
||||
LZSS_ENDH EQU $9A
|
||||
MB_FRAME_DIFF2 EQU $9F
|
||||
;LZSS_RL EQU $95
|
||||
;LZSS_RH EQU $96
|
||||
;LZSS_COUNT EQU $97
|
||||
;LZSS_MASK EQU $98
|
||||
;LZSS_ENDL EQU $99
|
||||
;LZSS_ENDH EQU $9A
|
||||
;MB_FRAME_DIFF2 EQU $9F
|
||||
|
||||
; More zero-page addresses
|
||||
; we try not to conflict with anything DOS, MONITOR or BASIC related
|
||||
|
||||
;COLOR1 EQU $E0
|
||||
;COLOR2 EQU $E1
|
||||
;MATCH EQU $E2
|
||||
;XX EQU $E3
|
||||
;YY EQU $E4
|
||||
;SHIPY EQU $E4
|
||||
;YADD EQU $E5
|
||||
;LOOP EQU $E6
|
||||
;MEMPTRL EQU $E7
|
||||
;MEMPTRH EQU $E8
|
||||
;NAMEL EQU $E9
|
||||
;NAMEH EQU $EA
|
||||
;NAMEX EQU $EB
|
||||
;CHAR EQU $EC
|
||||
DISP_PAGE EQU $ED
|
||||
DRAW_PAGE EQU $EE
|
||||
|
||||
;FIRST EQU $F0
|
||||
;LASTKEY EQU $F1
|
||||
;PADDLE_STATUS EQU $F2
|
||||
XPOS EQU $F3
|
||||
;YPOS EQU $F4
|
||||
TEMP EQU $FA
|
||||
;RUN EQU $FA
|
||||
;TEMP2 EQU $FB
|
||||
;TEMPY EQU $FB
|
||||
INL EQU $FC
|
||||
INH EQU $FD
|
||||
OUTL EQU $FE
|
||||
OUTH EQU $FF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
SHIPY EQU $E4
|
||||
|
||||
KEYPRESS EQU $C000
|
||||
KEYRESET EQU $C010
|
||||
|
Loading…
x
Reference in New Issue
Block a user