Update fat image, add hw version text.

* Fat image now had updated version of GodMode9i. (Version with slot2
support that now has latest commits from main branch of GM9i)
* Autoboot can now be toggled on/off via single const bool. Compile with
the bool set to false if you wish to disable autoboot.
* New card command added to read hw version from EZP cart. This command
was found courtasy of Lifehackerhansol. UI code updated to dispaly this
in top right corner of top screen UI. (This is only displayed if file
browser UI is activated)
This commit is contained in:
ApacheThunder 2024-11-22 22:31:46 -06:00
parent 648a3f9695
commit 71a5741cd5
5 changed files with 54 additions and 23 deletions

View File

@ -5,15 +5,14 @@ ifeq ($(strip $(DEVKITARM)),)
$(error "Please set DEVKITARM in your environment. export DEVKITARM=<path to>devkitARM")
endif
export TARGET := EZDS_P
export TARGET := EZFLASH_NEW
export TOPDIR := $(CURDIR)
export HBMENU_MAJOR := 1
export HBMENU_MINOR := 0
export HBMENU_PATCH := 2
# export HBMENU_MAJOR := 1
# export HBMENU_MINOR := 3
VERSION := $(HBMENU_MAJOR).$(HBMENU_MINOR).$(HBMENU_PATCH)
# VERSION := $(HBMENU_MAJOR).$(HBMENU_MINOR)
# GMAE_ICON is the image used to create the game icon, leave blank to use default rule
GAME_ICON :=
@ -47,7 +46,6 @@ checkarm9:
#---------------------------------------------------------------------------------
$(TARGET).nds : $(NITRO_FILES) arm7/$(TARGET).elf arm9/$(TARGET).elf
ndstool -c $(TARGET).nds -7 arm7/$(TARGET).elf -9 arm9/$(TARGET).elf \
-b $(CURDIR)/icon.bmp "hbmenu;$(VERSION);http://devkitpro.org" \
-g ABJJ 01 "EZFLASH NEW" -t banner.bin -d $(NITRO_FILES)
dlditool ntro.dldi $(TARGET).nds

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -30,18 +30,27 @@
#include "hbmenu_banner.h"
#include "font6x8.h"
#define TITLE_POS_X (13*8)
#define TITLE_POS_Y (10*8)
#define TITLE_POS_X (13*8)
#define TITLE_POS_Y (2)
#define TITLE_POS_OFFSET_Y (10)
#define ICON_POS_X 26
#define ICON_POS_Y 79
// #define ICON_POS_Y 79
#define ICON_POS_Y 81
#define TEXT_WIDTH ((22-4)*8/6)
#define TEXT_WIDTH ((22-4)*8/6)
#define TEXT_WIDTH_VERSTRING ((26-4)*8/6)
#define VERSTRING_LENGTH 26
static int bg2, bg3;
static u16 *sprite;
static tNDSBanner banner;
static volatile u32 EZPHWVerBuffer[1] = { 0xFFFFFFFF };
// static char EZPHardwareVersion[11] = { 'H', 'W', ' ', 'V', 'e', 'r', ':', ' ', '0', '0', '\0' };
static char EZPHardwareVersion[VERSTRING_LENGTH];
extern tNDSBanner hbNoIcon_bin;
static inline void writecharRS (int row, int col, u16 car) {
@ -59,24 +68,37 @@ static inline void writecharRS (int row, int col, u16 car) {
gfx[row*(512/8/2)+col/2] = oldval;
}
// Modified to use TITLE_POS_OFFSET_Y as offset since ver string needs to be printed at 0 position outside of main text box.
static inline void writeRow (int rownum, const char* text) {
int i, len, r = (rownum + TITLE_POS_OFFSET_Y), p = 0;
len=strlen(text);
if (len>TEXT_WIDTH)len=TEXT_WIDTH;
// clear left part
for (i=0;i<(TEXT_WIDTH-len)/2;i++)writecharRS (r, i, 0);
// write centered text
for (i=(TEXT_WIDTH-len)/2;i<((TEXT_WIDTH-len)/2+len);i++)writecharRS (r, i, text[p++]-' ');
// clear right part
for (i=((TEXT_WIDTH-len)/2+len);i<TEXT_WIDTH;i++)writecharRS (r, i, 0);
}
static inline void writeVerString (const char* text) {
int i,len,p=0;
len=strlen(text);
if (len>TEXT_WIDTH)
len=TEXT_WIDTH;
if (len>TEXT_WIDTH_VERSTRING)len=TEXT_WIDTH_VERSTRING;
// clear left part
for (i=0;i<(TEXT_WIDTH-len)/2;i++)
writecharRS (rownum, i, 0);
for (i=0;i<(TEXT_WIDTH_VERSTRING-len)/2;i++)writecharRS (0, i, 0);
// write centered text
for (i=(TEXT_WIDTH-len)/2;i<((TEXT_WIDTH-len)/2+len);i++)
writecharRS (rownum, i, text[p++]-' ');
for (i=(TEXT_WIDTH_VERSTRING-len)/2;i<((TEXT_WIDTH_VERSTRING-len)/2+len);i++)writecharRS (0, i, text[p++]-' ');
// clear right part
for (i=((TEXT_WIDTH-len)/2+len);i<TEXT_WIDTH;i++)
writecharRS (rownum, i, 0);
for (i=((TEXT_WIDTH_VERSTRING-len)/2+len);i<TEXT_WIDTH_VERSTRING;i++)writecharRS (0, i, 0);
}
static inline void clearIcon (void) { dmaFillHalfWords(0, sprite, sizeof(banner.icon)); }
@ -143,6 +165,16 @@ static void loadDefaultIcon() {
void iconTitleUpdate (int isdir, const std::string& name) {
if (EZPHWVerBuffer[0] == 0xFFFFFFFF) {
cardParamCommand (0x3E, 0, CARD_ACTIVATE | CARD_nRESET | CARD_BLK_SIZE(7) | CARD_SEC_CMD | CARD_DELAY2(24) | CARD_SEC_EN | CARD_SEC_DAT, (u32*)EZPHWVerBuffer, 1);
if (EZPHWVerBuffer[0] != 0xFFFFFFFF) {
for (int i = 0; i < VERSTRING_LENGTH; i++)EZPHardwareVersion[i] = '\0';
sprintf(EZPHardwareVersion, " EZP HW VER %02X", (u8)EZPHWVerBuffer[0]);
writeVerString(EZPHardwareVersion);
}
}
writeRow (0, name.c_str());
writeRow (1, "");
writeRow (2, "");

View File

@ -55,6 +55,7 @@ volatile bool gbaGuiEnabled = false;
static const int pathListSize = 4;
static const int framePathListSize = 5;
static const bool EnableAutoBoot = false;
// First path is expected to be from internal fat image.
static const char *PossiblePaths[4] = { "/GBAExploader.nds", "ez5n:/boot.nds", "ez5n:/boot.dat", "ez5n:/GBAExploader.nds" };
@ -224,15 +225,15 @@ int main(int argc, char **argv) {
bool autoBoot = false;
switch (key) {
case KEY_B: gbaMode(); break;
case KEY_A: {
if((access("/GodMode9i.nds", F_OK) == 0))runNdsFile("/GodMode9i.nds", 0, NULL);
} break;
case KEY_X: {
if((access("/mmd.nds", F_OK) == 0))runNdsFile("/mmd.nds", 0, NULL);
} break;
case KEY_Y: {
if((access("/GodMode9i.nds", F_OK) == 0))runNdsFile("/GodMode9i.nds", 0, NULL);
} break;
case KEY_SELECT: autoBoot = true; break;
case KEY_SELECT: autoBoot = EnableAutoBoot; break;
case 0: {
autoBoot = true;
autoBoot = EnableAutoBoot;
if (access("/nrio-usb-disk.nds", F_OK) == 0) {
nrio_usb_type_t usb = nrio_usb_detect();
if (usb.board_type != 0)runNdsFile("/nrio-usb-disk.nds", 0, NULL);