A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / Coding in C

 

Author Message
z5_
Member
#1 - Posted: 2 May 2011 12:47 - Edited
Reply Quote
I realise that this topic has been discussed a lot in different topics but i'm trying to approach it from a different (read "for dummies") angle.

Let's say i'd want to code amiga demos in C and that speed is not an issue at this point. Let's assume it's just for fun and to test out ideas. I'd prefer using a windows environment (because my Amiga is pretty much falling apart).

- what do i need?
- is there a ready made solution for dummies, preferably with example code that can be compiled and tested out of the box. I'm looking for example code to setup a window (some sort of startup/shutdown code), maybe display a picture, a tune and draw some pixels on screen. Something like this would make a world of difference.

Now let's assume i want to mix this code with assembler code later on. What software do i need then?

Basically, i'm looking for an environment that lets me play and test out effects before waisting huge amounts of time implementing them in assembler only to find out that the idea was crap anyway.

Also, is coding in C on Amiga a better option than using Amos? Amos demos tend to have this typical amos look in a lot of cases.
d0DgE
Member
#2 - Posted: 2 May 2011 13:08
Reply Quote
I strongly second that motion
Ambient
Member
#3 - Posted: 2 May 2011 13:42
Reply Quote
Hi

Ive just started to look into amiga demo development after a 15 year break. Im thinking about blending c/c++ and asm to get the best of both enviroments, Creating the engine itself in asm as libraries and using c/c++ for testing and putting it all together. Do anyone got some experience regarding this, maybe using a simililar setup?

I would very much appriciate an examples on how to setup a simple library in asm and calling it from c/c++ :)
noname
Member
#4 - Posted: 2 May 2011 17:23
Reply Quote
There are certainly more elaborate examples, but I could probably contribute some prose on how we approached mixing C and ASM for Prototype 1. Time-permitting, as this week is a bit full.
dalton
Member
#5 - Posted: 2 May 2011 17:41
Reply Quote
Maybe you could have a look at AgaOS (http://www.modermodemet.se/dalton/src/os/agaos-20 020811.lha). Haven't used it myself, but it seems to have a lot of nice functions and it uses a mix of asm and C, so you coud probably build a project around it quite easily.
Ambient
Member
#6 - Posted: 3 May 2011 04:20
Reply Quote
Cant get that link to work?
dalton
Member
#7 - Posted: 3 May 2011 07:23
Reply Quote
korruptor
Member
#8 - Posted: 3 May 2011 13:16
Reply Quote
I've been thinking about trying this as well. Seems like a good way to save some dev time while experimenting.

Cheers for the link Dalton :D
z5_
Member
#9 - Posted: 3 May 2011 22:11 - Edited
Reply Quote
Ambient:
Hi

Ive just started to look into amiga demo development after a 15 year break. Im thinking about blending c/c++ and asm to get the best of both enviroments, Creating the engine itself in asm as libraries and using c/c++ for testing and putting it all together. Do anyone got some experience regarding this, maybe using a simililar setup?

I would very much appriciate an examples on how to setup a simple library in asm and calling it from c/c++ :)

Welcome to the site! It's always nice to see people regaining interest in amiga coding. Did you code any demos before the 15 year break?

Maybe this is something that would be interesting for you: setting up a cross compiler for classic Amiga (by kufa) and also reading this thread. I'm not sure but i have the impression this could get you started as you seem to know already a lot about coding. There are some other threads about in the coding section.
z5_
Member
#10 - Posted: 3 May 2011 22:16
Reply Quote
Since there seems to be interest in some basic startup guide to coding in C and mixing C and assembler, is anybody interested and motivated to write some sort of beginners tutorial on the matter? Or a little guide as to where to start (looking)?
Ambient
Member
#11 - Posted: 4 May 2011 01:54
Reply Quote
Tnx.. I made a music disk (Chip Nostalgia) and had two effects in a Rebels demo(Paranoid). Besides that all my work got lost in a hd crash and I never did any more of if, until now hopefully. :)

Ill look into the links, and if I decide on the c + asm path ill sure write a tutorial or atleast a post about my setup.

On a side note, it is alot of fun to see that there is still some life in the amiga scene and some old faces hanging around, gave me quite a thrill to fire up AsmOne the other day for the first time since forever. Needed to do something usefull with my spare time .)
z5_
Member
#12 - Posted: 4 May 2011 18:34
Reply Quote
Ambient:
Tnx.. I made a music disk (Chip Nostalgia) and had two effects in a Rebels demo(Paranoid).

