Page 1 of 1

Debugging under CD-i Emulator.

Posted: Thu Aug 16, 2007 4:36 am
by cdoty
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...

Posted: Thu Aug 16, 2007 4:46 am
by cdoty
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.

Posted: Thu Aug 16, 2007 5:46 pm
by cdifan
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.

Posted: Fri Aug 17, 2007 4:41 am
by cdoty
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.

Posted: Fri Aug 17, 2007 7:10 am
by cdifan
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.

Posted: Sun Jan 13, 2008 3:49 am
by cdoty
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?