[SOLVED] Getting a simple DreamSDK Hello World working?

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
glaire_daggers
DCEmu Newbie
DCEmu Newbie
Posts: 2
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Wed Feb 03, 2021 3:10 pm
Has thanked: 0
Been thanked: 0

[SOLVED] Getting a simple DreamSDK Hello World working?

Post by glaire_daggers »

Hello, I just recently decided to dip my toes into dreamcast development and I found KOS & DreamSDK which seemed like the perfect fit.
I downloaded DreamSDK, got everything installed, downloaded a handful of kosports in the SDK manager, and in Code::Blocks created a brand new fresh "Sega Dreamcast Project". It creates a new hello world app, great. I set the target to Debug, press Build, and then I go into the bin/Debug folder and do all of the elf2bin, scramble, ipcreate, and makedisc stuff. I now have a game.cdi file.
I just want to see this run in an emulator for now for kicks & giggles, so I point Redream at my cdi file. It runs through the whole Dreamcast BIOS, displays a licensed by Sega screen... and then Redream logs this and bails:

Code: Select all

mem_unhandled_write addr=0x5801c164 size=1
exception_handler_handle unhandled exception pc=0000000001150012 fault_addr=ffffffffffffffff
(fwiw I also tried in nullDC and it logs a ton of unknown opcode errors?)

I'm not really sure what's going on here. I also don't really know how to get basic printf debugging up and running, so I don't really know if my hello world is actually getting printed or not (tried having Redream output to a virtual COM port to connect it to PuTTY, but no dice).

Anybody got tips for me to figure out what's going wrong here? Any help would be greatly appreciated!
Last edited by glaire_daggers on Thu Feb 04, 2021 12:58 pm, edited 1 time in total.
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5652
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: Getting a simple DreamSDK Hello World working?

Post by BlueCrab »

To follow up on this, considering I noticed it was answered on Discord...

There was an issue with how the OP was creating their disc image to boot in nulldc.
glaire_daggers
DCEmu Newbie
DCEmu Newbie
Posts: 2
Joined: Wed Feb 03, 2021 3:10 pm
Has thanked: 0
Been thanked: 0

Re: Getting a simple DreamSDK Hello World working?

Post by glaire_daggers »

Ah, right, I forgot to update the thread.
Yeah, so to be more precise: the problem was I was accidentally feeding the elf through the scramble process, not the bin file generated via elf2bin. All is fixed now!
User avatar
SiZiOUS
DC Developer
DC Developer
Posts: 404
Joined: Fri Mar 05, 2004 2:22 pm
Location: France
Has thanked: 27 times
Been thanked: 19 times
Contact:

Re: [SOLVED] Getting a simple DreamSDK Hello World working?

Post by SiZiOUS »

Since you are using DreamSDK, you may consider using the makedisc utility included in the package.
Post Reply