2022-01-11 07:59:52 +00:00
|
|
|
; Apple II graphics/music in 1k
|
|
|
|
|
|
|
|
; by deater (Vince Weaver) <vince@deater.net>
|
|
|
|
|
|
|
|
; Zero Page
|
|
|
|
.include "zp.inc"
|
|
|
|
.include "hardware.inc"
|
|
|
|
|
2022-01-15 21:23:59 +00:00
|
|
|
; for a 256 entry we need to fit in 252 bytes
|
2022-01-15 19:47:10 +00:00
|
|
|
|
2022-01-15 20:07:13 +00:00
|
|
|
; 310 bytes -- initial
|
2022-01-15 20:58:47 +00:00
|
|
|
; 268 bytes -- strip out interrupts
|
|
|
|
; 262 bytes -- simplify init
|
|
|
|
; 261 bytes -- optimize init more
|
|
|
|
; 253 bytes -- optimize var init
|
|
|
|
; 252 bytes -- bne vs jmp
|
|
|
|
; 250 bytes -- song only has 16 notes so can never be negative
|
|
|
|
; 249 bytes -- make terminating value $80 instead of $FF
|
2022-01-15 21:23:59 +00:00
|
|
|
; 247 bytes -- combine note loop. makes song a bit faster
|
2022-01-16 01:51:35 +00:00
|
|
|
; 245 bytes -- try to optimize writing out volume
|
|
|
|
; 255 bytes -- add in some visualization
|
2022-01-11 07:59:52 +00:00
|
|
|
|
|
|
|
d2:
|
|
|
|
|
|
|
|
;===================
|
|
|
|
; music Player Setup
|
|
|
|
|
|
|
|
tracker_song = peasant_song
|
|
|
|
|
|
|
|
; assume mockingboard in slot#4
|
|
|
|
|
|
|
|
; inline mockingboard_init
|
|
|
|
|
|
|
|
.include "mockingboard_init.s"
|
|
|
|
|
|
|
|
.include "tracker_init.s"
|
|
|
|
|
2022-01-16 01:51:35 +00:00
|
|
|
jsr SETGR
|
|
|
|
|
2022-01-15 20:58:47 +00:00
|
|
|
game_loop:
|
2022-01-16 01:51:35 +00:00
|
|
|
; typically A=0, X=FF, Y=0
|
|
|
|
|
|
|
|
; lda $70
|
|
|
|
;blah_smc:
|
|
|
|
; sta $400
|
|
|
|
; inc blah_smc+1
|
2022-01-15 20:58:47 +00:00
|
|
|
|
2022-01-11 07:59:52 +00:00
|
|
|
; start the music playing
|
|
|
|
|
2022-01-15 20:58:47 +00:00
|
|
|
.include "play_frame.s"
|
2022-01-15 21:23:59 +00:00
|
|
|
.include "ay3_write_regs.s"
|
2022-01-11 07:59:52 +00:00
|
|
|
|
2022-01-15 20:58:47 +00:00
|
|
|
; delay 20Hz, or 1/20s = 50ms
|
2022-01-11 07:59:52 +00:00
|
|
|
|
2022-01-15 20:58:47 +00:00
|
|
|
lda #140
|
|
|
|
jsr WAIT
|
2022-01-11 07:59:52 +00:00
|
|
|
|
2022-01-15 20:58:47 +00:00
|
|
|
beq game_loop
|
2022-01-11 07:59:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
; music
|
2022-01-15 19:47:10 +00:00
|
|
|
.include "mA2E_2.s"
|
2022-01-15 20:58:47 +00:00
|
|
|
|