Homebrew Unable to load any current emulator as an extlink module

lifehackerhansol

i write working(?) code
OP
Member
Joined
Oct 2, 2021
Messages
445
Trophies
0
XP
1,084
Country
Canada
The title is slightly misleading. Because common emulators do argument-based launch via argv, I thought I'd try to create an extlink -> argv app as a simple way to do this in Moonshell.

Trying to do this compiled with latest devkitARM refuses to work properly. It would just freeze at a white screen and do nothing afterwards.

Currently I have this: https://github.com/lifehackerhansol/extlink2argv

It compiles fine, and I think it also runs fine on its own? But when moonshell tries to launch it as an extlink module the console is stuck on a white screen.

Has anyone worked with extlink before, and could perhaps poke me in the right direction?

EDIT: I took a guess and attempted using only 0x200 as header size, as that was how it used to compile way back when. This did not work.

I should also note that any compiled with latest devkitARM did not work as reset_mse either. It refused to boot, kept getting stuck at a white screen. It would be a pain in the ass if I had to downgrade devkitARM to make this work...

EDIT 2: Perhaps the issue is that arm9 entry address requires to be set at 0x02000000. However ndstool flat-out refuses to set it there, always adding 0x800. I would have asked this on devkitPro's GitHub but I am blocked on their organization due to some other petty reason.

EDIT 3: 0x02000000 is not the solution. Why does it refuse to run?
 
Last edited by lifehackerhansol,

lifehackerhansol

i write working(?) code
OP
Member
Joined
Oct 2, 2021
Messages
445
Trophies
0
XP
1,084
Country
Canada
I've found the issue:

Moonshell 2, upon launching any homebrew, will write 32KB of DLDI data into the binary, regardless of whether the size is 32KB or not.

libnds, as of commit https://github.com/devkitPro/libnds/commit/c9668aa8f47bd41400f485b8a9a728b517a1174d, has reduced it to 16KB. Binaries as a result are corrupted upon loading into memory as Moonshell 2 overwrites 16KB of data after the 16KB of actual DLDI space.

As a result, I forked libnds, then made a wrapper that parses extlink data to argv, so that any modern homebrew can be bootstrapped this way: https://github.com/lifehackerhansol/extlink2argv

None of the memory address relocation were necessary, it just needed 32KB of space that modern homebrew don't have anymore.
 
  • Like
Reactions: banjo2
General chit-chat
Help Users
  • K3N1 @ K3N1:
    Yeah but that's art not porn
  • Veho @ Veho:
    It depends on where you live.
  • Veho @ Veho:
    In Murrica it's considered hardcore porn.
  • K3N1 @ K3N1:
    Isn't it now what site you're on these days and you'll instantly be slayed if it's Twitter?
  • The Real Jdbye @ The Real Jdbye:
    i've seen lots of porn on twitter
  • K3N1 @ K3N1:
    Yes but it mostly involves trying to get someone cancelled
  • Veho @ Veho:
    Twitter doesn't give a fuck any more, the only thing that will get you banned there is criticizing Musk.
  • Skelletonike @ Skelletonike:
    Tbf, there's too much censorship nowadays.
  • K3N1 @ K3N1:
    Hate censorship hurt feelings
  • K3N1 @ K3N1:
    Life might be like a box of chocolates but it sure doesn't taste like it
  • Veho @ Veho:
    Censorship hurts my feefees.
  • Veho @ Veho:
    I can't even say we need to exterminate the lesser races without some pearl clutching woke librul getting mad at me.
  • K3N1 @ K3N1:
    I can't even say chocolate without being called a racist
  • Skelletonike @ Skelletonike:
    Friday is so far away.
  • Veho @ Veho:
    Friday is a state of mind.
  • Veho @ Veho:
    What does Friday have that other days don't?
  • Skelletonike @ Skelletonike:
    The weekend
  • Skelletonike @ Skelletonike:
    I need another weekend.
  • Visceral_88getsONE_STAR @ Visceral_88getsONE_STAR:
    visceral_88 is kind of a worthless person u know?
  • Veho @ Veho:
    Lick the car?
  • Veho @ Veho:
    Can the car be a... van? :creep:
    Veho @ Veho: Can the car be a... van? :creep: