31 July 2018, 16:17 | #1 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
wanting to port C games I wrote to Amiga classic with SDL
Hi,
I've tried that some years ago and it was slow as hell, but maybe things have improved and I can also make it so my coding is not as bruteforce as today. I have ported/remade a fair amount of games for SDL on Windows, some even running on Nintendo DS. Some include: - Magic Pockets remake - Bagman/Le Bagnard (arcade) - O2EM (Videopac/Odyssey emulator) ported from O2EM using Allegro => SDL convert layer I've written - A lot of Oric games (Zorgon/Xenon/Scuba dive/Golden Eagle/text/gfx adventure games...) They all run very well on windows, but my attempt to make "Le bagnard" run on Amiga wasn't very successful. I mean, it ran, but slooooowly. I think the culprit is SDL and the way it updates the screen: like emulators do: the whole thing, and probably on 8 bitplanes... So I had some questions: - where to find an up-to-date 68k version of SDL for classic amiga? - is sound supported properly? - is AmiDevCPP still the best cross dev system around? - If I only update parts of the screen, is it possible for SDL NOT to redraw the whole screen? because I used that partial refresh method on Amoric (an emulator I had written moons ago) and that worked pretty well, but at the time I was "banging" in the bitplanes directly, not using SDL. It seems that SDL uses a flip/flop buffer technique, but maybe it's possible not to use it. The idea is to port stuff that can be ported (no hopes for Magic pockets, but we already have it ), maybe without sound, maybe only text-based adventure games, with a good playability on some moderately powered amigas like 68030. |
31 July 2018, 17:10 | #2 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
http://aminet.net/package/dev/lib/SDL_AGA is good for an '040+FPU.
|
31 July 2018, 17:44 | #3 |
Registered User
Join Date: Feb 2018
Location: London / UK
Posts: 112
|
I personally use vbcc + vasm for cross compiling on Mac.
http://sun.hasenbraten.de/vbcc/ GCC 6 might be faster but I haven't tried it yet myself: http://eab.abime.net/showthread.php?t=85474 If you're porting a game that uses only 16 colours a 4 bitplane C2P routine and not using SDL would be much faster of course. Something like what's available in: http://privat.bahnhof.se/wb800787/da...p/kalmsc2p.lha |
31 July 2018, 17:52 | #4 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
|
Write a wrapper around SDL to make the interface look more like how the Amiga would do things.
Adapt your games so they don't touch SDL directly but only thru your own functions. Then rewrite your functions with normal Amiga code. |
31 July 2018, 18:19 | #5 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
+1 That's the only sane approach IMHO. |
|
01 August 2018, 02:36 | #6 | |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,400
|
Quote:
Yep my SDL AGA lib (hack) can be used to port but as already mentioned it needs an 040 as a minimum (030's are too slow for doing SDL ports, even an overclocked 060 can struggle). Sound is supported by my SDL hack and it also used to support partial screen updates but I can't remember if the version on AmiNet does or not. I used AmiDevCPP for all of my ports but you might want to use GCC 6 as already suggested. The best thing about using SDL is the time it take to get something up and running, it only took me 4 hours work to get Wolfenstein running on my A1200 using some SDL source code that I downloaded |
|
01 August 2018, 10:24 | #7 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
Yes that is the spirit. Where can your hack be found?
|
01 August 2018, 11:00 | #8 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
See post 2.
|
03 August 2018, 15:27 | #9 |
Registered User
Join Date: Feb 2013
Location: Olathe, Kansas
Posts: 214
|
in my experience - ive made SDL ports - your best option is to get the executable up and running with SDL as more of a proof of concept
then start replacing SDL with native Amiga calls. your code will almost always run faster |
03 August 2018, 16:09 | #10 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
thanks for all those excellent advices. The project(s) I want to port is a bit like an emulator, so the SDL calls are very localized. If I remove them & replace by native amiga stuff, all games are going to be available at the same time I hate to require a 68040+AHI just to run 8-bit games.
I've written Amoric (oric emulator) moons ago so I can reuse display & even probably sound stuff (okay it is asm code I'll convert it to C or I'll cross-compile it). I'll have to pick a compiler first. I'll check the "C compiler" thread, because my version of m68k gcc seems to require cygwin and I just hate that. The main issue I see when NOT using SDL is the resources: for some projects I have .wav files (different sampling rates & mono/stereo) that I'll have to convert to AIFF. And some other projects also use .png files, that I'd have to convert to "blittable objects". But if I can do that, I can bring a pixel-perfect "Le Bagnard / Bagman" arcade version to the amiga: [ Show youtube player ] (video contains arcade version + my remake running on the PC, I'm not the author of the video) Are there some decent Windows music module editors or should I stick to OctaMED (that I used to know pretty well) ? Last edited by jotd; 03 August 2018 at 16:21. |
03 August 2018, 16:35 | #11 |
Registered User
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
|
|
03 August 2018, 16:37 | #12 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
|
03 August 2018, 17:58 | #13 | |||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
|
Quote:
Quote:
Quote:
|
|||
03 August 2018, 18:21 | #14 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,801
|
Off topic : new Atari ST screen modes : http://www.atari-forum.com/viewtopic.php?t=34108
|
03 August 2018, 19:54 | #15 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
thanks for the replies. I know I can ask for code on this forum. @meynaf If your flac player can:
- can play .wav files - one shot or looped I'm definitely interested, as those are the only sound effects of my project. If you have another simple sound lib that is able to play a sample looped or one shot, I'm interested as well. For PNG, I can cleanly convert it to IFF using imagemagic for instance. no need for screen capture Are there other Oric emulators for Amiga?? Maybe MESS but it's probably slow as hell and has a bug in the 6522 chip that prevents tape loading (well, it was the case 10 years ago when I reported it and the coders didn't want to fix it) |
03 August 2018, 21:10 | #16 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
|
Quote:
http://eab.abime.net/showthread.php?t=91092 I have my own tools to play sounds but it's part of a larger project - whole system abstraction (which is used in all my game ports). |
|
03 August 2018, 23:03 | #17 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
looks good. Can you share the source for your tool?
|
04 August 2018, 09:33 | #18 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
|
|
05 August 2018, 17:11 | #19 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
|
First attempt zoned some french adventure game I just could port using SDL. not exactly fast, because of SDL but using the GCC toolchain I could adapt it without too much effort (Amiga GCC 6 toolchain includes a working SDL version: really excellent, and doesn't require Cygwin, really excellent)
I'm using SDL in 8-bit mode, windowed (could be full screen, well, that's a test) now I'm sure that I have to do better than that... get rid of SDL/enable partial updates. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Site with many interesting 68k SDL games | arti | Amiga websites reviews | 52 | 16 April 2024 14:07 |
Fake86 (68k SDL Port) - 8086 PC emulator | NovaCoder | project.Amiga Game Factory | 5 | 08 November 2018 11:13 |
Why Did Amiga Games have So Many ST Port Games? | Amiga Forever | Retrogaming General Discussion | 9 | 11 November 2010 10:47 |
There is SDL (Simple DirectMedia Layer) support for Classic Amigas | doble07 | Coders. General | 10 | 08 January 2009 23:35 |
Possibility to port an AMiga/PC classic to WindowsCE ? | astuermer | Retrogaming General Discussion | 0 | 16 August 2006 17:36 |
|
|