Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
JaceCear committed Jan 31, 2025
1 parent 350917d commit abb130b
Show file tree
Hide file tree
Showing 10 changed files with 631 additions and 574 deletions.
59 changes: 57 additions & 2 deletions config.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,59 @@
### Build Configuration ###

# Default variables
# Default platform variables
PLATFORM ?= gba
CPU_ARCH ?= arm
MIDI_COMMENTS := "arm"
THUMB_SUPPORT ?= 1 # Supports ARM's Thumb instruction set
COMPARE ?= 1


ifeq ($(CPU_ARCH),arm)
ifneq ($(PLATFORM),gba)
THUMB_SUPPORT ?= 0
endif

MIDI_COMMENTS := "arm"
# This is 'i386' because that's the arch's name in GNU Linker scripts
else ifeq ($(CPU_ARCH),i386)
THUMB_SUPPORT ?= 0
MIDI_COMMENTS := "x86"
else
$(error unknown arch: $(CPU_ARCH))
endif

LDSCRIPT := ldscript

NON_MATCHING ?= 0
ifeq ($(PLATFORM),gba)
ifeq ($(DEBUG),1)
# Debug
PORTABLE := 0
NON_MATCHING := 1
ENABLE_DECOMP_CREDITS := 1
COMPARE ?= 0
LDSCRIPT := $(LDSCRIPT).txt
else
# Original
PORTABLE := 0
NON_MATCHING := 0
ENABLE_DECOMP_CREDITS := 0
COMPARE ?= 1
LDSCRIPT := $(LDSCRIPT).txt
endif
else
# Other
PORTABLE := 1
NON_MATCHING := 1
ENABLE_DECOMP_CREDITS := 1
COMPARE ?= 0
LDSCRIPT := $(LDSCRIPT).txt
endif

# Default game variables
GAME_REVISION ?= 0
GAME_REGION ?= EUROPE
DEBUG ?= 0
COMPARE ?= 1

# For gbafix
MAKER_CODE := 8P
Expand Down Expand Up @@ -35,6 +84,12 @@ else
endif
endif

ifeq ($(CREATE_PDB),1)
# If the user wants a PDB, the output needs to include debug info
# TODO: Is there a way to ECHO here?
DEBUG := 1
endif

# Debug
ifeq ($(DEBUG), 1)
COMPARE := 0
Expand Down
1 change: 1 addition & 0 deletions graphics.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Empty in SA3 for now
4 changes: 2 additions & 2 deletions include/gba/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ typedef int64_t s64;

// If the DISPLAY_HEIGHT was >255, scanline effects would break,
// so we have to
#ifdef PORTABLE
typedef u32 int_vcount;
#if PORTABLE
typedef u16 int_vcount;
#else
typedef u8 int_vcount;
#endif
Expand Down
4 changes: 2 additions & 2 deletions include/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ typedef void (*VoidFn)(void);

// helper macros

#if ((defined PORTABLE) || (defined NON_MATCHING))
#if (PORTABLE || (defined NON_MATCHING))
#define BUG_FIX
#define UB_FIX
#endif

#if ((defined PORTABLE) && !(defined NON_MATCHING))
#if (PORTABLE && !(defined NON_MATCHING))
#define NON_MATCHING 1
#endif

Expand Down
4 changes: 2 additions & 2 deletions include/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ typedef void (*TaskDestructor)(struct Task *);

// The task system uses the GBA's unique memory layout to halve the size of pointers.
// Other platforms need to have the same logical behavior, but done differently.
#ifndef PORTABLE
#if !PORTABLE
typedef u16 TaskPtr;

// Mainly used to silence (void* -> u16) warnings
Expand Down Expand Up @@ -61,7 +61,7 @@ struct Task {
#endif
};

#ifndef PORTABLE
#if !PORTABLE
typedef u16 IwramNodePtr;
typedef u32 IwramNodePtr32;
#else
Expand Down
Loading

0 comments on commit abb130b

Please sign in to comment.