Hacking R4 Commander

fli_guy84

Well-Known Member
Member
Joined
Nov 20, 2006
Messages
335
Trophies
1
XP
400
Country
Malaysia
Am I the only one who's not using this program yet?

I like to do things manually
biggrin.gif
 
B

bugmenot52

Guest
While R4 commander may be bug free or nearly so, other potential features are now available. Particularly, the features of the 1.8 firmware version. Namely, figuring out what to support, and adding support for:
  • cheats (perhaps an editor, or at the very least an autodownloader for usrcheats.dat. Perhaps use the new r4crypt.exe tool to convert usrcheats.dat to cheats.dat)
  • gbaframe.bmp support (It should be possible to handle this not unlike a skin.)
  • Perhaps some form of support for the new save-backups supported by firmware 1.08.
-----------
Finally a request for an update:


The tool "EZV_3in1_GBA" which is a full featured tool for using the EZV 3-in-1 cart with the R4DS. It can be used to enable the rumble/ram extention, which removes the need to patch games to support the card.

It also supports sending gba games (some of which must be patched) to the EZV 3-in-1, and starting them.

It even supports DS-gba link.

The information you should need is all available at http://gbatemp.net/index.php?showtopic=50658&pid=653571.

The main tricky thing I see is the need to add "/GBA/SAVES" to the card, even though the program would be installed to "/APPS" and the "data files" (gba roms) would be installed to "/GBA". Your .ifo format seems to lack a way to instruct R4 to create that supplementary directory.
 

TrolleyDave

Philosolosophising
OP
Former Staff
Joined
Jan 1, 2007
Messages
7,761
Trophies
1
Age
52
Location
Wales, UK
XP
933
Country
While R4 commander may be bug free or nearly so, other potential features are now available. Particularly, the features of the 1.8 firmware version. Namely, figuring out what to support, and adding support for:
  • cheats (perhaps an editor, or at the very least an autodownloader for usrcheats.dat. Perhaps use the new r4crypt.exe tool to convert usrcheats.dat to cheats.dat)
  • gbaframe.bmp support (It should be possible to handle this not unlike a skin.)
  • Perhaps some form of support for the new save-backups supported by firmware 1.08.
-----------
Finally a request for an update:


The tool "EZV_3in1_GBA" which is a full featured tool for using the EZV 3-in-1 cart with the R4DS. It can be used to enable the rumble/ram extention, which removes the need to patch games to support the card.

It also supports sending gba games (some of which must be patched) to the EZV 3-in-1, and starting them.

It even supports DS-gba link.

The information you should need is all available at http://gbatemp.net/index.php?showtopic=50658&pid=653571.

The main tricky thing I see is the need to add "/GBA/SAVES" to the card, even though the program would be installed to "/APPS" and the "data files" (gba roms) would be installed to "/GBA". Your .ifo format seems to lack a way to instruct R4 to create that supplementary directory.

Sorry to take so long to reply. I'm going to be doing a major overhaul of the R4 Commander after I finish the generic program I'm working on so I'll be adding alot of the stuff you mentioned into it.

Cheats : At the minute the only cheat file it supports is the one that's in the firmware file. There's a way you can cheat to put a blank cheat.dat and usrcheat.dat file (turn them into an installable homebrew package, just needs the files zipping and an info created) on the card but proper support will be added. I don't know about putting a built in cheat editor, I'm not really sure how it all works, but I'm thinking of putting in the option to load one of the other cheat editors that's floating around.

GBAframe support : Again you can cheat the program into installing them but I'm going to make a proper skin selector.

New save format : Erm, what new saves? If you mean the .BAK versions of the save it's already in there.

The only way around the EZV thing is the have a zip file with the necessary folders in it and have it install to the root of the card instead of the /apps folder. I doubt I'll be putting code into the program to do it, sorry. If I manage to pick one up in the future I'll do it, but without the card to test it the stuff on it won't be happening.
 

TrolleyDave

Philosolosophising
OP
Former Staff
Joined
Jan 1, 2007
Messages
7,761
Trophies
1
Age
52
Location
Wales, UK
XP
933
Country
Sorry for the lack of updates recently folks! I've posted a preview of the program I'm working on at the mo on the blog.

It's called Lightning Flash (previously EZ-Commander) and is a drag and drop card manager. Lightning Flash is going to be a generic R4 Commander in a way. It won't have the downloadable updates or skin manager but it'll have everything else.

A major update of the R4 Commander should be expected after that!
 
B

bugmenot52

Guest
Sorry to take so long to reply. I'm going to be doing a major overhaul of the R4 Commander after I finish the generic program I'm working on so I'll be adding alot of the stuff you mentioned into it.

Cheats : At the minute the only cheat file it supports is the one that's in the firmware file. There's a way you can cheat to put a blank cheat.dat and usrcheat.dat file (turn them into an installable homebrew package, just needs the files zipping and an info created) on the card but proper support will be added. I don't know about putting a built in cheat editor, I'm not really sure how it all works, but I'm thinking of putting in the option to load one of the other cheat editors that's floating around.

Well I will discuss this more at the bottom of this post.

GBAframe support : Again you can cheat the program into installing them but I'm going to make a proper skin selector.

Good. It is obviously trivial to workaround now, but propper support is certainly nice.

New save format : Erm, what new saves? If you mean the .BAK versions of the save it's already in there.

Oh, Ok then. Nevermind.


QUOTE(TrolleyDave @ May 19 2007, 03:17 AM)
The only way around the EZV thing is the have a zip file with the necessary folders in it and have it install to the root of the card instead of the /apps folder. I doubt I'll be putting code into the program to do it, sorry. If I manage to pick one up in the future I'll do it, but without the card to test it the stuff on it won't be happening.
Doh! That workaround is fairly obvious. That works in the current version? If so then that is quite nice.

------------

Ok. Now for the basic cheat information. You probably know at least some of this, and much of it is not terribly imporant. The official firmware updates come with a CHEATS.dat file. This is simply an encrypted cheats file. So it can be dealt with exactly like like the usrcheats file, except that one needs to remember to r4crypt.exe to convert as nessisary.

With the latest firmware 1.09, if a game is in both the CHEATS.dat and USRCHEAT.dat, the user can chose which one they want to use. Not quite as nice as merging the list, but still a step up. Nevertheless, this improvement can be completely ignored by your program.

The standard file format for Action Replay codes is an xml format. Because XML is very nice for programmatic manipulation it seems like this is what your program should primarily be working with.

The "offical" codes from codejockeys are availble as direct downloads from the codejockies site:
http://us.codejunkies.com/nds_actionreplay...codelist_us.asp
http://us.codejunkies.com/nds_actionreplay...codelist_eu.asp
http://us.codejunkies.com/nds_actionreplay...codelist_jp.asp

---------------------------
Now my ideas. Hopefully by the time you start working on this there will be a simple command line tool to convert an xml file to the r4ds format. The offical r4 editor can do this, but it appears to require interactive use.

As far as your program goes, I see no need to support both cheats.dat and usrcheats.dat.
If you support cheats.dat, you will need to re-implement or ship and run r4crypt. If you choose to support usrcheats, then all of my idea remains the same, but you should then simply replace the firmware's CHEATS.DAT file with a 0 byte file of the same name.

Here is a quick and dirty mock-up of a possible interface.


The list-box lists custom XML files containing codes the user wishes to include.
The add button opens up a "open file" dialog box to select a file to add.
The remove button removes the selected file from the list.
The edit button opens up one of the existing xml code editors (such as the java one mentioned
in the stickied topic.)

When the Install button is pushed, for any of the codejunkies boxes checked, download the latest version. The program will store this file. If a download fails, the program can still use the last downloaded version.
Then you merge the XML files together. The XML used is fairly simple, so this should hopefully be reasonably easy, especially if Delphi has good tools for dealing with xml.

The resulting merged XML file is converted with the hypothetical xml2r4 format converter i mentioned earlier. (As i said before, hopefully one will exist by the time you start on this.) Then the code file is encrypted (if you opted for CHEATS.dat). Finally it is installed on the card.

