From square one

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
zinger
Very interested
Posts: 60
Joined: Thu Apr 19, 2007 12:39 am
Location: sweden
Contact:

From square one

Post by zinger » Wed Feb 06, 2008 2:11 pm

Okay, so I'd like to at least attempt some Mega Drive development. I have the flashcart and the coding / ASM tutorial from Devega so I guess I could start from there. However, I have never coded anything in my entire life (except for some "hello world" stuff in C++, many years ago, of which I remember nothing!), and I'm under the impression that ASM is difficult to learn. I know there are C compilers for MD, is that an easier path to take for someone totally inexperienced with programming? What are the drawbacks with C for 68000?

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Re: From square one

Post by Shiru » Wed Feb 06, 2008 2:21 pm

zinger wrote:What are the drawbacks with C for 68000?
As anythere else, it generally just slower than hand-written ASM code and also takes more memory.

As beginner, you'd better start with C or even BEX. That way you can learn about SMD hardware more easily. Then you can slowly switch to ASM, if you'll really want to. Both C and BEX allows to use inline ASM.

zinger
Very interested
Posts: 60
Joined: Thu Apr 19, 2007 12:39 am
Location: sweden
Contact:

Post by zinger » Wed Feb 06, 2008 3:24 pm

Ok, so what's a good if I want to learn C for MD? C for Dummies? :) Should I begin coding for the PC or could I go with MD right away? Where can I find the C compiler?
Last edited by zinger on Wed Feb 06, 2008 3:40 pm, edited 1 time in total.

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Wed Feb 06, 2008 3:40 pm

I don't know any good books about C, just try to find any, and start read it. When you'll get basics and got questions, you always can find answers in the Net.

You can start on PC to get basics. On SMD it's not so trivial to get any output from program (show message, etc). You can start with simple console apps (command-line), which just shows text output. Learn about variables, it's types, conditions, loops, functions, pointers (very important!), then move to SMD.

On SMD you can start with SGCC and it's examples. Later you can move to GCC (Stef's mini devkit, for example).

zinger
Very interested
Posts: 60
Joined: Thu Apr 19, 2007 12:39 am
Location: sweden
Contact:

Post by zinger » Wed Feb 06, 2008 4:05 pm

Thanks Shiru. I was advised to start with C++ from a friend, since it would be a better introduction? I just downloaded Visual C++ 2008 Express...

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Wed Feb 06, 2008 4:33 pm

Don't mess C++ with C. For SMD you'll generally not need any C++ knowledge, plain C will be enough. Of course, you can use any C++ compiler to learn C.

TmEE co.(TM)
Very interested
Posts: 2392
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Feb 06, 2008 4:57 pm

I started with QB45 on PC, then learned some ASM, which I think is the easiest type language ever and now I do all ASM stuff on MD. QB45 is really simple, you'll get the concept of writing a program very fast in there, it took me a week to learn all BASIC has to offer, and some days for ASM (especially 68K which is really easy in ASM level). I plan to learn C in future, but ATM, I stick with QB45 and ASM. Devega documents are very good, also, you might want to take a look in programmersheaven.com, I found few excellent 68K ASM docs there. I have few things on my site aswell.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Chilly Willy
Very interested
Posts: 2847
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Feb 06, 2008 11:25 pm

My opinion:

C++ is too much for older consoles like the Genesis. Stick to C or assembly.

Assembly on the 68000 is actually pretty easy. As long as you document your code and register usage, you may find it easier than C. Assembly on the Z80 is also not too bad, and you probably don't really need to do any Z80 coding - if you want music/sound on the Z80, just use pre-done code for it.

Learn C in general and do some PC stuff in C before trying to use C on the Genesis. I recommend that for ANY console, not just the Genesis. Programming a game console is harder than programming a general PC, so learn to program first, then learn the specifics about the console you then wish to program for.

stalepie
Very interested
Posts: 101
Joined: Sun Dec 10, 2006 1:18 pm

Post by stalepie » Thu Feb 07, 2008 1:31 am

