--- a/Makefile +++ b/Makefile @@ -82,7 +82,7 @@ -L$(LIBTONC)/lib \ -L$(LIBGBA)/lib \ -L$(CURDIR) \ - -lmm -ltonc -lgba + -ltonc # ───────────────────────────────────────────────────────────────────────────── # SOURCE COLLECTION (recursive via find) --- a/source/main.c +++ b/source/main.c @@ -14,7 +14,6 @@ #include "landing_area.h" #include "game_score.h" #include "graphics/logo.h" -#include "graphics/ScratchLogoSmall1.h" static OBJ_ATTR obj_buffer[MAX_SPRITES]; @@ -83,38 +82,6 @@ irq_init(NULL); irq_add(II_VBLANK, NULL); - // Load title screen tiles in CBB2 - memcpy32(tile8_mem[2], ScratchLogoSmall1Tiles, ScratchLogoSmall1TilesLen / 4); - // Load title screen tilemap in SBB 23 - memcpy16(se_mem[29], ScratchLogoSmall1Map, ScratchLogoSmall1MapLen / 2); - // Load title screen palette - memcpy16(pal_bg_mem, ScratchLogoSmall1Pal, ScratchLogoSmall1PalLen / 2); - // Configure BG1 and priority 0 - REG_BG1CNT = BG_CBB(2) | BG_SBB(29) | BG_8BPP | BG_REG_32x32 | BG_PRIO(1); - // Set regular background (Mode 1, BG0) - REG_DISPCNT = DCNT_MODE(1) | DCNT_BG1; - REG_BLDCNT = BLD_BG1 | BLD_BLACK; - for (int frame = 16; frame >= 0; frame--) { - REG_BLDY = BLDY_BUILD(frame); - for (int j = 0; j < 4; j++) { - VBlankIntrWait(); - } - } - for (int i = 0; i < 180; i++) { - VBlankIntrWait(); - } - for (int frame = 0; frame <= 16; frame++) { - REG_BLDY = BLDY_BUILD(frame); - for (int j = 0; j < 4; j++) { - VBlankIntrWait(); - } - } - REG_BLDCNT = 0; - REG_BLDY = 0; - REG_BG1CNT &= ~(BG_CBB(2) | BG_SBB(29) | BG_8BPP | BG_REG_32x32 | BG_PRIO(1)); - REG_DISPCNT &= ~(DCNT_MODE(1) | DCNT_BG1); - - shell_init(); GameState prev_state = shell_state(); shell_render_engine_init(); --- /dev/null +++ b/source/syscalls_stub.c @@ -0,0 +1,30 @@ +/* Added by FredyGames: the devkitPro libsysbase is not available in our toolchain, so the newlib system + calls the C library links against are stubbed (the game does no file or console I/O). */ +#include +#include +#include + +void *fake_heap_end = 0; + +static char heap_area[8192] __attribute__((aligned(4))); +static size_t heap_used; + +void *_sbrk(ptrdiff_t incr) { + if (heap_used + (size_t)incr > sizeof heap_area) { + errno = ENOMEM; + return (void *)-1; + } + void *p = heap_area + heap_used; + heap_used += (size_t)incr; + return p; +} + +int _close(int fd) { (void)fd; errno = EBADF; return -1; } +int _fstat(int fd, struct stat *st) { (void)fd; st->st_mode = S_IFCHR; return 0; } +int _isatty(int fd) { (void)fd; return 1; } +int _lseek(int fd, int off, int whence) { (void)fd; (void)off; (void)whence; return 0; } +int _read(int fd, char *buf, int len) { (void)fd; (void)buf; (void)len; return 0; } +int _write(int fd, char *buf, int len) { (void)fd; (void)buf; return len; } +int _getpid(void) { return 1; } +int _kill(int pid, int sig) { (void)pid; (void)sig; errno = EINVAL; return -1; } +void _exit(int code) { (void)code; for (;;) {} }