Finally, a possible feature that may be too much trouble to be worth it, but that some people may like is "Only codes for installed games". The XML file identifies games by the 4 Letter code. That code is part of the DS header (found at offset 0x0c). Thus the idea is that after the xml file is merged, all games not installed on the card are removed from the xml file.



Overall, my idea does not fit perfectly with the style of the rest of the program because in this case
the program is generating the file to be installed. However, it does seem like a solid way
to make managing the codes simple.
 

TrolleyDave

Philosolosophising
OP
Former Staff
Joined
Jan 1, 2007
Messages
7,761
Trophies
1
Age
52
Location
Wales, UK
XP
933
Country
Sorry to take so long to reply.  I'm going to be doing a major overhaul of the R4 Commander after I finish the generic program I'm working on so I'll be adding alot of the stuff you mentioned into it.

Cheats : At the minute the only cheat file it supports is the one that's in the firmware file.  There's a way you can cheat to put a blank cheat.dat and usrcheat.dat file (turn them into an installable homebrew package, just needs the files zipping and an info created) on the card but proper support will be added.  I don't know about putting a built in cheat editor, I'm not really sure how it all works, but I'm thinking of putting in the option to load one of the other cheat editors that's floating around.

Well I will discuss this more at the bottom of this post.

GBAframe support : Again you can cheat the program into installing them but I'm going to make a proper skin selector.

Good. It is obviously trivial to workaround now, but propper support is certainly nice.

New save format : Erm, what new saves? If you mean the .BAK versions of the save it's already in there.

Oh, Ok then. Nevermind.


QUOTE(TrolleyDave @ May 19 2007, 03:17 AM)The only way around the EZV thing is the have a zip file with the necessary folders in it and have it install to the root of the card instead of the /apps folder.  I doubt I'll be putting code into the program to do it, sorry.  If I manage to pick one up in the future I'll do it, but without the card to test it the stuff on it won't be happening.
Doh! That workaround is fairly obvious. That works in the current version? If so then that is quite nice.

------------

Ok. Now for the basic cheat information. You probably know at least some of this, and much of it is not terribly imporant. The official firmware updates come with a CHEATS.dat file. This is simply an encrypted cheats file. So it can be dealt with exactly like like the usrcheats file, except that one needs to remember to r4crypt.exe to convert as nessisary.

With the latest firmware 1.09, if a game is in both the CHEATS.dat and USRCHEAT.dat, the user can chose which one they want to use. Not quite as nice as merging the list, but still a step up. Nevertheless, this improvement can be completely ignored by your program.

The standard file format for Action Replay codes is an xml format. Because XML is very nice for programmatic manipulation it seems like this is what your program should primarily be working with.

The "offical" codes from codejockeys are availble as direct downloads from the codejockies site:
http://us.codejunkies.com/nds_actionreplay...codelist_us.asp
http://us.codejunkies.com/nds_actionreplay...codelist_eu.asp
http://us.codejunkies.com/nds_actionreplay...codelist_jp.asp

---------------------------
Now my ideas. Hopefully by the time you start working on this there will be a simple command line tool to convert an xml file to the r4ds format. The offical r4 editor can do this, but it appears to require interactive use.

As far as your program goes, I see no need to support both cheats.dat and usrcheats.dat.
If you support cheats.dat, you will need to re-implement or ship and run r4crypt. If you choose to support usrcheats, then all of my idea remains the same, but you should then simply replace the firmware's CHEATS.DAT file with a 0 byte file of the same name.

Here is a quick and dirty mock-up of a possible interface.


The list-box lists custom XML files containing codes the user wishes to include.
The add button opens up a "open file" dialog box to select a file to add.
The remove button removes the selected file from the list.
The edit button opens up one of the existing xml code editors (such as the java one mentioned
in the stickied topic.)

When the Install button is pushed, for any of the codejunkies boxes checked, download the latest version. The program will store this file. If a download fails, the program can still use the last downloaded version.
Then you merge the XML files together. The XML used is fairly simple, so this should hopefully be reasonably easy, especially if Delphi has good tools for dealing with xml.

The resulting merged XML file is converted with the hypothetical xml2r4 format converter i mentioned earlier. (As i said before, hopefully one will exist by the time you start on this.) Then the code file is encrypted (if you opted for CHEATS.dat). Finally it is installed on the card.

Finally, a possible feature that may be too much trouble to be worth it, but that some people may like is "Only codes for installed games". The XML file identifies games by the 4 Letter code. That code is part of the DS header (found at offset 0x0c). Thus the idea is that after the xml file is merged, all games not installed on the card are removed from the xml file.



Overall, my idea does not fit perfectly with the style of the rest of the program because in this case
the program is generating the file to be installed. However, it does seem like a solid way
to make managing the codes simple.

Sorry, I can't quite figure out the whole multi-quote thing so I'll have to answer everything below! Doh!

The gbaframe.bmp files : As I've pretty much got the Lightning Flash program up to a usable-ish state and I've not really got any feedback on it I'm going to start converting it into the R4 Commander v2. I'm not sure whether to keep the old tabbed style or move over to the drag and drop and have a pop up file selector and game library. The skins thing will be a module so it can be used standalone or with the program. Basically what I'm thinking is just a radio button set so you can choose between gbaframe or a proper skin pack, and people who prefer to use Rominator can just use the skin applicator. I'm going to try to add the ability to edit the theme.ini file and build a skin by dropping in bitmaps and then saving it as the correct filename but I don't know enough about coding just yet.

The EZV workaround : Yep, it's no problem setting the path to anything you want. The *APPPATH* is just a macro for the program to replace, but putting any directory there will work. It'll create the directory if it doesn't exist. I can't seem to get WinZip to put an empty directory into a zip file though so you need to put some kind of empty file in there if the directory is going to be empty. I've tried to make the packs as powerful as possbile with regards to what can be installed, although as everything it can always be more powerful! I'm trying to keep it simple though. I know it sounds completely illogical to use for apps but you can also use the Homebrew Games packs to install a secondary zip file. I did it for stuff like Doom, so you can zip doom.wad into a file called doomwad.zip and it unpacks the zip to whatever directory (you can set it to be different to the main zip) you tell it. Have a look at the ini files in the .HBG folder and you'll see what I mean.

You're suggestion for the cheat codes sounds great to be honest. It also fits in to the new style of R4 Commander 2 as I'm writing it so you can launch external apps as well. I'm not really sure I've got the skill to write it as of yet but I'm a pretty quick learner so hopefully pretty shortly in the future. Although I will need someone to write the theoretical r4crypt.exe tool as there's definitely no way I've got the skill to do something like that anytime soon.

Do you mind if I PM you about this stuff when I'm ready? If you've got any other suggestions then hit me with them as well, many brains are much better than one!

Cheers!
 

laurenz

Well-Known Member
Member
Joined
Jun 3, 2006
Messages
324
Trophies
0
Website
Visit site
XP
135
Country
Netherlands
The idea seemed so great, but i'm already annoyed before i got everything started. First off i don't know what to download on the site, there's some Lightning shit that i downloaded but i have no clue on how to use it, so i downloaded a older version, which doesn't seem to work either. When i try to update my microSD with the 1.09 kernel i press 'update this blablabla' and it starts downloading and unpacking, but nothing happens after!
Can anybody help me how this works?
 

TrolleyDave

Philosolosophising
OP
Former Staff
Joined
Jan 1, 2007
Messages
7,761
Trophies
1
Age
52
Location
Wales, UK
XP
933
Country
Lightning Flash is a work in progress and isn't the R4 Commander. When you choose the update with 1.09 it just downloads it from the server and puts it in the available firmwares in the Utils tab. Install the firmware from there and it'll be fine. Also have you made sure that you've selected the correct microsd drive?
 
B

bugmenot52

Guest
Sorry, I can't quite figure out the whole multi-quote thing so I'll have to answer everything below! Doh!

The gbaframe.bmp files : As I've pretty much got the Lightning Flash program up to a usable-ish state and I've not really got any feedback on it I'm going to start converting it into the R4 Commander v2. I'm not sure whether to keep the old tabbed style or move over to the drag and drop and have a pop up file selector and game library. The skins thing will be a module so it can be used standalone or with the program. Basically what I'm thinking is just a radio button set so you can choose between gbaframe or a proper skin pack, and people who prefer to use Rominator can just use the skin applicator. I'm going to try to add the ability to edit the theme.ini file and build a skin by dropping in bitmaps and then saving it as the correct filename but I don't know enough about coding just yet.

The EZV workaround : Yep, it's no problem setting the path to anything you want. The *APPPATH* is just a macro for the program to replace, but putting any directory there will work. It'll create the directory if it doesn't exist. I can't seem to get WinZip to put an empty directory into a zip file though so you need to put some kind of empty file in there if the directory is going to be empty. I've tried to make the packs as powerful as possbile with regards to what can be installed, although as everything it can always be more powerful! I'm trying to keep it simple though. I know it sounds completely illogical to use for apps but you can also use the Homebrew Games packs to install a secondary zip file. I did it for stuff like Doom, so you can zip doom.wad into a file called doomwad.zip and it unpacks the zip to whatever directory (you can set it to be different to the main zip) you tell it. Have a look at the ini files in the .HBG folder and you'll see what I mean.

You're suggestion for the cheat codes sounds great to be honest. It also fits in to the new style of R4 Commander 2 as I'm writing it so you can launch external apps as well. I'm not really sure I've got the skill to write it as of yet but I'm a pretty quick learner so hopefully pretty shortly in the future. Although I will need someone to write the theoretical r4crypt.exe tool as there's definitely no way I've got the skill to do something like that anytime soon.

Do you mind if I PM you about this stuff when I'm ready? If you've got any other suggestions then hit me with them as well, many brains are much better than one!

Cheers!
No Problem with the PM, although It may take me a while to notice depending on how often I'm visiting the fourm.

The r4crypt tool already exists, and it simply converts between encrypted files and unencrpted files. In fact, no less than 3 such tools exist. (one had a nicer command line interface, the second had better code, and I had no problems combining the two to create a 6.5KB exe that has the best of both.)

What is still hypothetical is the xml2r4 cheatcode format converter. I have taken a look at this, and I may be able to do it, but it is not terribly easy. (I'll continue to look into this.)

As for implementing the cheat interface, there isn't really too much that is tricky. Downloading files is easy, as is calling external programs. The only tricky part seems to be manipulating the XML to merge the files. I know this is very easy using for example C#, but have no experience with Delphi.

I might be able to produce some sample code, but I cannot guarantee it. If i do manage to produce such example code, i will post it here.

EDIT: Status Update:
At this point I have working sample code for the XML merging, the xml manipulation side of option to include codes only for installed games. However, I have found that I was wrong about the Codejunkies XML download. That will need special code. I'm working on writing that. However if a good xml2r4 converter does not appear, all of this will be wasted. I have tried analyzing the format, and It is not terribly easy to reverse engineer. The easiest thing would be if somebody could convince R4 to release the source code for their Cheat Code editor. That would make it far simpler to create the needed utility. Hopefully, it would also be easy to edit that source so that it is not as picky as it currently is as far as the xml format.
 

TrolleyDave

Philosolosophising
OP
Former Staff
Joined
Jan 1, 2007
Messages
7,761
Trophies
1
Age
52
Location
Wales, UK
XP
933
Country
In case anyone is interested in a look here are screenshots from R4 Commander V2.0!

Main Window (Drag and drop control center)


Game Library Window (Yes, R4 Commander now uses a release database!)


Pack Library (A unified App/Emu/Game/Firmware and much more library)


Classic Browser (For users comfortable with R4 Commander V1.XX)
 

TrolleyDave

Philosolosophising
OP
Former Staff
Joined
Jan 1, 2007
Messages
7,761
Trophies
1
Age
52
Location
Wales, UK
XP
933
Country
And in case anyone is interested here's an early copy of the program to play with! It still needs alot of visual and code tidying up to do and there's a few things I still want to add in like the download library, backing up saves, the ability to list missing releases, and some more filtering. Oh yeah, and there's definitely alot of bugs in there, but if you don't misuse it it'll work. I'll hopefully get it finished for beta testing this weekend.

R4 Commander V1.XX users should open the Classic Browser from the File menu in the main window and click on files from there to add them to the library as they want them (or the Catalog All button and got out for a while if you've got alot of games!).

There's a nowhere near finished readme included in the archive but it'll help you get the basics of using it.

Unzip the archive of your preference to the folder of your preference. When it's tested and done I'll create a proper install.

Program
http://www.dpgdownloads.com/trolleyguy/Commander/r4c2.rar
http://www.dpgdownloads.com/trolleyguy/Commander/r4c2.zip

Packs (drop them into the main window to add them to the Pack Library)
http://www.dpgdownloads.com/trolleyguy/Com...e.1.09.Pack.ezc
http://www.dpgdownloads.com/trolleyguy/Com...mulDS.v0.5a.ezc
 

gaboumafou

Well-Known Member
Member
Joined
Dec 23, 2006
Messages
489
Trophies
1
Website
Visit site
XP
534
Country
Canada
It's a pretty good program, I'm having fun sorting my roms while waiting for my M3 Simply to be delivered!
tongue.gif


Just one strange thing I found: when I put the Nintendogs: Best Friends (U) rom, it displays Spiderman 2 boxart!
 

TrolleyDave

Philosolosophising
OP
Former Staff
Joined
Jan 1, 2007
Messages
7,761
Trophies
1
Age
52
Location
Wales, UK
XP
933
Country
As V2.0 of R4/M3S Commander is nearing a non-beta release I thought I'd release a final update of V1.XX which is now up to V1.09. The program now uses a release database to get the names of games and also uses the same engine as V2.0 for it's boxarts/screenshots so pictures should be up to date.

V1.09
-----
- WWW browser now uses a drop down list instead of scrolling through 1 by 1.
- Increased the size of the window and all file browsers.
- Added boxart engine from R4 Commander V2.0.
- Now uses release database to pull names from.
- Added .7Z support.
 

1111

Active Member
Newcomer
Joined
Nov 8, 2002
Messages
33
Trophies
0
Website
Visit site
XP
338
Country
Serbia, Republic of
Thank you, TralleyDave. I started using 2.0 version, it's cool!
Why do you not added your blog into program? Application Packs kinda nice idea. Do u planning to add moonshell?
Thank you again.
 

TrolleyDave

Philosolosophising
OP
Former Staff
Joined
Jan 1, 2007
Messages
7,761
Trophies
1
Age
52
Location
Wales, UK
XP
933
Country
Thank you, TralleyDave. I started using 2.0 version, it's cool!
Why do you not added your blog into program? Application Packs kinda nice idea. Do u planning to add moonshell?
Thank you again.

Thanks! The blog isn't in the program, but it is in the Start menu. Don't know why I haven't put it in the program, just scatterbrained I guess!

I haven't added Moonshell yet but probably will be as soon as the program is ready for a non-beta release. I'll just ask people to leave comments on the blog with which programs that want added. The packs are pretty easy to make yourself if you want to try it. Just rename it from .EZC to .ZIP and unpack it, there's an INI file in there that R4 Commander gets all it's info from. PM me if you want more details.
 

1111

Active Member
Newcomer
Joined
Nov 8, 2002
Messages
33
Trophies
0
Website
Visit site
XP
338
Country
Serbia, Republic of
The packs are pretty easy to make yourself if you want to try it. Just rename it from .EZC to .ZIP and unpack it, there's an INI file in there that R4 Commander gets all it's info from. PM me if you want more details.
Awesome! I will probably .ezc-ing all my homebrew that way
happy.gif


Can you add new path (dpg, rom, mp3, applications, emulators, games) for books (txt)?
Can I toggle on(off) process of copying roms to my hard drive (i found all roms copied from dvd disc to micro sd also copied to disc c too). And now I have in C:\rom1, rom2, rom3, rom4... and so on. Only roms, not apps and videos. And importd saves in C:\Program Files\R4 Commander\SAVES.LIB
Can I change all these things?

P.S. Sorry, my English is not perfect. I hope you can understand me.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    DinohScene @ DinohScene: ahh nothing beats a coffee disaronno at work