mirror of
https://github.com/cc65/cc65.git
synced 2024-11-16 02:10:52 +00:00
af3d4581d3
It won't waste space in a cartridge if it isn't used.
41 lines
1.0 KiB
ArmAsm
41 lines
1.0 KiB
ArmAsm
; void __fastcall__ bios_playsound (void *a, unsigned char b);
|
|
|
|
|
|
.export _bios_playsound
|
|
|
|
.import popax
|
|
|
|
.include "creativision.inc"
|
|
|
|
|
|
songptr := $00 ; Points to current tune data
|
|
volptr := $04 ; Points to current volume table
|
|
|
|
|
|
;* Creativision Sound Player
|
|
;* Based on BIOS song player.
|
|
;*
|
|
;* Pass a pointer to a set of note triples, terminated with a tempo byte;
|
|
;* and pass the length of the triples and tempo (max 255).
|
|
;*
|
|
;* Note: tune data must be stored backwards.
|
|
|
|
_bios_playsound:
|
|
php
|
|
pha ; Save tune length
|
|
sei
|
|
|
|
lda #<$FCD5 ; BIOS decreasing-volume table
|
|
ldx #>$FCD5
|
|
sta volptr
|
|
stx volptr+1
|
|
|
|
jsr popax ; Get tune array pointer
|
|
sta songptr
|
|
stx songptr+1
|
|
|
|
pla
|
|
tay
|
|
dey ; Point to tempo byte
|
|
jmp BIOS_PLAY_SONG ; Let BIOS do its thing
|