WonderWitch/FreyaBIOS/Sound: Difference between revisions

From WSdev Wiki
Jump to navigationJump to search
(Created page with "The Sound interrupt provides an abstraction layer for the WonderSwan's sound hardware. == Interrupts == === INT 15/AH=00h - sound_init === * AH = 00h === INT 15/AH=01h - sound_set_channel === * AH = 01h * BL = Channel Control value === INT 15/AH=02h - sound_get_channel === * AH = 02h Return: * AL = Channel Control value === INT 15/AH=03h - sound_set_output === * AH = 03h * BL = Sound#S...")
 
mNo edit summary
 
Line 3: Line 3:
== Interrupts ==
== Interrupts ==


=== INT 15/AH=00h - sound_init ===
=== INT $15/AH=$00 - sound_init ===


* AH = 00h
* AH = $00


=== INT 15/AH=01h - sound_set_channel ===
=== INT $15/AH=$01 - sound_set_channel ===


* AH = 01h
* AH = $01
* BL = [[Sound#Sound Channel Control|Channel Control]] value
* BL = [[Sound#Sound Channel Control|Channel Control]] value


=== INT 15/AH=02h - sound_get_channel ===
=== INT $15/AH=$02 - sound_get_channel ===


* AH = 02h
* AH = $02


Return:
Return:
Line 20: Line 20:
* AL = [[Sound#Sound Channel Control|Channel Control]] value
* AL = [[Sound#Sound Channel Control|Channel Control]] value


=== INT 15/AH=03h - sound_set_output ===
=== INT $15/AH=$03 - sound_set_output ===


* AH = 03h
* AH = $03
* BL = [[Sound#Sound Output Control|Output Control]] value
* BL = [[Sound#Sound Output Control|Output Control]] value


=== INT 15/AH=04h - sound_get_output ===
=== INT $15/AH=$04 - sound_get_output ===


* AH = 04h
* AH = $04


Return:
Return:
Line 33: Line 33:
* AL = [[Sound#Sound Output Control|Output Control]] value
* AL = [[Sound#Sound Output Control|Output Control]] value


=== INT 15/AH=05h - sound_set_wave ===
=== INT $15/AH=$05 - sound_set_wave ===


* AH = 05h
* AH = $05
* AL = Channel (0, 1, 2, 3)
* AL = Channel (0, 1, 2, 3)
* DS:DX = Pointer to waveform data (16 bytes)
* DS:DX = Pointer to waveform data (16 bytes)


=== INT 15/AH=06h - sound_set_pitch ===
=== INT $15/AH=$06 - sound_set_pitch ===


* AH = 06h
* AH = $06
* AL = Channel (0, 1, 2, 3)
* AL = Channel (0, 1, 2, 3)
* BX = Frequency divider (0 - 2047)
* BX = Frequency divider (0 - 2047)


=== INT 15/AH=07h - sound_get_pitch ===
=== INT $15/AH=$07 - sound_get_pitch ===


* AH = 07h
* AH = $07
* AL = Channel (0, 1, 2, 3)
* AL = Channel (0, 1, 2, 3)


Line 54: Line 54:
* AX = Frequency divider (0 - 2047)
* AX = Frequency divider (0 - 2047)


=== INT 15/AH=08h - sound_set_volume ===
=== INT $15/AH=$08 - sound_set_volume ===


* AH = 08h
* AH = $08
* AL = Channel (0, 1, 2, 3)
* AL = Channel (0, 1, 2, 3)
* BL = [[Sound#Sound Channel Volume|Channel Volume]] value
* BL = [[Sound#Sound Channel Volume|Channel Volume]] value


=== INT 15/AH=09h - sound_get_volume ===
=== INT $15/AH=$09 - sound_get_volume ===


* AH = 09h
* AH = $09
* AL = Channel (0, 1, 2, 3)
* AL = Channel (0, 1, 2, 3)


Line 69: Line 69:
* AL = [[Sound#Sound Channel Volume|Channel Volume]] value
* AL = [[Sound#Sound Channel Volume|Channel Volume]] value


=== INT 15/AH=0Ah - sound_set_sweep ===
=== INT $15/AH=$0A - sound_set_sweep ===


* AH = 0Ah
* AH = $0A
* BL = [[Sound#Sound Channel 3 Sweep Amount|Sweep Amount]]
* BL = [[Sound#Sound Channel 3 Sweep Amount|Sweep Amount]]
* CL = [[Sound#Sound Channel 3 Sweep Ticks|Sweep Ticks]]
* CL = [[Sound#Sound Channel 3 Sweep Ticks|Sweep Ticks]]


=== INT 15/AH=0Bh - sound_get_sweep ===
=== INT $15/AH=$0B - sound_get_sweep ===


* AH = 0Bh
* AH = $0B


Return:
Return:
Line 84: Line 84:
* AH = [[Sound#Sound Channel 3 Sweep Ticks|Sweep Ticks]]
* AH = [[Sound#Sound Channel 3 Sweep Ticks|Sweep Ticks]]


=== INT 15/AH=0Ch - sound_set_noise ===
=== INT $15/AH=$0C - sound_set_noise ===


* AH = 0Ch
* AH = $0C
* BL = [[Sound#Sound Channel 4 Noise Control|Channel 4 Noise Control]] value
* BL = [[Sound#Sound Channel 4 Noise Control|Channel 4 Noise Control]] value


=== INT 15/AH=0Dh - sound_get_noise ===
=== INT $15/AH=$0D - sound_get_noise ===


* AH = 0Dh
* AH = $0D


Return:
Return:
Line 97: Line 97:
* AL = [[Sound#Sound Channel 4 Noise Control|Channel 4 Noise Control]] value
* AL = [[Sound#Sound Channel 4 Noise Control|Channel 4 Noise Control]] value


=== INT 15/AH=0Eh - sound_get_random ===
=== INT $15/AH=$0E - sound_get_random ===


* AH = 0Eh
* AH = $0E


Return:
Return:


* AX = [[Sound#Sound Channel 4 LFSR Register|Channel 4 LFSR Register]] value
* AX = [[Sound#Sound Channel 4 LFSR Register|Channel 4 LFSR Register]] value

Latest revision as of 08:20, 20 July 2024

The Sound interrupt provides an abstraction layer for the WonderSwan's sound hardware.

Interrupts

INT $15/AH=$00 - sound_init

  • AH = $00

INT $15/AH=$01 - sound_set_channel

INT $15/AH=$02 - sound_get_channel

  • AH = $02

Return:

INT $15/AH=$03 - sound_set_output

INT $15/AH=$04 - sound_get_output

  • AH = $04

Return:

INT $15/AH=$05 - sound_set_wave

  • AH = $05
  • AL = Channel (0, 1, 2, 3)
  • DS:DX = Pointer to waveform data (16 bytes)

INT $15/AH=$06 - sound_set_pitch

  • AH = $06
  • AL = Channel (0, 1, 2, 3)
  • BX = Frequency divider (0 - 2047)

INT $15/AH=$07 - sound_get_pitch

  • AH = $07
  • AL = Channel (0, 1, 2, 3)

Return:

  • AX = Frequency divider (0 - 2047)

INT $15/AH=$08 - sound_set_volume

INT $15/AH=$09 - sound_get_volume

  • AH = $09
  • AL = Channel (0, 1, 2, 3)

Return:

INT $15/AH=$0A - sound_set_sweep

INT $15/AH=$0B - sound_get_sweep

  • AH = $0B

Return:

INT $15/AH=$0C - sound_set_noise

INT $15/AH=$0D - sound_get_noise

  • AH = $0D

Return:

INT $15/AH=$0E - sound_get_random

  • AH = $0E

Return: