Getting started in ST C programming and boilerplate code / template?

C and PASCAL (or any other high-level languages) in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Mozartkugel
Retro freak
Retro freak
Posts: 11
Joined: Tue Apr 09, 2019 6:25 am

Getting started in ST C programming and boilerplate code / template?

Postby Mozartkugel » Wed Apr 10, 2019 1:04 pm

Hi guys! I couldn't believe my eyes, but my synth band buddy / 8-bit computer club friend got me an Atari ST for my birthday!! Best present ever! 8O

20190405_230328.jpg


I had an Atari Lynx as a kid after my Commodore 128 and later an Amiga 500, but I've gotten really interested in the Atari ST too in an ongoing "retro computer craze". I was always curious about the ST, because of its good looking industrial design and because no one I knew had one back in the day. Now a days I also like it because of the YM2149F. Old school low bit rate samples sound great but chip music is closest to the heart.

Since I now have an ST It'd be fun to program some small game for it, but I've browsed through the forum and feel a little lost/overwhelemed right now. Could someone kindly help pointing me in the right direction concerning a couple of things?

1.Is there a cross compiler setup comparable to cc65 for programming C for the ST with maybe some ready made libraries for joystick input, sprites, sound and such? C would make sense since I'm not a "real programmer/engineer" more of an artsy fartsy tinkerer, so I would like to go for the simplest approach possible and I care more about a games appeal rather than fps/pushing a system to its limits. Also I know some C from before (I've done some minigames for the Lynx and gotten a good start with C64/VIC20/Plus4 C coding too).

2.What would be the obvious system specific things on the ST that I'd need to look up / read about? I feel I could've saved almost years if someone would've pointed me for example to sprite structures on the Lynx or custom characters, multicolor text mode, screen memory, color memory on the Commodores. Can someone propose a good book and/or online tutorials/documentation?

3.Did someone happen to share boilerplate code / a template / a skeleton that would contain the essential building blocks for a game? Like: background, sprites, joystick input, music/sfx and loader + loader image?

Sorry if someone feels I want everything handed over, well I kinda want that :mrgreen: but I'm not afraid of doing my own research, I'm just looking for a kick start (sorry amiga terminology) / I don't want to reinvent the wheel, because I'm terribly busy as a family man and because of a bunch of other "retro computer" projects.

Any help appreciated, thanks beforehand! [smilie=greencolorz4_pdt_17.gif]
You do not have the required permissions to view the files attached to this post.

User avatar
lp
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2442
Joined: Wed Nov 12, 2003 11:09 pm
Location: GFA Headquarters
Contact:

Re: Getting started in ST C programming and boilerplate code / template?

Postby lp » Wed Apr 10, 2019 3:06 pm

Have a look at GODLIB: http://rg.atari.org/source.htm
Also this: https://bitbucket.org/d_m_l/agtools/src/default/

Search on this forum for GODLIB and agtools to see related threads.

User avatar
Greenious
Hardware Guru
Hardware Guru
Posts: 1462
Joined: Sat Apr 24, 2004 5:39 pm
Location: Sweden

Re: Getting started in ST C programming and boilerplate code / template?

Postby Greenious » Wed Apr 10, 2019 5:25 pm

That friend is obviously a keeper... :)

There's so much free stuff out there now, it's impossible to cover it all, but some places worth checking out is:

[A]tari [G]ame [T]ools - 2D prototyping engine for STE
viewtopic.php?f=16&t=31558#p316951

Atari Document Archive - most written atari documentations there is, including manuals, programming books, hardware info
https://www.dev-docs.org/docs/

Atari ST sources repository
https://github.com/ggnkua/Atari_ST_Sources
Updated my guides as of june 28th, 2016. Check'em out and feedback!
viewtopic.php?t=5040

neanderthal
Atari freak
Atari freak
Posts: 72
Joined: Sun Jul 10, 2016 10:58 pm

Re: Getting started in ST C programming and boilerplate code / template?

Postby neanderthal » Wed Apr 10, 2019 5:53 pm

For reference I tend to use this when dont have the books around.(when talking sys-stuff)
http://toshyp.atari.org/en/index.html

czietz
Hardware Guru
Hardware Guru
Posts: 1006
Joined: Tue May 24, 2016 6:47 pm

Re: Getting started in ST C programming and boilerplate code / template?

Postby czietz » Wed Apr 10, 2019 6:28 pm

As for C cross compilers, we have the latest versions of gcc (8.3) available for 68k: https://tho-otto.de/crossmint.php.

Many first time gcc users are shocked to see that a "hello world"-type program is ca. 100 kB after compilation. This is just because of the extensive standard C library that contains many functions required e.g. to port Unix software to Atari/MiNT. When you're interested more in game development, you probably don't need a POSIX compliant standard library. Maybe you can work without standard C library at all (using only system calls) or you can use a smaller library such as https://github.com/mfro0/libcmini.

Generally speaking, gcc produces very well optimized code.

Mozartkugel
Retro freak
Retro freak
Posts: 11
Joined: Tue Apr 09, 2019 6:25 am

Re: Getting started in ST C programming and boilerplate code / template?

Postby Mozartkugel » Wed Apr 10, 2019 9:42 pm

Hey thank you so much everyone for all the info and great links! [smilie=greencolorz4_pdt_17.gif] I've started to look through all the stuff already, but there's quite a lot here to digest so I need to investigate closer to be able to know which one is best suited for me.

I forgot to mention that I would've liked to target the first ST model(s), does that rule out godlib or is STFM commonly used as a family name for the first models? I thought FM was just for built in TV modulator and floppy drive?

Complete Reservoir Gods libraries for easy creation of software for STFM,STE,TT and Falcon.


I don't know any C++ so that might push AGT into the future for me, but it looks very nice and tempting!

One more question if I may, does anyone happen to know if any of the YM2149F trackers support an output that would be easy to use in C code?

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5122
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Getting started in ST C programming and boilerplate code / template?

Postby simonsunnyboy » Thu Apr 11, 2019 3:27 pm

You can also check here:

https://github.com/simonsunnyboy/stlibs4gcc

and

My own framework is in hibernation, never started to work on that since last year. But you can check

https://github.com/simonsunnyboy/eswkernel4st
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Mozartkugel
Retro freak
Retro freak
Posts: 11
Joined: Tue Apr 09, 2019 6:25 am

Re: Getting started in ST C programming and boilerplate code / template?

Postby Mozartkugel » Fri Apr 12, 2019 6:28 am

Hey thanks for the additional links man! I will look into them.


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 4 guests