15 February 2021, 11:56 | #41 | |
Registered User
Join Date: Aug 2018
Location: Untergrund/Germany
Posts: 408
|
Quote:
|
|
15 February 2021, 12:27 | #42 | |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
Quote:
Usually trade memory for performance, 16 bit alignment etc... But I wonder how that works out on the Amiga? Maybe two memory reads is less efficient than one memory read and a swap. Oh, but it's C, so maybe you aren't optimizing to that level anyway. |
|
15 February 2021, 14:05 | #43 | |
Registered User
Join Date: Aug 2018
Location: Untergrund/Germany
Posts: 408
|
Quote:
On Amiga 500 i try to make everything optimal from the start to have enough performance in the end. So i care about memory layout, and what types i use. However, in my experience it doesn't matter much if you use C or ASM with game development if you only consider performance. GCC 10 is good in optimizing. |
|
15 February 2021, 14:27 | #44 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
I've been quite surprised with just how good GCC 10 is at optimising. I did a few minor tests in Bartman's Visual Studio Code environment and the assembly it creates is quite good.
|
15 February 2021, 22:10 | #45 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
|
so basically you didn't use the original code as you thought you could write more efficient code from scratch.
And that worked. |
15 February 2021, 22:58 | #46 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 4,856
|
|
16 February 2021, 00:20 | #47 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
|
I'm also interested by this gcc 10 version.
I've used bebbo's gcc 6 for my game (Bagman) and (no offence) I'm disappointed by the speed. Maybe it's me, maybe it's C++, but in my game nothing much is happening and I find that slow... I've used the blitter, avoided memory copies and all, not a lot of characters, no massive blits, no scrolling, using 16 colors, and still the game is super slow... it needs a 68030 IIRC. |
16 February 2021, 00:35 | #48 | |
Registered User
Join Date: May 2018
Location: Ireland
Posts: 672
|
Quote:
|
|
16 February 2021, 11:52 | #49 |
Registered User
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
|
Yeah, we found each major version update gives 10-20% extra performance
|
16 February 2021, 17:10 | #50 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
Surprising how good GCC is for 68k. I didn't think 68k got much love which usually means poor optimization.
|
16 February 2021, 17:40 | #51 | |
Registered User
Join Date: Aug 2018
Location: Untergrund/Germany
Posts: 408
|
Quote:
I looked through your code on GitHub and saw you use SDL. I don't know the SDL port for Amiga but i guess this is the main issue why your game runs slow. The other parts of your code look mostly fine for Amiga 500 (at least when LTO is enabled because you have a lot of function calls). If you really want to know where the performance goes then you need to profile |
|
16 February 2021, 17:40 | #52 |
Registered User
Join Date: Aug 2018
Location: Untergrund/Germany
Posts: 408
|
|
16 February 2021, 19:52 | #53 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
|
@pink^abyss
Thanks for checking my code No the code doesn't use SDL (amiga SDL uses chunky2pixel so it's a no go from the start!) It uses SDL interfaces, but the structures have been hacked to use the blitter. Images are loaded as planar, and SDL_UpperBlit performs... blits . It's a port from a SDL game, and I thought that it would be easier not to remove the SDL interface. It was kind of a challenge but it worked. Basically the assets are pngs for the SDL windows version, but a python script combines them to compute the best 16 color palette then creates custom format with header + bitplanes compatible for the blitter (and sprites, but that's not active yet). I'm pretty happy with that engine, except for the speed... Using ptreplay from phx was also very easy. Now if you have the link for a GCC 10 for 68k compiled for windows, I'd like to rebuild with that. I'd like to avoid VSCode if possible, I already have a project under a different build system. Profiling is always a good idea. I didn't get how it can be done on amiga though... I hope the C++ part isn't the main culprit as it would be a pain to rewrite all that in C. So if you have some more details/links I'll happily check them. If I had to do another game, I'd probably avoid the multi-platform part that time... found this https://github.com/BartmanAbyss/vscode-amiga-debug seems to contain everything that looks great Last edited by jotd; 16 February 2021 at 21:06. |
17 February 2021, 00:05 | #54 | |
Registered User
Join Date: Aug 2018
Location: Untergrund/Germany
Posts: 408
|
Quote:
Ah, nice, i did't realize the amiga sdl emu you did! It seems you are running while the OS is active? This takes away a lot of performance on A500. Also the non interleaved blits add a lot of overhead. The blit routine for objects <16 pixels will become super slow when it goes into the setpixel block. If you call it just one each frame it could eat all rastertime on A500. I'm not sure about the C++ overhead from older GCC. I currently use C++ for with Bartmans GCC10 (without any dynamic memory allocations). C++ is as fast as C for me so far. |
|
17 February 2021, 00:43 | #55 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
AFAIK there was a point at which the GCC optimisations suddenly became much better on the M68K branch. Not sure if that was version 8, 9 or 10 but I remember seeing a video about Amiga demo coding in C that talked about this leap in performance.
|
17 February 2021, 13:44 | #56 |
Registered User
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
|
are you referring to my seminar? https://www.twitch.tv/videos/468413972?t=02h20m09s
Excerpt from there: VBCC->GCC 6.2 +100% ->GCC 7.0 +20% ->GCC 8.2 +20% |
17 February 2021, 14:01 | #57 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,409
|
Quote:
|
|
17 February 2021, 14:13 | #58 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
|
problem is: I'm using a lot of standard library (C and C++) in my project. And the distro seems to provide bareboard includes only.
|
17 February 2021, 15:22 | #59 | |
Registered User
Join Date: Aug 2018
Location: Untergrund/Germany
Posts: 408
|
Quote:
A few days ago i switched to C++ on A500 to enjoy much less typing then i had to do with C. Also having now ranged for loops in my templated UnitHeaps saved a lot casting around and adds some extra safety at compile time. |
|
17 February 2021, 15:30 | #60 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,162
|
I now suddenly understand why your games are only made with 1 exec file.
All assets are probably "static const unsigned char bitmap[] = {0x...}" like. It makes sense, as long as the whole game data fits into memory without loading. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tinyus Open Beta Released (OCS Gradius port) | pink^abyss | News | 213 | 11 May 2023 01:50 |
Tinyus - An arcade quality Amiga OCS port of Gradius/Nemesis | pink^abyss | News | 103 | 12 May 2021 04:58 |
Tech AMIGA magazine | thinlega | request.Apps | 9 | 19 February 2021 17:26 |
Trackmo tech | paraj | Coders. Asm / Hardware | 4 | 30 March 2017 20:57 |
AmigaWorld Tech Journal | Shadowfire | AMR news | 7 | 26 April 2009 19:14 |
|
|