Load ELF/BIN NullDC 1.04 For Debug / Testing

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
Dreamcast
DCEmu Freak
DCEmu Freak
Posts: 81
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Fri Jul 27, 2007 2:23 am
Has thanked: 2 times
Been thanked: 4 times

Load ELF/BIN NullDC 1.04 For Debug / Testing

Post by Dreamcast »

I jumped through the hoops of creating a syscalls.bin and IP file hoping it would solve the issue of not being able to load an ELF/BIN, but now I'm just getting NullDC to freeze at the "SEGA" license screen after the swirl animation. I'm trying to load 2ndmix.elf (the KOS demo). I even tried creating a blank CDI image to load instead of choosing "no disk" after loading the ELF.

What am I missing / what do you do to get an ELF to run in an emulator short of creating a bootable image. And, yes, I could use real hardware, but for right now, an emulator is preferred.
User avatar
Protofall
DCEmu Freak
DCEmu Freak
Posts: 78
Joined: Sun Jan 14, 2018 8:03 pm
Location: Emu land
Has thanked: 21 times
Been thanked: 18 times
Contact:

Re: Load ELF/BIN NullDC 1.04 For Debug / Testing

Post by Protofall »

Dreamcast wrote: Wed Jul 10, 2019 10:16 am I jumped through the hoops of creating a syscalls.bin and IP file hoping it would solve the issue of not being able to load an ELF/BIN, but now I'm just getting NullDC to freeze at the "SEGA" license screen after the swirl animation. I'm trying to load 2ndmix.elf (the KOS demo). I even tried creating a blank CDI image to load instead of choosing "no disk" after loading the ELF.

What am I missing / what do you do to get an ELF to run in an emulator short of creating a bootable image. And, yes, I could use real hardware, but for right now, an emulator is preferred.
I haven't used nullDC much myself. I've never got my homebrew to run on it, but I know others have had success with it.

Having said that the main emulators I use are Redream (For Unix) and DEMUL (For Windows). IMO DEMUL is the most hardware accurate from all my tests only failing to emulate the serial port on the back and one super minor issue with variable types. I've never used true debugging tools so I can't say how good DEMUL is there.

Any reason you want to load elf's instead of cdi's? If you needit, here are the unix commands to convert an elf to a cdi (Install cdi4dc, I use this Unix port https://github.com/Kazade/img4dc )
PROG=""		#Name of your program ($PROG.elf)
IP_PATH=""	#The path to your IP.BIN file

sh-elf-objcopy -R .stack -O binary $PROG.elf $PROG.bin
$KOS_BASE/utils/scramble/scramble $PROG.bin 1st_read.bin
mkisofs -G $IP_PATH -C 0,11702 -J -l -r -o $PROG.iso .
cdi4dc $PROG.iso $PROG.cdi
Moving Day: A clone of Dr Mario with 8-player support <https://dcemulation.org/phpBB/viewtopic ... 4&t=105389>
A recreation of Minesweeper for the Dreamcast <viewtopic.php?f=34&t=104820>

Twitter <https://twitter.com/ProfessorToffal>
YouTube (Not much there, but there are a few things) <https://www.youtube.com/user/TrueMenfa>
Dreamcast
DCEmu Freak
DCEmu Freak
Posts: 81
Joined: Fri Jul 27, 2007 2:23 am
Has thanked: 2 times
Been thanked: 4 times

Re: Load ELF/BIN NullDC 1.04 For Debug / Testing

Post by Dreamcast »

@Protofall - Wanting to use ELF vs CDI comes down to not wanting to have to repackage all of my assets over and over again for quick tests. With NullDC, I can provide the ELF, then specify a CDI containing all of the assets separately. That method is similar to how I use the official SDK / Dev.Box. GD-Workshop creates the virtual disc containing all of the assets and Codescape loads the binary directly into memory.
User avatar
ThePerfectK
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Apr 27, 2006 10:15 am
Has thanked: 27 times
Been thanked: 35 times

Re: Load ELF/BIN NullDC 1.04 For Debug / Testing

Post by ThePerfectK »

Ive been able to use redream to load elf files using dctool-serial and dcload-serial by creating a virtual serial connection using socat. I can write up a tutorial on how to do this if youd like more info. The basic gist is you use socat to link a couple of files that you output to, then pass that file to redream using the --serial command. You can go a step further and also use gdb to remote debug yout application by using socat again to link the virtual serial file to localhost:2159.

If you are looking to avoid repackaging assets, you can send them over dctool as well. Just make a romdisk image and send it over after you launch your elf.
Still Thinking!~~
mrneo240
DCEmu Freak
DCEmu Freak
Posts: 86
Joined: Wed Mar 14, 2018 12:22 am
Has thanked: 16 times
Been thanked: 19 times

Re: Load ELF/BIN NullDC 1.04 For Debug / Testing

Post by mrneo240 »

I assure you creating a cdi isn't intensive.

If it is then just run it on a ram drive and it will be near instant.
KingCrazy
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 33
Joined: Sat Aug 04, 2018 11:36 am
Has thanked: 2 times
Been thanked: 7 times

Re: Load ELF/BIN NullDC 1.04 For Debug / Testing

Post by KingCrazy »

I was never able to get .elf files to load into NullDC, personally. I always just compiled my .elf, converted it to a .bin (much like the first half of the code that Protofall suggested), and then used Bootdreams to make it into a CDI file.
Post Reply