01 May 2023, 12:22 | #21 | |
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,549
|
Quote:
|
|
01 May 2023, 12:32 | #22 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,147
|
What Bruce said. A lot of compilers have intrinsics to support C language features that are quite easy to spot once you've seen them before.
|
01 May 2023, 13:35 | #23 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
ok.. so the answer is "no" when using the qualifiers "generally" and "reliably", but f/a 18 is probably compiled using some well-known compiler :-)
|
07 May 2023, 14:41 | #24 |
Registered User
Join Date: Sep 2009
Location: Norway
Posts: 1,711
|
|
08 May 2023, 01:07 | #25 |
Registered User
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,549
|
F/A 18 appears to be ~1/3rd C and 2/3rds assembler. The C code looks like Lattice, which would make sense since it was the official compiler for the Amiga. To prove it I would have to compile some code with an early version of Lattice C and see what it produced.
|
08 May 2023, 21:29 | #26 |
Registered User
Join Date: Jun 2017
Location: Finland
Posts: 361
|
This discussion is very intriguing, like watching a detective story of sorts
|
23 May 2023, 00:08 | #27 |
Registered User
Join Date: Oct 2009
Location: Belgium
Age: 50
Posts: 42
|
I found a function in the binary that is only called when some bytes are set to 1. I don't see them being written anywhere in the code, so I guess it's a function meant for debugging.
The attached picture shows the result. The small diagonal line in the top left corner is drawn every odd frame. The three-digit number is the frame rate (but not in fps, the base seems to be 800000). The other two numbers are the x and y input of the input controller. Last edited by ara; 23 May 2023 at 00:53. |
24 May 2023, 00:15 | #28 |
Registered User
Join Date: May 2005
Location: Cheshire, UK
Age: 56
Posts: 322
|
I recall when you look at code made in pure assembler in a decompiler, it looks "clean" in comparison for want of a better word. I seemed to remember encountering BCD more frequently in non-ASM compiled code.
Also, there's frequently obvious bloat in higher level compilers. I expect that the exec stub would have some kind of uniqueness, as well as what sort of mem alloc pieces there are. I expect one of the number of ex-crackers on here would recognise code structure from their typical tracing experiences. |
24 May 2023, 16:45 | #29 |
Registered User
Join Date: Oct 2009
Location: Belgium
Age: 50
Posts: 42
|
The compilers in the 1980s were not as much optimizing as the modern ones. For example, I don't remember to have ever seen loop unrolling in old compiled code. In addition, in code written in assembly language you can find structures that don't appear in compiled code. Typical example: code shared between several functions, like this:
Code:
function1: some instructions function: some instructions rts Do you know which game was written almost entirely in C? Populous. The code is very easy to read. I started translating it to Java and actually finished the game initialization and rendering part (see the attached picture), but at some point implementing all the game logic became too boring (so many "if"s....) |
24 May 2023, 20:13 | #30 |
Registered User
Join Date: Oct 2022
Location: Shelby Township
Posts: 72
|
Doesn’t IDA Pro decompile nowadays? Last time I looked at it about 10+ years ago I thought it did?
|
24 May 2023, 21:13 | #31 |
Registered User
Join Date: Jun 2017
Location: Finland
Posts: 361
|
Theoretically speaking, would this mean that the game could be further optimized at least to a modestly significant degree by hand-written assembler? I'm assuming here that the compiled C code from 1991 is not as efficient. |
24 May 2023, 23:08 | #32 | |
Registered User
Join Date: Oct 2009
Location: Belgium
Age: 50
Posts: 42
|
Quote:
Here is a fragment of C code that I reverse-engineered with the help of Ghidra. It comes from a function that flattens a 9x9 patch of land for the AI player: Code:
(player->action).id = 2; // land lowering action (player->action).x = x; (player->action).y = y; player->moveDone = 1; Code:
movea.l (-0xe,A5),A0 move.b #0x2,(A0) movea.l (-0xe,A5),A0 move.b d4,(0x1,A0) movea.l (-0xe,A5),A0 move.b d5,(0x2,A0) movea.l (-0xe,A5),A0 move.w #0x1,(0x8,A0) |
|
24 May 2023, 23:10 | #33 | |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,147
|
Quote:
|
|
24 May 2023, 23:10 | #34 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,174
|
okay but do you really need more speed on that game? Our elders knew that compilers were crap, so they wrote critical parts in assembly already.
if so, I suppose that one could disassemble, remove the useless instructions / write more efficient code, reassemble. But first, you'd have to profile the code to see where you'd have the best gain, else it's a lot of work for unguaranteed results. PS: great job with the RE of Populous nevertheless. Granted, re-making those games for modern platform has little interest as those modern platforms can already emulate the real game. Unless you add features (HD, extensions...) which is another story... |
24 May 2023, 23:21 | #35 |
Registered User
Join Date: Oct 2009
Location: Belgium
Age: 50
Posts: 42
|
True. For me, it's just a leisure activity and a kind of archeology. It's fun to see how much game play they could squeeze into a few kbytes of code. If a remake or extended version were the goal, it would be more interesting to directly start from Populous 2.
|
25 May 2023, 08:56 | #36 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,174
|
Another useful thing when resourcing is you can figure out how data is done and create level editors for the original engine.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Most advanced game by year? | rothers | Amiga scene | 51 | 15 April 2022 20:47 |
Best Game of Year 2021 | Solo Kazuki | Amiga scene | 13 | 28 February 2022 15:08 |
EAB Game of the year poll | mcgeezer | Amiga scene | 20 | 15 December 2021 08:05 |
From What year to what year You can use a stock Commodore Amiga 500? | The Brave Ant | Nostalgia & memories | 3 | 10 June 2014 18:34 |
AGTW game of the Year | Dizzy | project.EAB | 6 | 23 December 2006 17:58 |
|
|