Skip to content

Commit

Permalink
Update for calico
Browse files Browse the repository at this point in the history
TODO: Several things are still broken
  • Loading branch information
Epicpkmn11 committed Dec 16, 2024
1 parent 140d032 commit 7d61fe3
Show file tree
Hide file tree
Showing 86 changed files with 1,775 additions and 9,104 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

81 changes: 44 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,64 +1,71 @@
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
.SECONDARY:

ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif

include $(DEVKITARM)/ds_rules

export TARGET := GodMode9i
export TOPDIR := $(CURDIR)

export GAME_TITLE := $(TARGET)
# specify a directory which contains the nitro filesystem
# this is relative to the Makefile
NITRO_FILES := nitrofiles

export NITRODATA := nitrofiles
# These set the information text in the nds file
GAME_TITLE := GodMode9i
GAME_SUBTITLE :=
GAME_AUTHOR := Rocket Robz
GAME_CODE := HGMA
GAME_HEADER_TITLE := GODMODE9I

.PHONY: all bootloader bootstub clean dsi arm7/$(TARGET).elf arm9/$(TARGET).elf
GAME_ICON := icon.bmp

all: bootloader bootstub $(TARGET).nds

dsi: $(TARGET).dsi
ifeq ($(strip $(GAME_SUBTITLE)),)
GAME_FULL_TITLE := $(GAME_TITLE);$(GAME_AUTHOR)
else
GAME_FULL_TITLE := $(GAME_TITLE);$(GAME_SUBTITLE);$(GAME_AUTHOR)
endif

$(TARGET).nds: arm7/$(TARGET).elf arm9/$(TARGET).elf
ndstool -c $(TARGET).nds -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf -d $(NITRODATA) \
-b icon.bmp "GodMode9i;Rocket Robz" \
-z 80040000
include $(DEVKITARM)/ds_rules

$(TARGET).dsi: arm7/$(TARGET).elf arm9/$(TARGET).elf
ndstool -c $(TARGET).dsi -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf -d $(NITRODATA) \
-b icon.bmp "GodMode9i;Rocket Robz" \
-g HGMA 00 "GODMODE9I" -z 80040000 -u 00030004
.PHONY: arm7/$(TARGET).elf bootloader bootstub clean

#---------------------------------------------------------------------------------
arm7/$(TARGET).elf:
@$(MAKE) -C arm7
# main targets
#---------------------------------------------------------------------------------
all: $(TARGET).nds $(TARGET).dsi

#---------------------------------------------------------------------------------
arm9/$(TARGET).elf:
@$(MAKE) -C libnds32 release
@$(MAKE) -C arm9
$(TARGET).nds : $(NITRO_FILES) arm7/$(TARGET).elf arm9/$(TARGET).elf
ndstool -c $(TARGET).nds -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf \
-b $(GAME_ICON) "$(GAME_FULL_TITLE)" -z 80040000 \
$(_ADDFILES)

$(TARGET).dsi : $(NITRO_FILES) arm7/$(TARGET).elf arm9/$(TARGET).elf
ndstool -c $(TARGET).dsi -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf \
-b $(GAME_ICON) "$(GAME_FULL_TITLE)" \
-g $(GAME_CODE) 00 "$(GAME_HEADER_TITLE)" -z 80040000 -u 00030004 \
$(_ADDFILES)

#---------------------------------------------------------------------------------
#$(BUILD):
#@[ -d $@ ] || mkdir -p $@
#@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
arm7/$(TARGET).elf:
$(MAKE) -C arm7

#---------------------------------------------------------------------------------
clean:
@echo clean ...
@rm -fr data/*.bin
@rm -fr $(BUILD) $(TARGET).elf $(TARGET).nds
@rm -fr $(TARGET).arm7.elf
@rm -fr $(TARGET).arm9.elf
@$(MAKE) -C libnds32 clean
@$(MAKE) -C bootloader clean
@$(MAKE) -C bootstub clean
@$(MAKE) -C arm9 clean
@$(MAKE) -C arm7 clean
arm9/$(TARGET).elf: bootloader bootstub
$(MAKE) -C arm9

bootloader: data
@$(MAKE) -C bootloader LOADBIN=$(CURDIR)/data/load.bin

bootstub: data
@$(MAKE) -C bootstub

clean:
@rm -fr data/*.bin
@rm -fr $(TARGET).nds
@$(MAKE) -C bootloader clean
@$(MAKE) -C bootstub clean
@$(MAKE) -C arm9 clean
@$(MAKE) -C arm7 clean
2 changes: 1 addition & 1 deletion arm7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include $(DEVKITARM)/ds_rules
TARGET := GodMode9i
BUILD := build
SOURCES := source
INCLUDES := include build
INCLUDES := include build ../shared/include

#---------------------------------------------------------------------------------
# options for code generation
Expand Down
4 changes: 2 additions & 2 deletions arm7/include/gba.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <nds/ndstypes.h>

void readEeprom(u8 *dst, u32 src, u32 len);
void writeEeprom(u32 dst, u8 *src, u32 len);
bool gbaReadEeprom(u8 *dst, u32 src, u32 len);
bool gbaWriteEeprom(u32 dst, u8 *src, u32 len);

#endif // GBA_H
9 changes: 9 additions & 0 deletions arm7/include/my_i2c.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#define MY_I2C_H
#ifdef MY_I2C_H

#include <nds/ndstypes.h>

u8 my_i2cReadRegister8(u8 device, u8 reg);
u8 my_i2cWriteRegister8(u8 device, u8 reg, u8 data);

#endif // MY_I2C_H
197 changes: 0 additions & 197 deletions arm7/include/my_sdmmc.h

This file was deleted.

21 changes: 21 additions & 0 deletions arm7/include/pxi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef PXI_H
#define PXI_H

#include "pxiVars.h"

#include <calico/system/thread.h>

#ifdef __cplusplus
extern "C" {
#endif

extern Thread s_pxiThread;
extern u8 s_pxiThreadStack[1024];

int pxiThreadMain(void* arg);

#ifdef __cplusplus
}
#endif

#endif // PXI_H
Loading

0 comments on commit 7d61fe3

Please sign in to comment.