compile fixes for CI

This commit is contained in:
kub 2023-10-23 23:13:30 +02:00
parent 725e007ae5
commit 3167aa9a94
15 changed files with 56 additions and 51 deletions

3
.gitmodules vendored
View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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 <platform/gp2x/940ctl.h>
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__ */

View file

@ -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

View file

@ -12,10 +12,16 @@
#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__

View file

@ -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)

Binary file not shown.

BIN
platform/gp2x/warm_2.4.25.o Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -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/

View file

@ -1,4 +1,4 @@
TARGETS = amalgamate textfilter
TARGETS = amalgamate textfilter make_carthw_c
HOSTCC ?= cc
all: