nds-bootstrap variant

- Changes to the makefile to build only the nds-bootstrap variant
- Visual cues for loading progress
This commit is contained in:
Kei 2024-12-14 17:51:51 +00:00
parent 5c632b58f5
commit 21dbfe534e
13 changed files with 143 additions and 61 deletions

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
build
themes
package
data/load.bin
*.elf
*.nds

52
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,52 @@
{
"files.associations": {
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"limits": "cpp",
"new": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"cinttypes": "cpp",
"typeinfo": "cpp"
}
}

View File

@ -9,26 +9,27 @@ export TARGET := $(shell basename $(CURDIR))
export TOPDIR := $(CURDIR)
# GMAE_ICON is the image used to create the game icon, leave blank to use default rule
GAME_ICON :=
GAME_ICON := icon.bmp
# specify a directory which contains the nitro filesystem
# this is relative to the Makefile
NITRO_FILES :=
# These set the information text in the nds file
GAME_TITLE := acekard
GAME_SUBTITLE1 := Real Play Gear
GAME_SUBTITLE2 := www.acekard.com
GAME_TITLE := akmenu-next
GAME_SUBTITLE1 := nds-bootstrap
GAME_SUBTITLE2 := github.com/coderkei
include $(DEVKITARM)/ds_rules
.PHONY: checkarm7 checkarm9 checkarm9_ak2 checkarm9_dsi checkarm9_m3 checkarm9_tt clean
#.PHONY: checkarm7 checkarm9 checkarm9_ak2 checkarm9_dsi checkarm9_m3 checkarm9_tt clean
.PHONY: checkarm7 checkarm9 checkarm9_dsi clean
#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
all: checkarm7 checkarm9 checkarm9_ak2 checkarm9_dsi checkarm9_m3 checkarm9_tt \
$(TARGET).nds $(TARGET)_ak2.nds $(TARGET)_m3.nds $(TARGET)_tt.nds $(TARGET).dsi
all: checkarm7 checkarm9 checkarm9_dsi \
$(TARGET).nds $(TARGET).dsi
#---------------------------------------------------------------------------------
checkarm7:
@ -38,49 +39,16 @@ checkarm7:
checkarm9:
$(MAKE) -C arm9
#---------------------------------------------------------------------------------
checkarm9_ak2:
$(MAKE) -C arm9_ak2
#---------------------------------------------------------------------------------
checkarm9_dsi:
$(MAKE) -C arm9_dsi
#---------------------------------------------------------------------------------
checkarm9_m3:
$(MAKE) -C arm9_m3
#---------------------------------------------------------------------------------
checkarm9_tt:
$(MAKE) -C arm9_tt
#---------------------------------------------------------------------------------
$(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_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" \
$(_ADDFILES)
#---------------------------------------------------------------------------------
$(TARGET)_ak2.nds : $(NITRO_FILES) arm7/$(TARGET).elf arm9_ak2/$(TARGET).elf
ndstool -c $@ -7 arm7/$(TARGET).elf -9 arm9_ak2/$(TARGET).elf \
-b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" \
$(_ADDFILES)
dlditool DLDI/ak2_sd.dldi $@
#---------------------------------------------------------------------------------
$(TARGET)_m3.nds : $(NITRO_FILES) arm7/$(TARGET).elf arm9_m3/$(TARGET).elf
ndstool -c $@ -7 arm7/$(TARGET).elf -9 arm9_m3/$(TARGET).elf \
-b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" \
$(_ADDFILES)
dlditool DLDI/m3ds.dldi $@
#---------------------------------------------------------------------------------
$(TARGET)_tt.nds : $(NITRO_FILES) arm7/$(TARGET).elf arm9_tt/$(TARGET).elf
ndstool -c $@ -7 arm7/$(TARGET).elf -9 arm9_tt/$(TARGET).elf \
-b $(GAME_ICON) "$(GAME_TITLE);$(GAME_SUBTITLE1);$(GAME_SUBTITLE2)" \
$(_ADDFILES)
dlditool DLDI/ttio.dldi $@
#---------------------------------------------------------------------------------
$(TARGET).dsi : $(NITRO_FILES) arm7/$(TARGET).elf arm9_dsi/$(TARGET).elf
ndstool -c $@ -7 arm7/$(TARGET).elf -9 arm9_dsi/$(TARGET).elf \
@ -95,28 +63,13 @@ arm7/$(TARGET).elf:
arm9/$(TARGET).elf:
$(MAKE) -C arm9
#---------------------------------------------------------------------------------
arm9_ak2/$(TARGET).elf:
$(MAKE) -C arm9_ak2
#---------------------------------------------------------------------------------
arm9_dsi/$(TARGET).elf:
$(MAKE) -C arm9_dsi
#---------------------------------------------------------------------------------
arm9_m3/$(TARGET).elf:
$(MAKE) -C arm9_m3
#---------------------------------------------------------------------------------
arm9_tt/$(TARGET).elf:
$(MAKE) -C arm9_tt
#---------------------------------------------------------------------------------
clean:
$(MAKE) -C arm9 clean
$(MAKE) -C arm9_ak2 clean
$(MAKE) -C arm9_dsi clean
$(MAKE) -C arm9_m3 clean
$(MAKE) -C arm9_tt clean
$(MAKE) -C arm7 clean
rm -f *.nds *.dsi

18
README.md Normal file
View File

@ -0,0 +1,18 @@
# akmenu-next
Frontend for nds-bootstrap based upon lifehansolhacker's akmenu4 port [https://github.com/lifehackerhansol/akmenu4](https://github.com/lifehackerhansol/akmenu4).
## Getting Started
Requires devkitarm to be installed. Build the repository with `build.sh`.
### Configuration
The system directory is `_nds` where the akmenu system files should be placed, along with a copy of nds-bootstrap as `nds-bootstrap-release.nds`.
For cheats, put a copy of `usrcheat.dat` into the `_nds/cheats` folder. Themes go into `_nds/ui`.
## License
This project is comprimised of various sources and is collectively licensed under the GPL-3.0-or-later license.
Please check [the license section](https://github.com/coderkei/akmenu-next/tree/main/licenses) for more information as well as a copy of all applicable licenses.

View File

@ -47,7 +47,7 @@ cHelpWnd::cHelpWnd(s32 x, s32 y, u32 w, u32 h, cWindow* parent, const std::strin
// u8 nandDriverVer = getNandDriverVer();
_helpText += '\n';
_helpText += formatString("LHS akmenu %s.%s ", AKMENU_VERSION_MAIN, AKMENU_VERSION_SUB);
_helpText += formatString("coderkei akmenu-next %s.%s ", AKMENU_VERSION_MAIN, AKMENU_VERSION_SUB);
_helpText += formatString("\n%s %s ", AKMENU_LOADER_NAME, AKMENU_LOADER_VERSION);
}

View File

@ -19,6 +19,9 @@
#include "../inifile.h"
#include "../mainlist.h"
#include "../systemfilenames.h"
#include "../language.h"
#include "../ui/msgbox.h"
#include "../ui/progresswnd.h"
#include "ILauncher.h"
#include "NdsBootstrapLauncher.h"
#include "nds_loader_arm9.h"
@ -74,8 +77,12 @@ bool NdsBootstrapLauncher::prepareIni() {
bool NdsBootstrapLauncher::launchRom(std::string romPath, std::string savePath, u32 flags,
u32 cheatOffset, u32 cheatSize) {
const char ndsBootstrapPath[] = SD_ROOT_0 "/_nds/nds-bootstrap-release.nds";
progressWnd().setTipText("Initializing nds-bootstrap...");
progressWnd().show();
progressWnd().setPercent(0);
if (access(ndsBootstrapPath, F_OK) != 0) {
progressWnd().hide();
printLoaderNotFound(ndsBootstrapPath);
return false;
}
@ -90,20 +97,29 @@ bool NdsBootstrapLauncher::launchRom(std::string romPath, std::string savePath,
if (access("/_nds/nds-bootstrap/", F_OK) != 0) {
mkdir("/_nds/nds-bootstrap/", 0777);
}
progressWnd().setPercent(25);
// Setup argv to launch nds-bootstrap
argv.push_back(ndsBootstrapPath);
progressWnd().setTipText("Loading usrcheat.dat...");
progressWnd().setPercent(50);
// Prepare cheat codes if enabled
if (flags & PATCH_CHEATS) {
if (!prepareCheats()) return false;
if (!prepareCheats()) {
return false;
}
}
progressWnd().setTipText("Initializing nds-bootstrap...");
progressWnd().setPercent(75);
// Setup nds-bootstrap INI parameters
if (!prepareIni()) return false;
progressWnd().setPercent(100);
// Launch
eRunNdsRetCode rc = runNdsFile(argv[0], argv.size(), &argv[0]);
progressWnd().hide();
if (rc == RUN_NDS_OK) return true;
return false;

View File

@ -380,6 +380,7 @@ void cMainWnd::onKeyAPressed() {
void cMainWnd::launchSelected() {
std::string fullPath = _mainList->getSelectedFullPath();
std::string romName = _mainList->getSelectedShowName();
if (fullPath[fullPath.size() - 1] == '/') {
_mainList->enterDir(fullPath);
@ -402,9 +403,12 @@ void cMainWnd::launchSelected() {
dbg_printf("%d\n", fullPath[fullPath.size() - 1]);
std::string title, text;
bool show = true;
bool show = true;;
progressWnd().setTipText("Loading " + romName + "...");
progressWnd().show();
progressWnd().setPercent(0);
switch (launchRom(fullPath, rominfo,
rominfo.isHomebrew() && "akmenu4.nds" == _mainList->getSelectedShowName())) {
rominfo.isHomebrew() && "BOOT.NDS" == _mainList->getSelectedShowName())) {
case ELaunchNoFreeSpace:
title = LANG("no free space", "title");
text = LANG("no free space", "text");
@ -413,7 +417,9 @@ void cMainWnd::launchSelected() {
show = false;
break;
}
progressWnd().setPercent(100);
if (show) messageBox(this, title, text, MB_OK);
progressWnd().hide();
}
void cMainWnd::onKeyBPressed() {

View File

@ -10,9 +10,9 @@
#pragma once
#ifndef __DSIMODE__
#define SFN_SYSTEM_DIR "fat:/__rpg/"
#define SFN_SYSTEM_DIR "fat:/_nds/"
#else
#define SFN_SYSTEM_DIR "sd:/__rpg/"
#define SFN_SYSTEM_DIR "sd:/_nds/"
#endif
#define SFN_OFFICIAL_SAVELIST SFN_SYSTEM_DIR "savelist.bin"
#define SFN_CUSTOM_SAVELIST SFN_SYSTEM_DIR "gamedata.bin"

View File

@ -180,6 +180,19 @@ u32 cForm::doModal() {
return modalRet();
}
u32 cForm::doStatic() {
windowManager().addWindow(this);
show();
timer().updateFps();
INPUT& inputs = updateInput();
processInput(inputs);
windowManager().update();
gdi().present(GE_MAIN);
return modalRet();
}
void cForm::onOK() {
_modalRet = 1;
}

View File

@ -25,6 +25,8 @@ class cForm : public cWindow {
public:
u32 doModal();
u32 doStatic();
cForm& addChildWindow(cWindow* aWindow);
cForm& removeChildWindow(cWindow* aWindow);

View File

@ -131,6 +131,13 @@ cMessageBox::cMessageBox(s32 x, s32 y, u32 w, u32 h, cWindow* parent, const std:
_buttonOK->show();
}
if (_style & MB_NONE) {
buttonPitch = _buttonCANCEL->size().x + 8;
nextButtonX -= buttonPitch;
_buttonOK->setRelativePosition(cPoint(nextButtonX, buttonY));
//_buttonOK->show();
}
arrangeChildren();
loadAppearance("");
@ -215,4 +222,12 @@ u32 messageBox(cWindow* parent, const std::string& title, const std::string& msg
return msgbox.doModal();
}
u32 messageBoxStatic(cWindow* parent, const std::string& title, const std::string& msg, u32 style) {
// check point 如果出现奇怪的对话框消失问题就检查这里
cMessageBox msgbox(12, 36, 232, 120, parent, title, msg, style);
// cMessageBox msgbox( 0, 0, 256, 192, parent, text, style );
return msgbox.doStatic();
}
} // namespace akui

View File

@ -22,6 +22,7 @@ namespace akui {
#define MB_YES 4
#define MB_NO 8
#define MB_YES_NO 12
#define MB_NONE 16
#define ID_OK 1
#define ID_CANCEL 0
@ -77,4 +78,8 @@ class cMessageBox : public cForm {
u32 messageBox(cWindow* parent, const std::string& title, const std::string& msg, u32 style);
// namespace akui
u32 messageBoxStatic(cWindow* parent, const std::string& title, const std::string& msg, u32 style);
} // namespace akui

BIN
icon.bmp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 1.1 KiB