Debugging on an emulator

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
spencer723
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 11
Joined: Sun Jul 26, 2020 2:31 pm
Has liked: 2 times
Been liked: 2 times

Debugging on an emulator

Post by spencer723 » Sun Jul 26, 2020 2:46 pm

Hey everyone, I'm new to the Dreamcast dev scene. I have installed DreamSDK and Code::Blocks and I have been able to compile the Hello, World program. What I'm now trying to figure out is how to debug through an emulator rather than the actual hardware for now. I tried NullDC but it kept rebooting with the Hello, World CDI I made. Demul didn't have anything for debugging that I could see and I couldn't figure out Redream. If anyone could point me in the right direction, I would really appreciate it. Thanks!
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5425
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has liked: 2 times
Been liked: 18 times
Contact:

Re: Debugging on an emulator

Post by BlueCrab » Mon Jul 27, 2020 10:01 am

Frist off, moved to the programming forum.

To answer your question, I've always recommended that people not do their debugging in an emulator. Simply put, when you run into issues with your code, you never really know if its your code or the emulator causing the problem. Plus, there are plenty of instances of things working fine in an emulator but barfing on the real hardware too.

That all said, there are people around that do do their debugging in emulators often. Hopefully one of them can actually give advice on how to set things up to do that, as I have no recent experience in doing so.
User avatar
lerabot
Insane DCEmu
Insane DCEmu
Posts: 126
Joined: Sun Nov 01, 2015 8:25 pm
Has liked: 0
Been liked: 3 times

Re: Debugging on an emulator

Post by lerabot » Mon Jul 27, 2020 11:37 am

Hello,

I've been using lxdream (on linux) and reicast (https://github.com/reicast/reicast-emulator/releases) to do testing and some debugging using simple printf and whatever error message comes out of the terminalk. Obviously the real test at the end of the day is if it works on my DC.

I don't know if reicast compile under windows, but I would try that.
spencer723
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 11
Joined: Sun Jul 26, 2020 2:31 pm
Has liked: 2 times
Been liked: 2 times

Re: Debugging on an emulator

Post by spencer723 » Mon Jul 27, 2020 12:59 pm

lerabot wrote:
Mon Jul 27, 2020 11:37 am
Hello,

I've been using lxdream (on linux) and reicast (https://github.com/reicast/reicast-emulator/releases) to do testing and some debugging using simple printf and whatever error message comes out of the terminalk. Obviously the real test at the end of the day is if it works on my DC.

I don't know if reicast compile under windows, but I would try that.
I actually downloaded reicast this morning and got that working after I saw that nullDC development was moved to reicast, basically. With the terminal output enabled in reicast, it gives me a basic way to debug for now. Eventually, I would love to mod my DC with serial output to my computer for testing but I'm just going to play around with the emulator for now :grin: Thanks for the help!
User avatar
Protofall
DCEmu Freak
DCEmu Freak
Posts: 65
Joined: Sun Jan 14, 2018 8:03 pm
Location: Emu land
Has liked: 12 times
Been liked: 10 times
Contact:

Re: Debugging on an emulator

Post by Protofall » Tue Jul 28, 2020 4:52 am

lerabot wrote:
Mon Jul 27, 2020 11:37 am
Hello,

I've been using lxdream (on linux) and reicast (https://github.com/reicast/reicast-emulator/releases) to do testing and some debugging using simple printf and whatever error message comes out of the terminalk. Obviously the real test at the end of the day is if it works on my DC.

I don't know if reicast compile under windows, but I would try that.
Can confirm Reicast exists on Windows. It has some bad graphics issues, but that might be that my build is old. As for emulators that are closest to hardware, DEMUL seems to be the best (However it isn't perfect, it has audio issues and sometime stuff works there that doesn't on hardware)
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>
User avatar
Ian Robinson
DCEmu Fast Newbie
DCEmu Fast Newbie
Posts: 18
Joined: Mon Mar 11, 2019 7:12 am
Has liked: 22 times
Been liked: 4 times

Re: Debugging on an emulator

Post by Ian Robinson » Sat Aug 01, 2020 9:08 pm

It's Pretty much a fools task optimizing or debugging on an emulator.. It's ok for fast proto typing a port to get it just running.. But sh4 math asm any thing that uses the dreamcast hardware even dma will not show the same on an emulator.. For example demul redream nulldc all have instant DMA so it makes it look like pvr DMA is very fast it is but run the same code on real hardware and it's not instant like an emulator.. Also many of the emulators will let you stream 2 files at time like video and cdda at the same time.. Which you cant do on hardware... Sh4 math asm show almost no change on emulators.. on hardware can be big boost or slower ..

Ask me how i know lol..
spencer723
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 11
Joined: Sun Jul 26, 2020 2:31 pm
Has liked: 2 times
Been liked: 2 times

Re: Debugging on an emulator

Post by spencer723 » Sat Aug 01, 2020 9:49 pm

Ian Robinson wrote:
Sat Aug 01, 2020 9:08 pm
It's Pretty much a fools task optimizing or debugging on an emulator.. It's ok for fast proto typing a port to get it just running.. But sh4 math asm any thing that uses the dreamcast hardware even dma will not show the same on an emulator.. For example demul redream nulldc all have instant DMA so it makes it look like pvr DMA is very fast it is but run the same code on real hardware and it's not instant like an emulator.. Also many of the emulators will let you stream 2 files at time like video and cdda at the same time.. Which you cant do on hardware... Sh4 math asm show almost no change on emulators.. on hardware can be big boost or slower ..

Ask me how i know lol..
Yeah, I definitely don't plan to optimize anything using the emulator :) Like you said, I want to prototype quickly but I wanted to have the option to track down issues with my coding :P
These users liked the author spencer723 for the post:
Ian Robinson
Post Reply