gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Wifiloader BETA 1.2

#108532 - Hermes - Thu Nov 09, 2006 10:51 pm

Hi,

for a few days, i have been released a little utility for the DS developers.

This utility is thinking to load an application via WIFI directly in the RAM, without access to the SD or CF.

The utility have the abilty to do a softreset using the key combination L+R+START+SELECT to return again to the Wifiloader application.

Of course, it is not compatible with a filsystem in ROM, because you only have the appllication in RAM. It is capable to load an application of 3MB.

It is very easy to use and connect to your PC using the WFC datas and the port 9999.

This port can be changed using a little tool to add a txt file with the configuration datas (for example, the new port to access)

I have compiled the server under MinGW enviroment and i include the source code of this server too. To change the port here, use the line command: wifiloader 5555 and it change the port to 5555


The last release have support for 128 bit WEP. I have finded and resolved a little bug on the WIFI Lib and now, it work fine with mi AP :)

I hope you undestand to me (i am spanish and i have problems to speak in english ;) )

Download here:

http://mods.elotrolado.net/~hermes/wifiloader_beta1.2.rar


I am working to release the new version of my eSound and Multithread library's with some news thinks and WIFI integrated. The source code of Wifiloader is part of this release, patience ;)

#108537 - Lick - Thu Nov 09, 2006 11:27 pm

Nice! I will try it out tomorrow!
_________________
http://licklick.wordpress.com

#108549 - Izhido - Fri Nov 10, 2006 12:30 am

Wow! Fantastic! If this really works, it might become a major step for the homebrewing scene. No need for a intermediate "flashcarting" step to test apps anymore! At least, for us owners of a WiFi card on our PC...

This is gonna be huge... congratulations, Hermes!

#108564 - tepples - Fri Nov 10, 2006 2:24 am

Good idea.

Feature request: Would it be hard to make the program use the industry-standard HTTP wire protocol to fetch the .nds file from the PC? This would let any computer with an operating system capable of running Apache HTTP Server (i.e. Windows, Mac OS, and Linux, on any CPU) act as a server.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#108582 - scanlime - Fri Nov 10, 2006 6:53 am

Wow, quite a coincidence... I wrote a very similar program last week.

Mine uses a very slightly different approach:

1. It stores the downloaded image in the GBAROM area. It is written for the EZFlash IV, which has 32MB of RAM mapped here. If you have another GBA flash card which uses RAM, you may be able to trivially modify my loader to work with it.

2. Instead of connecting back to a server running on your PC, my loader listens for incoming TCP connections. You can dump a raw .gba, .ds.gba, or .nds file to TCP port 6502 on your DS, it stores that image in GBAROM, then bootstraps it.

3. It knows how to bootstrap .ds.gba-style images off the GBAROM, and how to run GBA games in compatibility mode. It will automatically detect .nds files and prepend the ndsmall.bin loader.

4. It does support returning back to the bootloader, but not via patching the ROM. I include a small header file that you can use in your homebrew games to jump back to the loader at any time. This is implemented by having the bootloader relocate a copy of itself to the very top of GBAROM, then store an entry point address in an unused portion of the NDS header at the top of main RAM.

The source code is BSD-licensed, and it's up on a public Subversion server:
http://svn.navi.cx/misc/trunk/nds/wifi-ez4-loader/

And here's the example project that shows you how to return to the bootloader from your own homebrew code:
http://svn.navi.cx/misc/trunk/nds/loader-template/

Here's a snapshot release, including source and binaries:
http://releases.navi.cx/nds/wifi-ez4-loader-20061109.zip

Remember, my loader is only known to work with the EZFlash IV Lite Deluxe! It may work with other flash cards, but try it at your own risk. It will probably require at least a little modification to un-writeprotect the RAM on your card.

If you want to run games directly out of RAM, it sounds like Hermes' loader is exaclty what you need. If you want to run large images out of GBAROM and you have an EZ4, this might work better.

#108603 - EyeballKid - Fri Nov 10, 2006 11:38 am

tepples wrote:
Good idea.

