Skip to content

Commit

Permalink
added support for Pokemon Ranger: Shadows of Almia
Browse files Browse the repository at this point in the history
  • Loading branch information
FIX94 committed Nov 29, 2016
1 parent e95c51f commit 3b4e51b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The following games right now are supported by the installer:
|Super Mario 64 DS|101C3300|101C3400|101C3500|
|Zelda Phantom Hourglass|101C3600|101C3700|101C3800|
|Kirby Mass Attack|101C8600|101C8700|101C8800|
|Pokemon Ranger: Shadows of Almia|101E0F00|101E1000|101E1100|

## Dependencies

Expand Down
2 changes: 2 additions & 0 deletions dsrom/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ zeldast.nds:
@armips haxchi_rop.s
@armips haxchi.s
@mv rom.nds zeldast.nds
@cp zeldast.nds shadowsofalmia.nds

brainage.zip:
$(ZIP) -JXjq9 ../installer/data/brainage.zip brainage.nds
Expand Down Expand Up @@ -206,6 +207,7 @@ zeldaph.zip:

zeldast.zip:
$(ZIP) -JXjq9 ../installer/data/zeldast.zip zeldast.nds
$(ZIP) -JXjq9 ../installer/data/shadowsofalmia.zip shadowsofalmia.nds

clean:
@rm -f *.bin *.nds ../installer/data/*.zip defines.s
Expand Down
4 changes: 4 additions & 0 deletions installer/src/gameList.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ gList_t GameList[] = {
{ 0x101C8600, "Kirby Mass Attack [JPN]", kirbymassattack_zip, &kirbymassattack_zip_size },
{ 0x101C8700, "Kirby Mass Attack [USA]", kirbymassattack_zip, &kirbymassattack_zip_size },
{ 0x101C8800, "Kirby Mass Attack [PAL]", kirbymassattack_zip, &kirbymassattack_zip_size },

{ 0x101E0F00, "Pokemon Ranger: Shadows of Almia [JPN]", shadowsofalmia_zip, &shadowsofalmia_zip_size },
{ 0x101E1000, "Pokemon Ranger: Shadows of Almia [USA]", shadowsofalmia_zip, &shadowsofalmia_zip_size },
{ 0x101E1100, "Pokemon Ranger: Shadows of Almia [PAL]", shadowsofalmia_zip, &shadowsofalmia_zip_size },
};

static const int GameListSize = sizeof(GameList) / sizeof(gList_t);
Expand Down
39 changes: 21 additions & 18 deletions installer/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ int Menu_Main(void)
{
OSScreenClearBufferEx(0, 0);
OSScreenClearBufferEx(1, 0);
println_noflip(0,"Haxchi v2.0u1 by FIX94");
println_noflip(0,"Haxchi v2.1 by FIX94");
println_noflip(1,"Credits to smea, plutoo, yellows8, naehrwert, derrek and dimok");
println_noflip(2,"Please select the game for the Installation from the list below.");
// Starting position.
Expand All @@ -266,7 +266,7 @@ int Menu_Main(void)
{
OSScreenClearBufferEx(0, 0);
OSScreenClearBufferEx(1, 0);
println_noflip(0,"Haxchi v2.0u1 by FIX94");
println_noflip(0,"Haxchi v2.1 by FIX94");
println_noflip(1,"Credits to smea, plutoo, yellows8, naehrwert, derrek and dimok");
println_noflip(2,"You have selected the following game:");
println_noflip(3,SelectedGame->name);
Expand Down Expand Up @@ -415,23 +415,26 @@ int Menu_Main(void)
xmlDocDumpFormatMemoryEnc(doc, &newXml, &newSize, "utf-8", 0);
xmlFreeDoc(doc);
free(metaBuf);
//libxml2 adds in extra \n at the end
if(newXml != NULL && newSize > 0 && newXml[newSize-1] == '\n')
if(newXml != NULL && newSize > 0)
{
newXml[newSize-1] = '\0';
newSize--;
}
//write back to nand
if(IOSUHAX_FSA_OpenFile(fsaFd, path, "wb", &mlcFd) >= 0)
{
println(line++,"Changing game title...");
//UTF-8 BOM
char bom[3] = { 0xEF, 0xBB, 0xBF };
if(memcmp(newXml, bom, 3) != 0)
fsa_write(fsaFd, mlcFd, bom, 0x03);
fsa_write(fsaFd, mlcFd, newXml, newSize);
IOSUHAX_FSA_CloseFile(fsaFd, mlcFd);
mlcFd = -1;
//libxml2 adds in extra \n at the end
if(newXml[newSize-1] == '\n')
{
newXml[newSize-1] = '\0';
newSize--;
}
//write back to nand
if(IOSUHAX_FSA_OpenFile(fsaFd, path, "wb", &mlcFd) >= 0)
{
println(line++,"Changing game title...");
//UTF-8 BOM
char bom[3] = { 0xEF, 0xBB, 0xBF };
if(memcmp(newXml, bom, 3) != 0)
fsa_write(fsaFd, mlcFd, bom, 0x03);
fsa_write(fsaFd, mlcFd, newXml, newSize);
IOSUHAX_FSA_CloseFile(fsaFd, mlcFd);
mlcFd = -1;
}
free(newXml);
}
}
Expand Down
1 change: 1 addition & 0 deletions installer/src/zipList.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ extern u8 masterofdisguise_zip[]; extern u32 masterofdisguise_zip_size;
extern u8 newsmb_zip[]; extern u32 newsmb_zip_size;
extern u8 newsmb_eur_zip[]; extern u32 newsmb_eur_zip_size;
extern u8 partnersintime_zip[]; extern u32 partnersintime_zip_size;
extern u8 shadowsofalmia_zip[]; extern u32 shadowsofalmia_zip_size;
extern u8 sfcommand_zip[]; extern u32 sfcommand_zip_size;
extern u8 sm64ds_zip[]; extern u32 sm64ds_zip_size;
extern u8 wwtouched_zip[]; extern u32 wwtouched_zip_size;
Expand Down

0 comments on commit 3b4e51b

Please sign in to comment.