PONG!

Anything relating to CD-i can be discussed in this forum. From the multiple hardware iterations of the system to the sofware including games, reference, music and Video CDs. Maybe you hold an interest in Philips Media and the many development houses set up to cater for CD-i if so then this is the forum.
User avatar
Devin
CDinteractive Admin
Posts: 2153
Joined: Sun Jun 19, 2005 1:51 pm
Location: England
Contact:

PONG!

Post by Devin » Thu Jul 14, 2005 6:05 pm

A little extract from the old Game Spy Forums I posted donkeys years ago:

Code: Select all

Devin:
I've always felt the urge to have "PONG" on CD-i. No seriously!! Something simple like this might be an ideal starting point for CD-i programming. It wouldn't be too time consuming the gameplay is understood everywhere and addictive. Provided as a free downloadable ISO image it could get people turning their heads towards CD-i as a platform to develop for. What do you guys reckon? It would also be cool if you could incorporate the disc swap trick used in "Atlantis: The Last Resort" so you can play the game and listen to your own audio CD at the same time on CD-i.
Still think it would be a neat idea to this day :shock:

Perhaps something to consider after Frog Feast Charles, although I do like the prospect of Volley Ball and Ardvark Adventures!!

User avatar
Bas
CDinteractive Admin
Posts: 3041
Joined: Mon Jun 20, 2005 11:14 am
Location: the Netherlands
Contact:

Post by Bas » Thu Jul 14, 2005 8:00 pm

that would be really nice. Never noticed this post on game spy's...

More arcade classics please!

InTheSand
Burn:Cycle Activated
Posts: 32
Joined: Mon Aug 15, 2005 3:30 am
Location: Nelson, New Zealand

Post by InTheSand » Thu Aug 18, 2005 1:16 pm

I guess stuff like that will be easier once we all have access to the emulator!

How difficult is the CD-i to program when doing something simple?

For example, are all the applications/tools freely available to create a very simple CD-i disc that boots up and displays "Hello world" (without cheating and doing it as a VCD!)?

If so, where's the best place to look? I've grabbed most of the downloads from the excellent ICDIA site, but examples and basic tools (assemblers, compilers) seem lacking unless I haven't looked hard enough.

Does the CD-i lend itself to being programmed in 68K assembler? Are you allowed to "bash on the hardware" at all, or will this break compatibility between different CD-i models?

Regards,

- Ali

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

Post by cdifan » Thu Aug 18, 2005 4:58 pm

The CD-i system is notoriously difficult to program. There are toolkits that are supposed to make it easier, but in my opinition sticking with the "base" system is, in the long run, better.

