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 > [RELEASE] Combined M3 & GBAMP - CF-FAT-Driver

#56572 - Mighty Max - Sun Oct 09, 2005 9:28 pm

Hi,

After the tests where successfull i have modified chishm's gbamp_cf. ( http://www.geocities.com/chishm1/ )

The main credits still goes to Chishm,
Thanks to Pepsiman for hinting me to the unlock sequence (and doing the most work there)
Thanks to El Hobito (even it didn't work) and WileEQuixote for testing it.

You can find the modified source at [link removed, please use Chishm's]

Greets
Mighty Max








Old Thread:
Hi there,

I think i have my multiboot ready to read files from the M3 perfect CF. Yet i can't test if that is correct.

I have uploaded a modified Multiboot to http://mightymax.org/M3_Test.rar

It'd be cool if someone could be so kind to put that onto his M3 and start the _boot_mp.nds (prefereable via wmb to exclude any execute/flasher problems)

Thanks in advance

(PS the booting won't work, as there is no modified firmware for it (yet))


:edit: Added the unlock sequence (Thanks pepsiman_) hope we get positive results.
_________________
GBAMP Multiboot


Last edited by Mighty Max on Sun Oct 16, 2005 11:09 pm; edited 2 times in total

#56579 - tepples - Sun Oct 09, 2005 11:02 pm

Have you tried it in GBA mode first?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#56585 - pepsiman - Sun Oct 09, 2005 11:11 pm

tepples wrote:
Have you tried it in GBA mode first?

Neither of us have an M3, so we haven't tried it at all.

#56643 - El Hobito - Mon Oct 10, 2005 12:37 pm

i guess this is where i come in then...

hmmm no love so far it doesnt even power up (ie all is black).

any other way i can help?
maybe if you pm me the modified driver i can add it to my test program? i might be able to diagnose it easier

#56972 - Mighty Max - Wed Oct 12, 2005 8:09 pm

I'll contact you on the weekend . I'm pretty sure i got the right registers, just have to check if the magic numbers are used right :p

I'll write a test application so that we can get it running step by step. So if anyone else wants to help, just say here :p

Greets
_________________
GBAMP Multiboot

#57102 - Mighty Max - Thu Oct 13, 2005 8:15 pm

Heya,

I've checked and redone the unlocking. Can someone let http://mightymax.org/m3_test.nds run with the m3 plugged in and make a screenshot / write down the output?

:)

Thanks
_________________
GBAMP Multiboot

#57114 - El Hobito - Thu Oct 13, 2005 9:28 pm

thats very odd indeed, i just get black screens. im assuming this test would be similar to pepsimans previous ones (ie sending the unlock code and then testing to see if it then allows it to be read/written to. Have a few ideas of other ways to boot but every other app runs so im not sure why this is crashing it.

#57116 - Mighty Max - Thu Oct 13, 2005 9:31 pm

It's a "real" nds, iirc the m3 wants them to be .ds.gba named as .nds?

It's WMB able tho, and only contains a few console prints and the sequence. It shouldn't crash, at least not before the first output is made.
_________________
GBAMP Multiboot

#57118 - El Hobito - Thu Oct 13, 2005 9:42 pm

the m3 can boot both types unlike the supercard. you press A to boot ds.gba and start for .nds files. Could you make it ds.gba anyway?

#57119 - Mighty Max - Thu Oct 13, 2005 9:47 pm

http://mightymax.org/m3_test.ds.gba

In hope that it works better
_________________
GBAMP Multiboot

#57123 - El Hobito - Thu Oct 13, 2005 10:06 pm

sorry still nothing the screens dont even power up :(
i've reformatted my card in both fat16 and fat32 just to be sure

p.s. maybe you could have a "press start to run" first? at least then you'd know the rom was running and it was the code itself causing it to not boot.



p.p.s. i appreciate the work here considering neither you or pepsiman own this!

#57128 - Mighty Max - Thu Oct 13, 2005 10:14 pm

Hmm thats weird, it just run's fine here (as it starts and shows debug info) alltho it can't unlock the m3 which is not plugged in *g*

I'd think even if there is some HAX in there to protect whatever however it should show "Testapplication M3" on the lower screen. It is not accessing anything before that step, so ...

I hope i'll get my m3 soon (atm are all retailers in germany seem to be out of stock ... still)
_________________
GBAMP Multiboot

#57130 - El Hobito - Thu Oct 13, 2005 10:24 pm

would you mind pm-ing me the source to the test? i might have a look it certainly should work since they managed to mod moonshell to use it but its a really old one

#57172 - WileEQuixote - Fri Oct 14, 2005 1:33 am

I just tested all the posted files using my m3 & passkey. I also get two black screens with the first multiboot test file.

With the second m3_test.nds I get:
Code:

Testapplication M3
- Mighty Max -

M3-Hardware-Register:
  aaab5054 # eae25561 # b1db1570
 # e02a5950 # aa6a5413
M2-Hardware-Register:
  abaa8391 # bba84155 # 9da27951
 # a2a25dd9 # f7a97d91
Running unlock...done
M3-Hardware-Register:
  aaab5054 # eae25561 # b1db1570
 # e02a5950 # aa6a5413
M2-Hardware-Register:
  abaa8391 # bba84155 # 9da27951
 # a2a25dd9 # f7a97d91

On the bottom screen.

m3_test.ds.gba gives identical results.

From the system update page on my M3:
Current system version is NDS Movie Player V2.10 English
version(updategc.e03)

Let me know if there is anything else you want me to test.

#57191 - Mighty Max - Fri Oct 14, 2005 6:21 am

The .nds and the .ds.gba has been updated with another unlock step (i hope at least)
_________________
GBAMP Multiboot

#57196 - WileEQuixote - Fri Oct 14, 2005 7:05 am

Only slightly different results.

Code:

Testapplication M3
- Mighty Max -

M3-Hardware-Register:
  aaab5054 # eae25561 # b1db1570
 # e02a5950 # aa6a5413
M2-Hardware-Register:
  8a2a8391 # bbaa4155 # 9da27951
 # a2a25dd9 # d6257dd3
Running unlock...done
Failed
M3-Hardware-Register:
  aaab5054 # eae25561 # b1db1570
 # e02a5950 # aa6a5413
M2-Hardware-Register:
  8a2a8391 # bbaa4155 # 9da27951
 # a2a25dd9 # d6257dd3


There is now a Failed message, and the M2-Hardware-Register numbers are slightly different from what they were last time. Again, same results with .nds and .ds.gba.

Actually... I just noticed that the register numbers can be different every time I run it. But the unlock always fails.

Just so you know, I can use the M3 moonshell to access the card with no problems, so my CF card & M3 should work.

I'm going to get some sleep, but I can do more testing tomorrow.

#57217 - El Hobito - Fri Oct 14, 2005 11:21 am

i still get nothing...the latest firmware must break compatability since im on e06 revision.

#57243 - Mighty Max - Fri Oct 14, 2005 2:45 pm

Yes, the Failed is new, it should turn into a "passed" as soon as i got the unlock working, as it is trying to set the cf to a ready state.

That the M2 register dither on your NDS on each run is no problem, i just included them to compare your M3 with my movieplayer 2 results :p

but ... hmm thats weird i just noticed, i do 16bit reads (volatile unsigned short) why does it read a full long? guess i should disasm my own code to see if its optimized the wrong way / disable optimzing *hides*



Very odd El Hobito, all i do in this nds till first printing to the display is setting the WAIT_CR, setting the display mode and init the console. All standard code taken from the tutorials.



:edit: yes, just checked my own code in arm-asm and it is reading via 32bit instead of 16 ... so, i'll brb with an updated nds

:edit^2: updated both files again. now doing the intended reads.
_________________
GBAMP Multiboot

#57250 - El Hobito - Fri Oct 14, 2005 4:10 pm

darn can't it to do anything..sorry i can't help i tried to flashing it to e04 which seems to be the earliest one bar the original and the recently released e08 but i get nothing when running the file it doesnt even turn the screens on. The only other homebrew app it does this with is the keyboard example so its not related to your code specifically. It works fine when i put it in the gbamp v2 but obviously thats no use!

#57261 - WileEQuixote - Fri Oct 14, 2005 5:35 pm

Hey, that last update made a difference!

Code:

Testapplication M3
- Mighty Max -
M3-Hardware-Register:
  5054 # 5561 # 1570 # 5950 # 5413
M2-Hardware-Register:
  8391 # 4155 # 5d51 # 5dd9 # 7c91
Running unlock...done
Passed
M3-Hardware-Register:
  50 # 50 #   # fa # 33
M2-Hardware-Register:
  #    #    #    #


Hopefully that is the result you are looking for.

@El Hobito:
I've read that the e06 firmware causes problems for some homebrew. Hopefully they fix the problem in future updates.

#57264 - Mighty Max - Fri Oct 14, 2005 5:46 pm

That are EXACTLY the results i wanted to see, great :)) the next version will be up soon, hopefully accessing a file. If that works, i'll submit the changes to chishm.

:)

I'd like to see apps running on GBAMP & M3 with CF without the dever to care what of both is plugged in.

BRB :D
_________________
GBAMP Multiboot

#57265 - El Hobito - Fri Oct 14, 2005 5:51 pm

yeah cheers bud glad you could help mighty max instead, the e08 update still doesnt fix it so i'd suggest staying on that one for now. i'll get in touch with the m3 people and see what they have to say.

edit: MM your a legend! this added to the ability to use it as a 32Meg ram extension which pepsiman already figured out could have some serious benefits for dslinux and other homebrew

#57267 - Mighty Max - Fri Oct 14, 2005 5:54 pm

El Hobito wrote:
yeah cheers bud glad you could help mighty max instead, the e08 update still doesnt fix it so i'd suggest staying on that one for now. i'll get in touch with the m3 people and see what they have to say.


As soon as i got it running, we can start finding out what causes the incompatibility ... maybe i should switch to the latest devkit sometime soon :p
_________________
GBAMP Multiboot

#57269 - El Hobito - Fri Oct 14, 2005 6:00 pm

heh typicial that this (and the keyboard demo) are the only two homebrews that dont work...you'll probably find it just works when you put it on the loader.

#57270 - Mighty Max - Fri Oct 14, 2005 6:19 pm

http://mightymax.org/m3_test.nds
http://mightymax.org/m3_test.txt

Please put the text into the root dir of the inserted card. It should open the txt file and prints it contents. Should be enough for a verify it's function :)
_________________
GBAMP Multiboot

#57273 - WileEQuixote - Fri Oct 14, 2005 6:44 pm

@Mighty Max:

It works, nice job!

If you want, I can type the full output, but it's pretty much the same as before. It now ends with:
Code:
This test was successfull!

Done output


Awesome work! I can't wait for this to start appearing in the other homebrew.

@El Hobito:
According to this compatibility wiki, e04 and later also break Hexen, but Heretic works. Interesting.

#57274 - Mighty Max - Fri Oct 14, 2005 6:48 pm

WileEQuixote wrote:
@Mighty Max:

It works, nice job!

If you want, I can type the full output, but it's pretty much the same as before. It now ends with:
Code:
This test was successfull!

Done output


Awesome work! I can't wait for this to start appearing in the other homebrew.


I'll start merging my code with chsishm's latest driver. Thank you very much for testing the code :) I feared noone would trust it in the first place.

