chiptune: move chunksize to 3

also abandon hope of getting starfield background; needs 3kB of
RAM that we can't afford
This commit is contained in:
Vince Weaver 2018-02-18 00:13:30 -05:00
parent bb5f5c3aec
commit 1f63b498a2
6 changed files with 105 additions and 84 deletions

View File

@ -2,16 +2,18 @@
; "Beneath Apple DOS" by Don Worth and Pieter Lechner
; FIXME: make these a parameter
; filename
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
;RWTSL EQU $F0
;RWTSH EQU $F1
;DOSBUFL EQU $EE
;DOSBUFH EQU $EF
;FILEML EQU $EC
;FILEMH EQU $ED
;; DOS Constants
OPEN EQU $01
@ -221,10 +223,10 @@ dos33_read:
sta (FILEML),y
ldy #6 ; point to number of bytes to read
lda #>read_size
lda #<read_size
sta (FILEML),y ; we want to read 255 bytes
iny
lda #<read_size
lda #>read_size
sta (FILEML),y
ldy #8 ; buffer address

View File

@ -7,7 +7,8 @@ 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 0x6000 OUT.0
$(DOS33) -y chiptune_player.dsk SAVE B OUT.0
# $(DOS33) -y chiptune_player.dsk BSAVE -a 0x6000 OUT.0
CHIPTUNE_PLAYER: chiptune_player.o

Binary file not shown.

View File

@ -1,5 +1,4 @@
+ Load from disk
+ Starfield
+ Starfield -- takes too much ram (3k+)
+ Volume Bars
+ Print Descriptive Text
+ Print time

View File

@ -5,21 +5,23 @@
CHUNK_BUFFER EQU $6000
;=============================
; Print message
; Setup
;=============================
jsr HOME
jsr TEXT
; init variables
lda #0
sta DRAW_PAGE
sta CH
sta CV
sta DONE_PLAYING
sta XPOS
lda #0
sta MB_FRAME_DIFF
; print detection message
lda #<mocking_message ; load loading message
sta OUTL
lda #>mocking_message
@ -40,12 +42,12 @@ CHUNK_BUFFER EQU $6000
jmp forever_loop ; and wait forever
mockingboard_found:
lda #<found_message ; print found message
sta OUTL
lda #>found_message
sta OUTH
inc CV
jsr move_and_print
; lda #<found_message ; print found message
; sta OUTL
; lda #>found_message
; sta OUTH
; inc CV
; jsr move_and_print
;============================
; Init the Mockingboard
@ -55,7 +57,6 @@ mockingboard_found:
jsr reset_ay_both
jsr clear_ay_both
;=========================
; Setup Interrupt Handler
;=========================
@ -71,7 +72,7 @@ mockingboard_found:
; Enable 50Hz clock on 6522
;============================
lda #$40 ; Generate continuous interrupts, don't touch PB7
lda #$40 ; Continuous interrupts, don't touch PB7
sta $C40B ; ACR register
lda #$7F ; clear all interrupt flags
sta $C40E ; IER register (interrupt enable)
@ -91,7 +92,7 @@ mockingboard_found:
;============================
; Setup Graphics
; Draw title screen
;============================
jsr set_gr_page0
@ -124,6 +125,7 @@ mockingboard_found:
sta INH
lda #<CHUNK_BUFFER
sta INL
lda #$0
sta MB_CHUNK
@ -131,16 +133,35 @@ mockingboard_found:
;============================
; Enable 6502 interrupts
;============================
;
cli ; clear interrupt mask
;============================
; Init Background
;============================
; jsr clear_screens ; clear top/bottom of page 0/1
; jsr set_gr_page0
; lda #0
; sta DRAW_PAGE
; sta RANDOM_POINTER
; sta SCREEN_Y
; always multiply with low byte as zero
; sta NUM2L
;============================
; Loop forever
;============================
playing_loop:
;============================
; starfield
;============================
; jsr starfield
lda DONE_PLAYING
beq playing_loop
@ -204,7 +225,7 @@ mb_not_13:
; so write same to both left/write
clc
lda INH
adc #$4
adc #$3
sta INH
inx
@ -223,7 +244,7 @@ wraparound:
inc MB_CHUNK
lda MB_CHUNK
cmp #$4
cmp #$3
bne chunk_good
lda #0
sta MB_CHUNK
@ -243,7 +264,6 @@ 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/gr_fast_clear.s"
.include "../asm_routines/pageflip.s"
.include "../asm_routines/gr_unrle.s"

View File

@ -2,26 +2,25 @@
;; 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
; dos33 zero page = 26-2f, 35-38, 3e 3f 40-4d
; overlap applesoft 67-6a,6f,70,af,b0,ca-cd,d8
RWTSL EQU $60
RWTSH EQU $61
DOSBUFL EQU $62
@ -30,11 +29,9 @@ FILEML EQU $64
FILEMH EQU $65
;TURNING EQU $60
;SCREEN_X EQU $61 ; not used?
;SCREEN_Y EQU $62
;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
@ -48,6 +45,8 @@ FILEMH EQU $65
;CX_F EQU $6D
;DY_I EQU $6E
;DY_F EQU $6F
;SPACEY_I EQU $70
;SPACEY_F EQU $71
;CY_I EQU $72
@ -61,29 +60,29 @@ FILEMH EQU $65
;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
;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
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
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
@ -95,10 +94,10 @@ MB_FRAME_DIFF EQU $94
; 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
;COLOR1 EQU $E0
;COLOR2 EQU $E1
;MATCH EQU $E2
XX EQU $E3
;YY EQU $E4
;SHIPY EQU $E4
;YADD EQU $E5
@ -107,24 +106,24 @@ MB_FRAME_DIFF EQU $94
;MEMPTRH EQU $E8
;NAMEL EQU $E9
;NAMEH EQU $EA
;NAMEX EQU $EB
;CHAR EQU $EC
DISP_PAGE EQU $ED
DRAW_PAGE EQU $EE
;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
;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