From: kub Date: Mon, 23 Oct 2023 21:13:30 +0000 (+0200) Subject: compile fixes for CI X-Git-Tag: v2.00~176 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3167aa9a9446a68458e26c14e5589e4581b15a04;p=picodrive.git compile fixes for CI --- diff --git a/.gitmodules b/.gitmodules index 53449e32..4f610dff 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,9 +7,10 @@ [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 diff --git a/Makefile b/Makefile index d3fe5e3e..152e0181 100644 --- a/Makefile +++ b/Makefile @@ -231,7 +231,7 @@ OBJS += platform/gp2x/vid_mmsp2.o 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 @@ -373,6 +373,7 @@ clean: $(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) @@ -439,7 +440,9 @@ cpu/fame/famec.o: CFLAGS += -Od 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 diff --git a/README.md b/README.md index 68806637..cdfb1da7 100644 --- a/README.md +++ b/README.md @@ -52,14 +52,14 @@ MP3 audio files with CD games. The helix source files are however not supplied 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 diff --git a/pico/32x/32x.c b/pico/32x/32x.c index d0d26f02..d88b23f0 100644 --- a/pico/32x/32x.c +++ b/pico/32x/32x.c @@ -282,7 +282,7 @@ static void p32x_end_blank(void) 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); } diff --git a/pico/sound/sound.c b/pico/sound/sound.c index f4686c2d..9c7a9289 100644 --- a/pico/sound/sound.c +++ b/pico/sound/sound.c @@ -120,6 +120,12 @@ static void YM2612_setup_FIR(int inrate, int outrate, int stereo) 0.85, 2, 2*inrate/50, stereo); } +// wrapper for the YM2612UpdateONE macro +static int YM2612UpdateONE(s32 *buffer, int length, int stereo, int is_buf_empty) +{ + return YM2612UpdateOne(buffer, length, stereo, is_buf_empty); +} + // to be called after changing sound rate or chips void PsndRerate(int preserve_state) { @@ -146,7 +152,7 @@ void PsndRerate(int preserve_state) YM2612Init(ym2612_clock, PicoIn.sndRate, ((PicoIn.opt&POPT_DIS_FM_SSGEG) ? 0 : ST_SSG) | ((PicoIn.opt&POPT_EN_FM_DAC) ? ST_DAC : 0)); - PsndFMUpdate = YM2612UpdateOne; + PsndFMUpdate = YM2612UpdateONE; } if (preserve_state) { // feed it back it's own registers, just like after loading state diff --git a/pico/sound/ym2612.h b/pico/sound/ym2612.h index 3e364b7a..84263b2b 100644 --- a/pico/sound/ym2612.h +++ b/pico/sound/ym2612.h @@ -179,6 +179,7 @@ void *YM2612GetRegs(void); void YM2612PicoStateSave2(int tat, int tbt); int YM2612PicoStateLoad2(int *tat, int *tbt); +/* NB must be macros for compiling GP2X 940 code */ #ifndef __GP2X__ #define YM2612Init YM2612Init_ #define YM2612ResetChip YM2612ResetChip_ @@ -187,23 +188,14 @@ int YM2612PicoStateLoad2(int *tat, int *tbt); #else /* GP2X specific */ #include -static inline void YM2612Init(int baseclock, int rate, int flags) { - if (PicoIn.opt&POPT_EXT_FM) YM2612Init_940(baseclock, rate, flags); - else YM2612Init_(baseclock, rate, flags); -} - -static inline void YM2612ResetChip(void) { - if (PicoIn.opt&POPT_EXT_FM) YM2612ResetChip_940(); - else YM2612ResetChip_(); -} -static inline int YM2612UpdateOne(s32 *buffer, int length, int stereo, int is_buf_empty) { - return (PicoIn.opt&POPT_EXT_FM) ? YM2612UpdateOne_940(buffer, length, stereo, is_buf_empty) : - YM2612UpdateOne_(buffer, length, stereo, is_buf_empty); -} -static inline void YM2612PicoStateLoad(void) { - if (PicoIn.opt&POPT_EXT_FM) YM2612PicoStateLoad_940(); - else YM2612PicoStateLoad_(); -} +#define YM2612Init(baseclock, rate, flags) \ + (PicoIn.opt & POPT_EXT_FM ? YM2612Init_940 : YM2612Init_)(baseclock, rate, flags) +#define YM2612ResetChip() \ + (PicoIn.opt & POPT_EXT_FM ? YM2612ResetChip_940 : YM2612ResetChip_)() +#define YM2612PicoStateLoad() \ + (PicoIn.opt & POPT_EXT_FM ? YM2612PicoStateLoad_940 : YM2612PicoStateLoad_)() +#define YM2612UpdateOne(buffer, length, sterao, isempty) \ + (PicoIn.opt & POPT_EXT_FM ? YM2612UpdateOne_940 : YM2612UpdateOne_)(buffer, length, stereo, isempty) #endif /* __GP2X__ */ diff --git a/platform/common/helix/Makefile b/platform/common/helix/Makefile index 9fa4c1cc..9f3f4ef0 100644 --- a/platform/common/helix/Makefile +++ b/platform/common/helix/Makefile @@ -1,9 +1,9 @@ -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 diff --git a/platform/common/mp3_helix.c b/platform/common/mp3_helix.c index 0e53bf8f..f3650bf2 100644 --- a/platform/common/mp3_helix.c +++ b/platform/common/mp3_helix.c @@ -12,10 +12,16 @@ #include #include -#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__ diff --git a/platform/gp2x/code940/Makefile b/platform/gp2x/code940/Makefile index 6968f835..2535cfda 100644 --- a/platform/gp2x/code940/Makefile +++ b/platform/gp2x/code940/Makefile @@ -1,15 +1,6 @@ # you may or may not need to change this -#devkit_path ?= $(HOME)/opt/devkitGP2X/ -#lgcc_path = $(devkit_path)lib/gcc/arm-linux/4.0.3/ -#CROSS = $(devkit_path)bin/arm-linux- -#devkit_path ?= $(HOME)/opt/open2x -#lgcc_path = $(devkit_path)/gcc-4.1.1-glibc-2.3.6/lib/gcc/arm-open2x-linux/4.1.1/ -#CROSS ?= $(devkit_path)/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux- -#devkit_path ?= $(HOME)/opt/arm-unknown-linux-gnu -#lgcc_path = $(HOME)/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/gcc/arm-open2x-linux/4.1.1/ -#CROSS ?= $(devkit_path)/bin/arm-unknown-linux-gnu- lgcc_path = $(HOME)/opt/open2x/gcc-4.1.1-glibc-2.3.6/lib/gcc/arm-open2x-linux/4.1.1/ -CROSS ?= arm-linux-gnueabi- +CROSS_COMPILE ?= arm-none-eabi- # settings #up = 1 @@ -19,11 +10,11 @@ CFLAGS += -I../../common/helix/pub -I../../.. -I. -D__GP2X__ -DARM CFLAGS += -mcpu=arm940t -mtune=arm940t -mabi=apcs-gnu -mfloat-abi=soft -mfpu=fpa LDFLAGS = -static -e code940 -Ttext 0x0 -L$(lgcc_path) -lgcc -GCC = $(CROSS)gcc -STRIP = $(CROSS)strip -AS = $(CROSS)as -LD = $(CROSS)ld -OBJCOPY = $(CROSS)objcopy +GCC = $(CROSS_COMPILE)gcc +STRIP = $(CROSS_COMPILE)strip +AS = $(CROSS_COMPILE)as +LD = $(CROSS_COMPILE)ld +OBJCOPY = $(CROSS_COMPILE)objcopy vpath %.c = ../../common @@ -52,7 +43,7 @@ OBJS940 += 940init.o 940.o 940ym2612.o misc_arm.o mp3_sync.o OBJS940 += uClibc/memset.o uClibc/s_floor.o uClibc/e_pow.o uClibc/e_sqrt.o uClibc/s_fabs.o OBJS940 += uClibc/s_scalbn.o uClibc/s_copysign.o uClibc/k_sin.o uClibc/k_cos.o uClibc/s_sin.o OBJS940 += uClibc/e_rem_pio2.o uClibc/k_rem_pio2.o uClibc/e_log.o uClibc/wrappers.o -LIBHELIX ?= ../../common/helix/$(notdir $(CROSS))helix_mp3.a +LIBHELIX ?= ../../common/helix/$(notdir $(CROSS_COMPILE))helix_mp3.a $(BIN) : code940.elf @echo ">>>" $@ @@ -75,7 +66,7 @@ mp3_sync.o: ../../common/mp3_sync.c $(GCC) $(CFLAGS) -Os -DCODE940 -c $< -o $@ $(LIBHELIX): - @$(MAKE) -C ../../common/helix/ CROSS=$(CROSS) + @$(MAKE) -C ../../common/helix/ CROSS_COMPILE=$(CROSS_COMPILE) up: $(BIN) diff --git a/platform/gp2x/code940/pico940_v3.bin b/platform/gp2x/code940/pico940_v3.bin new file mode 100755 index 00000000..d77ac4bc Binary files /dev/null and b/platform/gp2x/code940/pico940_v3.bin differ diff --git a/platform/gp2x/warm_2.4.25.o b/platform/gp2x/warm_2.4.25.o new file mode 100644 index 00000000..23a80b81 Binary files /dev/null and b/platform/gp2x/warm_2.4.25.o differ diff --git a/platform/gp2x/warm_2.4.26-open2x.o b/platform/gp2x/warm_2.4.26-open2x.o new file mode 100644 index 00000000..5bcb338b Binary files /dev/null and b/platform/gp2x/warm_2.4.26-open2x.o differ diff --git a/platform/gp2x/warm_2.6.24.ko b/platform/gp2x/warm_2.6.24.ko new file mode 100644 index 00000000..d2b8dc4d Binary files /dev/null and b/platform/gp2x/warm_2.6.24.ko differ diff --git a/platform/psp/Makefile b/platform/psp/Makefile index ee6ed25f..6231d1ea 100644 --- a/platform/psp/Makefile +++ b/platform/psp/Makefile @@ -6,6 +6,12 @@ $(error need VER) endif endif +../../tools/textfilter: ../../tools/textfilter.c + make -C ../../tools/ textfilter + +readme.txt: ../../tools/textfilter ../base_readme.txt ../../ChangeLog + ../../tools/textfilter ../base_readme.txt $@ PSP + # ? rel: ../../EBOOT.PBP readme.txt ../game_def.cfg mkdir -p PicoDrive/skin/ diff --git a/tools/Makefile b/tools/Makefile index b20bc20f..77fd273f 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,4 +1,4 @@ -TARGETS = amalgamate textfilter +TARGETS = amalgamate textfilter make_carthw_c HOSTCC ?= cc all: