Skip to content

Commit

Permalink
Fix GCC common symbols
Browse files Browse the repository at this point in the history
- For now lets just link those against GLN64
- They never run at the same time, are same type and it lowers maintenance efforts
  • Loading branch information
m4xw committed Jun 26, 2020
1 parent 5de248e commit c5fe217
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
14 changes: 12 additions & 2 deletions GLideN64/src/N64.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#include "N64.h"

u8 *HEADER;
u8 *DMEM;
u8 *IMEM;

/*
DMEM and IMEM conflict with CXD4 with GCC 10.x
It's defined as pu8 so it's the same type as used in GLN64, just typedef'd.
Since we never run both at the same time, let's just link CXD4's to this
Also we always assume that we will build with GLideN64 at all times
*/
extern "C" {
u8 *DMEM;
u8 *IMEM;
}

u64 TMEM[512];
u8 *RDRAM;

Expand Down
9 changes: 7 additions & 2 deletions GLideN64/src/N64.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,13 @@ struct N64Regs

extern N64Regs REG;
extern u8 *HEADER;
extern u8 *DMEM;
extern u8 *IMEM;

extern "C" {
// See comment in N64.cpp
extern u8 *DMEM;
extern u8 *IMEM;
}

extern u8 *RDRAM;
extern u64 TMEM[512];
extern u32 RDRAMSize;
Expand Down
6 changes: 4 additions & 2 deletions mupen64plus-rsp-cxd4/su.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ u32 SR[32];
typedef VECTOR_OPERATION(*p_vector_func)(v16, v16);

pu8 DRAM;
pu8 DMEM;
pu8 IMEM;

// NOTE: Links against GLideN64\src\N64.cpp due to conflicts and maintenance efforts
extern pu8 DMEM;
extern pu8 IMEM;

NOINLINE void res_S(void)
{
Expand Down

0 comments on commit c5fe217

Please sign in to comment.