Hello. I hope you don't mind if I offer some words of discouragement. I decided it was crazy to try to learn how to program for the Genesis. The same with the NES, which I also had an interest in. Why learn how an old machine works when the game will primarily be played (if played at all) in an emulator on a much more powerful computer? I did pester David Perry in email a little bit and he said that he'd try to find the Sega development documents and put them on the web, and that he was surprised they weren't out there already, but then I annoyed him with other trash in email and probably he doesn't want to hear from me again :) But the point is: think twice before learning an old machine. It is the year 2008 and these machines are dead! They are unlikely to be remade for further usage. Sure, the Virtual Console and Xbox Live bring money to old games, and a few homebrew Atari games DID wind their way onto a commercial product called the Flashback 2.0, but what is the use, really? Nowadays no one programs in assembly unless it's for PIC microcontrollers! (And all the great games of Sega's heyday used assembly... very few used C or anything else -- although the people here say that it's fast enough now). I decided it was a VERY crazy idea to try to learn how an old machine works when one can better spend their time learning a new machine like the DS or modern Intels. After all, you could very well just program a Windows, Linux or Mac game to look and sound like a Sega Genesis by using a certain restricted color palette and a similar FM sound design, sprite limitations, etc. I mean, I miss the cartridge days. I really do. My favorite games came out in the late 80s and early 90s, mainly from Japan (no, it was better from everywhere then). I think the limited CPU and memory restraints encouraged creativity, plus the teams were smaller, and less money was involved. Annnd they also had developer kits! A start-up company working for Sega got special documents in the mail that explained to them the basics of making a game, or so that's what I've been led to believe. And we don't have these. We don't have them even in the better-documented NES community, 'far as I know. Plus more established game companies built up a stash of clever tricks and wisdom which they kept around to use for any game they were programming, which is part of why various Konami games, for instance, might have a similar look or "feel" to them even if they have different names in the credits.
Last edited by stalepie on Thu Feb 07, 2008 2:22 am, edited 6 times in total.

Shiru
Very interested
Posts: 786
Joined: Sat Apr 07, 2007 3:11 am
Location: Russia, Moscow
Contact:

Post by Shiru » Thu Feb 07, 2008 2:12 am

stalepie, first, do you know what is 'paragraph'? It's really hard to read this 'stream of consciousness' which you posted.

About old machines, it can be explained very shortly: it's a 'hobby'. So nothing you talking about is matters here.
And they also had developer's kits!
Nowadays we have much better tools than developers of 90s had. And we can do our own tools much easily that it was possible at old days.
A start-up company working for Sega got special documents in the mail that explained to them the basics of making a game
That's absurd. Companies like Sega does not work and even talk with beginners. You always had to be company with good name and portfolio to work with them.

Christuserloeser
Very interested
Posts: 145
Joined: Sun Jan 28, 2007 2:01 am
Location: DCEvolution.net
Contact:

Post by Christuserloeser » Thu Feb 07, 2008 3:14 am

@ stalepie: I think you are completely wrong here. :roll: - I mean, this is a forum about retro dev...

I did pester David Perry in email a little bit and he said that he'd try to find the Sega development documents and put them on the web, and that he was surprised they weren't out there already, but then I annoyed him with other trash in email and probably he doesn't want to hear from me again :)
WTF !? ...and you're proud of that ? :lol:
http://www.DCEvolution.net - Gigabytes of free Dreamcast software for you

Image

zinger
Very interested
Posts: 60
Joined: Thu Apr 19, 2007 12:39 am
Location: sweden
Contact:

Post by zinger » Fri Feb 08, 2008 12:49 pm

stalepie wrote:words
Basically, what Shiru said. It's a hobby, but also a unique way of expression that is closely related to the limitations of hardware. If you can't see that, you might be in the wrong forum. Musicians don't use Gameboys because it's better than Logic or Cubase.

I have slowly begun to look at 68000 ASM, trying to decipher the codes and such. Not an easy task - I'm having hell trying to understand the cryptic tutorials I have been able to find, but still pretty exciting so far.

Post Reply