1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-06 15:06:07 +00:00
cc65/libsrc/creativision/psg.s

64 lines
1.3 KiB
ArmAsm
Raw Normal View History

2013-12-05 11:40:44 +00:00
; void __fastcall__ psg_outb( unsigned char b );
; void __fastcall__ psg_delayms( unsigned char c);
; void __fastcall__ bios_playsound( void *b, unsigned char c);
; void psg_silence( void );
2017-02-01 18:46:04 +00:00
.export _psg_outb, _psg_silence, _psg_delay
.export _bios_playsound
.import popa
.include "creativision.inc"
2013-12-05 11:40:44 +00:00
_psg_outb:
2017-02-01 18:46:04 +00:00
;* Let BIOS output the value
jmp $FE77
2013-12-05 11:40:44 +00:00
_psg_silence:
2017-02-01 18:46:04 +00:00
jmp $FE54
2013-12-05 11:40:44 +00:00
_psg_delay:
2017-02-01 18:46:04 +00:00
tay
l1: lda #200
l2: sbc #1
bne l2
lda #200
l3: sbc #1
bne l3
dey
bne l1
rts
2013-12-05 11:40:44 +00:00
;* Creativision Sound Player
;*
;* Based on BIOS sound player.
;* Pass a pointer to a set of note triples, terminated with a tempo byte
;* and the len (max 255)
_bios_playsound:
2017-02-01 18:46:04 +00:00
pha ; Save Length Byte
sei
lda #$D5 ; BIOS volume table low
sta $4
lda #$FC ; BIOS volume table high
sta $5
jsr popa ; Get Sound table pointer low
sta $0
jsr popa ; Get Sound table pointer high
sta $1
pla
tay ; Put length in Y
dey
php
jmp $FBED ; Let BIOS do it's thing