Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaks for BlocksDS port. #526

Merged
merged 4 commits into from
Mar 3, 2025
Merged
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
5 changes: 4 additions & 1 deletion arch/nds-blocksds/CONFIG.NDS
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/sh

./config.sh --platform nds-blocksds --prefix $BLOCKSDS --optimize-size --enable-lto \
[ -z "$BLOCKSDS" ] && { echo "\$BLOCKSDS is unset, aborting"; exit 1; }
[ -z "$WONDERFUL_TOOLCHAIN" ] && { echo "\$WONDERFUL_TOOLCHAIN is unset, aborting"; exit 1; }

./config.sh --platform nds-blocksds --prefix "$BLOCKSDS" --optimize-size --enable-lto \
--disable-editor --disable-helpsys --disable-utils \
--disable-libpng --enable-release --enable-meter \
--enable-extram --disable-screenshots --enable-stdio-redirect "$@"
5 changes: 4 additions & 1 deletion arch/nds-blocksds/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ ifeq ($(strip $(BLOCKSDS)),)
$(error "BLOCKSDS must be set in your environment.")
endif

ifeq ($(strip $(WONDERFUL_TOOLCHAIN)),)
$(error "WONDERFUL_TOOLCHAIN must be set in your environment.")
endif

EXTRA_LICENSES += ${LICENSE_CC0} ${LICENSE_MPL2} ${LICENSE_NEWLIB}

#
# NDS target rules
#
WONDERFUL_TOOLCHAIN ?= /opt/wonderful
ARM_NONE_EABI_PATH ?= $(WONDERFUL_TOOLCHAIN)/toolchain/gcc-arm-none-eabi/bin/
CROSS_COMPILE := ${ARM_NONE_EABI_PATH}arm-none-eabi-

Expand Down
1 change: 1 addition & 0 deletions scripts/buildscripts/mzx-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build_release "windows-x64" "$STABLE" "$STABLE_UPDATES"
build_debug "windows-x64" "$UNSTABLE" "$UNSTABLE_UPDATES"
build_debug "windows-x64" "$DEBYTECODE" "$DEBYTECODE_UPDATES" "--enable-debytecode"
build_release "nds" "$STABLE"
build_release "nds-blocksds" "$STABLE"
build_release "3ds" "$STABLE"
build_release "wii" "$STABLE"
build_release "wiiu" "$STABLE"
Expand Down
2 changes: 1 addition & 1 deletion scripts/buildscripts/mzx-scripts/caverns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ caverns_init()
OLD_DIR="$(pwd)"
cd "$CAVERNS_BASE/$CAVERNS_MMUTIL_PATH" || { ERRNO="CV-1"; return; }
for f in ./*.MOD; do
"$DEVKITPRO/tools/bin/mmutil" -d -m "$f" && rm -f "$f"
"$DEVKITPRO/tools/bin/mmutil" -d -m "$f"
done
cd "$OLD_DIR" || { ERRNO="CV-2"; return; }
fi
Expand Down
50 changes: 50 additions & 0 deletions scripts/buildscripts/mzx-scripts/platforms/nds-blocksds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/sh

# Copyright (C) 2025 Alice Rowan <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

platform_init()
{
[ -z "$BLOCKSDS" ] && { ERRNO=20; return; }
[ -z "$WONDERFUL_TOOLCHAIN" ] && { ERRNO=20; return; }

if [ -n "$MSYSTEM" ]; then
export BLOCKDS="$(cygpath -u "$BLOCKSDS")"
export WONDERFUL_TOOLCHAIN="$(cygpath -u "$WONDERFUL_TOOLCHAIN")"
fi

export PATH="$PATH:$WONDERFUL_TOOLCHAIN/bin"

export PLATFORM_CAVERNS_EXEC="mzxrun.nds"
export PLATFORM_CAVERNS_BASE="games/megazeux"
export PLATFORM_CAVERNS_WHICH="caverns_mmutil"
export PLATFORM_CRLF=1
}

platform_config_release()
{
arch/nds-blocksds/CONFIG.NDS "$@"
}

platform_check_build()
{
[ -f "mzxrun" ] || ERRNO=25;
}

platform_setup_environment()
{
return
}
12 changes: 0 additions & 12 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,15 +641,3 @@ void __stack_chk_fail(void)
}

#endif // __amigaos__

#if defined(CONFIG_PSP) || defined(CONFIG_NDS)
FILE *popen(const char *command, const char *type)
{
return NULL;
}

int pclose(FILE *stream)
{
return 0;
}
#endif // CONFIG_PSP || CONFIG_NDS
Loading