Skip to content

Commit

Permalink
Merge branch 'libretro:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanaobrien authored Sep 1, 2023
2 parents 74fbae4 + 5703193 commit 713ae2d
Show file tree
Hide file tree
Showing 39 changed files with 571 additions and 393 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci-gp2x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI (GP2X)
on: [push, pull_request]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: |
whoami
sudo apt-get update -qq
sudo apt-get install -y wget
wget http://notaz.gp2x.de/downloads/gp2x/devkitGP2X_small.tar.xz
tar -C /tmp/ -xf devkitGP2X_small.tar.xz
- name: configure
run: DUMP_CONFIG_LOG=1 PATH=$PATH:/tmp/devkitGP2X/bin CROSS_COMPILE=arm-linux- ./configure --platform=gp2x
- name: make
run: PATH=$PATH:/tmp/devkitGP2X/bin CROSS_COMPILE=arm-linux- make PLATFORM_MP3=0
11 changes: 11 additions & 0 deletions .github/workflows/ci-libretro-default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: CI (libretro default)
on: [push, pull_request]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: make
run: LDFLAGS=-Wl,--no-undefined make -f Makefile.libretro
17 changes: 17 additions & 0 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI (Linux)
on: [push, pull_request]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y libsdl1.2-dev libasound2-dev libpng-dev libz-dev
- name: configure
run: DUMP_CONFIG_LOG=1 ./configure
- name: make
run: make
20 changes: 20 additions & 0 deletions .github/workflows/ci-pandora.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI (pandora)
on: [push, pull_request]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: |
whoami
sudo apt-get update -qq
sudo apt-get install -y wget
wget http://notaz.gp2x.de/misc/pnd/toolchains/arm-gcc-4.9.4_with_libs_small.tar.xz
tar -C /tmp/ -xf arm-gcc-4.9.4_with_libs_small.tar.xz
- name: configure
run: DUMP_CONFIG_LOG=1 PATH=$PATH:/tmp/arm-gcc-4.9.4/bin CPATH=/tmp/arm-gcc-4.9.4/arm-unknown-linux-gnueabi/sysroot/usr/local/include/ CROSS_COMPILE=arm-unknown-linux-gnueabi- ./configure --platform=pandora
- name: make
run: PATH=$PATH:/tmp/arm-gcc-4.9.4/bin CPATH=/tmp/arm-gcc-4.9.4/arm-unknown-linux-gnueabi/sysroot/usr/local/include/ CROSS_COMPILE=arm-unknown-linux-gnueabi- make
20 changes: 20 additions & 0 deletions .github/workflows/ci-psp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI (PSP)
on: [push, pull_request]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install dependencies
run: |
whoami
sudo apt-get update -qq
sudo apt-get install -y wget
wget https://github.com/pspdev/pspdev/releases/download/latest/pspdev-ubuntu-latest.tar.gz
tar -C /tmp/ -xf pspdev-ubuntu-latest.tar.gz
- name: configure
run: DUMP_CONFIG_LOG=1 PATH=$PATH:/tmp/pspdev/bin CROSS_COMPILE=psp- ./configure --platform=psp
- name: make
run: PATH=$PATH:/tmp/pspdev/bin CROSS_COMPILE=psp- make
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ chkCCflag = $(shell n=/dev/null; echo $(1) | tr " " "\n" | while read f; do \

ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","gp2x" "opendingux" "miyoo" "rpi1"))
# very small caches, avoid optimization options making the binary much bigger
CFLAGS += -fno-common -fno-stack-protector -finline-limit=42 -fno-unroll-loops -ffast-math
CFLAGS += -fno-common -finline-limit=42 -fno-unroll-loops -ffast-math
CFLAGS += $(call chkCCflag, -fno-stack-protector)
ifneq ($(call chkCCflag, -fipa-ra),) # gcc >= 5
CFLAGS += $(call chkCCflag, -flto -fipa-pta -fipa-ra)
else
# these improve execution speed on 32bit arm/mips with gcc pre-5 toolchains
CFLAGS += -fno-ipa-cp -fno-caller-saves -fno-guess-branch-probability -fno-regmove
CFLAGS += -fno-caller-saves -fno-guess-branch-probability -fno-regmove
# very old gcc toolchains may not have these options
CFLAGS += $(call chkCCflag, -fno-tree-loop-if-convert -fipa-pta)
CFLAGS += $(call chkCCflag, -fno-tree-loop-if-convert -fipa-pta -fno-ipa-cp)
endif
endif

Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ config_mak="config.mak"
fail()
{
echo "$@"
if test -n "$DUMP_CONFIG_LOG"; then cat config.log; fi
exit 1
}

Expand Down Expand Up @@ -127,7 +128,7 @@ set_platform()
pandora)
sound_drivers="oss alsa"
have_libavcodec="yes"
MFLAGS="-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard"
MFLAGS="-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp"
;;
gp2x | wiz | caanoo)
sound_drivers="oss"
Expand All @@ -148,7 +149,6 @@ set_platform()
CFLAGS="$CFLAGS -D__PSP__"
MFLAGS="-march=allegrex"
ARCH=mipsel
need_zlib="yes"
;;
*)
fail "unsupported platform: $platform"
Expand Down
10 changes: 5 additions & 5 deletions cpu/DrZ80/drz80.S
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ z80_xmap_rebase_sp:
sub r2,z80pc,r1
str r2,[cpucontext,#previouspc]
.endif
ldrplb r0,[z80pc],#1
ldrpl pc,[opcodes,r0, lsl #2]
bmi z80_execute_end
ldrgtb r0,[z80pc],#1
ldrgt pc,[opcodes,r0, lsl #2]
ble z80_execute_end
.endm

.macro eatcycles cycs
Expand Down Expand Up @@ -1442,8 +1442,8 @@ DrZ80Run:
PIC_LDR(opcodes, r0, MAIN_opcodes)

cmp z80_icount,#0 ;@ irq might have used all cycles
ldrplb r0,[z80pc],#1
ldrpl pc,[opcodes,r0, lsl #2]
ldrgtb r0,[z80pc],#1
ldrgt pc,[opcodes,r0, lsl #2]


z80_execute_end:
Expand Down
40 changes: 12 additions & 28 deletions cpu/cz80/cz80_opXY.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,39 +70,39 @@ switch (Opcode)
OPXY(0x5c): // LD E,HX
OPXY(0x7c): // LD A,HX
zR8((Opcode >> 3) & 7) = data->B.H;
RET(5)
RET(4)

OPXY(0x45): // LD B,LX
OPXY(0x4d): // LD C,LX
OPXY(0x55): // LD D,LX
OPXY(0x5d): // LD E,LX
OPXY(0x7d): // LD A,LX
zR8((Opcode >> 3) & 7) = data->B.L;
RET(5)
RET(4)

OPXY(0x60): // LD HX,B
OPXY(0x61): // LD HX,C
OPXY(0x62): // LD HX,D
OPXY(0x63): // LD HX,E
OPXY(0x67): // LD HX,A
data->B.H = zR8(Opcode & 7);
RET(5)
RET(4)

OPXY(0x68): // LD LX,B
OPXY(0x69): // LD LX,C
OPXY(0x6a): // LD LX,D
OPXY(0x6b): // LD LX,E
OPXY(0x6f): // LD LX,A
data->B.L = zR8(Opcode & 7);
RET(5)
RET(4)

OPXY(0x65): // LD HX,LX
data->B.H = data->B.L;
RET(5)
RET(4)

OPXY(0x6c): // LD LX,HX
data->B.L = data->B.H;
RET(5)
RET(4)

OPXY(0x06): // LD B,#imm
OPXY(0x0e): // LD C,#imm
Expand All @@ -113,11 +113,11 @@ switch (Opcode)

OPXY(0x26): // LD HX,#imm
data->B.H = READ_ARG();
RET(5)
RET(4)

OPXY(0x2e): // LD LX,#imm
data->B.L = READ_ARG();
RET(5)
RET(4)

OPXY(0x0a): // LD A,(BC)
goto OP_LOAD_A_mBC;
Expand Down Expand Up @@ -244,12 +244,12 @@ switch (Opcode)
OPXY(0x24): // INC HX
data->B.H++;
zF = (zF & CF) | SZHV_inc[data->B.H];
RET(5)
RET(4)

OPXY(0x2c): // INC LX
data->B.L++;
zF = (zF & CF) | SZHV_inc[data->B.L];
RET(5)
RET(4)

OPXY(0x34): // INC (IX+o)
adr = data->W + (INT8)READ_ARG();
Expand All @@ -270,12 +270,12 @@ switch (Opcode)
OPXY(0x25): // DEC HX
data->B.H--;
zF = (zF & CF) | SZHV_dec[data->B.H];
RET(5)
RET(4)

OPXY(0x2d): // DEC LX
data->B.L--;
zF = (zF & CF) | SZHV_dec[data->B.L];
RET(5)
RET(4)

OPXY(0x35): // DEC (IX+o)
adr = data->W + (INT8)READ_ARG();
Expand All @@ -298,12 +298,10 @@ switch (Opcode)

OPXY(0x84): // ADD A,HX
val = data->B.H;
USE_CYCLES(1)
goto OP_ADD;

OPXY(0x85): // ADD A,LX
val = data->B.L;
USE_CYCLES(1)
goto OP_ADD;

OPXY(0x86): // ADD A,(IX+o)
Expand All @@ -328,12 +326,10 @@ switch (Opcode)

OPXY(0x8c): // ADC A,HX
val = data->B.H;
USE_CYCLES(1)
goto OP_ADC;

OPXY(0x8d): // ADC A,LX
val = data->B.L;
USE_CYCLES(1)
goto OP_ADC;

OPXY(0x8e): // ADC A,(IX+o)
Expand All @@ -358,12 +354,10 @@ switch (Opcode)

OPXY(0x94): // SUB HX
val = data->B.H;
USE_CYCLES(1)
goto OP_SUB;

OPXY(0x95): // SUB LX
val = data->B.L;
USE_CYCLES(1)
goto OP_SUB;

OPXY(0x96): // SUB (IX+o)
Expand All @@ -388,12 +382,10 @@ switch (Opcode)

OPXY(0x9c): // SBC A,HX
val = data->B.H;
USE_CYCLES(1)
goto OP_SBC;

OPXY(0x9d): // SBC A,LX
val = data->B.L;
USE_CYCLES(1)
goto OP_SBC;

OPXY(0x9e): // SBC A,(IX+o)
Expand All @@ -418,12 +410,10 @@ switch (Opcode)

OPXY(0xbc): // CP HX
val = data->B.H;
USE_CYCLES(1)
goto OP_CP;

OPXY(0xbd): // CP LX
val = data->B.L;
USE_CYCLES(1)
goto OP_CP;

OPXY(0xbe): // CP (IX+o)
Expand All @@ -448,12 +438,10 @@ switch (Opcode)

OPXY(0xa4): // AND HX
val = data->B.H;
USE_CYCLES(1)
goto OP_AND;

OPXY(0xa5): // AND LX
val = data->B.L;
USE_CYCLES(1)
goto OP_AND;

OPXY(0xa6): // AND (IX+o)
Expand All @@ -478,12 +466,10 @@ switch (Opcode)

OPXY(0xac): // XOR HX
val = data->B.H;
USE_CYCLES(1)
goto OP_XOR;

OPXY(0xad): // XOR LX
val = data->B.L;
USE_CYCLES(1)
goto OP_XOR;

OPXY(0xae): // XOR (IX+o)
Expand All @@ -508,12 +494,10 @@ switch (Opcode)

OPXY(0xb4): // OR HX
val = data->B.H;
USE_CYCLES(1)
goto OP_OR;

OPXY(0xb5): // OR LX
val = data->B.L;
USE_CYCLES(1)
goto OP_OR;

OPXY(0xb6): // OR (IX+o)
Expand Down
Loading

0 comments on commit 713ae2d

Please sign in to comment.