Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:

- name: Checkout the Git repository
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Download and install GRRLIB
run: |
Expand All @@ -24,5 +24,6 @@ jobs:

- name: Build library and demo
run: |
(cd GRRMOD && make && make install)
/opt/devkitpro/portlibs/wii/bin/powerpc-eabi-cmake -B build
cmake --build build --target install
(cd demo && make)
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.25)
project(grrmod VERSION 0.0.1)

option(GRRMOD_INSTALL "Generate the install target" ON)
Expand All @@ -15,7 +15,8 @@ find_library(AESND aesnd
if(GRRMOD_USE_MOD)
file(GLOB MOD_SRC_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/GRRMOD/GRRMOD_MOD.c"
"${CMAKE_CURRENT_SOURCE_DIR}/GRRMOD/mikmod/drivers/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/GRRMOD/mikmod/drivers/drv_nos.c"
"${CMAKE_CURRENT_SOURCE_DIR}/GRRMOD/mikmod/drivers/drv_wii.c"
"${CMAKE_CURRENT_SOURCE_DIR}/GRRMOD/mikmod/loaders/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/GRRMOD/mikmod/mmio/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/GRRMOD/mikmod/playercode/*.c"
Expand Down
7 changes: 6 additions & 1 deletion GRRMOD/GRRMOD_MOD.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*------------------------------------------------------------------------------
Copyright (c) 2010-2024 The GRRLIB Team
Copyright (c) 2010-2026 The GRRLIB Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,6 +19,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
------------------------------------------------------------------------------*/
// Required hack before including mikmod headers
// This is because libogc and libmikmod both defines BOOL
#define _MIKMOD_OS2 1
typedef char CHAR;
typedef unsigned long int ULONG;

#include "GRRMOD_internals.h"
#include "mikmod/include/mikmod.h"
Expand Down
22 changes: 19 additions & 3 deletions GRRMOD/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,27 @@ $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>dev
endif

include $(DEVKITPPC)/base_rules

ifeq ($(PLATFORM),cube)
MACHDEP := -DHW_DOL

# Installation directory
DESTDIR := $(DEVKITPRO)/portlibs/gamecube

LIBOGC_INC := $(DEVKITPRO)/libogc/include
LIBOGC_LIB := $(DEVKITPRO)/libogc/lib/cube
else
MACHDEP := -DHW_RVL

# Installation directory
DESTDIR := $(DEVKITPRO)/portlibs/wii

LIBOGC_INC := $(DEVKITPRO)/libogc/include
LIBOGC_LIB := $(DEVKITPRO)/libogc/lib/wii
endif

INSTALL_INC := $(DEVKITPRO)/portlibs/ppc/include
INSTALL_LIB := $(DEVKITPRO)/portlibs/ppc/lib
INSTALL_INC := $(DESTDIR)/include
INSTALL_LIB := $(DESTDIR)/lib

#---------------------------------------------------------------------------------
# options for building the library, set to yes to include, anything else to exclude
Expand Down Expand Up @@ -66,7 +82,7 @@ endif
#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------
MACHDEP := -DGEKKO -mcpu=750 -meabi -msdata=eabi -mhard-float -fmodulo-sched -ffunction-sections -fdata-sections
MACHDEP += -DGEKKO -mcpu=750 -meabi -msdata=eabi -mhard-float -fmodulo-sched -ffunction-sections -fdata-sections
CFLAGS += -O2 $(MACHDEP) $(INCLUDE)
CXXFLAGS := $(CFLAGS)

Expand Down
7 changes: 3 additions & 4 deletions GRRMOD/mikmod/drivers/drv_wii.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,14 @@
#endif

#include <gctypes.h>
#include <gcbool.h>
#include "mikmod_internals.h"

static int buffersize=0;
static int *audiobuffer=NULL;

static BOOL WII_IsThere(void)
{
return TRUE;
return true;
}

static int WII_Init(void)
Expand All @@ -59,12 +58,12 @@ static int WII_Init(void)

static void WII_CommandLine(const CHAR *cmdline)
{
CHAR *ptr=MD_GetAtom("buffer",cmdline,FALSE);
CHAR *ptr=MD_GetAtom("buffer",cmdline,false);
if (ptr) {
audiobuffer = (void *)atoi(ptr);
free(ptr);
}
ptr=MD_GetAtom("size",cmdline,FALSE);
ptr=MD_GetAtom("size",cmdline,false);
if (ptr) {
buffersize = atoi(ptr);
free(ptr);
Expand Down
5 changes: 3 additions & 2 deletions GRRMOD/mikmod/include/mikmod.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ extern "C" {

#define LIBMIKMOD_VERSION_MAJOR 3L
#define LIBMIKMOD_VERSION_MINOR 3L
#define LIBMIKMOD_REVISION 12L
#define LIBMIKMOD_REVISION 13L

#define LIBMIKMOD_VERSION \
((LIBMIKMOD_VERSION_MAJOR<<16)| \
Expand Down Expand Up @@ -124,7 +124,7 @@ typedef char CHAR;

/* BOOL: 0=false, <>0 true -- 16 bits on Amiga, int-wide on others. */
#if !(defined(_MIKMOD_OS2) || defined(_MIKMOD_WIN32) || defined(_MIKMOD_AMIGA))
typedef unsigned int BOOL;
typedef int BOOL;
#endif

/* 1 byte, signed and unsigned: */
Expand Down Expand Up @@ -834,6 +834,7 @@ MIKMODAPI extern struct MDRIVER drv_dc; /* Dreamcast driver */
MIKMODAPI extern struct MDRIVER drv_gp32; /* GP32 Sound driver */
MIKMODAPI extern struct MDRIVER drv_psp; /* PlayStation Portable driver */
MIKMODAPI extern struct MDRIVER drv_n64; /* Nintendo64 driver */
MIKMODAPI extern struct MDRIVER drv_vita; /* PlayStation Vita driver */

MIKMODAPI extern struct MDRIVER drv_wss; /* DOS WSS driver */
MIKMODAPI extern struct MDRIVER drv_sb; /* DOS S/B driver */
Expand Down
3 changes: 3 additions & 0 deletions GRRMOD/mikmod/playercode/mdreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ static void _mm_registeralldrivers(void)
#ifdef DRV_N64
_mm_registerdriver(&drv_n64);
#endif
#ifdef DRV_VITA
_mm_registerdriver(&drv_vita);
#endif

/* dos drivers - wss first, since some cards emulate sb */
#ifdef DRV_WSS
Expand Down
4 changes: 2 additions & 2 deletions GRRMOD/mikmod/playercode/mwav.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static SAMPLE* Sample_LoadGeneric_internal_wav(MREADER* reader)
_mm_errno=MMERR_UNKNOWN_WAVE_TYPE;
return NULL;
}
if(!(si=(SAMPLE*)MikMod_malloc(sizeof(SAMPLE)))) return NULL;
if(!(si=(SAMPLE*)MikMod_calloc(1,sizeof(SAMPLE)))) return NULL;
si->speed = wh.nSamplesPerSec/wh.nChannels;
si->volume = 64;
si->length = len;
Expand Down Expand Up @@ -172,7 +172,7 @@ static SAMPLE* Sample_LoadRawGeneric_internal(MREADER* reader, ULONG rate, ULONG
long len;
int samp_size=1;

if(!(si=(SAMPLE*)MikMod_malloc(sizeof(SAMPLE)))) return NULL;
if(!(si=(SAMPLE*)MikMod_calloc(1,sizeof(SAMPLE)))) return NULL;

/* length */
_mm_fseek(reader, 0, SEEK_END);
Expand Down
2 changes: 1 addition & 1 deletion LICENCE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2010-2025 The GRRLIB Team
Copyright (c) 2010-2026 The GRRLIB Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 1 addition & 10 deletions demo/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.18)
cmake_minimum_required(VERSION 3.25)
project(demo)

include(GNUInstallDirs)
Expand All @@ -16,10 +16,6 @@ find_library(FAT fat
find_library(GRRLIB grrlib REQUIRED)
find_library(PNGU pngu REQUIRED)

file(GLOB_RECURSE BIN_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/data/*.*"
)

add_executable(demo)

target_compile_options(demo
Expand All @@ -39,12 +35,7 @@ target_include_directories(demo
${DEVKITPRO}/portlibs/${OGC_CONSOLE}/${CMAKE_INSTALL_INCLUDEDIR}
)

dkp_add_embedded_binary_library(data
${BIN_FILES}
)

target_link_libraries(demo
data
${GRRMOD_LIBRARIES}
${GRRLIB}
${PNGU}
Expand Down
100 changes: 1 addition & 99 deletions demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ include $(DEVKITPPC)/wii_rules
TARGET := $(notdir $(CURDIR))
BUILD := build
SOURCES := source
DATA := data
DATA :=
INCLUDES :=

#---------------------------------------------------------------------------------
Expand Down Expand Up @@ -138,104 +138,6 @@ $(OUTPUT).elf: $(OFILES)
@echo $(notdir $<)
$(bin2o)

#---------------------------------------------------------------------------------
# This rule links in binary Module data
#---------------------------------------------------------------------------------
%.mp3.o : %.mp3
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.mod.o : %.mod
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.xm.o : %.xm
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.it.o : %.it
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.s3m.o : %.s3m
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.stm.o : %.stm
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.stx.o : %.stx
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.669.o : %.669
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.amf.o : %.amf
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.asy.o : %.asy
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.med.o : %.med
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.mtm.o : %.mtm
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.far.o : %.far
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.ult.o : %.ult
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.uni.o : %.uni
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.okta.o : %.okta
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.imf.o : %.imf
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.gdm.o : %.gdm
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)
#---------------------------------------------------------------------------------
%.dsm.o : %.dsm
#---------------------------------------------------------------------------------
@echo $(notdir $<)
$(bin2o)


-include $(DEPENDS)

Expand Down
Loading