Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gba/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ CFLAGS := -g -Wall -O2\
-ffast-math \
$(ARCH)

CFLAGS += $(INCLUDE) -DGBA
CFLAGS += $(INCLUDE) -D__GBA__
CXXFLAGS := $(CFLAGS)

ASFLAGS := -g $(ARCH)
Expand Down
10 changes: 5 additions & 5 deletions include/fat.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ extern "C" {

#include "libfatversion.h"

// When compiling for NDS, make sure NDS is defined
#ifndef NDS
#if defined ARM9 || defined ARM7
#define NDS
// When compiling for NDS, make sure __NDS__ is defined, as old Makefiles don't define it
#if !defined __NDS__ && !defined __GBA__
#if defined NDS || defined ARM9 || defined ARM7
#define __NDS__
#endif
#endif

Expand All @@ -50,7 +50,7 @@ extern "C" {
#if defined(__gamecube__) || defined (__wii__)
# include <ogc/disc_io.h>
#else
# ifdef NDS
# ifdef __NDS__
# include <nds/disc_io.h>
# else
# include <disc_io.h>
Expand Down
2 changes: 1 addition & 1 deletion nds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CFLAGS := -g -Wall -O2 \
-ffast-math \
$(ARCH)

CFLAGS += $(INCLUDE) -DARM9 -DNDS
CFLAGS += $(INCLUDE) -DARM9 -D__NDS__
CXXFLAGS := $(CFLAGS)

ASFLAGS := -g $(ARCH)
Expand Down
15 changes: 4 additions & 11 deletions source/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,16 @@
#include <stddef.h>
#include <stdint.h>

// When compiling for NDS, make sure NDS is defined
#ifndef NDS
#if defined ARM9 || defined ARM7
#define NDS
#endif
#endif

// Platform specific includes
#if defined(__gamecube__) || defined (__wii__)
#include <gctypes.h>
#include <ogc/disc_io.h>
#include <gccore.h>
#elif defined(NDS)
#elif defined(__NDS__)
#include <nds/ndstypes.h>
#include <nds/system.h>
#include <nds/disc_io.h>
#elif defined(GBA)
#elif defined(__GBA__)
#include <gba_types.h>
#include <disc_io.h>
#elif defined(GP2X)
Expand All @@ -68,11 +61,11 @@
#define DEFAULT_SECTORS_PAGE 64
#define USE_LWP_LOCK
#define USE_RTC_TIME
#elif defined (NDS)
#elif defined (__NDS__)
#define DEFAULT_CACHE_PAGES 16
#define DEFAULT_SECTORS_PAGE 8
#define USE_RTC_TIME
#elif defined (GBA)
#elif defined (__GBA__)
#define DEFAULT_CACHE_PAGES 2
#define DEFAULT_SECTORS_PAGE 8
#define LIMIT_SECTORS 128
Expand Down
4 changes: 2 additions & 2 deletions source/disc.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const INTERFACE_ID _FAT_disc_interfaces[] = {
};

/* ====================== NDS ====================== */
#elif defined (NDS)
#elif defined (__NDS__)
#include <nds/system.h>
#include <nds/memory.h>
#include <nds/arm9/dldi.h>
Expand All @@ -103,7 +103,7 @@ const INTERFACE_ID _FAT_disc_interfaces[] = {
};

/* ====================== GBA ====================== */
#elif defined (GBA)
#elif defined (__GBA__)
#include <disc.h>

const INTERFACE_ID _FAT_disc_interfaces[] = {
Expand Down