PS: you can change the .txt and the message displayed will change too. Just so you can see it's really working :p
_________________
GBAMP Multiboot

#57275 - El Hobito - Fri Oct 14, 2005 7:00 pm

Everyother homebrew app works fine but the newer firmwares mess upp lcdswap() so that it ends up displaying on the wrong screens. DsHexen works on here but the touch pad is also the playing screen so its not pleasant. I'm looking forward to the m3 gaining the gbamp's cf features so i dont have to keep bringing them both with me!

#57280 - Mighty Max - Fri Oct 14, 2005 7:32 pm

Updated the nds once again, could you please try this version too? I integrated my changes to chishm's code and if i didn't make an error will post the modified source so everyone can grab it / chishm can include it into his.

El Hobito, if it works, i'll sent you the source code of the testing app, so you can better figure out what's causing it.


:edit: Changed Title and first post to point to the source code.
_________________
GBAMP Multiboot

#57288 - WileEQuixote - Fri Oct 14, 2005 8:51 pm

Yes, the latest version works correctly.

Code:
Testapplication M3
- Mighty Max -

This test was successfull!

Done output


No register output now.

A question. Can your code auto-detect the difference between a MP and a M3? Will it just be a recompile with the new lib? Or will homebrewers have to create separate MP and M3 versions of their programs?

