Homebrew DS(i) Mode hacking progress thread

  • Thread starter Thread starter Billy Acuña
  • Start date Start date
  • Views Views 810,458
  • Replies Replies 4,367
  • Likes Likes 81
No problem, there have been worse off topic on this thread. Maybe now you could give an hand by testing some homebrews with you brand new nds-hbmenu installed?

There is lot of homebrews to test : http://gamebrew.org/wiki/List_of_DS_homebrew_applications

Let me explain why I need this information on how I achieved the dldi compatiblity in the current version of nds-hbmenu. The dldi compatibility is formed of 4 parts :
- a bootloader : this one was taken from the original hbmenu, it loads the homebrew and all the other pieces in memory and transfert the execution to the homebrew.
- a dldi driver : this is the easy part, it detect if the execution take place in arm7 or arm9. If it takes place in arm7 it just access the sdcard. If it takes place in arm9 it writes a command for arm7 in the main memory shared between both, try to trigger some interrupts ar arm7 level then wait for arm7.
- an arm7 patcher : this is integrated in the bootloader, it modify some part of the homebrew binary (the current method target "interruptDispatcher.s" of libnds) in order to get a "parralel" exection flow to the homebrew. This can be done via the interrupt mechanism and was inspired by NitroHax code (even if the NitroHax original method only work with retail games). This is the smallest part but it is quite hard to implements and debug. Most compatibility improvement in the future should come from this part.
- a arm7 "sdengine" binary : this part is like "server" that waits command from the dldi driver (the "client"), process them (read the sd) then reply to arm9 (put the sd piece of data needed in the main memory and put some special value in memory to notify arm9 that the work is done).

The current compatibility is somewhere at 40%, I suppose that most of the freezes are due to the fact that if for some reason the arm9 dldi driver send a command the the sdengine but interrupts are not yet enabled or temporarily disabled on arm7 everything get stuck. So I will need to patch other functions in libnds to avoid that (the one that enable or disable interrupt for example) but these functions may have different signature according to the libnds versions (and there is a lot of them). The part of interruptDispatcher.s I am targeting have never changed in 10 years, it is a sort of "silver bullet" but I will not always be so lucky.

So in the end I will probably end with several patching methods configurable via the ini file according to the homebrew we are launching (I can recognize it via md5 or filename for example).

But first I need to know what is working or not now with the first method (I need also to know which version is tested) and a little explanation of what you observe (white screen, black screen, it freezes when I do that).

The retail game loading will be built on the same base and obey to the same restrictions (do not expects a full compatibility at launch, If I can get 40% of the 500 first games released to works I will be happy).

You can provide results in this thread or here : https://github.com/ahezard/nds-bootstrap/issues or if someone want to create a wiki I will be very happy as well.

I'm trying jEnesisDS but roms aren't showing up in the directory, I have them saved on the "Games" folder inside the "jEnesisDS" folder saved in the SDcard and the file extension of the games is .bin.
 
Last edited by AtlasFontaine,
  • Like
Reactions: ahezard
No problem, there have been worse off topic on this thread. Maybe now you could give an hand by testing some homebrews with you brand new nds-hbmenu installed?

There is lot of homebrews to test : http://gamebrew.org/wiki/List_of_DS_homebrew_applications

Let me explain why I need this information on how I achieved the dldi compatiblity in the current version of nds-hbmenu. The dldi compatibility is formed of 4 parts :
- a bootloader : this one was taken from the original hbmenu, it loads the homebrew and all the other pieces in memory and transfert the execution to the homebrew.
- a dldi driver : this is the easy part, it detect if the execution take place in arm7 or arm9. If it takes place in arm7 it just access the sdcard. If it takes place in arm9 it writes a command for arm7 in the main memory shared between both, try to trigger some interrupts ar arm7 level then wait for arm7.
- an arm7 patcher : this is integrated in the bootloader, it modify some part of the homebrew binary (the current method target "interruptDispatcher.s" of libnds) in order to get a "parralel" exection flow to the homebrew. This can be done via the interrupt mechanism and was inspired by NitroHax code (even if the NitroHax original method only work with retail games). This is the smallest part but it is quite hard to implements and debug. Most compatibility improvement in the future should come from this part.
- a arm7 "sdengine" binary : this part is like "server" that waits command from the dldi driver (the "client"), process them (read the sd) then reply to arm9 (put the sd piece of data needed in the main memory and put some special value in memory to notify arm9 that the work is done).

The current compatibility is somewhere at 40%, I suppose that most of the freezes are due to the fact that if for some reason the arm9 dldi driver send a command the the sdengine but interrupts are not yet enabled or temporarily disabled on arm7 everything get stuck. So I will need to patch other functions in libnds to avoid that (the one that enable or disable interrupt for example) but these functions may have different signature according to the libnds versions (and there is a lot of them). The part of interruptDispatcher.s I am targeting have never changed in 10 years, it is a sort of "silver bullet" but I will not always be so lucky.

So in the end I will probably end with several patching methods configurable via the ini file according to the homebrew we are launching (I can recognize it via md5 or filename for example).

But first I need to know what is working or not now with the first method (I need also to know which version is tested) and a little explanation of what you observe (white screen, black screen, it freezes when I do that).

The retail game loading will be built on the same base and obey to the same restrictions (do not expects a full compatibility at launch, If I can get 40% of the 500 first games released to works I will be happy).

You can provide results in this thread or here : https://github.com/ahezard/nds-bootstrap/issues or if someone want to create a wiki I will be very happy as well.
I'll be glad to. Let me hop on my laptop and i'll give feedback.
 
After searching further, I learned that jEnesisDS should show my folders on the sd card, instead, it only shows this.

1ZZJcBY.jpg


Sorry for the quality. if the image is hard to understand, there's nothing showing more than that gray.
 
Last edited by AtlasFontaine,
I think it's just a matter of downloading the files for the homebrew and booting the .NDS in HBMenu, correct me if I'm wrong
 
Sorry for the noob questions :
1 can i play DS games with it ? and does it run smoothly enough for enjoyable gameplay ?
2 if so where can i download the cia version of it ?
those githubs link are so messy i can bearly understand them lol
 
Sorry for the noob questions :
1 can i play DS games with it ? and does it run smoothly enough for enjoyable gameplay ?
2 if so where can i download the cia version of it ?
those githubs link are so messy i can bearly understand them lol

You could always read the OP.
 
Sorry for the noob questions :
1 can i play DS games with it ? and does it run smoothly enough for enjoyable gameplay ?
2 if so where can i download the cia version of it ?
those githubs link are so messy i can bearly understand them lol
You can't, but you can run very old kickass homebrews like NeoDS.
 

Site & Scene News

Popular threads in this forum