Skip to content

Commit

Permalink
Drop libnds32
Browse files Browse the repository at this point in the history
Upstream libnds now allows configurable DLDI allocation size. Since the
only reason libnds32 existed was to increase the driver size, it can
now be nuked.
  • Loading branch information
lifehackerhansol committed Nov 19, 2023
1 parent e0f6121 commit 7ecb281
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 26 deletions.
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,3 @@
path = DLDI
url = https://github.com/DS-Homebrew/DLDI
branch = builds
[submodule "libnds32"]
path = libnds32
url = https://github.com/lifehackerhansol/libnds32
branch = blocksds
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
BLOCKSDS ?= /opt/blocksds/core
BLOCKSDSEXT ?= /opt/blocksds/external

export TOPDIR := $(shell pwd $(CURDIR))

# User config
# ===========

Expand Down Expand Up @@ -229,7 +227,7 @@ dist : all
@cp N5/_ds_menu.dat bootstrap/N5/_ds_menu.dat

@cd bootstrap && zip -r bootstrap.zip *
@mv bootstrap/bootstrap.zip $(TOPDIR)
@mv bootstrap/bootstrap.zip .

_ds_menu.dat: $(ROM)
@echo "Make original R4"
Expand Down
6 changes: 2 additions & 4 deletions Makefile.arm9
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ BLOCKSDSEXT ?= /opt/blocksds/external
WONDERFUL_TOOLCHAIN ?= /opt/wonderful
ARM_NONE_EABI_PATH ?= $(WONDERFUL_TOOLCHAIN)/toolchain/gcc-arm-none-eabi/bin/

export LIBNDS32 := $(TOPDIR)/libnds32

# Source code paths
# -----------------

Expand All @@ -27,8 +25,8 @@ DEFINES := -D_NO_BOOTSTUB_
# Libraries
# ---------

LIBS := -lnds329
LIBDIRS := $(LIBNDS32)
LIBS := -lnds9
LIBDIRS := $(BLOCKSDS)/libs/libnds

# Build artifacts
# ---------------
Expand Down
6 changes: 2 additions & 4 deletions Makefile.arm9_crt0set
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ BLOCKSDSEXT ?= /opt/blocksds/external
WONDERFUL_TOOLCHAIN ?= /opt/wonderful
ARM_NONE_EABI_PATH ?= $(WONDERFUL_TOOLCHAIN)/toolchain/gcc-arm-none-eabi/bin/

export LIBNDS32 := $(TOPDIR)/libnds32

# Source code paths
# -----------------

Expand All @@ -27,8 +25,8 @@ DEFINES := -D_NO_BOOTSTUB_
# Libraries
# ---------

LIBS := -lnds329
LIBDIRS := $(LIBNDS32)
LIBS := -lnds9
LIBDIRS := $(BLOCKSDS)/libs/libnds

# Build artifacts
# ---------------
Expand Down
6 changes: 2 additions & 4 deletions Makefile.arm9_r4ids
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ BLOCKSDSEXT ?= /opt/blocksds/external
WONDERFUL_TOOLCHAIN ?= /opt/wonderful
ARM_NONE_EABI_PATH ?= $(WONDERFUL_TOOLCHAIN)/toolchain/gcc-arm-none-eabi/bin/

export LIBNDS32 := $(TOPDIR)/libnds32

# Source code paths
# -----------------

Expand All @@ -27,8 +25,8 @@ DEFINES := -D_NO_BOOTSTUB_
# Libraries
# ---------

LIBS := -lnds329
LIBDIRS := $(LIBNDS32)
LIBS := -lnds9
LIBDIRS := $(BLOCKSDS)/libs/libnds

# Build artifacts
# ---------------
Expand Down
6 changes: 2 additions & 4 deletions Makefile.arm9_r4isdhc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ BLOCKSDSEXT ?= /opt/blocksds/external
WONDERFUL_TOOLCHAIN ?= /opt/wonderful
ARM_NONE_EABI_PATH ?= $(WONDERFUL_TOOLCHAIN)/toolchain/gcc-arm-none-eabi/bin/

export LIBNDS32 := $(TOPDIR)/libnds32

# Source code paths
# -----------------

Expand All @@ -27,8 +25,8 @@ DEFINES := -D_NO_BOOTSTUB_
# Libraries
# ---------

LIBS := -lnds329
LIBDIRS := $(LIBNDS32)
LIBS := -lnds9
LIBDIRS := $(BLOCKSDS)/libs/libnds

# Build artifacts
# ---------------
Expand Down
11 changes: 11 additions & 0 deletions arm9/source/dldi_size.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@
@ flashcard-bootstrap
@ By lifehackerhansol
@
@ SPDX-License-Identifier: 0BSD
@

@ Use 32KB DLDI space, needed for legacy homebrew

.global __dldi_size
.equ __dldi_size, 32768
17 changes: 17 additions & 0 deletions arm9_r4isdhc/ds_arm9_r4isdhc.ld
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,23 @@ SECTIONS
. = ALIGN(4); /* REQUIRED. LD is flaky without it. */
} >ewram :main = 0x00

/* Create DLDI driver area. It should be zero-byte if DLDI code
is not present, but set to an user-provided size if it is
present. */
PROVIDE(__dldi_size = 16384);
__dldi_log2_size = LOG2CEIL(__dldi_size + 1) - 1;
.dldi :
{
__dldi_start = .;
*(.dldi)
. = ALIGN(4);

__dldi_data_end = .;
__dldi_end = __dldi_data_end > __dldi_start ? __dldi_start + __dldi_size : __dldi_start;
. = __dldi_end;
. = ALIGN(4);
} >ewram :main = 0x00

.plt : { *(.plt) } >ewram :main = 0xff

.init :
Expand Down
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ clang -o resource/dsbize/dsbize resource/dsbize/dsbize.c
clang++ -o resource/r4denc/r4denc resource/r4denc/r4denc.cpp
mkdir -p data
make -C bootloader LOADBIN=$PWD/data/load.bin
make -C libnds32 arm9 -j`nproc`
make dist
1 change: 0 additions & 1 deletion clean.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
make -C bootloader clean
make -C libnds32 clean
make clean
rm resource/dsbize/dsbize resource/r4denc/r4denc
1 change: 0 additions & 1 deletion libnds32
Submodule libnds32 deleted from a8efe1

0 comments on commit 7ecb281

Please sign in to comment.