Skip to content

Commit

Permalink
Restore ak2loaders; add needed files
Browse files Browse the repository at this point in the history
This renames BL2CK to ak2loader.nds; they're the same thing at the end
of the day.
  • Loading branch information
lifehackerhansol committed Aug 26, 2023
1 parent c094090 commit 5247191
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 48 deletions.
45 changes: 28 additions & 17 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ cp -f ../static/WoodTT/ttloader.nds ../release/woodtt/__rpg/ttloader.nds
7z a -r ../release/woodtt.7z ../release/woodtt/*
#BUILD_WOODTT

#: <<"#BUILD_WOODBL2CK"
echo Building WoodBL2CK...
#: <<"#BUILD_WOODAK2"
echo Building WoodAK2...
cp -f ../patch/romloader_bl2ck.cpp akmenu4/arm9/source/romloader.cpp
make akmenu4/_DS_MENU.DAT >/dev/null
cp -f akmenu4/akmenu4_r4.nds ../build/woodbl2ck.nds
cp -f akmenu4/akmenu4_r4.nds ../build/woodak2.nds
make clean >/dev/null
../xenobox dldipatch ../dldi/ak2_sd.dldi ../build/woodbl2ck.nds
../xenobox modifybanner ../build/woodbl2ck.nds "Wood BL2CK;with autorunWithLastRom"
../xenobox dldipatch ../dldi/ak2_sd.dldi ../build/woodak2.nds
../xenobox modifybanner ../build/woodak2.nds "Wood AK2;AK2 infolib support"
#BUILD_WOODBL2CK

#: <<"#BUILD_WOODR4Li"
Expand Down Expand Up @@ -301,18 +301,29 @@ cp -f ../static/WoodR4iDSN/__rpg/r4idsnloader.nds ../release/woodr4idsn/__rpg/r4
7z a -r ../release/woodr4idsn.7z ../release/woodr4idsn/*
#RELEASE_R4IDSN

#: <<"#RELEASE_BL2CK"
mkdir -p ../release/woodbl2ck/__rpg
cp -a ../build/__rpg/fonts ../release/woodbl2ck/__rpg/
cp -a ../build/__rpg/language ../release/woodbl2ck/__rpg/
cp -a ../build/__rpg/ui ../release/woodbl2ck/__rpg/
cp -f ../build/woodbl2ck.nds ../release/woodbl2ck/akmenu4.nds
cp -f ../dldi/ak2_sd.dldi ../release/woodbl2ck/__rpg/r4isd.dldi
cp -a ../static/BL2CK/* ../release/woodbl2ck/
cp -a ../static/*.ini ../release/woodbl2ck/__rpg/
cp -f ../static/savelist.bin ../release/woodbl2ck/__rpg/savelist.bin
7z a -r ../release/woodbl2ck.7z ../release/woodbl2ck/*
#RELEASE_BL2CK
#: <<"#RELEASE_AK2"
mkdir -p ../release/woodak2info/__rpg
cp -a ../build/__rpg/fonts ../release/woodak2info/__rpg/
cp -a ../build/__rpg/language ../release/woodak2info/__rpg/
cp -a ../build/__rpg/ui ../release/woodak2info/__rpg/
cp -f ../build/woodak2info.nds ../release/woodak2info/akmenu4.nds
cp -f ../dldi/ak2_sd.dldi ../release/woodak2info/__rpg/ak2sd.dldi
cp -a ../static/WoodAK2Info/* ../release/woodak2info/
cp -a ../static/*.ini ../release/woodak2info/__rpg/
cp -f ../static/savelist.bin ../release/woodak2info/__rpg/savelist.bin
7z a -r ../release/woodak2info.7z ../release/woodak2info/*
mkdir -p ../release/woodak2mix/__rpg
cp -a ../build/__rpg/fonts ../release/woodak2mix/__rpg/
cp -a ../build/__rpg/language ../release/woodak2mix/__rpg/
cp -a ../build/__rpg/ui ../release/woodak2mix/__rpg/
cp -f ../build/woodak2mix.nds ../release/woodak2mix/akmenu4.nds
../xenobox modifybanner ../release/woodak2mix/akmenu4.nds "Wood AK2;AK2 mixinfo support"
cp -f ../dldi/ak2_sd.dldi ../release/woodak2mix/__rpg/ak2sd.dldi
cp -a ../static/WoodAK2Mix/* ../release/woodak2mix/
cp -a ../static/*.ini ../release/woodak2mix/__rpg/
cp -f ../static/savelist.bin ../release/woodak2mix/__rpg/savelist.bin
7z a -r ../release/woodak2mix.7z ../release/woodak2mix/*
#RELEASE_AK2

#: <<"#RELEASE_M3"
echo Archiving WoodM3...
Expand Down
22 changes: 21 additions & 1 deletion patch/romloader_bl2ck.cpp → patch/romloader_ak2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
#include <iorpg.h>
#endif

// non-woodrpg headers
#include <unistd.h>
#include "progresswnd.h"

static void resetAndLoop()
{
// Interrupt
Expand Down Expand Up @@ -64,11 +68,12 @@ bool loadRom( const std::string & filename, const std::string & savename, u32 fl
u32 hed[16];
u8 *ldrBuf;
FILE *ldr=NULL;
FILE *TTSYSFile=NULL;

#if defined(_STORAGE_rpg)
ldr = fopen("fat0:/__rpg/rpgloader.nds", "rb");
#elif defined(_STORAGE_r4)
ldr = fopen("fat0:/__rpg/bl2ckloader.nds", "rb");
ldr = fopen("fat0:/__rpg/ak2loader.nds", "rb");
#endif
if(ldr == NULL) return false;
fread((u8*)hed, 16*4, 1, ldr);
Expand All @@ -84,6 +89,21 @@ bool loadRom( const std::string & filename, const std::string & savename, u32 fl
__NDSHeader->arm7executeAddress = hed[13];
fclose(ldr);

// Create TTMENU.SYS if it don't exist
if(access("fat0:/__rpg/system.sys", F_OK) != 0) {
progressWnd().setTipText("Generating SYSTEM.SYS...");
progressWnd().show();
progressWnd().setPercent(0);
TTSYSFile = fopen("fat0:/__rpg/system.sys", "wb");
fseek(TTSYSFile, 0, SEEK_SET);
// memdump. Actually just expanding the file seems to crash, but this works totally fine...
fwrite((void*)0x02400000, 0x400000, 1, TTSYSFile);
fflush(TTSYSFile);
fclose(TTSYSFile);
progressWnd().setPercent(100);
progressWnd().hide();
}

#if defined(_STORAGE_rpg)
// copy filename to sram
ALIGN(4) u8 filenameBuffer[MAX_FILENAME_LENGTH];
Expand Down
12 changes: 8 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,13 @@ continue by lifehackerhansol:
- r4liloader was slightly changed to also create a Gateway Blue loader.
- ex4loader and ilsloader are deprecated. They work fine with the r4liloader.
- If woodrpg ever gets better compatibility maybe this will be reverted.
- ak2loader replaced with BL2CK loader (and add missing files).
- DATs updated to BL2CK latest dats (can't use RGFs because of redistrib license. yeah...)
- ak2loader updates:
- r1 -> r4isdhc.com 1.52
- r2 -> r4isdhc.hk 1.72
- Naming slightly changed; now there are separate releases for r1 and r2, named WoodAK2Info and WoodAK2Mix respectively.
- Updated infolib/extinfo pulled from BL2CK's website (can't use RGFs because of redistrib license. yeah...)
- Updated mixinfo from r4isdhc.hk 1.72.
- default savelist.bin attached (from AKAIO 1.9.0)
- m3loader proprietary is dropped in favour of patched m3loader, as it actually works better.
- BL2CK is found to support the AK2i. So just cp `_DS_MENU.DAT` to `akmenu4.nds` to make it work.
- woodrpg_ak2i is dropped in favour of this
- ak2loader is found to support the actual AK2i. So just cp `_DS_MENU.DAT` to `akmenu4.nds` to make it work.
- woodrpg_ak2i is dropped in favour of this; AKAIO has been heavily encrypted since forever and it's not worth the task to reverse it.
Binary file removed static/BL2CK/__rpg/datas/shut.dat
Binary file not shown.
6 changes: 0 additions & 6 deletions static/BL2CK/__rpg/linkconfig.ini

This file was deleted.

Binary file removed static/BL2CK/__rpg/r4isd.dldi
Binary file not shown.
20 changes: 0 additions & 20 deletions static/BL2CK/__rpg/sdlist.ini

This file was deleted.

Binary file removed static/BL2CK/__rpg/system.sys
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added static/WoodAK2Mix/__rpg/ak2loader.nds
Binary file not shown.
Binary file added static/WoodAK2Mix/__rpg/mixinfo.dat
Binary file not shown.
Binary file added static/WoodAK2Mix/_ds_menu.dat
Binary file not shown.

0 comments on commit 5247191

Please sign in to comment.