no$psx : invalid FORM

Problems or feedback about the NO$PSX emulator by Martin Korth
Post Reply
ericde45
Curious PSXDEV User
Curious PSXDEV User
Posts: 15
Joined: Aug 07, 2024
Location: France

no$psx : invalid FORM

Post by ericde45 » September 13th, 2024, 9:01 pm

hello,

i think i am missing something with no$psx emulator, i tried some psnoobsdk example, tweak one a little, it works with my ps1 or with duckstation, but with no$psx i get an error : ELF : Invalid FORM
i tried running the exe, but also building a cue+bin, with no success

is there something to add to the CMakeLists.txt or something linked to elf , to be able to run an exe in no$psx ?

thanks

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 605
Joined: Nov 12, 2012
Contact:

Post by nocash » September 14th, 2024, 5:30 am

ericde45 wrote: September 13th, 2024, 9:01 pm i think i am missing something with no$psx emulator, i tried some psnoobsdk example, tweak one a little, it works with my ps1 or with duckstation, but with no$psx i get an error : ELF : Invalid FORM
Thanks for bringing that up!

What has happened is this: No$psx is based on no$gba (which has ELF support for GBA, NDS, DSi executables). In turn, the ELF support is also included in no$psx v1.0 and up, but I would be very surprised if it would be actually working (it's completely untested because most people seem to use old PsyQ tools with SYM files or whatever, and I could only guess how ELF files for PSX might look like in practice).

There are at least four possible scenarious:
1) Debug info in ELF file, with executable code also in the same ELF file
2) Debug info in ELF file, with executable code in EXE file
3) Debug info in ELF file, with executable code in CDROM image (like CUE/BIN or whatever)
4) Debug info in multiple ELF files, with multiple executables in CDROM image

Variant number 4 would be difficult to implement. But 1-3 should be no problem.
Could you post some sample file(s) as attachment (or send them per PM, if they aren't for public release)?
ericde45 wrote: September 13th, 2024, 9:01 pm i tried running the exe, but also building a cue+bin, with no success
is there something to add to the CMakeLists.txt or something linked to elf , to be able to run an exe in no$psx ?
I don't know what went wrong there, an EXE or CUE/BIN should work without problems.
If it was loaded okay, then you should see the executable showing up as PSX.EXE in the filesystem viewer window.
And if it's there, but doesnt boot, maybe the filesize isn't a multiple of 800h? Or it hangs in the EXE's init function?
I can look into that, too. If you attach a sample file.

PS. Or did you mean that no$psx thinks that your EXE file is an ELF file?
Then it's perhaps really in ELF format instead of PSX EXE format? If it's just a matter of stripping the ELF header then I could probably support that, too (plus adding support for DWARF2 debug info, if the ELF file contains such data).
Last edited by nocash on September 14th, 2024, 5:41 am, edited 1 time in total.

ericde45
Curious PSXDEV User
Curious PSXDEV User
Posts: 15
Joined: Aug 07, 2024
Location: France

Post by ericde45 » September 14th, 2024, 5:37 am

here is the file that does not work
cue+bin
&
.exe

tested OK on pcsx-redux, real PS1 and duckstation.

thanks once gain for your support.
( i would like to use no$cash as emulator+debugger for my projects )
You do not have the required permissions to view the files attached to this post.

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 605
Joined: Nov 12, 2012
Contact:

Post by nocash » September 14th, 2024, 5:51 am

Works for me.
Ah, there was/is some bug about loading files via commandline in the recent no$psx version... does it work when loading the file from inside of the File menu?

Not sure where the ELF problem came from, it seems to be just a normal PS-X EXE file.

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 605
Joined: Nov 12, 2012
Contact:

Post by nocash » September 14th, 2024, 6:14 am

Or other question: Do you have an ELF file with same name (gte.exe and gte.elf) in the same folder? Then no$psx would automatically try to load debug info from that file.

ericde45
Curious PSXDEV User
Curious PSXDEV User
Posts: 15
Joined: Aug 07, 2024
Location: France

Post by ericde45 » September 14th, 2024, 6:16 am

yes, that's exactly what is wrong, i have the .elf, once renamed to .elf2, this works.
will add the rename to my build cmake

thanks a lot !

ericde45
Curious PSXDEV User
Curious PSXDEV User
Posts: 15
Joined: Aug 07, 2024
Location: France

Post by ericde45 » September 14th, 2024, 6:38 am

if needed by someone else in th future, to remove a file after cmake build :

add_custom_command(TARGET gte POST_BUILD
COMMAND ${CMAKE_COMMAND} -E rm ${PROJECT_BINARY_DIR}/gte.elf
COMMENT "removed ${PROJECT_BINARY_DIR}/gte.elf"
)

User avatar
nocash
Verified
PSX Aficionado
PSX Aficionado
Posts: 605
Joined: Nov 12, 2012
Contact:

Post by nocash » September 14th, 2024, 7:35 am

Okay, good that it's working now, but can you also upload the whole package, with elf, exe, cue, bin files?
It would be probably better if no$psx just wouldn't crash upon presence of elf files.
And (if the elf contains debug info with labels and line numbers), it might be also useful to display that stuff in the debugger.

ericde45
Curious PSXDEV User
Curious PSXDEV User
Posts: 15
Joined: Aug 07, 2024
Location: France

Post by ericde45 » September 14th, 2024, 4:33 pm

here it is

elf+exe+cue+bin+map
You do not have the required permissions to view the files attached to this post.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest