Jump to content
IGNORED

What do YOU code on?


Metal Ghost

Recommended Posts

What kind of hardware do you use to program the 7800?

 

Mainly my CC2 and PAL 7800 for initial testing. I'll fire up the game on my NTSC console if I think VBLANK time is going to be tight and to choose colours. All my games auto-detect the TV type and configure themselves correctly for display lines, colours, animation frame display times etc. It means I only have one lot of code to maintain.

Link to comment
Share on other sites

Are more tools necessary than CC65 is able to provide in order to facilitate coding in C??

 

It all depends on what "coding in C" means. Obviously the 7800 doesn't have I/O which would fit stdio.h, so that's kinda out. The C compiler would also have to do the following (off the top of my head):

1. Provide a peek & poke to modify the TIA, MARIA and RIOT registers. (Although I guess this could be done with pointers.)

2. Handle the 7800 memory map (zero page $40-$FF, RAM space, ROM space)

3. Put code & data on the correct ROM addresses (for holey DMA)

 

But it's certainly possible to use C to develop for the 7800. Much of 7800 code is basically data movement. And it's certainly possible to describe the Display List as a C structure.

 

Of course, it's tough to match the space & speed of hand coded assembly.

Handling the hardware registers and regions of specific memory are simple and elegant in C, I think :) For example..

#define SWCHA(*(volatile unsigned char*)0x0280)
	unsigned char val = SWCHA;

As for memory areas, same thing:

unsigned char* zeropage = (unsigned short*)0x0000;
unsigned char* stack    = (unsigned short*)0x0100;
unsigned char* ram      = (unsigned short*)0x1800;

And as for specific addresses for ROM and stuff, surely that'd be something that would be something you'd handle at link time with stuff being put into specific segments ?

Though I'm sure this kind of stuff is already out there for the 7800 :)

 

 

Link to comment
Share on other sites

Handling the hardware registers and regions of specific memory are simple and elegant in C, I think :) For example..

#define SWCHA(*(volatile unsigned char*)0x0280)
	unsigned char val = SWCHA;

 

That's pretty much how its done on CC65 except it ignores the volatile keyword.

 

And as for specific addresses for ROM and stuff, surely that'd be something that would be something you'd handle at link time with stuff being put into specific segments ?

 

Yep! Segments are handled by the linker. I have config files for a variety of ROM sizes. My set-up also handles malloc, initialised data etc.

Link to comment
Share on other sites

Thanks!

 

I'm trying to get software onto my old, re-purposed PC (probably 8 years old....XP SP3, 512 RAM). It was hillarious.....I don't know what speed CD-Rom drive I have in the thing, but I kept getting errors when trying to load Creative Suite onto it. So I figured I'd dump the files from disc and install from HDD. 16 hours to get the files from both CD-ROMS onto the hard drive. But in any event, the box itself is actually pretty speedy. I'm not sure what all got loaded onto the thing over the years, but it was basically unuseable, so I did a clean install of XP Professional and PRESTO - now she's purring! Once CS was on HDD, installed in less than 10 minutes, no problems.

Edited by Metal Ghost
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...