Skip to content

Commit

Permalink
bfsmacklib: Moved MSSSMACKTIMERREAD(), and changed implementation
Browse files Browse the repository at this point in the history
The Smacker library is not supposed to directly use SDL. Bullfrog
Library should do that (though for timer the bflibrary currently
does not use SDL either).
  • Loading branch information
mefistotelis committed Jun 30, 2024
1 parent 4127a48 commit 3c254b5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 5 additions & 0 deletions bfsmacklib/include/smack2ail.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ extern "C" {

/******************************************************************************/

/** Link Smacker audio output to AIL library interface.
*
* @param speed Frequency of the timer sending buffers to AIL output.
* @param digdrv Digital Audio Driver instance from the AIL library.
*/
uint8_t RADAPI SMACKSOUNDUSEMSS(uint32_t speed, void *digdrv);

/******************************************************************************/
Expand Down
7 changes: 6 additions & 1 deletion bfsmacklib/src/smack2ail.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "smack2ail.h"

#include <stddef.h>
#include "bftime.h"
/******************************************************************************/
extern void *SmackMSSDigDriver;
extern uint32_t MSSSpeed;
Expand All @@ -43,11 +44,15 @@ void RADAPI MSSLOWSOUNDCLOSE(SmackSndTrk *sstrk);
uint32_t RADAPI MSSLOWSOUNDPLAYED(SmackSndTrk *sstrk);
void RADAPI MSSLOWSOUNDPURGE(SmackSndTrk *sstrk);
void RADAPI MSSSMACKTIMERSETUP(void);
uint32_t RADAPI MSSSMACKTIMERREAD(void);
void RADAPI MSSSMACKTIMERDONE(void);
void RADAPI MSSLOWSOUNDCHECK(void);
void RADAPI MSSLOWSOUNDVOLPAN(uint32_t pan, uint32_t volume, SmackSndTrk *sstrk);

uint32_t RADAPI MSSSMACKTIMERREAD(void)
{
return LbTimerClock();
}

uint8_t RADAPI SMACKSOUNDUSEMSS(uint32_t speed, void *digdrv)
{
#if 1
Expand Down
2 changes: 1 addition & 1 deletion src/bflib_snd_mss_s.sx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ GLOBAL_FUNC (MSSSMACKTIMERSETUP)


/*----------------------------------------------------------------*/
MSSSMACKTIMERREAD:
ASM_MSSSMACKTIMERREAD:
/*----------------------------------------------------------------*/
push %esi
push %edi
Expand Down
6 changes: 0 additions & 6 deletions src/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,3 @@ timer_get_18_2_hz_ticks (void)
{
return (((uint64_t) SDL_GetTicks () * 1193182 / 1000) >> 15);
}

uint32_t
MSSSMACKTIMERREAD (void)
{
return SDL_GetTicks ();
}

0 comments on commit 3c254b5

Please sign in to comment.