mirror of https://github.com/ClassiCube/ClassiCube
At least note GBA port in readme
This commit is contained in:
parent
119cacac0d
commit
4bd8d682c9
|
|
@ -40,16 +40,11 @@ CFLAGS = -g -Wall -O2 -DPLAT_GBA -ffunction-sections -fdata-sections -mcpu=arm7t
|
|||
ASFLAGS = -g $(ARCH)
|
||||
|
||||
LDFLAGS = -specs=gba.specs -g $(ARCH)
|
||||
LIBS = -ltonc
|
||||
|
||||
LIBGBA := $(DEVKITPRO)/libgba
|
||||
INCLUDES += $(foreach dir, $(LIBGBA), -I$(dir)/include)
|
||||
LDFLAGS += $(foreach dir, $(LIBGBA), -L$(dir)/lib)
|
||||
|
||||
LIBTONC = $(DEVKITPRO)/libtonc
|
||||
INCLUDES += $(foreach dir, $(LIBTONC), -I$(dir)/include)
|
||||
LDFLAGS += $(foreach dir, $(LIBTONC), -L$(dir)/lib)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Compiler tools
|
||||
|
|
@ -94,6 +89,9 @@ $(BUILD_DIR)/%.o: src/%.c
|
|||
$(BUILD_DIR)/%.o: src/gba/%.c
|
||||
$(ARM_CC) $(CFLAGS) $(INCLUDES) $(DEPFLAGS) -c $< -o $@
|
||||
|
||||
$(BUILD_DIR)/%.o: src/gba/%.S
|
||||
$(ARM_CC) $(CFLAGS) $(INCLUDES) $(DEPFLAGS) -c $< -o $@
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
# Dependency tracking
|
||||
|
|
|
|||
10
readme.md
10
readme.md
|
|
@ -259,6 +259,14 @@ Run `make ds`. You'll need [BlocksDS](https://github.com/blocksds/sdk)
|
|||
|
||||
Run `make n64`. You'll need the opengl branch of [libdragon](https://github.com/DragonMinded/libdragon/tree/opengl)
|
||||
|
||||
#### GBA
|
||||
|
||||
Run `make gba`. You'll need [libgba](https://github.com/devkitPro/libgba)
|
||||
|
||||
**NOTE: It is highly recommended that you install the precompiled devkitpro packages from [here](https://devkitpro.org/wiki/Getting_Started) - you need the `gba-dev` group)**
|
||||
|
||||
**NOTE: The GBA port has terrible performance and is unusable in practice.**
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
|
|
@ -462,6 +470,8 @@ Further information (e.g. style) for ClassiCube's source code can be found in th
|
|||
* [ares](https://github.com/ares-emulator/ares) - Emulator used to test Nintendo 64 port
|
||||
* [BlocksDS](https://github.com/blocksds/sdk) - Backend for Nintendo DS
|
||||
* [melonDS](https://github.com/melonDS-emu/melonDS) - Emulator used to test Nintendo DS port
|
||||
* [libgba](https://github.com/devkitPro/libgba) - Backend for GBA
|
||||
* [mGBA](https://github.com/mgba-emu/mgba) - Emulator used to test GBA port
|
||||
* [vitasdk](https://github.com/vitasdk) - Backend for PS Vita
|
||||
* [Vita3K](https://github.com/Vita3K/Vita3K) - Emulator used to test Vita port
|
||||
* [pspsdk](https://github.com/pspdev/pspsdk) - Backend for PSP
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
.global nocash_log
|
||||
.global nocash_msg
|
||||
|
||||
// BEG nocash_log
|
||||
.section .ewram,"ax",%progbits
|
||||
.thumb_func
|
||||
.align 2
|
||||
|
||||
// nocash looks for this specific pattern
|
||||
nocash_log:
|
||||
mov r12, r12
|
||||
b nocash_log_return
|
||||
.short 0x6464, 0x0000
|
||||
nocash_msg:
|
||||
.space 82
|
||||
|
||||
nocash_log_return:
|
||||
bx lr
|
||||
|
||||
.size nocash_log, .-nocash_log
|
||||
.type nocash_log, %function
|
||||
// END nocash_log
|
||||
|
|
@ -139,35 +139,53 @@ cc_uint64 Stopwatch_Measure(void) {
|
|||
return base_time + raw;
|
||||
}
|
||||
|
||||
extern int nocash_puts(const char *str);
|
||||
static void Log_Nocash(char* buffer) {
|
||||
nocash_puts(buffer);
|
||||
}
|
||||
|
||||
#define MGBA_LOG_DEBUG 4
|
||||
#define REG_DEBUG_ENABLE (vu16*)0x4FFF780
|
||||
#define REG_DEBUG_FLAGS (vu16*)0x4FFF700
|
||||
#define REG_DEBUG_STRING (char*)0x4FFF600
|
||||
|
||||
static void Log_mgba(char* buffer, int len) {
|
||||
static void Log_mgba(const char* msg, int len) {
|
||||
*REG_DEBUG_ENABLE = 0xC0DE;
|
||||
// Check if actually emulated or not
|
||||
if (*REG_DEBUG_ENABLE != 0x1DEA) return;
|
||||
|
||||
Mem_Copy(REG_DEBUG_STRING, buffer, len);
|
||||
while (len)
|
||||
{
|
||||
// Can only be up to 120 bytes total
|
||||
int bit = min(len, 119);
|
||||
char* dst = REG_DEBUG_STRING;
|
||||
|
||||
Mem_Copy(dst, msg, bit);
|
||||
dst[bit] = '\0';
|
||||
|
||||
*REG_DEBUG_FLAGS = MGBA_LOG_DEBUG | 0x100;
|
||||
msg += bit; len -= bit;
|
||||
}
|
||||
}
|
||||
|
||||
void Platform_Log(const char* msg, int len) {
|
||||
// Can only be up to 120 bytes total
|
||||
char buffer[120];
|
||||
len = min(len, 118);
|
||||
// Log to nocash debugger
|
||||
extern char nocash_msg[82];
|
||||
extern void nocash_log(void);
|
||||
|
||||
Mem_Copy(buffer, msg, len);
|
||||
buffer[len + 0] = '\n';
|
||||
buffer[len + 1] = '\0';
|
||||
Log_Nocash(buffer);
|
||||
Log_mgba(buffer, len);
|
||||
static void Log_Nocash(const char* msg, int len) {
|
||||
while (len)
|
||||
{
|
||||
// Can only be up to 80 bytes total
|
||||
int bit = min(len, 80);
|
||||
char* dst = nocash_msg;
|
||||
|
||||
Mem_Copy(dst, msg, bit);
|
||||
dst[bit + 0] = '\0';
|
||||
|
||||
nocash_log();
|
||||
msg += bit; len -= bit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Platform_Log(const char* msg, int len) {
|
||||
Log_mgba(msg, len);
|
||||
Log_Nocash(msg, len);
|
||||
}
|
||||
|
||||
TimeMS DateTime_CurrentUTC(void) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue