Skip to content

Commit

Permalink
Initial Work - Broken compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Diogo Autilio authored and dogo committed Jun 14, 2024
1 parent f2c226d commit b348b27
Show file tree
Hide file tree
Showing 65 changed files with 3,737 additions and 2,709 deletions.
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ PSP_FW_VERSION=371
#<-- STAS: pack all the necessary MikMod stuff directly into libosl.a
# in order to avoid conflict with the newest libmikmod releases.
SOURCE_DIR := src
MM_DIR := $(SOURCE_DIR)/mikmod
INCLUDE_DIR := $(MM_DIR)
MM_DIR := $(SOURCE_DIR)/libmikmod
MM_INCLUDE_DIR := $(MM_DIR)/include
#<-- STAS END -->

#----------------------------------------------------------------------------
Expand Down Expand Up @@ -80,23 +80,23 @@ PSPMATHOBJS := $(SOURCE_DIR)/libpspmath/printMatrixFloat.o \
$(SOURCE_DIR)/libpspmath/vfpu_quaternion_sample_hermite.o \
$(SOURCE_DIR)/libpspmath/vfpu_quaternion_hermite_tangent.o

MMLoaderObjs := $(MM_DIR)/mloader.o $(MM_DIR)/mlreg.o $(MM_DIR)/npertab.o \
$(MM_DIR)/sloader.o $(MM_DIR)/load_uni.o $(MM_DIR)/mwav.o \
$(MM_DIR)/load_mod.o $(MM_DIR)/load_m15.o $(MM_DIR)/load_mtm.o \
$(MM_DIR)/load_s3m.o $(MM_DIR)/load_stm.o $(MM_DIR)/load_669.o \
$(MM_DIR)/load_far.o $(MM_DIR)/load_dsm.o $(MM_DIR)/load_med.o \
$(MM_DIR)/load_xm.o $(MM_DIR)/load_ult.o $(MM_DIR)/load_it.o \
$(MM_DIR)/s3m_it.o $(MM_DIR)/load_wav.o
MMLoaderObjs := $(MM_DIR)/playercode/mloader.o $(MM_DIR)/playercode/mlreg.o $(MM_DIR)/playercode/npertab.o \
$(MM_DIR)/playercode/sloader.o $(MM_DIR)/loaders/load_uni.o $(MM_DIR)/playercode/mwav.o \
$(MM_DIR)/loaders/load_mod.o $(MM_DIR)/loaders/load_m15.o $(MM_DIR)/loaders/load_mtm.o \
$(MM_DIR)/loaders/load_s3m.o $(MM_DIR)/loaders/load_stm.o $(MM_DIR)/loaders/load_669.o \
$(MM_DIR)/loaders/load_far.o $(MM_DIR)/loaders/load_dsm.o $(MM_DIR)/loaders/load_med.o \
$(MM_DIR)/loaders/load_xm.o $(MM_DIR)/loaders/load_ult.o $(MM_DIR)/loaders/load_it.o \
$(MM_DIR)/s3m_it.o $(MM_DIR)/loaders/load_wav.o

MMDriverObjs := $(MM_DIR)/mdriver.o $(MM_DIR)/mdreg.o $(MM_DIR)/drv_nos.o
MMDriverObjs := $(MM_DIR)/playercode/mdriver.o $(MM_DIR)/playercode/mdreg.o $(MM_DIR)/drivers/drv_nos.o

MMPlayerObjs := $(MM_DIR)/mplayer.o
MMPlayerObjs := $(MM_DIR)/playercode/mplayer.o

MMIOOBJS := $(MM_DIR)/mmio/mmalloc.o \
$(MM_DIR)/mmio/mmerror.o $(MM_DIR)/mmio/mmio.o

MIKMODLIBOBJS := $(MM_DIR)/stream.o \
$(MM_DIR)/virtch.o $(MM_DIR)/munitrk.o \
MIKMODLIBOBJS := $(MM_DIR)/playercode/stream.o \
$(MM_DIR)/playercode/virtch.o $(MM_DIR)/playercode/munitrk.o \
$(MMLoaderObjs) $(MMDriverObjs) $(MMPlayerObjs)

LIBOBJS := $(SFONTOBJS) \
Expand Down Expand Up @@ -164,7 +164,7 @@ OBJS := $(LIBOBJS)

INCDIR := $(INCDIR) \
$(SOURCE_DIR) \
$(INCLUDE_DIR)
$(MM_INCLUDE_DIR)

#----------------------------------------------------------------------------
# Addditional libraries
Expand Down
107 changes: 107 additions & 0 deletions src/libmikmod/drivers/drv_nos.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/* MikMod sound library
(c) 1998, 1999, 2000 Miodrag Vallat and others - see file AUTHORS for
complete list.
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/

/*==============================================================================
$Id$
Driver for no output
==============================================================================*/

/*
Written by Jean-Paul Mikkers <[email protected]>
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#include "mikmod_internals.h"

#define ZEROLEN 32768

static SBYTE *zerobuf=NULL;

static BOOL NS_IsThere(void)
{
return 1;
}

static BOOL NS_Init(void)
{
zerobuf=(SBYTE*)MikMod_malloc(ZEROLEN);
return VC_Init();
}

static void NS_Exit(void)
{
VC_Exit();
MikMod_free(zerobuf);
}

static void NS_Update(void)
{
if (zerobuf)
VC_WriteBytes(zerobuf,ZEROLEN);
}

MIKMODAPI MDRIVER drv_nos={
NULL,
"No Sound",
"Nosound Driver v3.0",
255,255,
"nosound",
NULL,
NULL,
NS_IsThere,
VC_SampleLoad,
VC_SampleUnload,
VC_SampleSpace,
VC_SampleLength,
NS_Init,
NS_Exit,
NULL,
VC_SetNumVoices,
VC_PlayStart,
VC_PlayStop,
NS_Update,
NULL,
VC_VoiceSetVolume,
VC_VoiceGetVolume,
VC_VoiceSetFrequency,
VC_VoiceGetFrequency,
VC_VoiceSetPanning,
VC_VoiceGetPanning,
VC_VoicePlay,
VC_VoiceStop,
VC_VoiceStopped,
VC_VoiceGetPosition,
VC_VoiceRealVolume
};


/* ex:set ts=4: */
174 changes: 174 additions & 0 deletions src/libmikmod/drivers/drv_raw.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
/* MikMod sound library
(c) 1998, 1999, 2000 Miodrag Vallat and others - see file AUTHORS for
complete list.
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/

/*==============================================================================
$Id$
Driver for output to a file called MUSIC.RAW
==============================================================================*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif

#ifndef macintosh
#include <sys/types.h>
#include <sys/stat.h>
#endif

#include "mikmod_internals.h"

#define BUFFERSIZE 32768
#define FILENAME "music.raw"

#ifndef O_BINARY
#define O_BINARY 0
#endif

#if defined(WIN32) && !defined(__MWERKS__)
#define open _open
#endif

static int rawout=-1;
static SBYTE *audiobuffer=NULL;
static CHAR *filename=NULL;

static void RAW_CommandLine(CHAR *cmdline)
{
CHAR *ptr=MD_GetAtom("file",cmdline,0);

if(ptr) {
MikMod_free(filename);
filename=ptr;
}
}

static BOOL RAW_IsThere(void)
{
return 1;
}

static BOOL RAW_Init(void)
{
#if defined unix || (defined __APPLE__ && defined __MACH__)
if(!MD_Access(filename?filename:FILENAME)) {
_mm_errno=MMERR_OPENING_FILE;
return 1;
}
#endif

if((rawout=open(filename?filename:FILENAME,O_RDWR|O_TRUNC|O_CREAT|O_BINARY
#if !defined(macintosh) && !defined(__MWERKS__)
,S_IREAD|S_IWRITE
#endif
))<0) {
_mm_errno=MMERR_OPENING_FILE;
return 1;
}
md_mode|=DMODE_SOFT_MUSIC|DMODE_SOFT_SNDFX;

if (!(audiobuffer=(SBYTE*)MikMod_malloc(BUFFERSIZE))) {
close(rawout);unlink(filename?filename:FILENAME);
rawout=-1;
return 1;
}

if ((VC_Init())) {
close(rawout);unlink(filename?filename:FILENAME);
rawout=-1;
return 1;
}
return 0;
}

static void RAW_Exit(void)
{
VC_Exit();
if (rawout!=-1) {
close(rawout);
rawout=-1;
}
MikMod_free(audiobuffer);
}

static void RAW_Update(void)
{
write(rawout,audiobuffer,VC_WriteBytes(audiobuffer,BUFFERSIZE));
}

static BOOL RAW_Reset(void)
{
close(rawout);
if((rawout=open(filename?filename:FILENAME,O_RDWR|O_TRUNC|O_CREAT|O_BINARY
#if !defined(macintosh) && !defined(__MWERKS__)
,S_IREAD|S_IWRITE
#endif
))<0) {
_mm_errno=MMERR_OPENING_FILE;
return 1;
}

return 0;
}

MIKMODAPI MDRIVER drv_raw={
NULL,
"Disk writer (raw data)",
"Raw disk writer (music.raw) v1.1",
0,255,
"raw",
"file:t:music.raw:Output file name\n",
RAW_CommandLine,
RAW_IsThere,
VC_SampleLoad,
VC_SampleUnload,
VC_SampleSpace,
VC_SampleLength,
RAW_Init,
RAW_Exit,
RAW_Reset,
VC_SetNumVoices,
VC_PlayStart,
VC_PlayStop,
RAW_Update,
NULL,
VC_VoiceSetVolume,
VC_VoiceGetVolume,
VC_VoiceSetFrequency,
VC_VoiceGetFrequency,
VC_VoiceSetPanning,
VC_VoiceGetPanning,
VC_VoicePlay,
VC_VoiceStop,
VC_VoiceStopped,
VC_VoiceGetPosition,
VC_VoiceRealVolume
};

/* ex:set ts=4: */
Loading

0 comments on commit b348b27

Please sign in to comment.