Skip to content

Commit

Permalink
bfsmacklib: Some headers and files to be filled
Browse files Browse the repository at this point in the history
  • Loading branch information
mefistotelis committed Jun 30, 2024
1 parent 24f5f87 commit f752b65
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 0 deletions.
45 changes: 45 additions & 0 deletions bfsmacklib/include/smack.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/******************************************************************************/
// Bullfrog Engine Smacker Playback Library - for use to remake classic games
// like Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper.
/******************************************************************************/
/** @file smack.h
* Header file for Smacker API.
* @par Purpose:
* Interface of the smacker library.
* @par Comment:
* None.
* @author Tomasz Lis
* @date 12 Nov 2011 - 13 Jun 2024
* @par Copying and copyrights:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
/******************************************************************************/
#ifndef BFSMACKLIB_SMACK_H_
#define BFSMACKLIB_SMACK_H_

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

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

typedef struct {
uint8_t Field_0[1196];
} Smack;

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


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

#ifdef __cplusplus
};
#endif

#endif // BFSMACKLIB_SMACK_H_
/******************************************************************************/
44 changes: 44 additions & 0 deletions bfsmacklib/include/smack2ail.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/******************************************************************************/
// Bullfrog Engine Smacker Playback Library - for use to remake classic games
// like Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper.
/******************************************************************************/
/** @file smack2ail.h
* Header file for smack2ail.c.
* @par Purpose:
* External interface of the smacker playback library.
* @par Comment:
* None.
* @author Tomasz Lis
* @date 12 Nov 2011 - 13 Jun 2024
* @par Copying and copyrights:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
/******************************************************************************/
#ifndef BFSMACKLIB_SMACK2AIL_H_
#define BFSMACKLIB_SMACK2AIL_H_

#include <stdint.h>
#include "smack.h"

#ifdef __cplusplus
extern "C" {
#endif

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


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

uint8_t __stdcall SMACKSOUNDUSEMSS(uint32_t freq, void *digdrv);

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

#ifdef __cplusplus
};
#endif

#endif // BFSMACKLIB_SMACK2AIL_H_
/******************************************************************************/
51 changes: 51 additions & 0 deletions bfsmacklib/src/smack2ail.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/******************************************************************************/
// Bullfrog Engine Smacker Playback Library - for use to remake classic games
// like Syndicate Wars, Magic Carpet, Genewars or Dungeon Keeper.
/******************************************************************************/
/** @file smack2ail.c
* Interface for bounding the Smacer library to AIL interface.
* @par Purpose:
* Allows to easily play audio paths from SMK videos through AIL interface.
* @par Comment:
* None.
* @author Tomasz Lis
* @date 12 Nov 2011 - 13 Jun 2024
* @par Copying and copyrights:
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
/******************************************************************************/
#include "smack2ail.h"

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

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

#if 0
uint8_t __stdcall SMACKSOUNDUSEMSS(uint32_t freq, void *digdrv)
{
if (SmackTimerReadAddr)
return 0;
SmackMSSDigDriver = digdrv;
if (freq < 200)
freq = 200;
MSSSpeed = freq;
LowSoundOpenAddr = MSSLOWSOUNDOPEN;
LowSoundCloseAddr = MSSLOWSOUNDCLOSE;
LowSoundPlayedAddr = MSSLOWSOUNDPLAYED;
LowSoundPurgeAddr = MSSLOWSOUNDPURGE;
LowSoundOffAddr = MSSLOWSOUNDPURGE;
SmackTimerSetupAddr = MSSSMACKTIMERSETUP;
SmackTimerReadAddr = MSSSMACKTIMERREAD;
SmackTimerDoneAddr = MSSSMACKTIMERDONE;
MSSTimerPeriod = 1193181 / freq;
LowSoundCheckAddr = MSSLOWSOUNDCHECK;
LowSoundOnAddr = NULL;
LowSoundVolPanAddr = MSSLOWSOUNDVOLPAN;
return 1;
}
#endif

/******************************************************************************/
3 changes: 3 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ swars_SOURCES = \
../bfariadne/include/delaunay.h \
../bfsmacklib/include/bfsmack.h \
../bfsmacklib/src/bfsmack.c \
../bfsmacklib/include/smack.h \
../bfsmacklib/include/smack2ail.h \
../bfsmacklib/src/smack2ail.c \
../bfsmacklib/src/bfsmacklib_s.sx \
linksmk.h \
linksmk.c \
Expand Down

0 comments on commit f752b65

Please sign in to comment.