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 Flash Equipment > Prevent reset when GBA slot linker is inserted

#126487 - KeithE - Mon Apr 23, 2007 7:35 pm

The N-Card, Firelink, NeoFlash MK5, and other similar cards come with a GBA slot USB linker that is used to transfer programs from the PC to the DS card.

When this linker is inserted, the DS automatically restarts, except when the SELECT key is held in the flash cartridge main menu during insertion.

My question is: does anyone know what is happening when SELECT is held to prevent the DS from resetting? I want to write some software that prompts the user to insert the cartridge, and I don't want the DS to reset. It must be possible, since the firmware of the cartridge somehow prevents the reset when SELECT is held.

Thanks.

#126498 - josath - Mon Apr 23, 2007 9:50 pm

Does it reset if you insert the linker while running homebrew? Perhaps it's working the other way around...the flashcart menu listens for card insert and triggers a reset, unless you hold select.

#126525 - KeithE - Tue Apr 24, 2007 1:44 am

Yes, it does reset when I insert the linker while running homebrew.

#126532 - tepples - Tue Apr 24, 2007 4:30 am

Does it reset even if the homebrew explicitly disables Game Pak interrupts?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#126559 - KeithE - Tue Apr 24, 2007 1:47 pm

Good idea tepples. I just tried that, with this code in both arm7 and arm9 right before the main while loop:

Code:
irqDisable(IRQ_CART);


Unfortunately, it still is resetting.

#135293 - darkfader - Sat Jul 21, 2007 11:33 pm

I think it's just tripping the power circuit.

#135335 - KeithE - Sun Jul 22, 2007 1:55 pm

What do you mean by "tripping the power circuit"?

The interesting thing is that it can be prevented by holding SELECT while in the flash cartridge menu, so there must be a way to make homebrew that allows it to be inserted without resetting.

#135341 - wintermute - Sun Jul 22, 2007 3:23 pm

He means shorting the power circuit so that the protection kicks in and the DS resets.

Your only real option is to dump the menu and find out what it's doing when select is pressed. It's likely that one or more of the GBA cart lines is normally in a particular state before the cartridge is inserted. Circuitry in the cart probably uses this state to enable a gate which shorts the power supply, causing a reset. Code in the menu will set the output to a different state - maybe SRAM select line or a particular address on the bus.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#135953 - KeithE - Fri Jul 27, 2007 9:01 pm

That seems like a very likely scenario. I've never dumped a menu or tried to reverse engineer an .nds file, so I guess I've got my work cut out for me.

I did figure out a way to put the USB GBA cartridge into a mode where it will not cause a reset.

1) With the DS turned off, insert the USB cartridge in the GBA slot and nothing in the DS slot.
2) Turn the DS on, and wait for the menu to show.
3) Remove the USB cartridge, then turn the DS off.

After this process, when I insert the USB cartridge while the DS is on, it does not reset. To put it back into the mode where it resets, I can turn the DS off before removing the USB cartridge.

#135954 - spinal_cord - Fri Jul 27, 2007 9:15 pm

Does the DS do a 'proper' reset, or does it just switch off? Would figuring this out lead to the ability for homebrew to reset the DS?
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#135955 - KeithE - Fri Jul 27, 2007 9:27 pm

When the USB cartridge is inserted the DS resets completely, just like you have turned it off, then back on again with the power switch.

#135956 - wintermute - Fri Jul 27, 2007 9:34 pm

spinal_cord wrote:
Does the DS do a 'proper' reset, or does it just switch off? Would figuring this out lead to the ability for homebrew to reset the DS?


It's a hardware based reset, so no.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog