Homebrew [Discontinued] TWLoader - CTR-mode NDS app

  • Thread starter Thread starter RocketRobz
  • Start date Start date
  • Views Views 1,821,834
  • Replies Replies 9,252
  • Likes Likes 147
Status
Not open for further replies.
No. Try getting the file from TWLoader.7z, and overwrite your current one.
Also, make sure the file isn't set to read-only.
Alright, I will...

--------------------- MERGED ---------------------------

No. Try getting the file from TWLoader.7z, and overwrite your current one.
Also, make sure the file isn't set to read-only.
Thank you dude!
 
So do boxart files have to be converted to .bin now as well? if so how do i go about it? i was wondering why my game icons broke in the recent updates and now after i used the "Add gaames" feature it created image files in .bin format disregarding the .png's
 
So do boxart files have to be converted to .bin now as well? if so how do i go about it? i was wondering why my game icons broke in the recent updates and now after i used the "Add gaames" feature it created image files in .bin format disregarding the .png's
Boxart files are still .png files. The banner .bin files also contain the text.
 
Boxart files are still .png files. The banner .bin files also contain the text.
Why is it that they no longer show for me then? i never changed anything and they stopped working recently, has the directory changed or something?
the directory i'm still using is "sd:/_nds/twloader/boxart/flashcard" (gamename.png and gamename.ini.png both fail to work)
 
Last edited by Shinygati,
Why is it that they no longer show for me then? i never changed anything and they stopped working recently, has the directory changed or something?
the directory i'm still using is "sd:/_nds/twloader/boxart/flashcard" (gamename.png and gamename.ini.png both fail to work)
The directory is still the same.
Just to make sure, the .png files are named exactly as the .ini files (SM64DS.ini is SM64DS.ini.png for box art), right?
 
The directory is still the same.
Just to make sure, the .png files are named exactly as the .ini files (SM64DS.ini is SM64DS.ini.png for box art), right?
Yep filenames are exactly the same, Pokemon pearl's .ini for example is named "Pokemon Pearl.ini" and the boxart is named "Pokemon Pearl.ini.png" i never changed anything to the image files and they were working perfectly fine before so i have no idea what happened.
 
Yep filenames are exactly the same, Pokemon pearl's .ini for example is named "Pokemon Pearl.ini" and the boxart is named "Pokemon Pearl.ini.png" i never changed anything to the image files and they were working perfectly fine before so i have no idea what happened.
No idea either, 'cause I never changed the boxart loading code.
 
@GerbilSoft Can you fix some code in the flashcard side's arm9 main.cpp file?
You might be able to fix the shutdown issue.
I don't have any experience with NDS flashcard programming so that'll take some time. I'm currently working on some other stuff, but I'll let you know if I find anything.
 
Just an update in case anyone else runs into the same problem that i had with the boxarts not showing but what i did to resolve it was to delete the _nds and roms folder and redownload/copy them back over to the 3ds's SD card, originally i just replaced them and that didn't fix the issue so you will have to delete them and then use twloaders built in "Add Games" function to generate the .ini's again i have no idea if backing up and then restoring the .ini's will also work or not so i just played it safe to try and fix the problem. I don't know what exactly went wrong here but i did notice that every time i launched twloader i would see a small box flash too quick to read but something saying 1/1 i guess game counter?
 
@Robz8 @GerbilSoft

based on the ini file versioning issues i suggest that we start actually adding versions to all ini files, this way twloader knows when an outdated ini is being parsed and it can either abort or preferably recreate a new ini based on the new structure
 
Last edited by bakawun,
Just an update in case anyone else runs into the same problem that i had with the boxarts not showing but what i did to resolve it was to delete the _nds and roms folder and redownload/copy them back over to the 3ds's SD card, originally i just replaced them and that didn't fix the issue so you will have to delete them and then use twloaders built in "Add Games" function to generate the .ini's again i have no idea if backing up and then restoring the .ini's will also work or not so i just played it safe to try and fix the problem. I don't know what exactly went wrong here but i did notice that every time i launched twloader i would see a small box flash too quick to read but something saying 1/1 i guess game counter?
Didn't work for me, sadly. Hopefully the devs will look into this.
 
Yesterday the app crashed back to the home menu blanking the screens after attempting to boot with rainbow RGB enabled. Reboot fixed it but not sure if it has anything to do with the MCU mods.
 
@Robz8 @GerbilSoft @umbjolt

Here I suggest a few changes that will provide the following benefits:
* folder/file structure issues completely solved
* twloader can be completely installed from just the twloader cia, no more need to remove the sd card (flashcard sd is still manually)
* per flashcard settings (handy for testing and users with multiple cards)
* no more files or path's with things you will never user

Here is a list of changes needed to have these benefits

1: parsing the main ini file and updating twloader to prevent having to do the other checks twice
Code:
1 On startup twloader needs to load its settings file before anything else
  1: check if ini file exists
     no go-to 2
     yes go-to 3
  2: create versioned ini file using defaults and go-to 1
  3: check ini file version
     old/no-version go-to 4
     current go-to 7
  4: parse the ini file using legacy parser
  5: perform sanity check on old values
  5: fill new or broken values with defaults
  6: create versioned ini file using values just created and go-to 1
  7: is (auto) updating allowed?
      yes go-to 8
      no go-to 12
  8: download version number from server
  9: compare remote and local version numbers
      old go-to 10
      current go-to 12
 10: download binary
 11: update version in ini file after successfull download and go-to 2
 12: continue to path check/creation code

2: create the file structure
Code:
1 after parsing the ini so twloader knows which paths to create check and create paths
  1: Generate list of paths
  2: check if path's exists
     no go-to 3
     yes go-to 4
  3: run recursive mkdir to create missing path and go-to 2
  4: Remove path from list
  5: Are there any more paths to check in the list?
     no go-to 6
     yes, select path and go-to 2
  6: contine to file checking/downloading code

3: create binaries and their ini files
Code:
1 after parsing the ini so twloader knows which binary files need to be created
  1: generate list of binaries
  2: check if ini file exists
     no go-to 3
     yes go-to 4
  3: create versioned ini file using defaults, set the binary version to -1 (do not trust unversioned files)
  4: check ini file version
     old/no-value go-to 5
     current go-to 9
  5: parse the ini file using legacy parser
  6: perform sanity check on old values
  7: fill new or broken values with defaults
  8: create versioned ini file using values just created and go-to 2
  9: is (auto) updating allowed?
      yes go-to 10
      no go-to 14 (force update)
 10: download version number from server
 11: compare remote and local version numbers
      old go-to 12
      current go-to 14
 12: download binary
 13: update version in ini file after successfull download and go-to 2
 14: verify binary exists
      no go-to 12
      yes go-to 14
 15: Remove binary from list
 16: Are there any more binaries to check in the list?
     no go-to 17
     yes, select path and go-to 2
 17: continue to game specific ini file verifications

4: verify game specific ini files and
Code:
1 after parsing the ini so twloader knows which folders need to be checked
  1: generate list of ini's found
  2: check ini file version
    old/no-version go-to 3
     current go-to 7
  4: parse the ini file using legacy parser
  5: perform sanity check on old values
  5: fill new or broken values with defaults
  6: create versioned ini file using values just created and go-to 2
  7: Remove ini from list
  8: Are there any more ini's to check in the list?
     no go-to 9
     yes, select path and go-to 2
  9: continue to existing banner/boxart checking code

missing from these proces flows are:
Code:
1 hard limit on the amount of times any check is allowed to loop on a single path/file/ini
2 checking if there is enough room on the sdcard to do the write actions
3 checking if binaries are correct by running a hash check (known hash from server version file)
4 using timestamps to prevent checking the server more than once per period
5 using similar logic for checking/updating banners and boxart
6 error handling for failing downloads and failed writes
7 rejecting garbage values from ini files that are not upgraded
8 user selectable auto updating of all file types including boxart, warnings about forced updates
9 the option to use similar system to build flashcard side sd card files on a per flashcard basis. so that the user just has to copy the for_flashcard_sd contents over to the flashcard from the pc (or at some point twloader may be able to write directly to the flashcard)