Thanks again!

#57290 - Mighty Max - Fri Oct 14, 2005 8:54 pm

WileEQuixote wrote:
Yes, the latest version works correctly.

Code:
Testapplication M3
- Mighty Max -

This test was successfull!

Done output


No register output now.

A question. Can your code auto-detect the difference between a MP and a M3? Will it just be a recompile with the new lib? Or will homebrewers have to create separate MP and M3 versions of their programs?

Thanks again!


It's fully transparent against the "normal" gbamp cf driver of chishm. On the first CF access it tries to unlock the M3 and if it works it's using M3 code, otherwise GBAMP. The app itself does not notice any difference.
_________________
GBAMP Multiboot

#57298 - zubiac - Fri Oct 14, 2005 9:15 pm

so what do I gain when I update chishm's gbamp v2 to yours?
_________________
Abusing Cube and DS with all sorts of homebrew and hacks.

#57301 - Mighty Max - Fri Oct 14, 2005 9:20 pm

This is not the modified firmware. It does not replace chishm's firmware nor his gbamp cf work.


It's just extends the lib to access the CF card from your homebrew.

The advance you get (as a dever) is that you can access M3 CF card and GBAMP CF card with the same source code.
_________________
GBAMP Multiboot

#57302 - zubiac - Fri Oct 14, 2005 9:25 pm

Mighty Max wrote:
This is not the modified firmware. It does not replace chishm's firmware nor his gbamp cf work.


It's just extends the lib to access the CF card from your homebrew.

The advance you get (as a dever) is that you can access M3 CF card and GBAMP CF card with the same source code.


oh,thanx for clearing this
so nothing for me as I don't own a M3 and never will(too pricey).
great work anyway!
_________________
Abusing Cube and DS with all sorts of homebrew and hacks.

#57318 - El Hobito - Fri Oct 14, 2005 10:33 pm

darn i was hoping to just put it into the moonshell sources and recompile but it seems hes made some modification to the cf driver so its gonna take some time to update

#57320 - Mighty Max - Fri Oct 14, 2005 10:41 pm

El Hobito wrote:
darn i was hoping to just put it into the moonshell sources and recompile but it seems hes made some modification to the cf driver so its gonna take some time to update


I only added M3_* definitions, M3_Unlock(), the cfHost var and modified the CF_* functions.

All other (FAT_*) functions remained the same

So do the same, and you'll be set. its simply just onther set of registers + unlocking.
_________________
GBAMP Multiboot

#57322 - El Hobito - Fri Oct 14, 2005 10:54 pm

i got it compiling but i dont understand how to work imfs. it has its own bat file which as a far as i can see works but nothing happens so it wont run since it cant find the data it needs

#57351 - chishm - Sat Oct 15, 2005 2:31 am