Feature request: Would it be hard to make the program use the industry-standard HTTP wire protocol to fetch the .nds file from the PC? This would let any computer with an operating system capable of running Apache HTTP Server (i.e. Windows, Mac OS, and Linux, on any CPU) act as a server.


Just thought I should plug my HTTP library: HappyHTTP.
There are better HTTP libs out there (eg libcurl), but HappyHTTP is easy to get running on the DS, is easy to use, and simple to integrate (one header file and one .cpp file).
(My DSlurper tool uses it)

#108657 - diggla - Sat Nov 11, 2006 12:41 am

where can i set the ip of the pc so my nds connects to the correct ip? the wfc data uses my dsl router as gateway and not my pc.

#111872 - falco216 - Mon Dec 11, 2006 7:22 am

i dont understand how to work this, step by step instructions please.

#112472 - pas - Sat Dec 16, 2006 6:03 pm

Strange... If I start the PC Application, then start the DS Application, both on the defaultport 9999, and: Nothing happens... No Window pops up that let's me choos a .nds data. What Am I doing wrong ? My Wifisettings are configured properly and work with every Homebrew out there (I use a Router). Any Ideas ?

Greets:

Pas

#112479 - Dark Knight ez - Sat Dec 16, 2006 7:15 pm

Try the newer wifiloader (beta) update. That one lets you specify what computer is running the server program (which is probably what you need).
I'd link you to it, but I forgot the link. He only posted it on some Spanish website. Search for it.
_________________
AmplituDS website

#112536 - pas - Sun Dec 17, 2006 7:29 pm

Isn't the Downloadlink he postet her the Beta ???

#112539 - Dark Knight ez - Sun Dec 17, 2006 7:36 pm

A newer version, I said.

In this topic I found this link.

It's beta 1.5. Unofficial release.

You'll need to first unpack beta 1.2 and then overwrite some of those files with files in this 1.5 zip. Only the .nds file and the textfile are new, I think. The server executable remains the same. Read the instructions on how to use this properly.
_________________
AmplituDS website

#113158 - pas - Sat Dec 23, 2006 8:25 pm

@Dark Knight ez: Could you please explain me how to get this to work ? I don't get it, even with version 1,5...

#113164 - Dark Knight ez - Sat Dec 23, 2006 9:42 pm

========= Installing =========
1) Set your Wifi Connection with an official Wifi Connection game such as Mario Kart DS. Make sure you can play internet matches, which means you can succesfully connect to your router (and the internet).

2) Download and unpack beta 1.2 zipfile.
3) Download and unpack beta 1.5 zipfile at the same place, overwriting some of the files from beta 1.2.
4) Edit the textfile wificfg.txt (NDS folder of the unpacked files) to this:

Code:
<WIFICFG>
PCIP= 192.168.0.1
AUTO= 1
</WIFICFG>


Where 192.168.0.1 is your own PC's IP address in your local area network. (The IP address which your router sees your PC as.)

5) Run wifiloader_cfg_changer.bat (same folder as wificfg.txt)
6) Put the .nds or .ds.gba file in that folder on your NDS.

Note that if you did these steps and later realise that you put in the wrong IP address, you will have to do all these steps over again (except for step 1), including steps 2 and 3.

========= Running =========
1) Run wifiloader.exe on your computer (PC folder of the unpacked files)
2) Run the .nds or .ds.gba file on your NDS.
3) You'll be able to select what .nds or .ds.gba file you wish to load by wifiloader.exe when the NDS has succesfully connected to your PC.


That's it. If you're not able to get it to work, don't bother.
It seems that due to this wifiloader rewriting some code of the .nds or .ds.gba file you "download" to your NDS (in order to be able to soft reset itself), a lot of games and applications don't work properly. (Unfortunately. It's the only real downside to this program.)
_________________
AmplituDS website

#113182 - dantheman - Sun Dec 24, 2006 3:15 am

Thank you for the mini guide. It works well on a few games (DELite and the WMB version of DSLinux for instance)

#113285 - devine - Tue Dec 26, 2006 1:27 am

scanlime wrote:
1. It stores the downloaded image in the GBAROM area. It is written for the EZFlash IV, which has 32MB of RAM mapped here. If you have another GBA flash card which uses RAM, you may be able to trivially modify my loader to work with it.


This is seriously awesome! With a couple of minor modifications I was able to make wifiloader run on my SD Mini & M3 Lite. Your program is 10x better than wmbhost, restarting a program is almost instant! It's just like a dream come true :)

Here is a version of wifiloader with support for SC/M3, let me know if it works well. Included is also nc.exe and the Hello, world program (which demonstrates the restart feature). (Note: WFC must be configured before running wifiloader.nds)

Again, great work! ^^

#113297 - dantheman - Tue Dec 26, 2006 8:23 am

devine, I can't seem to get it to work. I've got a Supercard miniSD and I copied the file onto my miniSD card and ran it. It connected to my network fine and started listening on 192.168.1.125:6502. I then opened a command window, navigated to the wifiloader directory, and typed
nc 192.168.1.125 6502 < hello.nds
and although the DS says "accepted 192.168.1.123:4567" it doesn't appear to be transmitting anything. Am I doing something wrong? Typing the wrong command?

#113310 - devine - Tue Dec 26, 2006 12:09 pm

dantheman wrote:
although the DS says "accepted 192.168.1.123:4567" it doesn't appear to be transmitting anything. Am I doing something wrong? Typing the wrong command?


Nope, had the same problem. You have to kill netcat with Ctrl-C so that wifiloader detects that the connection is closed.

EDIT: found an option to make nc exit after sending the nds:

Code:
nc.exe -w 1 192.168.1.60 6502 < hello.nds

#113345 - devine - Tue Dec 26, 2006 10:09 pm

devine wrote:
Here is a version of wifiloader with support for SC/M3, let me know if it works well. Included is also nc.exe and the Hello, world program (which demonstrates the restart feature). (Note: WFC must be configured before running wifiloader.nds)

I updated the version above with the unlock code for the G6, if anyone wants to give it a try ;-)

EDIT: although wifiloader can be streamed over wmbhost, after uploading a nds the program fails to start. Probably some kind of bad interaction with WMB.
.

#114098 - Hermes - Wed Jan 03, 2007 11:38 pm

Dark Knight ez wrote:
A newer version, I said.

In this topic I found this link.

It's beta 1.5. Unofficial release.

You'll need to first unpack beta 1.2 and then overwrite some of those files with files in this 1.5 zip. Only the .nds file and the textfile are new, I think. The server executable remains the same. Read the instructions on how to use this properly.



The official release of WIFILOADER 1.5 is part of the examples of "eLIBS".

You can download from here:

http://mods.elotrolado.net/~hermes/eLIBS_release_2.rar


It include the libraries with all the source code and some docs.

#114151 - laichung - Thu Jan 04, 2007 5:42 pm

Thx for the libraries~

I tested it with the lastest slot 1 card R4, it load homebrew fine.
But the restart patch is not work, do I need to write some code to make it work in my program? thanks ~~

#114488 - Hermes - Mon Jan 08, 2007 10:56 am

laichung wrote:
Thx for the libraries~

I tested it with the lastest slot 1 card R4, it load homebrew fine.
But the restart patch is not work, do I need to write some code to make it work in my program? thanks ~~


I cannot test it with one slot 1 card, because i only have M3 Perfect SD.

To restart a program is a good idea to read a key in your homebrew program and jump to a routine to "do nothing" (to avoid your program read datas from your card or process 3D polygons at same time you apply the soft reset).

But, it is necessary the ROM file is mapped from 0x08000000 address.

In my code (in asm.s) you can find two littles routines:

@ shutdown SC-EFA2
@ shutdown M3

This code is provide to change from the FAT mode access (to the CF/SD), to the ROM mode access of this cards, if you are using a FAT file system.

Maybe, it is necessary a similar code to detect your card and change the mode.

In this forum there are people who have better knowledge than I about this question (i only can test with my M3 card :/ )