Debugging under CD-i Emulator.

Support forum for homebrew development on the Philips CD-i system. Hosted through the CDinteractive network the CD-i Homebrew Forum will provide an active resource for new software initiatives on the system and offer hosting for any serious attempts.
Post Reply
User avatar
cdoty
Frog Feast Dev
Posts: 125
Joined: Sun Jul 03, 2005 12:35 am
Location: Houston, TX
Contact:

Debugging under CD-i Emulator.

Post by cdoty » Thu Aug 16, 2007 4:36 am

Here are the tips that I used when debugging under CD-i emulator:

The location of routines will shift around when the program is compiled.
To easily find an address of a routine:
1) Make it global.
In assembly, define it with a colon:
Label: rather than
Label

Nothing special is needed in C.

2) At the top of the main function add:
printf("Function address %08x\n", Routine_Name);

In the terminal window (details follow on the terminal) you will see the address of the routine.

I came up with this late in the project. It would've saved a lot of time early on...
Visit RasterSoft on facebook or visit the website.

User avatar
cdoty
Frog Feast Dev
Posts: 125
Joined: Sun Jul 03, 2005 12:35 am
Location: Houston, TX
Contact:

Post by cdoty » Thu Aug 16, 2007 4:46 am

Here's the important command line options (refer to HOWTO, included with the CD-i Emulator):

-debug - Starts with the debugger
-disc - Used to specify a disk image.
-playcdi - Immediately starts the CD-i disk.
-term - Opens a terminal window.

You'll need the rom from a development player to use some of this functionality.
Visit RasterSoft on facebook or visit the website.

User avatar
cdifan
CD-i Emulator Author
Posts: 904
Joined: Fri Jun 24, 2005 6:19 am
Location: The Netherlands
Contact:

Post by cdifan » Thu Aug 16, 2007 5:46 pm

cdoty wrote:You'll need the rom from a development player to use some of this functionality.
Actually this isn't true; the first three options are internal to CD-i Emulator and do not require a specific ROM. The -term option needs a player with a serial port, but all Philips and most non-Philips player have this.

For a CD-i 605 the useful option is -term duarta; this opens a terminal window to the standard input/output of the CD-i application. Use the SYSTEM button on the SETTINGS menu to open an OS-9 command prompt on this terminal.

Non-development players need the -term uart option; you cannot typically get a command prompt because the command interpreter (shell) is not included in these ROMs.

Use the ep command in the CD-i Emulator debug window to see the list of serial ports available with your player ROM.

User avatar
cdoty
Frog Feast Dev
Posts: 125
Joined: Sun Jul 03, 2005 12:35 am
Location: Houston, TX
Contact:

Post by cdoty » Fri Aug 17, 2007 4:41 am

cdifan wrote:
cdoty wrote:You'll need the rom from a development player to use some of this functionality.
Actually this isn't true; the first three options are internal to CD-i Emulator and do not require a specific ROM. The -term option needs a player with a serial port, but all Philips and most non-Philips player have this.
I guess this means that if I hooked a CD-I null modem cable to the CD-i 450 (for example), that I could view the printf statements on a terminal.

I think I was mixing up the need for extra memory for the shell.
Visit RasterSoft on facebook or visit the website.

User avatar
cdifan
CD-i Emulator Author
Posts: 904
Joined: Fri Jun 24, 2005 6:19 am
Location: The Netherlands
Contact:

Post by cdifan » Fri Aug 17, 2007 7:10 am

You could view printf statements on consumer players, yes.

Which is the reason there shouldn't be any in production code, because when nothing is connected the flow control will cause the serial output buffer to fill up and the CD-i application to hang on the next printf.

The shell doesn't need "extra" memory; it's in ROM! If you make a CD-i with the shell or other OS-9 programs on it you can run it perfectly well on a consumer player.

User avatar
cdoty
Frog Feast Dev
Posts: 125
Joined: Sun Jul 03, 2005 12:35 am
Location: Houston, TX
Contact:

Post by cdoty » Sun Jan 13, 2008 3:49 am

cdifan wrote:The shell doesn't need "extra" memory; it's in ROM! If you make a CD-i with the shell or other OS-9 programs on it you can run it perfectly well on a consumer player.
What prevents the 605 player from not using the shell, when extra memory is not enabled?
Visit RasterSoft on facebook or visit the website.

Post Reply