[submodule "pico/sound/emu2413"]
path = pico/sound/emu2413
url = https://github.com/digital-sound-antiques/emu2413.git
+ branch = main
[submodule "pico/cd/libchdr"]
path = pico/cd/libchdr
- url = https://github.com/rtissera/libchdr.git
+ url = https://github.com/irixxxx/libchdr.git
[submodule "platform/common/dr_libs"]
path = platform/common/dr_libs
url = https://github.com/mackron/dr_libs.git
OBJS += platform/gp2x/vid_pollux.o
OBJS += platform/gp2x/warm.o
USE_FRONTEND = 1
-PLATFORM_MP3 = 1
+PLATFORM_MP3 ?= 1
endif
ifeq "$(PLATFORM)" "psp"
CFLAGS += -DUSE_BGR565 -G8 # -DLPRINTF_STDIO -DFW15
$(RM) $(TARGET) $(OBJS) pico/pico_int_offs.h
$(MAKE) -C cpu/cyclone clean
$(MAKE) -C cpu/musashi clean
+ $(MAKE) -C tools clean
$(RM) -r .od_data
$(TARGET): $(OBJS)
endif
endif
-pico/carthw_cfg.c: pico/carthw.cfg
+tools/make_carthw_c:
+ make -C tools make_carthw_c
+pico/carthw_cfg.c: pico/carthw.cfg tools/make_carthw_c
tools/make_carthw_c $< $@
# preprocessed asm files most probably include the offsets file
due to licensing issues. If you have legally obtained the sources, put them in
the platform/common/helix directory.
-To compile the helix sources, set CROSS to your cross compiler prefix
+To compile the helix sources, set CROSS_COMPILE to your cross compiler prefix
(e.g. arm-linux-gnueabi-) and LIBGCC to your cross compiler's libgcc.a
(e.g. /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/libgcc.a), and compile with
-> make -C platform/common/helix CROSS=$CROSS LIBGCC=$LIBGCC
+> make -C platform/common/helix CROSS_COMPILE=$CROSS_COMPILE LIBGCC=$LIBGCC
-This will result in a shared library named ${CROSS}helix_mp3.so. Copy this
-as libhelix.so to where the PicoDrive binary is on the target device.
+This will result in a shared library named ${CROSS_COMPILE}helix_mp3.so. Copy
+this as libhelix.so to where the PicoDrive binary is on the target device.
Also, the support for helix must be enabled in PicoDrive by compiling with
Pico32x.vdp_regs[0x0a/2] &= ~P32XV_PEN; // no palette access
if (!(Pico32x.sh2_regs[0] & 0x80)) {
// NB must precede VInt per hw manual, min 4 SH-2 cycles to pass Mars Check
- Pico32x.hint_counter = -0x18;
+ Pico32x.hint_counter = (int)(-1.5*0x10);
p32x_schedule_hint(NULL, Pico.t.m68c_aim);
}
0.85, 2, 2*inrate/50, stereo);\r
}\r
\r
+// wrapper for the YM2612UpdateONE macro\r
+static int YM2612UpdateONE(s32 *buffer, int length, int stereo, int is_buf_empty)\r
+{\r
+ return YM2612UpdateOne(buffer, length, stereo, is_buf_empty);\r
+}\r
+\r
// to be called after changing sound rate or chips\r
void PsndRerate(int preserve_state)\r
{\r
YM2612Init(ym2612_clock, PicoIn.sndRate,\r
((PicoIn.opt&POPT_DIS_FM_SSGEG) ? 0 : ST_SSG) |\r
((PicoIn.opt&POPT_EN_FM_DAC) ? ST_DAC : 0));\r
- PsndFMUpdate = YM2612UpdateOne;\r
+ PsndFMUpdate = YM2612UpdateONE;\r
}\r
if (preserve_state) {\r
// feed it back it's own registers, just like after loading state\r
void YM2612PicoStateSave2(int tat, int tbt);\r
int YM2612PicoStateLoad2(int *tat, int *tbt);\r
\r
+/* NB must be macros for compiling GP2X 940 code */\r
#ifndef __GP2X__\r
#define YM2612Init YM2612Init_\r
#define YM2612ResetChip YM2612ResetChip_\r
#else\r
/* GP2X specific */\r
#include <platform/gp2x/940ctl.h>\r
-static inline void YM2612Init(int baseclock, int rate, int flags) {\r
- if (PicoIn.opt&POPT_EXT_FM) YM2612Init_940(baseclock, rate, flags);\r
- else YM2612Init_(baseclock, rate, flags);\r
-}\r
-\r
-static inline void YM2612ResetChip(void) {\r
- if (PicoIn.opt&POPT_EXT_FM) YM2612ResetChip_940();\r
- else YM2612ResetChip_();\r
-}\r
-static inline int YM2612UpdateOne(s32 *buffer, int length, int stereo, int is_buf_empty) {\r
- return (PicoIn.opt&POPT_EXT_FM) ? YM2612UpdateOne_940(buffer, length, stereo, is_buf_empty) :\r
- YM2612UpdateOne_(buffer, length, stereo, is_buf_empty);\r
-}\r
-static inline void YM2612PicoStateLoad(void) {\r
- if (PicoIn.opt&POPT_EXT_FM) YM2612PicoStateLoad_940();\r
- else YM2612PicoStateLoad_();\r
-}\r
+#define YM2612Init(baseclock, rate, flags) \\r
+ (PicoIn.opt & POPT_EXT_FM ? YM2612Init_940 : YM2612Init_)(baseclock, rate, flags)\r
+#define YM2612ResetChip() \\r
+ (PicoIn.opt & POPT_EXT_FM ? YM2612ResetChip_940 : YM2612ResetChip_)()\r
+#define YM2612PicoStateLoad() \\r
+ (PicoIn.opt & POPT_EXT_FM ? YM2612PicoStateLoad_940 : YM2612PicoStateLoad_)()\r
+#define YM2612UpdateOne(buffer, length, sterao, isempty) \\r
+ (PicoIn.opt & POPT_EXT_FM ? YM2612UpdateOne_940 : YM2612UpdateOne_)(buffer, length, stereo, isempty)\r
#endif /* __GP2X__ */\r
\r
\r
-CROSS ?= arm-linux-gnueabi-
+CROSS_COMPILE ?= arm-linux-gnueabi-
-CC = $(CROSS)gcc
-AS = $(CROSS)as
-AR = $(CROSS)ar
-TOOLCHAIN = $(notdir $(CROSS))
+CC = $(CROSS_COMPILE)gcc
+AS = $(CROSS_COMPILE)as
+AR = $(CROSS_COMPILE)ar
+TOOLCHAIN = $(notdir $(CROSS_COMPILE))
LIBGCC ?= ${HOME}/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/gcc/arm-open2x-linux/4.1.1/libgcc.a
CFLAGS += -Ipub -O2 -Wall -fstrict-aliasing -ffast-math
#include <dlfcn.h>
#include <pico/pico_int.h>
-#include "helix/pub/mp3dec.h"
+/*#include "helix/pub/mp3dec.h"*/
#include "mp3.h"
-static HMP3Decoder mp3dec;
+#ifndef _MP3DEC_H
+typedef void *HMP3Decoder;
+#define ERR_MP3_INDATA_UNDERFLOW -1
+#define ERR_MP3_MAINDATA_UNDERFLOW -2
+#endif
+
+static void *mp3dec;
static unsigned char mp3_input_buffer[2 * 1024];
#ifdef __GP2X__
# you may or may not need to change this\r
-#devkit_path ?= $(HOME)/opt/devkitGP2X/\r
-#lgcc_path = $(devkit_path)lib/gcc/arm-linux/4.0.3/\r
-#CROSS = $(devkit_path)bin/arm-linux-\r
-#devkit_path ?= $(HOME)/opt/open2x\r
-#lgcc_path = $(devkit_path)/gcc-4.1.1-glibc-2.3.6/lib/gcc/arm-open2x-linux/4.1.1/\r
-#CROSS ?= $(devkit_path)/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-\r
-#devkit_path ?= $(HOME)/opt/arm-unknown-linux-gnu\r
-#lgcc_path = $(HOME)/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/gcc/arm-open2x-linux/4.1.1/\r
-#CROSS ?= $(devkit_path)/bin/arm-unknown-linux-gnu-\r
lgcc_path = $(HOME)/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/gcc/arm-open2x-linux/4.1.1/\r
-CROSS ?= arm-linux-gnueabi-\r
+CROSS_COMPILE ?= arm-none-eabi-\r
\r
# settings\r
#up = 1\r
CFLAGS += -mcpu=arm940t -mtune=arm940t -mabi=apcs-gnu -mfloat-abi=soft -mfpu=fpa\r
LDFLAGS = -static -e code940 -Ttext 0x0 -L$(lgcc_path) -lgcc\r
\r
-GCC = $(CROSS)gcc\r
-STRIP = $(CROSS)strip\r
-AS = $(CROSS)as\r
-LD = $(CROSS)ld\r
-OBJCOPY = $(CROSS)objcopy\r
+GCC = $(CROSS_COMPILE)gcc\r
+STRIP = $(CROSS_COMPILE)strip\r
+AS = $(CROSS_COMPILE)as\r
+LD = $(CROSS_COMPILE)ld\r
+OBJCOPY = $(CROSS_COMPILE)objcopy\r
\r
vpath %.c = ../../common\r
\r
OBJS940 += uClibc/memset.o uClibc/s_floor.o uClibc/e_pow.o uClibc/e_sqrt.o uClibc/s_fabs.o\r
OBJS940 += uClibc/s_scalbn.o uClibc/s_copysign.o uClibc/k_sin.o uClibc/k_cos.o uClibc/s_sin.o\r
OBJS940 += uClibc/e_rem_pio2.o uClibc/k_rem_pio2.o uClibc/e_log.o uClibc/wrappers.o\r
-LIBHELIX ?= ../../common/helix/$(notdir $(CROSS))helix_mp3.a\r
+LIBHELIX ?= ../../common/helix/$(notdir $(CROSS_COMPILE))helix_mp3.a\r
\r
$(BIN) : code940.elf\r
@echo ">>>" $@\r
$(GCC) $(CFLAGS) -Os -DCODE940 -c $< -o $@\r
\r
$(LIBHELIX):\r
- @$(MAKE) -C ../../common/helix/ CROSS=$(CROSS)\r
+ @$(MAKE) -C ../../common/helix/ CROSS_COMPILE=$(CROSS_COMPILE)\r
\r
\r
up: $(BIN)\r
endif\r
endif\r
\r
+../../tools/textfilter: ../../tools/textfilter.c\r
+ make -C ../../tools/ textfilter\r
+\r
+readme.txt: ../../tools/textfilter ../base_readme.txt ../../ChangeLog\r
+ ../../tools/textfilter ../base_readme.txt $@ PSP\r
+\r
# ?\r
rel: ../../EBOOT.PBP readme.txt ../game_def.cfg\r
mkdir -p PicoDrive/skin/\r
-TARGETS = amalgamate textfilter
+TARGETS = amalgamate textfilter make_carthw_c
HOSTCC ?= cc
all: