Castle Defender -> Atari conversion

matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Castle Defender -> Atari conversion

Post by matosimi »

Hi,

I would like to perform Atari XL/XE conversion of Castle Defender.
I have managed to export the data from .ssd disk and I have been playing around with the contents...

Both machines are based on 6502 cpu, so the game logic might be preserved/transferred w/o changes.
However Atari has slightly lower cpu clock (1.79 MHz)... and the main change is the structure of video ram.

Atari has nothing like Mode 1 (320x256x4), the closest matching mode is (320x192x2).
On Atari video ram is sequential, meaning 1 scanline consists of 40bytes (40*8 = 320) which are sequentially stored in memory.
I can see that BBC Micro on the other hand stores video data in 8byte chunks (in case of Mode 1 it is in two 8byte chunks) which could be represented in text mode of Atari, which uses similar memory structure).

So I wrote small utility which converts gfx data by ORing the 2 color bytes (to reduce color palette from 4 colors to 2) which should represent your Mode 4...that is quite close to what Atari can do.
However I can see there are some additional data in L.1 file at the beginning, so the resulting image is not correctly aligned:
CF_g2f_L1.png
@ChrisB: could you let me know what is stored at the beginning of the L.1 file? I have already disassembled the code, however it would be great if you could be kind to provide me the sourcecode, so I would not need to reverse engineer everything.
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Castle Defender -> Atari conversion

Post by tricky »

Sorry, I can't help with the data, but have PMed Chris, yours will be activated after I think 25 posts.
I would love to see more ports between the two.
I think the Atom would also be a good candidate and I think that the memory map is much closer and hardware more basic (6847 based).
I have written a couple of "emulators" for running Atari arcade ROMs on the beeb, but I think the micro games might be more interesting.


URL:https://youtu.be/enupZbjSNck View at 720p+ for 50hz.


URL:https://youtu.be/yCnRqDsB8p4 View at 720p+ for 50hz.
User avatar
sydney
Posts: 2925
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: Castle Defender -> Atari conversion

Post by sydney »

I've activated PM's for you.
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

@sydney: thanks
@tricky: there are several BBC Micro games already converted to Atari: http://a8.fandal.cz/search.php?search=b ... etails_x=x
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: Castle Defender -> Atari conversion

Post by lurkio »

matosimi wrote: Mon Nov 26, 2018 2:05 pmthere are several BBC Micro games already converted to Atari: http://a8.fandal.cz/search.php?search=b ... etails_x=x
Wow, I’d heard about Spycat, but I didn’t know there were so many other Beeb-to-Atari conversions!

=D> =D>

Were you involved with all of them? Why did you choose Beeb games in particular to convert (apart from the fact that the Beeb and the Atari both have a 6502)?

:?:
Last edited by lurkio on Mon Nov 26, 2018 4:02 pm, edited 1 time in total.
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

lurkio wrote: Mon Nov 26, 2018 3:57 pm Were you involved with all of them? Why did you choose Beeb games in particular to convert (apart from the fact that the Beeb and the Atari both have a 6502)?

:?:
I was not, but I know Fandal in person... so I was quite aware of what he has done already; anyway this game would be my first :)

