aboutsummaryrefslogtreecommitdiff
path: root/src/mplayer
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2024-05-27 23:24:19 +0100
committerJuan J. Martinez <jjm@usebox.net>2024-05-27 23:24:19 +0100
commit703ab56587aac0d79ccc0f72f2b8d9ee235e20a5 (patch)
tree32b186dc14c56fe19c004a403eeaaf7e2dd0b10f /src/mplayer
parent420ac2c8f2307ddcbe551972544bbe11f05ee7ff (diff)
downloadubox-msx-lib-703ab56587aac0d79ccc0f72f2b8d9ee235e20a5.tar.gz
ubox-msx-lib-703ab56587aac0d79ccc0f72f2b8d9ee235e20a5.zip
Use SDCC's new calling convention
(this is an ABI breaking change, and will require changes to user-written asm functions or their declarations)
Diffstat (limited to 'src/mplayer')
-rw-r--r--src/mplayer/akm/akm_ubox.asm5
-rw-r--r--src/mplayer/mplayer_init.z809
-rw-r--r--src/mplayer/mplayer_play_effect.z8017
-rw-r--r--src/mplayer/mplayer_play_effect_p.z8041
-rw-r--r--src/mplayer/mplayer_stop_effect_channel.z802
5 files changed, 34 insertions, 40 deletions
diff --git a/src/mplayer/akm/akm_ubox.asm b/src/mplayer/akm/akm_ubox.asm
index cbbf8af..39aef74 100644
--- a/src/mplayer/akm/akm_ubox.asm
+++ b/src/mplayer/akm/akm_ubox.asm
@@ -7,11 +7,10 @@ PLY_AKM_ROM_Buffer = #c000
include "PlayerAkm.asm"
-; IN: L = channel
+; IN: a = channel
; OUT: L = 0 if is not on
PLY_AKM_IsSoundEffectOnDisarkGenerateExternalLabel:
PLY_AKM_IsSoundEffectOn:
- ld a,l
add a,a
add a,a
add a,a
@@ -22,6 +21,4 @@ PLY_AKM_IsSoundEffectOn:
ld a,(hl)
inc hl
or (hl)
- ld l,a
ret
-
diff --git a/src/mplayer/mplayer_init.z80 b/src/mplayer/mplayer_init.z80
index 90b3824..ee922ca 100644
--- a/src/mplayer/mplayer_init.z80
+++ b/src/mplayer/mplayer_init.z80
@@ -5,13 +5,12 @@
_mplayer_init::
ld ix, #2
add ix, sp
-
- ld l, 0 (ix)
- ld h, 1 (ix)
- ld a, 2 (ix)
+ ld a, 0 (ix)
di
call _PLY_AKM_INIT
ei
- ret
+ pop hl
+ inc sp
+ jp (hl)
diff --git a/src/mplayer/mplayer_play_effect.z80 b/src/mplayer/mplayer_play_effect.z80
index adf41b9..e2a233f 100644
--- a/src/mplayer/mplayer_play_effect.z80
+++ b/src/mplayer/mplayer_play_effect.z80
@@ -5,14 +5,13 @@
.globl _PLY_AKM_PLAYSOUNDEFFECT
_mplayer_play_effect::
- ld hl, #2
- add hl, sp
+ ld c, l
+ ld ix, #2
+ add ix, sp
+ ld b, 0 (ix)
- ld a, (hl)
- inc hl
- ld c, (hl)
- inc hl
- ld b, (hl)
-
- jp _PLY_AKM_PLAYSOUNDEFFECT
+ call _PLY_AKM_PLAYSOUNDEFFECT
+ pop hl
+ inc sp
+ jp (hl)
diff --git a/src/mplayer/mplayer_play_effect_p.z80 b/src/mplayer/mplayer_play_effect_p.z80
index 8efd705..9e428cd 100644
--- a/src/mplayer/mplayer_play_effect_p.z80
+++ b/src/mplayer/mplayer_play_effect_p.z80
@@ -7,39 +7,40 @@
.globl _PLY_AKM_PLAYSOUNDEFFECT
_mplayer_play_effect_p::
+ ld e, a
+ ld c, l
+
ld hl, #2
add hl, sp
+ ld b, (hl)
- ld e, (hl)
- inc hl
- ld c, (hl)
- inc hl
- ld b, (hl)
-
- ; e effect no
- ; bc: channel and volume
- push bc
- push de
- ld l, c
- call _mplayer_is_sound_effect_on
+ ; e effect no
+ ; bc: channel and volume
+ push bc
+ push de
+ ld a, c
+ call _mplayer_is_sound_effect_on
- ld a, l
or a
- pop de
- pop bc
+ pop de
+ pop bc
jr z, play_efx
ld a, (mplayer_current_efx)
- ; comment out following line if you don't want to
- ; replace current sound if is the same effect type
- dec a
+ ; comment out following line if you don't want to
+ ; replace current sound if is the same effect type
+ dec a
cp e
- ret nc
+ jp nc, play_exit
play_efx:
; all good, play the effect
ld a, e
ld (mplayer_current_efx), a
- jp _PLY_AKM_PLAYSOUNDEFFECT
+ call _PLY_AKM_PLAYSOUNDEFFECT
+play_exit:
+ pop hl
+ inc sp
+ jp (hl)
diff --git a/src/mplayer/mplayer_stop_effect_channel.z80 b/src/mplayer/mplayer_stop_effect_channel.z80
index 82eb5d7..2b03954 100644
--- a/src/mplayer/mplayer_stop_effect_channel.z80
+++ b/src/mplayer/mplayer_stop_effect_channel.z80
@@ -5,6 +5,4 @@
.globl _PLY_AKM_STOPSOUNDEFFECTFROMCHANNEL
_mplayer_stop_effect_channel::
- ld a, l
jp _PLY_AKM_STOPSOUNDEFFECTFROMCHANNEL
-