I would like to suggest we auto create everything on the 3ds sd card instead of relying on the 7z file and manual copying.
This will make it so twloader works out of the box from installing just twloader.cia.
Code:
sdroot:
_nds/ (create automatically on startup)
_nds/dstwoautoboot.ini (create or upgrade automatically on startup only if dstwo is selected as flashcard, run this check again when dstwo flashcard selection is saved)
_nds/bootstrap.nds (create or upgrade automatically on startup)
_nds/gbarunner2.nds (create or upgrade automatically on startup)
_nds/lastsave.ini (create or upgrade automatically on startup)
_nds/loadcard_dstt.nds (create or upgrade automatically on startup only if dstt is selected as flashcard, run this check again when dstt flashcard selection is saved)
_nds/nds-bootstrap.ini (create or upgrade automatically on startup)
_nds/YSMenu.ini (create or upgrade automatically on startup only if a flashcard is selected, run this check again when flashcard selection is saved to any card but none) (ps add a no flashcard option to the menu)

_nds/twloader/ (create automatically on startup)
_nds/twloader/NTR_Launcher.nds (create or upgrade automatically on startup)
_nds/twloader/settings.ini (create or upgrade automatically on startup)

_nds/twloader/bnricons/ (create automatically on startup)
_nds/twloader/bnricons/flashcard/ (create automatically on startup only if a flashcard is selected, run this check again when flashcard selection is saved to any card but none) (ps add a no flashcard option to the menu) (ps2 do we really need seperate bnricon folders for bootstrap and flashcard?)

_nds/twloader/boxart/ (create automatically on startup)
_nds/twloader/boxart/flashcard/ (create automatically on startup only if a flashcard is selected, run this check again when flashcard selection is saved to any card but none) (ps add a no flashcard option to the menu) (ps2 do we really need seperate boxart folders for bootstrap and flashcard?)

_nds/twloader/cia/ (create automatically on startup)
_nds/twloader/cia/TWLoader - TWLNAND side.cia  (create or upgrade automatically on startup)

_nds/twloader/loadflashcard/(create automatically on startup only if a flashcard is selected, run this check again when flashcard selection is saved to any card but none) (ps add a no flashcard option to the menu)
_nds/twloader/loadflashcard/ace_rpg.nds (create or upgrade automatically on startup only if ace_rpg is selected as flashcard, run this check again when ace_rpg flashcard selection is saved)
_nds/twloader/loadflashcard/r4.nds (create or upgrade automatically on startup only if r4 is selected as flashcard, run this check again when r4 flashcard selection is saved)
_nds/twloader/loadflashcard/r4idsn.nds (create or upgrade automatically on startup only if r4idsn is selected as flashcard, run this check again when r4idsn flashcard selection is saved)

While i did this i realized there may be a better way to order the 3ds sd card folder structure, so i suggest the following
Code:
_nds/art/
_nds/art/bnricons
_nds/art/boxart
_nds/launchers/ (loaders, forwarders,etc..)
_nds/launchers/GBARunner2/
_nds/launchers/GBARunner2/GBARunner2.ini
_nds/launchers/GBARunner2/GBARunner2.nds
_nds/launchers/GBARunner2/romsettings/
_nds/launchers/GBARunner2/romsettings/[per_rom_settings].ini
_nds/launchers/ace_rpg/
_nds/launchers/ace_rpg/ace_rpg.ini
_nds/launchers/ace_rpg/ace_rpg.nds
_nds/launchers/ace_rpg/romsettings/
_nds/launchers/ace_rpg/romsettings/[per_rom_settings].ini
_nds/launchers/bootstrap.ini
_nds/launchers/bootstrap.nds
_nds/launchers/bootstrap/
_nds/launchers/bootstrap/romsettings/
_nds/launchers/bootstrap/romsettings/[per_rom_settings].ini
_nds/launchers/dstt/
_nds/launchers/dstt/loadcard_dstt.ini
_nds/launchers/dstt/loadcard_dstt.nds
_nds/launchers/dstt/romsettings/
_nds/launchers/dstt/romsettings/[per_rom_settings].ini
_nds/launchers/dstwo/
_nds/launchers/dstwo/*.nds (missing?)
_nds/launchers/dstwo/dstwoautoboot.ini
_nds/launchers/dstwo/romsettings/
_nds/launchers/dstwo/romsettings/[per_rom_settings].ini
_nds/launchers/ntr_launcher/
_nds/launchers/ntr_launcher/NTR_Launcher.ini
_nds/launchers/ntr_launcher/NTR_Launcher.nds
_nds/launchers/ntr_launcher/romsettings/
_nds/launchers/ntr_launcher/romsettings/[per_rom_settings].ini
_nds/launchers/r4/
_nds/launchers/r4/r4.ini
_nds/launchers/r4/r4.nds
_nds/launchers/r4/romsettings/
_nds/launchers/r4/romsettings/[per_rom_settings].ini
_nds/launchers/r4idsn/
_nds/launchers/r4idsn/r4idsn.ini
_nds/launchers/r4idsn/r4idsn.nds
_nds/launchers/r4idsn/romsettings/
_nds/launchers/r4idsn/romsettings/[per_rom_settings].ini
_nds/roms/
_nds/roms/*.gba
_nds/roms/*.nds
_nds/twloader/
_nds/twloader/lastsave.ini
_nds/twloader/nandside_cia/TWLoader - TWLNAND side.cia
_nds/twloader/settings.ini

sample ini file with ini versioning and nds versioning
Code:
iniversion="0.1"
ndsversion="1.4"

server side you would have a "version.ini" that contains the version and you make twlauncher download that and compare it to the version in the local ini file. it the server side version is higher you update, if its the same, lower or corrupt you abort.
 
Last edited by bakawun,
server side you would have a "version.ini" that contains the version and you make twlauncher download that and compare it to the version in the local ini file. it the server side version is higher you update, if its the same, lower or corrupt you abort.

I like your idea and if I have time before they come, I'll try to do it. If not, maybe them can finished.
About version it's "almost" implemented with mysterious ver file in SD:\_nds\twloader\ver :P

I've see that the latest PR have change mkdir process so I cannot do nothing because my changes can override the PR or vice versa so we'll have to wait to that PR to be merged first :(
 
Last edited by umbjolt,
  • Like
Reactions: bakawun
i would like to add that it may look convulted with all the per card files, but this allows seemless switching between multiple cards, highly usefull when testing.
 
  • Like
Reactions: umbjolt
Is possible add custom banner , custom banner icon and custom name text for flashcard.???
For example : Dstwo appears this seems like Alex Stormbraker
 
I like your idea and if I have time before they come, I'll try to do it. If not, maybe them can finished.
About version it's "almost" implemented with mysterious ver file in SD:\_nds\twloader\ver :P

I've see that the latest PR have change mkdir process so I cannot do nothing because my changes can override the PR or vice versa so we'll have to wait to that PR to be merged first :(
Code:
git remote add gerbilsoft https://github.com/GerbilSoft/TWLoader.git
git fetch gerbilsoft
git checkout gerbilsoft/feature/improve-menu-cart-inserted
git checkout -b [insert your branch name here, i suggest using "versioning"]

you probably have to rebase when you want to send your pr but we'll see by then
 
  • Like
Reactions: umbjolt
Code:
git remote add gerbilsoft https://github.com/GerbilSoft/TWLoader.git
git fetch gerbilsoft
git checkout gerbilsoft/feature/improve-menu-cart-inserted
git checkout -b [insert your branch name here, i suggest using "versioning"]

you probably have to rebase when you want to send your pr but we'll see by then

First, I wanna finish something I'm working on but later I'll try :)
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum