Author Topic: Expanding Elite  (Read 473 times)

0 Members and 2 Guests are viewing this topic.

Offline Fessor

  • CPC6128
  • ****
  • Posts: 237
  • Country: de
  • Liked: 217
  • Likes Given: 46
Expanding Elite
« on: 20:15, 21 July 21 »
Out of boredom I started ghidra and started to disassemble Elite to see if we could get the full shipset in there.
Elite draws its graphics mainly in a background bitmap at address 0xa000 to 0xc000 and then copies it to the screenmemory at 0xc000, so banking should be possible. After several hours, proof-of-concept for a 128k version is achieved.

Thanks to banking, it has now been possible to free up space for the ships' data storage in the invisible program code, which is stored in the image memory,

The routines stored in the image memory are now, enriched with the ship definitions and the character set, stored in bank C9 and graphics routines are patched in such a way that they activate the image memory again when something is to be displayed. *)

There was also room in the program code itself, as the table with the ship's data was moved to the banked area and a routine that transferred the character set from the ROM to the hidden screen area could also be thrown out.

I was able to find graphic data for the ships in dissassembled versions for the Apple and C64, unfortunately the information in the headers and from the edges and faces differ and I have not yet been able to get Elite to display one of the newly added models because the purpose of some of the data in the headers is unknown. In the versions for the 6052s, the header is 20 bytes; at the CPC (and probably also Speccy) 23 bytes. Part of the data is identical, but is in different places.

The basic idea of ​​the whole thing is, since Elite is a Speccy port, to compare the codes with each other and then to compare the codes with the Russian extension and possibly port them ....
Unfortunately, I am not familiar with the spectrum at all and have no ideas how I can get the binary files from TAP files or disk images and would be very grateful if someone could send me the bin files with load addresses


*) The routines for the text screens have successfully evaded treatment for several hours and you sat in front of a screen and wondered why nothing happened after the second splash screen and it looked as if the program was hanging before i found out, that bankswitching of the routine was wrong and the text was drawn on the wrong bank.


Offline eto

  • Supporter
  • 464 Plus
  • *
  • Posts: 353
  • Country: de
  • Liked: 215
  • Likes Given: 208
Re: Expanding Elite
« Reply #1 on: 21:44, 21 July 21 »
OMG - this is fantastic. Elite on the CPC was the game I spent most time with in my whole life. Although I only reached "deadly" status.


So, I hope you are still bored for a few more sessions ;-) and I will definitely give this a try once it's playable.

Offline villain

  • Supporter
  • 464 Plus
  • *
  • Posts: 489
  • Country: de
  • Liked: 282
  • Likes Given: 547
Re: Expanding Elite
« Reply #2 on: 22:52, 21 July 21 »
@Fessor


@reidrac is familar with both systems, maybe he can offer some support.

Online ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.443
  • Country: au
    • index.php?action=treasury
  • Liked: 1139
  • Likes Given: 1360
Re: Expanding Elite
« Reply #3 on: 02:43, 22 July 21 »
This is a very exciting project!
I'm wondering, if you're changing it from a screen buffer copy method to banking, is there a small speed-up?
« Last Edit: 02:54, 22 July 21 by ervin »

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.380
  • Country: fr
  • Liked: 1307
  • Likes Given: 191
Re: Expanding Elite
« Reply #4 on: 10:38, 22 July 21 »
Very cool. But since you now have more memory, maybe revamp the game a bit more and add, for example, music? Like "battle" music when enemies are encountered, "docking" music, "station" music, etc. Could be interesting. But that implies being able to detect such situation, which may not be so easy.
« Last Edit: 10:51, 22 July 21 by Targhan »
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 833
  • Country: gb
  • Liked: 313
  • Likes Given: 495
Re: Expanding Elite
« Reply #5 on: 13:19, 22 July 21 »
Can you share all the ship header + data from the BBC and the CPC versions? Maybe some group investigation will find a solution.

Offline SkulleateR

  • 464 Plus
  • *****
  • Posts: 382
  • Country: de
  • Liked: 203
  • Likes Given: 107
Re: Expanding Elite
« Reply #6 on: 14:52, 22 July 21 »
Wasn't the BBC Micro source code for Elite released long time ago from Ian Bell ?

Offline eto

  • Supporter
  • 464 Plus
  • *
  • Posts: 353
  • Country: de
  • Liked: 215
  • Likes Given: 208
