2022-01-10 04:58:37 +00:00
|
|
|
; Apple II graphics/music in 1k
|
|
|
|
|
|
|
|
; by deater (Vince Weaver) <vince@deater.net>
|
|
|
|
|
|
|
|
; Zero Page
|
|
|
|
.include "zp.inc"
|
|
|
|
.include "hardware.inc"
|
|
|
|
|
|
|
|
; 466 bytes -- original from D2 demo
|
|
|
|
; 436 bytes -- left channel only
|
|
|
|
; 427 bytes -- optimize init a bit
|
2022-01-10 05:47:32 +00:00
|
|
|
; 426 bytes -- terminate init with $FF rather than extra $00
|
|
|
|
; 424 bytes -- move inits to zero together
|
|
|
|
; 414 bytes -- update ay output to write all registers
|
2022-01-10 06:20:48 +00:00
|
|
|
; 405 bytes -- more optimizing the interrupt handler
|
|
|
|
; 398 bytes -- only put song address one place
|
|
|
|
; 393 bytes -- don't keep song offset in Y
|
2022-01-10 06:41:36 +00:00
|
|
|
; 390 bytes -- use Y instead of X
|
|
|
|
; 388 bytes -- optimizing octave selection
|
2022-01-10 04:58:37 +00:00
|
|
|
|
|
|
|
d2:
|
|
|
|
|
|
|
|
;===================
|
|
|
|
; music Player Setup
|
|
|
|
|
2022-01-10 06:20:48 +00:00
|
|
|
tracker_song = peasant_song
|
|
|
|
|
|
|
|
; lda #<peasant_song
|
|
|
|
; sta SONG_L
|
|
|
|
; lda #>peasant_song
|
|
|
|
; sta SONG_H
|
2022-01-10 04:58:37 +00:00
|
|
|
|
|
|
|
; assume mockingboard in slot#4
|
|
|
|
|
2022-01-10 05:47:32 +00:00
|
|
|
; inline mockingboard_init
|
|
|
|
|
|
|
|
.include "mockingboard_init.s"
|
2022-01-10 04:58:37 +00:00
|
|
|
|
2022-01-10 05:47:32 +00:00
|
|
|
.include "tracker_init.s"
|
|
|
|
|
|
|
|
; start the music playing
|
2022-01-10 04:58:37 +00:00
|
|
|
|
|
|
|
cli
|
|
|
|
|
|
|
|
bob:
|
|
|
|
jmp bob
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;================
|
|
|
|
; halt music
|
|
|
|
; stop playing
|
|
|
|
; turn off sound
|
|
|
|
its_over:
|
|
|
|
sei
|
|
|
|
lda #$3f
|
2022-01-10 05:47:32 +00:00
|
|
|
sta AY_REGS+7
|
|
|
|
jsr ay3_write_regs
|
2022-01-10 04:58:37 +00:00
|
|
|
|
|
|
|
stuck_forever:
|
|
|
|
bne stuck_forever
|
|
|
|
|
|
|
|
|
|
|
|
; music
|
|
|
|
.include "mA2E_2.s"
|
|
|
|
.include "interrupt_handler.s"
|
|
|
|
; must be last
|
|
|
|
.include "mockingboard_setup.s"
|