Skip to content

Commit dc3cbfe

Browse files
authored
Merge pull request #3442 from cmitu/advmame-fixes
advmame: build fixes when using a newer `gcc`
2 parents b191e62 + 3c961d1 commit dc3cbfe

File tree

5 files changed

+56
-3
lines changed

5 files changed

+56
-3
lines changed

scriptmodules/emulators/advmame-0.94.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ function depends_advmame-0.94() {
2525
function sources_advmame-0.94() {
2626
downloadAndExtract "$md_repo_url" "$md_build" --strip-components 1
2727
_sources_patch_advmame-1.4
28+
# Fix the global vars missing the 'external' qualifier, needed for gcc > 10
29+
applyPatch "${md_path%/*}/advmame/02_fix_extern_globals_0_94.diff"
2830
}
2931

3032
function build_advmame-0.94() {

scriptmodules/emulators/advmame-1.4.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ function _sources_patch_advmame-1.4() {
3939

4040
# patch advmame to use a fake generated mode with the exact dimensions for fb - avoids need for configuring monitor / clocks.
4141
# the pi framebuffer doesn't use any of the framebuffer timing configs - it hardware scales from chosen dimensions to actual size
42-
applyPatch "$scriptdir/scriptmodules/$md_type/advmame/01_rpi_framebuffer.diff"
42+
applyPatch "${md_path%/*}/advmame/01_rpi_framebuffer.diff"
4343
fi
4444
}
4545

4646
function sources_advmame-1.4() {
4747
downloadAndExtract "$md_repo_url" "$md_build" --strip-components 1
4848
_sources_patch_advmame-1.4 1.4
49+
# Fix the global vars missing the 'external' qualifier, needed for gcc > 10
50+
applyPatch "${md_path%/*}/advmame/02_fix_extern_globals_1_4.diff"
4951
}
5052

5153
function build_advmame-1.4() {

scriptmodules/emulators/advmame.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ function sources_advmame() {
4343
function build_advmame() {
4444
local params=()
4545
if isPlatform "videocore"; then
46-
params+=(--enable-sdl1 --disable-sdl2 --enable-vc)
46+
params+=(--enable-sdl --disable-sdl2 --enable-vc)
4747
else
48-
params+=(--enable-sdl2 --disable-sdl1 --disable-vc)
48+
params+=(--enable-sdl2 --disable-sdl --disable-vc)
4949
fi
5050
./autogen.sh
5151
./configure CFLAGS="$CFLAGS -fno-stack-protector" --prefix="$md_inst" "${params[@]}"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/src/drivers/seibuspi.c b/src/drivers/seibuspi.c
2+
index 143dcc2..91187f8 100644
3+
--- a/src/drivers/seibuspi.c
4+
+++ b/src/drivers/seibuspi.c
5+
@@ -602,7 +602,7 @@ WRITE32_HANDLER( video_dma_length_w );
6+
WRITE32_HANDLER( video_dma_address_w );
7+
WRITE32_HANDLER( sprite_dma_start_w );
8+
9+
-UINT32 *scroll_ram;
10+
+extern UINT32 *scroll_ram;
11+
extern int old_vidhw;
12+
extern int bg_size;
13+
data32_t *spimainram;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From f8688cae05799a30cd5337e626a07fa9f004c0a3 Mon Sep 17 00:00:00 2001
2+
From: Andrea Mazzoleni <[email protected]>
3+
Date: Fri, 23 Oct 2020 21:29:41 +0200
4+
Subject: [PATCH] Fix build errors due new gcc 10 default for -fno-common
5+
6+
---
7+
src/drivers/cavepgm.c | 6 +++---
8+
1 file changed, 3 insertions(+), 3 deletions(-)
9+
10+
diff --git a/src/drivers/cavepgm.c b/src/drivers/cavepgm.c
11+
index 38d3dae8..df6e97ab 100644
12+
--- a/src/drivers/cavepgm.c
13+
+++ b/src/drivers/cavepgm.c
14+
@@ -287,7 +287,7 @@ Notes:
15+
#include "timer.h"
16+
17+
18+
-UINT16 *pgm_mainram, *pgm_bg_videoram, *pgm_tx_videoram, *pgm_videoregs, *pgm_rowscrollram;
19+
+extern UINT16 *pgm_mainram, *pgm_bg_videoram, *pgm_tx_videoram, *pgm_videoregs, *pgm_rowscrollram;
20+
static UINT8 *z80_mainram;
21+
static UINT32 *arm7_shareram;
22+
static UINT32 arm7_latch;
23+
@@ -852,8 +852,8 @@ static void expand_32x32x5bpp(void)
24+
/* This function expands the sprite colour data (in the A Roms) from 3 pixels
25+
in each word to a byte per pixel making it easier to use */
26+
27+
-UINT8 *pgm_sprite_a_region;
28+
-size_t pgm_sprite_a_region_allocate;
29+
+extern UINT8 *pgm_sprite_a_region;
30+
+extern size_t pgm_sprite_a_region_allocate;
31+
32+
static void expand_colourdata(void)
33+
{
34+
--
35+
2.32.0
36+

0 commit comments

Comments
 (0)