Re: Expanding Elite
« Reply #7 on: 15:02, 22 July 21 »
Wasn't the BBC Micro source code for Elite released long time ago from Ian Bell ?

yes: http://www.elitehomepage.org/archive/index.htm


Offline revaldinho

  • Supporter
  • CPC664
  • *
  • Posts: 115
  • Country: gb
  • Liked: 167
  • Likes Given: 105
Re: Expanding Elite
« Reply #8 on: 16:49, 22 July 21 »

Offline Fessor

  • CPC6128
  • ****
  • Posts: 237
  • Country: de
  • Liked: 217
  • Likes Given: 46
Re: Expanding Elite
« Reply #9 on: 21:12, 22 July 21 »
Finding disassemblies for the 6502s is no problem. I use the code from the Apple version https://6502disassembly.com/a2-elite/Elite.html#SymMVEIT , and everything is pretty well documented there and also the c-source of Elite TNK to understand the flow of the Program.. They all profit from the published source code for the BBC. (Dont know if it would be possible to use the c-source with sdcc)
But you can't find anything for the Z80. I have expected, since the ZX scene is bigger, that someone would have published something. But even of the extended Russian versions "Elite 2 / Elite 3" there is no source code to be found.
The MSX has been given a completely independent version, but there is nothing to be found there either.

Using the color tables, I was able to locate the various menus (marketplace, planet info, galactic / local map, etc.) and I want to trace through the galactic map in order to locate the graphic functions, among other things. Perhaps I can use the graphics functions to track down the problem of why the supposedly cleanly converted data is not drawn. Somewhere the whole calculation has to lead to a list of coordinates according to which the lines are to be drawn.

Attached are the CPC ship definitions for comparison with the 6502 versions, structure definitions as a c-header file and, if one want to debug, a symbol table for the first recognized functions for Winape.

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.681
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1259
  • Likes Given: 2954
Re: Expanding Elite
« Reply #10 on: Yesterday at 04:21 »
Holy cow! I didn't know it's a Spectrum port - and still that quick!
However, looking at Starglider / Starfox the speed difference is visible.


Great project! Good luck!  :) :) :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Online andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 979
  • Liked: 479
  • Likes Given: 79
Re: Expanding Elite
« Reply #11 on: Yesterday at 10:12 »
Holy cow! I didn't know it's a Spectrum port - and still that quick!
However, looking at Starglider / Starfox the speed difference is visible.


Great project! Good luck!  :) :) :)


Although based on the Speccy version, it's pretty obvious a fair bit of effort went into improving the code for the Amstrad specifically. The Speccy version didn't have colour planets for example.

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 2.681
  • Country: de
  • Reincarnation of TFM
    • FutureOS - The quickest OS for the CPC and Plus
  • Liked: 1259
  • Likes Given: 2954
Re: Expanding Elite
« Reply #12 on: Yesterday at 16:19 »

Although based on the Speccy version, it's pretty obvious a fair bit of effort went into improving the code for the Amstrad specifically. The Speccy version didn't have colour planets for example.
Maybe, but it still uses the speccy screen and then converts it to CPC.
http://futureos.de --> Get the revolutionary FutureOS (Update: 2021.01.24)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.07.15)

Offline Sykobee (Briggsy)

  • 6128 Plus
  • ******
  • Posts: 833
  • Country: gb
  • Liked: 313
  • Likes Given: 495
Re: Expanding Elite
« Reply #13 on: Yesterday at 18:48 »
It sounds like there's a lot of room for improvement when it comes to the graphics rendering pipeline.

Offline Fessor

  • CPC6128
  • ****
  • Posts: 237
  • Country: de
  • Liked: 217
  • Likes Given: 46
Re: Expanding Elite
« Reply #14 on: Yesterday at 20:11 »
I was able to successfully narrow down the drawing routine for the circles, even if I don't quite understand the mechanics behind it. I have no idea whether you can put a mask on the outer boundary or I just haven't found it yet. The code modifies itself to set a mask, but that only affects the rough inside of the circle. I might guess that these bytes are simply drawn from a table depending on the radius.

The spectrum also has filled circles, e.g. used for the sun. They probably had to make compromises because of the color clashing and made the decision to leave it to simple circles. Filled planets and xored vector graphics probably didn't look that good.