Great work MightyMax! I will add this to my source as soon as I get time. In the mean time, I suggest people use MightyMax's modified version. Hopefully I can still use my new CF_read & CF_write functions with the M3. They make use of the consecutive read ability of CF cards.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#57369 - gl0b - Sat Oct 15, 2005 11:26 am

any hope of a supercard port? ;)
_________________
----!-----

Next generation DS

#57375 - Mighty Max - Sat Oct 15, 2005 11:48 am

I'm just atm looking on some supercard bin. So i'm on it :p
_________________
GBAMP Multiboot

#57418 - MaHe - Sat Oct 15, 2005 6:43 pm

You know you rule, Mighty Max?
If you crack SuperCard, I'll worship you like a god (please try both SD and CF version, if neccesary, create a donations site to get some money for 'em ;) )

#57423 - pepsiman - Sat Oct 15, 2005 7:02 pm

El Hobito wrote:
hmmm no love so far it doesnt even power up (ie all is black).

This happens on the G6 if you don't set POWER_CR.
Is the M3 the same?
Fix:
Code:
POWER_CR = POWER_ALL_2D ;

#57424 - Mighty Max - Sat Oct 15, 2005 7:11 pm

Let's test it then :p

updated the m3_test.nds with the power all instruction.
_________________
GBAMP Multiboot

#57426 - El Hobito - Sat Oct 15, 2005 7:35 pm

guess what.......it works lol

that what i thought was wrong but i assumed you'd have it in. Thanks a bunch though pepsoman cos now i know how to get the keyboard example working!

#57427 - Mighty Max - Sat Oct 15, 2005 8:09 pm

yeah, you know ... im still a nds noob :p

Thank you pepsiman very much (again)
_________________
GBAMP Multiboot

#57450 - Mr. Picklesworth - Sat Oct 15, 2005 11:17 pm

Thank you for doing this. I have been worried about each homebrew app only being compatible with five different people's DSs, and this helps a lot :)
I was hoping for exactly what you have made.
_________________
Thanks!
MKDS Friend Code: 511165-679586
MP:H Friend Code: 2105 2377 6896

#57455 - amiga - Sun Oct 16, 2005 12:01 am

MaHe wrote:
You know you rule, Mighty Max?
If you crack SuperCard, I'll worship you like a god (please try both SD and CF version, if neccesary, create a donations site to get some money for 'em ;) )


Yeah, and then if you need money to buy a supercard sd we could donate for it.

#57486 - El Hobito - Sun Oct 16, 2005 12:42 pm

are there any programs out there that use the supercard cf? i believe mighty max probably dissassembled some of the roms that already used the m3 (like its own save game writer for roms or their modified moonshell)

#57545 - gl0b - Sun Oct 16, 2005 9:30 pm

Mighty Max wrote:
I'm just atm looking on some supercard bin. So i'm on it :p


fine! ask darkfader, he was asking romman for the supercard firmware dump to recover his mistakes :P
_________________
----!-----

Next generation DS

#57554 - chishm - Sun Oct 16, 2005 11:03 pm

I guess it's time to announce my latest version. I wasn't intending to release it for a little while, but MightyMax forced my hand :-).

Things added / changed (from memory):
* M3 support! Big thanks to MightyMax for this.
* Improved fseek speed - again thanks to MightyMax.
* Improved fread and fwrite speed - my own doing, using the consecutive sector ability of ATA.
* Modified API. File handles are now FAT_FILE* instead of int.
* Time / Date stamping for files on the NDS - thanks to Joat for the idea and partial implementation.
* Files split into hardware level and disc level routines.
* Plus a few bug fixes.

Get it here.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#57555 - Mighty Max - Sun Oct 16, 2005 11:12 pm

Hehe, thanks to you Chishm,

I removed the link to mine from the first page. I'll change the link on my HP to your version tomorrow.
_________________
GBAMP Multiboot