Maziacs / Bugziacs Conversion for QL

Tell us about your other hobbies & none QL related items here :)
spkr
Bent Pin Expansion Port
Posts: 98
Joined: Tue May 04, 2021 6:52 pm

Maziacs / Bugziacs Conversion for QL

Post by spkr »

One of my childhood games that stuck with me is Maziacs https://en.wikipedia.org/wiki/Maziacs . I loved it quite a bit, its simple, yet challenging and nicely executed. One of my scenebuddies was playing around with a Z80 to M68K converter, and did a conversion a little while ago for Atari ST, called Bugziacs https://www.pouet.net/prod.php?which=81412. He made a little writeup about the process http://beyondbrown.mooo.com/post/bugziacs/.

The converter opens up the possibility of doing (more) ZX conversions to M68k.

Ive been having a little look into adapting the Atari ST conversion for the QL. The main challenges are getting the executable in an acceptable size (<96kb if Im right) and getting the codebase all PC-relative. Im making decent progress, so I suppose input (keyboard en joystick) are up sooner rather than later.


User avatar
vanpeebles
Commissario Pebbli
Posts: 2815
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: Maziacs / Bugziacs Conversion for QL

Post by vanpeebles »

Loved that game as a kid, the animation when you fought was class :lol:


Derek_Stewart
Font of All Knowledge
Posts: 3928
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Maziacs / Bugziacs Conversion for QL

Post by Derek_Stewart »

Hi,

The link to the web page about Z80 to M68K makes interesting reading.

Years ago I started writing a set of macros for QMAC assembler to define Z80 and 6502 mneumontics.

The idea was to take a Z80 assembley language source file and include the Z80-M68K macros, which would allow the QMAC assembler to assemble the Z80 source file, with a little extra work on the M68K side. This I never finished.

I also wondered if a Z80 or 6502 mneumontics could be written as QL Prodecedures and Functions and compiled with Qliberator, as QL extenstions. So that the Z80, 6502 file could be run as an interpreted file, or compiled.

This might be slow, but a ZX Spectrum running 2Mhz, might be slower than a QL running a compiled version of the assembler code at 8Mhz plus, Q68 40Mhz...


Regards,

Derek
spkr
Bent Pin Expansion Port
Posts: 98
Joined: Tue May 04, 2021 6:52 pm

Re: Maziacs / Bugziacs Conversion for QL

Post by spkr »

Hiho,

I made a little progress this weekend. The code size is 92898 (~90.8kb), using a single buffer for display. I assumed that the stock QL has little under 96kb memory free to run a program, and this is a ballpark figure I can work with. Since Im mostly a goal-oriented dude, I focused on easy and big steps. As such, I have removed non-functional graphics from the game, like a title screen and a loading screen, to save space in big steps.

I also reworked the code such that it is all PC-relative code, and the current game project still runs (albeit on Atari ST).

During the process, I have played the game numerous times (you gotta check if you can still get the gold, you know .... 8-) ); and Im still not disliking the game, which is a good sign I guess :D

Next step for me now is to add some alternative codepaths for QL assembly and see if I can get an executable that loads and draws something on screen; to simply check if I can load+run the assembled binary on QL. Once that works, the next step is effectively replacing the ST display part for the QL display part. I have no real idea what Im getting into just yet, but Im hoping for some progress on this by next weekend.

Attached you find an overview of the sprites from the game:
sprites_orig.png
sprites_orig.png (4.87 KiB) Viewed 2804 times
I do not foresee any problem (just yet) in converting this to QL (color wise). As such, are there any suggested QL graphics conversion tools for Windows/OSX ?


spkr
Bent Pin Expansion Port
Posts: 98
Joined: Tue May 04, 2021 6:52 pm

Re: Maziacs / Bugziacs Conversion for QL

Post by spkr »

Bah, testing made me show that my memory assumption was wrong, by quite some bytes. I managed to load a binary up to 85944 bytes under Q-emuLator. I suppose I have to go and search where to nibble off more bytes :geek:


spkr
Bent Pin Expansion Port
Posts: 98
Joined: Tue May 04, 2021 6:52 pm

Re: Maziacs / Bugziacs Conversion for QL

Post by spkr »

First small success. Drawing text on the QL using ZX Spectrum basic code that has been converted to M68K and ported for QL :P.
Screenshot 2021-05-18 at 17.07.09.png
In comparison the Atari ST version I of the same actual code:



Time to get into the whole paper and ink stuff to adapt the actual graphics.
Screenshot 2021-05-18 at 17.09.12.png
And the actual ZX screen :)
Screenshot 2021-05-18 at 17.10.05.png


spkr
Bent Pin Expansion Port
Posts: 98
Joined: Tue May 04, 2021 6:52 pm

Re: Maziacs / Bugziacs Conversion for QL

Post by spkr »

Little update. I managed to get the maze generation working; because the port seems to rely on a time-tick for this generation.... I hacked something around it, to improve later. So now we can generate a playable maze and it drops into gamemode (in 384kb QL emulation mode), but the screen is one big garbled mess due to not having the QL display output ported yet:
Screenshot 2021-05-20 at 15.43.03.png
And the gameplay:
Screenshot 2021-05-20 at 15.43.21.png
So I made a start in converting the tiles for QL display. Currently it uses a 1:1 conversion of data, but considering a lot of tiles are only a single color, I think this is where I can optimize for space as well (get a 1:4 compression ration for most of the single color tiles):
Screenshot 2021-05-20 at 15.41.25.png
Got good hopes I get something playable this weekend!


spkr
Bent Pin Expansion Port
Posts: 98
Joined: Tue May 04, 2021 6:52 pm

Re: Maziacs / Bugziacs Conversion for QL

Post by spkr »

Whee, first crude, but functional playable game result!
Screenshot 2021-05-20 at 20.37.20.png
Now I cant wait to get the vdrive to start testing this on the real machine. It seems at first glance that speed-wise the game is acceptable.


spkr
Bent Pin Expansion Port
Posts: 98
Joined: Tue May 04, 2021 6:52 pm

Re: Maziacs / Bugziacs Conversion for QL

Post by spkr »

Small update on the tiles and drawing method; its complete now for the gameplay. Also reworked the maze generation, and now the game is playable and winnable.

The 256x192 ratio from the original ZX game makes it feel a bit stretched in width on the QL, so I stretched the tiles a bit vertically, but Im not sure yet if this is the way to go.

Nonetheless, progress!
Screenshot 2021-05-21 at 10.44.24.png
Things to do:
- make use of basic menu
- port minimap/overlay map
- make the game replayable, rather than crashing on game end
- [optional] add sound effects (havent figured or tried this out at all yet)
- make it fit in 86000 bytes


User avatar
vanpeebles
Commissario Pebbli
Posts: 2815
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: Maziacs / Bugziacs Conversion for QL

Post by vanpeebles »

Impressive :shock:


Post Reply