#47325 - TheMikaus - Thu Jul 07, 2005 2:47 pm
I was wondering three things.
How do you get the DS to send signals to a particular pin of the gba cart?
since the gba port is usually taken up by a flash card, is it possible to use the ds slot for the expansion instead?
if that's possible how do you send signals to a particular pin of the ds slot?
Thanks in advance!
#47387 - Mr Snowflake - Fri Jul 08, 2005 2:32 pm
Probably it would be possible to send a signal over a particular address or data line. You could send 00100 as address, so the 3th pin would get activated, same for data.. But this is only the theory (I guess), I don't know how to pull this of in practice.
#47391 - tepples - Fri Jul 08, 2005 3:06 pm
TheMikaus wrote: |
since the gba port is usually taken up by a flash card |
Load the .nds file completely into RAM and then pak-swap to the option pak.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#47399 - TheMikaus - Fri Jul 08, 2005 3:51 pm
If you were using a game that happened to use a file system then this would not be a viable solution.
#47400 - Lynx - Fri Jul 08, 2005 3:55 pm
Or wait a little longer, and make your option back a serial device and use the PassMe+RS232 that is being worked on.
Natrium42's site:
http://natrium42.com/projects/serial.html
ndshb.com news about it.
http://www.ndshb.com/modules.php?name=News&file=article&sid=13
#47401 - natrium42 - Fri Jul 08, 2005 3:57 pm
TheMikaus wrote: |
If you were using a game that happened to use a file system then this would not be a viable solution. |
You could use a Xport.
4 Mbytes of flash and 16 Mbytes of SDRAM. I haven't used one myself, but I assume the memories and registers are memory mapped in GBA cart address space.
_________________
www.natrium42.com
#47420 - tepples - Fri Jul 08, 2005 6:22 pm
TheMikaus wrote: |
If you were using a game that happened to use a file system then this would not be a viable solution. |
Oh really? Can you load everything from the file system before you ask the user to pak-swap? If not, then include your file system into the ARM9 binary other than through appending. For example, GBFS includes a tool called 'bin2s' that converts a binary file into assembly language that can be compiled to an object file that contains the data, properly aligned in memory[1]. Here's a quick example of its use:
Code: |
bin2s data.gbfs > data.s
gcc -mthumb-interwork -c data.s -o data.o |
Then link data.o in with your ARM9 binary.
[1] The GBA and Nintendo DS examples from the devkitarm site contain a bin2o macro that wraps objcopy, but I could never get it to set an object's alignment to a multiple larger than 1 byte because the last version of objcopy that I tried did not expose an interface for doing that. In fact the objcopy manual doesn't even contain the word "align".
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#47425 - TheMikaus - Fri Jul 08, 2005 6:39 pm
What if the binary was already 3 megs or so with out the extra gbfs stuff?
No this isn't the case here. I'm just saying in theory. And wouldn't using bin2s defeat the purpose of using gbfs?
Either way. I appreciate the suggestions.
#47426 - tepples - Fri Jul 08, 2005 7:07 pm
If the binary is already approaching the size of Nintendo DS EWRAM, then you probably can't use Xport either, as the Xport flash memory is no bigger than EWRAM.
Another suggestion: Connect two devices to the Xport: one cable to a PC (for loading the rest of the flash) and one of whatever Option Pak you want to use.
Another suggestion: Disassemble the Super Mario 64 DS WMB stub and figure out how to use Nintendo DS Wi-Fi, then implement IP, TCP, DHCP, and HTTP on top of that and have the program load assets from a computer running Apache HTTP Server in the same room.
Another suggestion: Disassemble the Super Mario 64 DS WMB stub and figure out how to use Nintendo DS Wi-Fi, then implement IP, TCP, and DHCP on the DS and some sort of server on the PC, and use an Option Pak attached to a USB port of the PC.
And no, bin2s does not defeat the purpose of GBFS. I include bin2s with the GBFS distribution because at least on the GBA, it's a lot easier to use ELF debugging with bin2s than with appended data. That way, the programming department can use the bin2s version while the asset department uses an appended data version.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#47434 - TheMikaus - Fri Jul 08, 2005 8:05 pm
but I thought one of the advantages of using gbfs w/ the ds was to be able to store on the cart than what could be held in memory for later access.
Why would I have to have to do that stub thing if I could just use the ds card slot as the expansion slot instead? Which was part of my initial and unanswered question. Can the ds slot be accessed as an expansion slot and if so how to send to the pins in code?
If your posts are to imply that it's not possible then. ok. :)
I don't think I'm good enough to do any of your stub suggestions. :(
#47436 - natrium42 - Fri Jul 08, 2005 8:54 pm
TheMikaus wrote: |
Can the ds slot be accessed as an expansion slot and if so how to send to the pins in code?
|
Look in the card.c file in ndslib. A microcontroller could easily talk to the DS through the DS slot.
_________________
www.natrium42.com
#47443 - TheMikaus - Fri Jul 08, 2005 10:47 pm
Thanks! I'll look into it!
#47450 - tepples - Sat Jul 09, 2005 12:01 am
Doesn't the PassMe need to remain in the slot? Or can it be safely pak-swapped? Or are you talking about a modded DS?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#47460 - The 9th Sage - Sat Jul 09, 2005 2:31 am
tepples wrote: |
Doesn't the PassMe need to remain in the slot? |
While I haven't used a PassMe in awhile because of the firmware update, I seem to remember it being removable after loading ends.
_________________
Now with 20% More Old Man from Zelda 1 than ever before!
#47462 - natrium42 - Sat Jul 09, 2005 3:06 am
The 9th Sage wrote: |
tepples wrote: | Doesn't the PassMe need to remain in the slot? |
While I haven't used a PassMe in awhile because of the firmware update, I seem to remember it being removable after loading ends. |
That's correct.
_________________
www.natrium42.com
#48671 - TheMikaus - Thu Jul 21, 2005 6:11 pm
I was thinking about trying to make an SD-adapter for the DS-slot. And after looking at the sd pinout found at
http://www.eeek.org.uk/~ahammond/newfairy/www.gamesfairy.co.uk/
and dark fader's cart pinout
http://darkfader.net/ds/files/cartridge.txt
I can map all the pins out except the chip select. As to how to communicate I'm still at a little loss (haven't looked at card.c yet, but I will)
What pin would be good to use for the chip select on the SD-card?
(I plan on doing all the stuff in software not hardware to read from the card)
#48682 - natrium42 - Thu Jul 21, 2005 7:16 pm
TheMikaus wrote: |
I was thinking about trying to make an SD-adapter for the DS-slot. And after looking at the sd pinout found at
http://www.eeek.org.uk/~ahammond/newfairy/www.gamesfairy.co.uk/
and dark fader's cart pinout
http://darkfader.net/ds/files/cartridge.txt
I can map all the pins out except the chip select. As to how to communicate I'm still at a little loss (haven't looked at card.c yet, but I will)
What pin would be good to use for the chip select on the SD-card?
(I plan on doing all the stuff in software not hardware to read from the card) |
You are right, there is a direct mapping since EEPROM uses SPI:
EEPROM CS ---> CS
CLK ---> Clock
D6 <--- MISO
D7 ---> MOSI
+3V3 ---- 3.3v
GND ---- GND
_________________
www.natrium42.com
#48686 - tepples - Thu Jul 21, 2005 7:49 pm
Don't GameCube memory cards and most MMC memory cards use SPI too?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#48688 - natrium42 - Thu Jul 21, 2005 7:54 pm
tepples wrote: |
Don't GameCube memory cards and most MMC memory cards use SPI too? |
Don't know about GC, but MMC do use SPI. (SD cards are backwards compatible with MMC.)
Anyway, firmware could be modified to load from SD/MMC connected to DS slot. GBA slot would remain unoccupied for extension cards, etc.
I wonder if the SD/MMC will fit into the slot so that there is nothing sticking out. I will check it once I get home.
_________________
www.natrium42.com
#48690 - TheMikaus - Thu Jul 21, 2005 8:13 pm
Quote: |
Don't GameCube memory cards and most MMC memory cards use SPI too? |
I think the GC does. or at least there's the right pins for it. Because of the SD adapter that's out (Which is where I got the pin layout for the SD card), one of the better people to ask is anyone of the people who worked on the libogc or gclib since they would have had to implement memory card routines (I think, maybe it's built into the hardware)
--edit--
natrium42 wrote: |
Anyway, firmware could be modified to load from SD/MMC connected to DS slot. GBA slot would remain unoccupied for extension cards, etc. |
meaning could be modified to do it with little hassle or someone would have to implement the SPI and then FAT16 on top of that? And if they'd have to implement both how would that affect the room left for the firmware?
#48692 - Veg - Thu Jul 21, 2005 8:21 pm
Once you've connected an SD card through the DS, what other hurdles are there to jump to get regular homebrew stuff to work?
Commercial DS programs are encrypted, right? So the DS expects encrypted data to come through the DS port? Would that mean you'd have to encrypt any homebrew programs you want to play through the DS slot?
Heh... it's probably a stupid question, but humour me guys. I'm just trying to get a handle on all this stuff.
#48694 - TheMikaus - Thu Jul 21, 2005 8:24 pm
http://www.procyonengineering.com/avr/avrlib/docs/html/files.html
has files for mmc and spi stuff, granted it's specific to their software/hardware and I don't know what the license is on it, but maybe code could be based on that.
As for the encrypted data thing... maybe. But I think you can access the pins directly using the information from card.c/h Again, I'm not sure. I only glanced at the file.
#48696 - natrium42 - Thu Jul 21, 2005 8:31 pm
Veg wrote: |
Once you've connected an SD card through the DS, what other hurdles are there to jump to get regular homebrew stuff to work?
|
Writing a loader for the firmware.
Veg wrote: |
Commercial DS programs are encrypted, right? So the DS expects encrypted data to come through the DS port? Would that mean you'd have to encrypt any homebrew programs you want to play through the DS slot?
Heh... it's probably a stupid question, but humour me guys. I'm just trying to get a handle on all this stuff. |
EEPROM communications are unencrypted.
_________________
www.natrium42.com
#48697 - natrium42 - Thu Jul 21, 2005 8:32 pm
TheMikaus wrote: |
natrium42 wrote: | Anyway, firmware could be modified to load from SD/MMC connected to DS slot. GBA slot would remain unoccupied for extension cards, etc. |
meaning could be modified to do it with little hassle or someone would have to implement the SPI and then FAT16 on top of that? And if they'd have to implement both how would that affect the room left for the firmware? |
Yes, firmware would need SPI and FAT so that it can read a file containing the binary.
_________________
www.natrium42.com
#48704 - tepples - Thu Jul 21, 2005 8:56 pm
natrium42 wrote: |
MMC do use SPI. (SD cards are backwards compatible with MMC.) |
According to this Wikipedia article, SPI is required on SD cards and optional on MMC cards. In practice, almost all MMC cards can use SPI (except for a few older ones).
Quote: |
Anyway, firmware could be modified to load from SD/MMC connected to DS slot. GBA slot would remain unoccupied for extension cards, etc. |
If so, what is wrong wtih this picture?
Quote: |
I wonder if the SD/MMC will fit into the slot so that there is nothing sticking out. I will check it once I get home. |
MMC is thinner than SD and may have a better time fitting into a simplistic electromechanical adapter.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#48716 - Dwedit - Thu Jul 21, 2005 10:16 pm
That was EVIL! The worst I've heard in years.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
#48739 - natrium42 - Fri Jul 22, 2005 12:43 am
tepples wrote: |
Quote: | Anyway, firmware could be modified to load from SD/MMC connected to DS slot. GBA slot would remain unoccupied for extension cards, etc. |
If so, what is wrong wtih this picture?
|
The buttons are swapped :)
But how is this relevant?
_________________
www.natrium42.com
#48748 - tepples - Fri Jul 22, 2005 1:46 am
natrium42 wrote: |
The buttons are swapped :)
But how is this relevant? |
Look closely at the system's name, southeast of the touch screen.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#48762 - natrium42 - Fri Jul 22, 2005 3:27 am
Gotcha :)
_________________
www.natrium42.com