Cool, you are already on ADA with two productions :)

Ambient:
On a side note, it is alot of fun to see that there is still some life in the amiga scene and some old faces hanging around, gave me quite a thrill to fire up AsmOne the other day for the first time since forever.

The last years, there seems to be an uprise in people coming back to doing Amiga demos. Last year, Ozone, Desire and Haujobb released new productions after many years of inactivity. This year, Skarla released a new demo. All groups that were most active at around the later nineties.

Anyhow, keep us posted in how you progress with coding and the C and asm mix. Should be interesting :)
kusma
Member
#13 - Posted: 6 May 2011 14:05
Reply Quote
I'm in the process of putting together a Windows based devkit for the Amiga, consisting of VBCC, VASM, VLINK, platform headers and libs. You can find what I have here. I'm planning on packaging it all up in an MSI-installer also. Do note that I did not include any kind of build system; I'm currently using MSYS (with GNU Make and all) for my own building-purposes.
noname
Member
#14 - Posted: 7 May 2011 17:18
Reply Quote
Here is a blog-post about how we approached mixing C and ASM for the development of Prototype 1. Note: Will finish that post later, time to go out now.
korruptor
Member
#15 - Posted: 10 May 2011 11:02
Reply Quote
Thanks for that, interesting reading. :D
z5_
Member
#16 - Posted: 10 May 2011 21:36
Reply Quote
Agreed, an interesting read. Also made me realise that the "hello world" i learned in C at school many years ago isn't enough to tackle the task.
superplek
Member
#17 - Posted: 18 Jun 2011 10:31
Reply Quote
kusma:
You can find what I have here. I'm planning on packaging it all up in an MSI-installer also.

That's quite useful. Thanks :)
krabob
Member
#18 - Posted: 1 Jun 2012 14:26
Reply Quote
There is various way to achieve all this...
You may:
- On windows, you may install winUAE and the whole amidevcpp package:
[url= http://amidevcpp.amiga-world.de/download.php?HR_LA NG=english] http://amidevcpp.amiga-world.de/download.php?HR_LA NG=english[/url]
amidevcpp will install a devcpp IDE + a gcc cross-compiler for amiga 68k classic and 3 other amiga-like platform. The good thing is: all official os-friendly SDKs are present in this package, and of course there is command line assembler with this. + you will be able to do modern C and C++. (#pragma once, etc...)

... on amiga or under UAE you may install a more or less old C compiler, SAS C that was used by commodore back then is still the best to screate the best short-sized executables. But I suspect there is no C++ support or a old one. (I never used it, but I compared exes created with it).

There is the VBCC project, started at the end of the nineties, run by the same guys that does the free assembler Phxass: it does C and no C++ at all, but was still maintained recently. I used that for PowerPC prods since it does 68k and ppc.

There is a free good opensource GCC for amiga , a version from 2000. (with quite modern C++,...): you have to install the last amiga "Geek Gadget" developper packages (cygwin equivalent, it adds unix-like libs to an amigaOS system and contain a whole gcc amongst other usefull things like grep command) then update it with the last patch, ... and you will be able to compile a hello world quickly... problem: there are standards unix include and libs, but the whole amiga OS lib SDK (libs and includes) are not present in this gcc: my hint: copy the amiga include and libs from the amidevcpp cross compiler: it works and all exemples from the official amiga developper CD can compile with this (but exe tends to be larger than those of the old SASC ) !

I used to be a fan of Haage&partners's StormC 4 from 2002: StormC3 was not good, but version 4 used another port of GCC: the best part of the software was its debugger, that used MMU stuffs and could work with MuGuardian angel. StormC 4 also had a correct IDE for debugging: breakpoints; stacks and register windows like a real modern platform (it could also debug melted 68k/warpos ppc code.)

... to use asm inline in C or to link asm objects with C objects (which I used to do a lot) there must already exist a thread in the forum about this.
mapurva
Member
#19 - Posted: 10 Oct 2012 19:44
Reply Quote
I have a project in my "Compiler" subkect for optimisation purpose. I want to work with vbcc. So please give a idea that how to install vbcc on windows and how to run C code with vbcc.
noname
Member
#20 - Posted: 15 Oct 2012 19:22
Reply Quote
There is no officially maintained Windows build of VBCC. Have you read the manual?
xxxxx
Member
#21 - Posted: 16 Oct 2012 05:28
Reply Quote
Hey mapurva, my winuae toolchain uses vbcc, and has examples on how to mix c and asm. Try it

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0