The Microware OS9 C compiler/assembler/linker set with all the required headers and libraries can be downloaded from somewhere (don't have the link handy, sorry), but it's not very useful without some sample code or a copy of the Green Book. And you also need a disc mastering tool (vcdmastr from the Video CD toolkit works fine) and probably some audio/video format conversion tools (I think these can also be downloaded somewhere).

Using 68K assembly language is certainly possible and might even be the best approach for simple or high-performance titles, but it's generally easier to debug C applications. There is supposed to be a GNU C/C++ port for OS9...

I may at some point release source for a small 68K assembly sample for a two-plane CLUT7 display with simple mouse operations; there are a few players out there that need a more intelligent CD-i Stub to get their ROMs and this would be needed for that. The sources to the current CD-i Stub are already available here do in fact constitute a fully working (if very simple) CD-i application. There is a bit of documentation and the source is commented.

According to the Green Book, you are not allowed to "bash on the hardware" at all. However, audio and video buffers can be provided by the application and thus be accessed directly (there are APIs to perform common tasks, but custom code is usually faster).

Many CD-i titles perform a bit of trickery to get direct memory access to the screen control tables, but this is a bit involved. I think one of the Interactive Engineers has an article that describes how to do it. This relies on a few subtle implications of the Green Book and works on all CD-i hardware.

All other direct hardware manipulation is risky; the interfaces differ considerably between player models (and believe me, as the author of CD-i Emulator I know!). The differences include the CPU type (68000, 68020, 68070 and 68341 have all been used) which means that even the instruction set and instruction timing aren't constant. Most titles optimize for the 68070 which is the one most commonly used.

Hope this helps?

InTheSand
Burn:Cycle Activated
Posts: 32
Joined: Mon Aug 15, 2005 3:30 am
Location: Nelson, New Zealand

Post by InTheSand » Mon Aug 22, 2005 5:30 am

Hi,

Thanks for the info - interesting to know, and I didn't realise the CD-i players used different CPUs - I was under the assumption that all were 68070-based.

Going back to a simple "hello world" program, would it be possible to:
1. Use the OS/API to initialise a screen mode (I don't know much about the CD-i's graphics hardware, but from the existing games and VCD playback, I assume it does 720x576 and 352x288, with presumably up to 8bpp/256 colours?)
2. Grab the start address of the screen buffer
3. Use 680x0 assembler to write directly into this buffer

It seems that the creation of new CD-i stuff might be more hassle than it's worth... :(

I was hoping for "simple" hardware, perhaps Atari ST-style, where hardware can be bashed on and screenmodes can be set easily. Oh well!

- Ali

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

Post by cdifan » Mon Aug 22, 2005 11:26 am

You could set up such a simple "hello world" program and I've already halfway done it; just be patient for a bit...

The maximum resolution ("high resolution") is 768x560 for PAL and 768x480 for NTSC, but it requires interlaced display and is not suitable for most applications.

Most titles use "normal resolution" which is 384x280 / 84x240. At this resolution you can use 8bpp/128colors in each plane (the player has two), or go for 8bpp/256color in one plane and use DYUV (delta-compressed YUV, great for photographic stuff) in the other. There's also an RGB555 mode but it requires both planes.

You can also use "double resolution" which is 768x280 / 768x240 but only in 4bpp/16color mode. This is useful for e.g. high-quality text or photo rendering (PhotoCD discs use it to add high-res brightness corrections to the basic DYUV image in the other plane).

Both of the indexed color modes have a variant that sacrifices a single color bit to support runlength encoding.

You can switch between normal/double resolution and display mode on a line-by-line basis for each plane; there are also all kinds of transparency and region control instructions that can be used on a line-by-line basis, as well as reprogramming the color palette. There's space for 8 such instructions on each line of each plane.

If you want more information, I'd advise you to look at the datasheet for the Motorola MCD212 Video Decoder which can be found here on the ICDIA website. A few of the "control area" instructions are not generic for all players (in particular, the cursor and VSR/DCR instructions, these have to be controlled using API calls), but it generally gives a pretty good idea.

So you can do your "Atari-ST" style programming, but it needs a bit of setup code (which I will provide at some point).

InTheSand
Burn:Cycle Activated
Posts: 32
Joined: Mon Aug 15, 2005 3:30 am
Location: Nelson, New Zealand

Post by InTheSand » Mon Aug 22, 2005 11:43 am

Hi,

Thanks again for your informative reply. I will be patient and wait for your sample code - I guess you've got more important things (like the emulator) to be getting on with!

Once I've got past the "hello world" stage, I'm planning on attempting a freeware remake of an 8-bit classic, something like Chuckie Egg or Jet Set Willy - which will be well within the bounds of the CD-i's capabilities and will allow me to learn as I go.

I'll also grab the MCD212's data sheet and have a read.

Regards,

- Ali

Overdrive_X
Softech Recruit
Posts: 59
Joined: Sat Jul 23, 2005 8:54 am
Contact:

Post by Overdrive_X » Mon Aug 22, 2005 11:54 am

InTheSand wrote:Hi,

Thanks again for your informative reply. I will be patient and wait for your sample code - I guess you've got more important things (like the emulator) to be getting on with!

Once I've got past the "hello world" stage, I'm planning on attempting a freeware remake of an 8-bit classic, something like Chuckie Egg or Jet Set Willy - which will be well within the bounds of the CD-i's capabilities and will allow me to learn as I go.

I'll also grab the MCD212's data sheet and have a read.

Regards,

- Ali
My Philips CD-I developement site with the toolkit will be online soon :P its under massive contruction (html but anyway the basic will be there, i never programed for cd-i but i will start this way and posting all my finding. i will post the url later today

InTheSand
Burn:Cycle Activated
Posts: 32
Joined: Mon Aug 15, 2005 3:30 am
Location: Nelson, New Zealand

Post by InTheSand » Tue Aug 23, 2005 12:32 am

@Overdrive_X: That's great news! The more information about CD-i development people can get hold of, the better.

Longer term, it'd be great to see some homebrew CD-i stuff, perhaps from some former ST and Amiga programmers.

What will your toolkit contain, or do I have to wait and see?!

- Ali

Overdrive_X
Softech Recruit
Posts: 59
Joined: Sat Jul 23, 2005 8:54 am
Contact:

Post by Overdrive_X » Tue Aug 23, 2005 1:22 am

InTheSand wrote:@Overdrive_X: That's great news! The more information about CD-i development people can get hold of, the better.

Longer term, it'd be great to see some homebrew CD-i stuff, perhaps from some former ST and Amiga programmers.

What will your toolkit contain, or do I have to wait and see?!

- Ali
The toolkit include Philips BALBOA SDK and Philips OS9 Compiler Toolset.
I will also try to describe each library for basic purpose.My website is currently under heavy construction. I will try to fix major bugs for less than 24 hours for basic purpose.

Overdrive_X
Softech Recruit
Posts: 59
Joined: Sat Jul 23, 2005 8:54 am
Contact:

Post by Overdrive_X » Tue Aug 23, 2005 12:59 pm

Here is the Preview website i am making. Please understand that i update often. Some link does work and other don't. I Fix thing a couple of time a day so :)

http://cdidev.overdrivex.net/

User avatar
Merijn
CDinteractive Moderator
Posts: 321
Joined: Mon Jul 04, 2005 9:33 pm
Location: Amsterdam

Post by Merijn » Tue Aug 23, 2005 2:20 pm

Hey guys.. just wanted to thank you all for your efforts! Go and spread the word.. the more people involved, and doing this stuff out of interest and love for CD-i.. the bigger the movement:-)

Keep it up!!

Overdrive_X
Softech Recruit
Posts: 59
Joined: Sat Jul 23, 2005 8:54 am
Contact:

Post by Overdrive_X » Wed Aug 24, 2005 12:05 am

I think the website need maybe one for two fix .

Afterward i will try to learn without docs what are BALBOA libs. After that PONG will comming. (OpenSource)

User avatar
Devin
CDinteractive Admin
Posts: 2153
Joined: Sun Jun 19, 2005 1:51 pm
Location: England
Contact:

Post by Devin » Wed Aug 24, 2005 4:20 pm

InTheSand wrote:Hi,

Thanks again for your informative reply. I will be patient and wait for your sample code - I guess you've got more important things (like the emulator) to be getting on with!

Once I've got past the "hello world" stage, I'm planning on attempting a freeware remake of an 8-bit classic, something like Chuckie Egg or Jet Set Willy - which will be well within the bounds of the CD-i's capabilities and will allow me to learn as I go.

I'll also grab the MCD212's data sheet and have a read.

Regards,

- Ali
WOW, that would be amazing...Chuckie Egg has to be one of the first games I ever played and a CD-i version would be awesome!!

New website looks great Overdrive_X 8) Looks like i've gotta lot of reading to do!!

InTheSand
Burn:Cycle Activated
Posts: 32
Joined: Mon Aug 15, 2005 3:30 am
Location: Nelson, New Zealand

Post by InTheSand » Fri Aug 26, 2005 3:44 am

Hi,

@Overdrive_X: thanks for making the dev stuff available on your web site. This should help lots, once I've done the nice 26Mb download through my slooooow dial-up connection!!!

@Devin: I still enjoy playing Chuckie Egg even now! I partially wrote a version of it in Java a year or two ago (was missing collision detection and the lifts that appear in level three onwards), so if I can find enough information and tools for CD-i development, I'm going to give it a go...

Longer term, if I can get Chuckie going, I'll attempt some more 8-bit classics... It's a shame the CD-i's CPU doesn't have enough grunt to run a Spectrum emulator... that'd be cool!

Regards,

- Ali

Post Reply