26 January 2020, 15:45 | #1 |
Registered User
Join Date: Feb 2017
Location: Germany
Age: 46
Posts: 19
|
Help needed: Starting Amiga 500 game programming in C
Hello everybody,
I want to learn to write games for the Amiga 500 in C. I've been writing games in AMOS for years and am fed up with its limits. I had thought about using Assembler, but that seems to be too complex for the available time budget I have. I know basic C syntax and have already written an Amiga program that opens its own screen and window and uses the timer.device for synching. However, I fail at meaningfully bringing graphics on the screen. In the mid term I want to be able to to the following:
The following conditions should also be met:
I feel like I have already dug through tons of tutorials and examples, yet I found nothing I was able to adapt. In my impression the descriptions either concentrate to much on programming basics or they imply too much. Hence, I turn to you, hoping to find some clues how to proceed. I have the following specific questions for now:
I'm looking forward to any hint you might have. Kind regards, Dennis |
26 January 2020, 19:32 | #2 |
Zone Friend
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
|
on amr.abime.net. Amiga Format coverdisk 21 has some source code in C by Paul Overaa. This source code displays a backdrop and you can move a sprite with the joystick. I can't remember if it reads an IFF or if the IFF was converted to RAW format. The code is not NTSC friendly.
I don't think the sprite displays on AGA screen modes (DOUBLENTSC, EURO36). Some one coded a demo in 100% C and released the source to that as well. |
31 January 2020, 18:23 | #3 | |
Registered User
Join Date: May 2017
Location: Dublin Ireland
Posts: 46
|
Quote:
These kind of ones are very good for beginner imo. At least you go off then and reference the RKRM if interested and need more info. If know any more like this maybe, kindly, link then here. |
|
31 January 2020, 19:37 | #4 |
Registered User
Join Date: Sep 2014
Location: Poland
Posts: 175
|
I might be wrong, but I recall iffparse compatible with 1.3, search in Amiga Developer CD 2.1. Does it really has to be IFF? I choosed RAW, it was easier and faster for me, something like: Open()->Read()->CopyMem(to chip ram!!!)->BltBitMapRastPort() and done!
I did some game-wannabe coding in C, unfortunately, I don't have access for my sources right now. But here are some resources from which I've taken samples: https://github.com/Zalewa/snekorama (Snake clone) https://github.com/68kPoker/Magazyn (Sokoban clone) http://aminet.net/search?query=amiganitzu (Paganitzu clone) http://aminet.net/package/game/jump/JetSetBilly (this one is using GELs system from graphics.library, IIRC) http://aminet.net/package/dev/c/GameX (gameport.device - joystick handling code) As for the compiler choice, stick to the one you are used to. Last edited by Ami; 31 January 2020 at 19:50. |
03 February 2020, 22:21 | #5 | |
Registered User
Join Date: May 2006
Location: Spain
Age: 42
Posts: 71
|
Quote:
This is just what I was doing. My goal is to have a small game engine in C code, which is capable of running on Amiga 500 with kickstart 1.3 using system functions. The first problem was to find how to configure a double buffer system that will work on an A500 with KS 1.3 using system functions. After doing a lot of research, I found a couple of solutions to be able to change the buffer at 50hz. Shortly after, I found the problem that the blitter was drowning, showing flickering graphics on screen when using graphics.library. After many tests, I concluded that the system functions to use the blitter are terribly slow, a lot. And after many tests, the solution was to access the blitter directly. This greatly improved the performance, Unfortunately, you can't configure interleaved graphics on Amiga 500 with KS 1.3 and graphics.library, I have not found a way to do it using system functions. All I have been able to do is program all the hardware directly, using C, but accessing directly the blitter, copper, etc. So you can configure the screen to use an interleaved bitmap, load your graphics bitmaps interleaved, and drawn each sprite with a single blitter operation. My code actually is advancing in this line, but I have a small example using C code using system functions except for blitter. You can find it in my github repository: https://github.com/balrogsoft/amiga500-game-engine It works on Amiga 500 with KS 1.3 It uses ptplayer routine by Frank Wille, which can be used in C, and it allows to reserve one channel for FX. It handle basic tile rendering, and blitter sprites rendering (using hardware directly, no graphics.library involved) Basic support for joystick. But it doesn't handle iff files, because iffparse.library is not included on wb 1.3, my code use raw graphics, you can export from IFF with PPaint, PicCon, or any other pic converter. For other tasks like using iff pictures, keyboard, ... you can adapt the code from my other engine, which require a faster machine, but it include a lot more than a basic A500 game engine. Both projects were compiled with SAS/C. https://github.com/balrogsoft/amiga-game-engine Last edited by balrogsoft; 03 February 2020 at 22:56. |
|
04 February 2020, 02:50 | #6 |
Moderator
Join Date: Jan 2002
Location: Chicago, IL
Posts: 3,375
|
Nice helpful hints guys.
|
04 February 2020, 14:16 | #7 |
Registered User
Join Date: May 2017
Location: Dublin Ireland
Posts: 46
|
|
05 February 2020, 11:17 | #8 |
Registered User
Join Date: May 2006
Location: Spain
Age: 42
Posts: 71
|
Yes, I got it working on VBCC some time ago, but the current code requires some changes to make it working on VBCC. Anyway, I did some tests and SAS/C was a little faster with my code, maybe some compiler options make it better under VBCC, but that is what i remember.
|
05 February 2020, 18:59 | #9 | |
Registered User
Join Date: Feb 2013
Location: Argentina
Posts: 281
|
Quote:
Thanks for sharing!, |
|
05 February 2020, 19:28 | #10 | |
Zone Friend
Join Date: Mar 2004
Location: Middle Earth
Age: 40
Posts: 2,127
|
Quote:
@balrogsoft any reason why you chose kick 13 over kick 12? Also I read in the cd32 developer docs that the blotter functions were fixed and optimised in kick 30+? |
|
05 February 2020, 21:46 | #11 | ||
Registered User
Join Date: May 2006
Location: Spain
Age: 42
Posts: 71
|
My Amiga 500 machine has kickstart 1.3, it is the minimum real configuration that I can test, but I have tested it with FS-UAE with KS 1.2 and it works perfectly. Quote:
They probably did, I have no reason to doubt it, but these functions are slow, FBlit exists for that reason. You should think that a system function like BltMaskBitMapRastPort should work in many scenarios. Calling the blitter directly is a more direct and faster solution, and if you use interleaved bit planes, it is wonderful to paint all the bit planes of a blitter sprite in one operation. CD 32 developer docs says this also: Quote:
So, if you need these things for your game, forget about being 100% compatible with the system. Last edited by balrogsoft; 05 February 2020 at 21:55. |
||
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Newbie with Amiga 500 plus - help needed | mike | support.Hardware | 3 | 02 March 2017 09:50 |
Starting Again: Amiga 500 kit kept in storage for 22 years. | robmeister | New to Emulation or Amiga scene | 10 | 02 November 2015 09:34 |
Amiga 3D game programming | Steve | Coders. General | 37 | 17 June 2013 22:15 |
Help needed with programming Amiga development forum | Cammy | Amiga scene | 18 | 06 February 2011 17:37 |
c programming help needed! | jonssonj | Coders. General | 2 | 25 February 2006 20:00 |
|
|