English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 18 November 2019, 17:58   #1
elanstra
Registered User
 
Join Date: Sep 2018
Location: Berlin / Deutschland
Posts: 18
Question Making games in C. graphics.library?

To my own shame I'm very new to the Amiga , so please forgive me if this maybe has an obvious answer.


I've seen from Compute's "Mapping the Amiga" and Sybex's "Amiga Programmer's Handbook" that the graphics.library provides functions for sprites, bobs, vsprites, etc.


Is this the way to go for making games in C for the Amiga? Or are there other more recommendable options? SDL for example comes to my mind.


Thanks a lot in advance.
elanstra is offline  
Old 18 November 2019, 21:09   #2
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
If you goto aminet.net and download RKMCompanion.lha on fredfish disk 344 for Kickstart 1.3 machines and Fredfish disks 741, 742 for kickstart 2+. They have C code for using the primitives functions (Sprites).

What Amiga are you programming for?
redblade is offline  
Old 18 November 2019, 21:24   #3
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,161
C is okay (get a good cross compiler like gcc or vbcc).

But don't try to create games with SDL. It will be slow as hell even on a 68060 because of damn c2p conversion. Use graphics library routines or direct hardware banging instead.

I'm currently creating a C++ game using SDL interface but amiga hardware underneath (porting a SDL game I made 9 years ago). That could be a good compromise (the game isn't working yet but it's taking shape)
jotd is offline  
Old 18 November 2019, 21:26   #4
deimos
It's coming back!
 
deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Quote:
Originally Posted by elanstra View Post
To my own shame I'm very new to the Amiga , so please forgive me if this maybe has an obvious answer.


I've seen from Compute's "Mapping the Amiga" and Sybex's "Amiga Programmer's Handbook" that the graphics.library provides functions for sprites, bobs, vsprites, etc.


Is this the way to go for making games in C for the Amiga? Or are there other more recommendable options? SDL for example comes to my mind.


Thanks a lot in advance.
It depends where your interest is.

Mine is is the original Amiga hardware but I don't have the inclination to code everything in assembly, so I code against the hardware in C, replacing only the bits that matter with hand written assembly routines.

In my opinion the operating system friendly side of Amiga game programming was never developed as much as it could be - there were excellent games and excellent applications, but they rarely met.
deimos is offline  
Old 19 November 2019, 09:21   #5
drHirudo
Amiga user
 
drHirudo's Avatar
 
Join Date: Nov 2008
Location: Sofia / Bulgaria
Posts: 455
I coded many games in C using the graphics library Sprites and BOBs. Almost all my Amiga games are running from Workbench and multitasking. With screenmode requester at the beginning, so even graphics cards users can play them. Most games on Amiga closed the Workbench and took complete control over the system for fluent animations and gameplay. If you have task in the background it is very hard to achieve smooth movements and gameplay. Any process can slow down the system and it gets noticeable. For example floppy insert/remove, hard disk loading, even screen savers and Internet. For machines with 68000 CPU having Workbench in the background means almost always slowdowns.
drHirudo is offline  
Old 19 November 2019, 19:07   #6
elanstra
Registered User
 
Join Date: Sep 2018
Location: Berlin / Deutschland
Posts: 18
Thanks everybody for the great answers. Awesome forum!

I have an A1200 with 4MB Fast RAM. Right now I'm programming with SAS/C. It's a bit slow compiling, so probably I'll have to move to a cross-compiler as suggested by jotd. Only trouble is the room where I have the Amiga is kind of a retro room. No modern computers. I even listen music with a Technics tape deck :-D

I have good experience with assembler in 8-bits (Z80 and 6510), so probably I'll end doing as deimos mentioned and having some pieces in ASM (once I learn a bit of M68k).

I've downloaded the RKMCompanion that redblade mentioned. I already had the PDFs, so it will be a great companion indeed.

Great tip, drHirudo. I'll check how to do it once I get further, if I see my game slowing down.
elanstra is offline  
Old 19 November 2019, 19:20   #7
Ami
Registered User
 
Ami's Avatar
 
Join Date: Sep 2014
Location: Poland
Posts: 175
Quote:
Originally Posted by drHirudo View Post
I coded many games in C using the graphics library Sprites and BOBs.
Did you used GELs functions?
Ami is offline  
Old 26 November 2019, 13:34   #8
balrogsoft
Registered User
 
Join Date: May 2006
Location: Spain
Age: 42
Posts: 71
Quote:
Originally Posted by elanstra View Post
I have an A1200 with 4MB Fast RAM. Right now I'm programming with SAS/C. It's a bit slow compiling, so probably I'll have to move to a cross-compiler as suggested by jotd.
I'm using SAS / C too, I compile my code under UAE, using a shared folder with UAE, it will let you editing with modern editors, and compile in SAS / C fast with UAE.

Quote:
Originally Posted by elanstra View Post

I've downloaded the RKMCompanion that redblade mentioned. I already had the PDFs, so it will be a great companion indeed.

I have found that some RKMCompanion examples are not very good, they run slow on my A500 and with flickering graphics. There are some examples more optimized, look on aminet, or github, there are some interesting examples:

http://aminet.net/package/dev/src/ScrollingTrick
https://github.com/astrofra/amiga-experiments
https://github.com/alpine9000/EWGM

This reading about graphics.library is also interesting:

https://wiki.amigaos.net/wiki/Classi...ffered_Display

Last edited by balrogsoft; 26 November 2019 at 14:31.
balrogsoft is offline  
Old 26 November 2019, 19:29   #9
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
Quote:
Originally Posted by balrogsoft View Post
I'm using SAS / C too, I compile my code under UAE, using a shared folder with UAE, it will let you editing with modern editors, and compile in SAS / C fast with UAE.




I have found that some RKMCompanion examples are not very good, they run slow on my A500 and with flickering graphics. There are some examples more optimized, look on aminet, or github, there are some interesting examples:

http://aminet.net/package/dev/src/ScrollingTrick
https://github.com/astrofra/amiga-experiments
https://github.com/alpine9000/EWGM

This reading about graphics.library is also interesting:

https://wiki.amigaos.net/wiki/Classi...ffered_Display
Hi Balrogsoft. I like your youtube channel. Not many fast OS friendly games for the Amiga 500. The ones I remember were Egyptian Run and Amoeba invaders in the 80s. How fast was the scrollingtrick on your A500?
redblade is offline  
Old 26 November 2019, 20:36   #10
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
check this site also
http://www.pjhutchison.org/tutorial/amiga_c.html
kamelito is offline  
Old 27 November 2019, 10:24   #11
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere else
Posts: 511
You may want to check this:

http://aminet.net/search?query=cmanual
hitchhikr is offline  
Old 28 November 2019, 21:26   #12
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere else
Posts: 511
Aminet is down, try those:

http://franck.charlet.pagesperso-ora...mp/CManual.lzh
http://franck.charlet.pagesperso-ora...p/CManual2.lzh
http://franck.charlet.pagesperso-ora...p/CManual3.lzh
http://franck.charlet.pagesperso-ora...p/CManual4.lzh
http://franck.charlet.pagesperso-ora...p/CManual5.lzh

f.
hitchhikr is offline  
Old 01 December 2019, 14:55   #13
balrogsoft
Registered User
 
Join Date: May 2006
Location: Spain
Age: 42
Posts: 71
Quote:
Originally Posted by redblade View Post
Hi Balrogsoft. I like your youtube channel. Not many fast OS friendly games for the Amiga 500. The ones I remember were Egyptian Run and Amoeba invaders in the 80s. How fast was the scrollingtrick on your A500?

I don't remember if it runs at 50 fps, anyway ScrollingTrick uses hardware directly for blitting, so it might not be the best example using graphics.library. There really aren't many examples in C, at least using system functions. The RKM examples use the ScrollVPort, RethinkDisplay functions, which are not very fast. ScrollVPort makes my code 25% slower even if there are not changes on the viewport.
balrogsoft is offline  
Old 01 December 2019, 21:39   #14
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
@balrogsoft what is your youtube channel?
kamelito is offline  
Old 01 December 2019, 22:12   #15
balrogsoft
Registered User
 
Join Date: May 2006
Location: Spain
Age: 42
Posts: 71
Quote:
Originally Posted by kamelito View Post
@balrogsoft what is your youtube channel?


My channel? I only have some old "Bit a bit" TV computer shows from spanish television.


https://www.youtube.com/channel/UCYo...ayNoOcFNTyZ6aA
balrogsoft is offline  
Old 02 December 2019, 20:54   #16
redblade
Zone Friend
 
redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
Quote:
Originally Posted by balrogsoft View Post
My channel? I only have some old "Bit a bit" TV computer shows from spanish television.


https://www.youtube.com/channel/UCYo...ayNoOcFNTyZ6aA
My fault, maybe I was looking at your c2p gifs on your website. I thought you did some Street fighter 2 videos as well. It must of been some other amiga channel I saw
redblade is offline  
Old 02 December 2019, 21:28   #17
balrogsoft
Registered User
 
Join Date: May 2006
Location: Spain
Age: 42
Posts: 71
Quote:
Originally Posted by redblade View Post
My fault, maybe I was looking at your c2p gifs on your website. I thought you did some Street fighter 2 videos as well. It must of been some other amiga channel I saw
Ok, but the c2p gifs aren't gifs images, they are javascript effects running in realtime. I made them a lot of years ago, when canvas didn't exists in javascript standards.
balrogsoft is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
graphics library v40.25 Schlachtwerk request.Apps 0 14 February 2015 20:47
Some question about graphics.library lowlevels Sonic Coders. General 3 28 July 2010 11:45
graphics.library private LVO's AmiCoder Coders. General 12 30 December 2009 04:24
Can't open version 36 of graphics.library Lambizkit support.Apps 1 07 November 2007 08:00
Making a shared library from a gcc .a library JoJo Coders. General 1 10 March 2003 19:06

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 15:53.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09257 seconds with 15 queries