Why? because of the same CPU, because Beeb does not have HW sprites or anything like that, so all is done SW way... (that's why C64 games could not be converted easily between other 6502-based platforms)
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: Castle Defender -> Atari conversion

Post by ChrisB »

Yes - I did receive the PMs. The 1972 bytes before the screen are the path the enemies take (all pre-calculated - there's a lot of that) and the 32 bytes before that are the locations of the Towers. I'll see what can be done with the source code - it was never really meant for public consumption - give me a few days...
Last edited by ChrisB on Mon Nov 26, 2018 8:34 pm, edited 1 time in total.
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

ChrisB wrote: Mon Nov 26, 2018 8:33 pm Yes - I did receive the PMs. The 1972 bytes before the screen are the path the enemies take (all pre-calculated - there's a lot of that) and the 32 bytes before that are the locations of the Towers. I'll see what can be done with the source code - it was never really meant for public consumption - give me a few days...
thanks for info.
I'm glad you are willing to help me. Regarding the sources, do not worry about it. I really dont need a lot of explanations or comments. The thing that will help me the most would be the labels, especially zero page and labels of inline data.
So dont waste your time to comment the code for me, i will need to rewrite all drawing routines anyway... and also I will need to replace all HW calls incl. disk accesses.
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

Hi,
after some time, i was able to dig into CD code (since 2 days ago) and now I have running game on Atari Xl/Xe.
I had to remove all disk loads and interrupt stuff and replace them by direct data blocks (inline data).
Controls are not yet handled.
Video output looks like this:
cd_r08.png
cd_r08.png (11.92 KiB) Viewed 14408 times
I know it is maybe not what you have expected, but the videoram has different structure on BBC Micro than on Atari.
Good message is that the code is running, towers are being drawn, sprites are NOT being drawn (i had to cheat the sprite loading routine) and after some time the the "Defeat!" message is shown.

So my next steps are to fix sprite (enemy) loading and after that I can start with all gfx data conversions and drawing routines adjustments.
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

cd_r12.gif
cd_r12.gif (110.65 KiB) Viewed 14312 times
Finally the original game code is running properly...
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: Castle Defender -> Atari conversion

Post by ChrisB »

Well done! :D
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

ChrisB wrote: Thu Dec 27, 2018 12:13 pmWell done! :D
Thanks

Current issue is that i have to convert all the assets to something like MODE4, which means that all sprites have to be preshifted to 8 positions instead of 4.
Also towers which are placed on odd x-position have to be preshifted and masked in order to put them nicely on desired spots in the map.
ATM I'm working on correct tower placement/look.
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

cd_r16.gif
cd_r16.gif (10.23 KiB) Viewed 14269 times
another iteration: converted background, converted tower sprite incl.masking
tingo
Posts: 27
Joined: Fri Jul 06, 2018 1:56 pm
Contact:

Re: Castle Defender -> Atari conversion

Post by tingo »

Yes, looking very nice.
--
Torfinn
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

cd_r22.gif
cd_r22.gif (113.94 KiB) Viewed 14112 times
enemy sprites drawn correctly...
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Castle Defender -> Atari conversion

Post by tricky »

Looking great
PS what do you use to make the gifs?
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

tricky wrote: Tue Jan 01, 2019 2:21 pm PS what do you use to make the gifs?
https://ezgif.com/video-to-gif
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

cd_r25.gif
cd_r25.gif (34.26 KiB) Viewed 14022 times
controls work, towers are drawn, explosion animation almost works
(bullets drawing not yet converted, tower upgrades drawing not converted as well, hit sprite variation not adapted yet)
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

finally i've found some time to dive into the "bullet storm".
good news is that bullets so so work, but some position adjustments would need to be applied... also bullet masking is required, otherwise they look quite bad
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

cd_r42.gif
cd_r42.gif (19.52 KiB) Viewed 13672 times
bullets, hitsprites, explosions working
Last edited by matosimi on Sun Feb 10, 2019 8:49 am, edited 1 time in total.
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

status bar works, however it does not fit to Atari screen (Atari does not have resolution with 256 scanlines), so I'm working on some alternative solution at the moment
cd.png
cd.png (11.38 KiB) Viewed 13495 times
also added +1 color/luminance by using PMG(sprite) overlay (I had to code additional editor for this)
pmg_lvl1_final.png
pmg_lvl1_final.png (13.98 KiB) Viewed 13495 times
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Castle Defender -> Atari conversion

Post by tricky »

Looks great, isn't there room at the sides?
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

tricky wrote: Tue Mar 12, 2019 7:43 am Looks great, isn't there room at the sides?
Yes, it is. However the emulated gfx mode does not allow me to use them, so I can (will) put there 2 column sprites (1 left to the main screen, 1 right) with the status info.
i have some mockups already, but I will share after i develop the final look.
Last edited by matosimi on Tue Mar 12, 2019 11:59 am, edited 1 time in total.
User avatar
ChrisB
Posts: 548
Joined: Wed Oct 05, 2011 10:37 pm
Location: Surrey
Contact:

Re: Castle Defender -> Atari conversion

Post by ChrisB »

Looking really good. The luminance really lifts the look.
Castle Defender, Untitled Dungeon Game, Night Ninja, Wordle, Waffle, Acorn Island, Beebchase, Ghostbusters
matosimi
Posts: 31
Joined: Thu Nov 22, 2018 7:39 am
Contact:

Re: Castle Defender -> Atari conversion

Post by matosimi »

cd_r62.png
cd_r62.png (15 KiB) Viewed 13316 times
status bars are working
User avatar
tricky
Posts: 7695
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Castle Defender -> Atari conversion

Post by tricky »

Looks great.
I think the beeb might be the only 8-bit with 256 vertical resolution.
User avatar
José Pereira
Posts: 1
Joined: Wed Mar 20, 2019 2:19 pm
Contact:

Re: Castle Defender -> Atari conversion

Post by José Pereira »

Hi to all because I'm new here though not for Atari 8bits people :D ...
I saw the game at AtariOnline and looking really good.
I would just suggest that you could DLI to have PF1 dark gray (04) and PF2 white (0E) for the bottom panel and same as for the road you could use the same 4Players (as you seem to be using 2+2 Missiles in 5th Player PF3 colour register on the sides) to have creatures and right numbers in gray (0C) or (0A).
It would look something like this:
cd_r62.png
cd_r62.png (14.96 KiB) Viewed 13141 times
:)
Last edited by José Pereira on Wed Mar 20, 2019 3:02 pm, edited 1 time in total.
Post Reply

Return to “conversions of acorn games to non-acorn platforms”