Due to unusually high levels of website traffic you will be presenting with regular Cloudflare checks for the time being.

"Arkanoid - The Hit Squad" mystery?

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
Post Reply
beginner
Drutt
Posts: 37
Joined: Sat May 21, 2022 10:23 pm

"Arkanoid - The Hit Squad" mystery?

Post by beginner »

Hi everybody,

I finally had some time to play a bit more with my emulator (ZX Spectrum 48k) and I am back with yet another question :) .

There's no surprise that Arkanoid is not wkoring on it, since I do not have any floating bus support.
However, I thought I should give a try to Arkanoid - The hit squad, since it should work without the floating bus. And it does, sort of.

Everything seems to be working pretty well, except for one tiny, little problem: the ball is invisible :D :lol:

Any ideas why?
Could it be because of the way my emulator draws the screen?
It reads and decodes the display file only once per frame at the end of the frame (after the 69888 clock cycles).

Or could it be something else?

Cheers :)
Last edited by beginner on Tue Aug 09, 2022 9:21 pm, edited 1 time in total.
User avatar
spider
Dynamite Dan
Posts: 1106
Joined: Wed May 01, 2019 10:59 am
Location: Derby, UK
Contact:

Re: "Arkanoid - The Hit Squad" mystery?

Post by spider »

I don't think it would be an emulator issue.

Which emulator are you using ? And have you tried it in another one ? :)

I tried that release (Speedlock 5) and yes there's no ball with a +3 , interestingly its also devoid with emulation of a grey +2 as well.

Actually, its only missing on the one emualator I tried that being ZXSpin if its set to 7Mhz , at 3.54 its present even with a +3 loaded from the Tape Loader.

EDIT... Pic, running +3:

Image

:)
beginner
Drutt
Posts: 37
Joined: Sat May 21, 2022 10:23 pm

Re: "Arkanoid - The Hit Squad" mystery?

Post by beginner »

Hi @spider
spider wrote: Tue Aug 09, 2022 8:54 pm I don't think it would be an emulator issue.

Which emulator are you using ? And have you tried it in another one ? :)
I've actually developed my own ZX Spectrum 48k emulator. I should have mentioned that in my first post.
So, in this case there are some chances that I might have implemented something incorrectly :D .

I also tried it on InkSpector 2.0.3 (48k machine mode) and there the ball is visible and everything works properly.

However, as you can see in the attached image, on my custom made emulator the ball is missing and I am wondering why :lol: .

Image

Cheers :)
^m00h^
Dizzy
Posts: 90
Joined: Fri Apr 17, 2020 11:48 pm

Re: "Arkanoid - The Hit Squad" mystery?

Post by ^m00h^ »

You should try Arcanoid 1,2 with pentagon fix in any emulator with pentagon support: https://vtrd.in/release.php?r=b01df4272 ... 49f1f08aa8
geecab
Drutt
Posts: 32
Joined: Sun Jun 23, 2019 12:44 pm

Re: "Arkanoid - The Hit Squad" mystery?

Post by geecab »

Hi there!

Bit of a long shot, but what might be happening here is the same thing I noticed a while ago when running FireFly using the zx spectrum emulator on MAME. I think it has to do with graphics being removed (In Arkanoid's case, the ball) after the game code decides the raster has gone past. I reckon if you run Firefly on your emulator, you might see the same issues I was seeing using MAME.

Here's a link to the mame forum I posted on regarding Firefly's missing graphics which resulted in a fix:
https://forums.bannister.org/ubbthreads ... ber=112363

Hope this helps! Respect to you writing your own emulator 8-)
User avatar
Einar Saukas
Bugaboo
Posts: 3202
Joined: Wed Nov 15, 2017 2:48 pm

Re: "Arkanoid - The Hit Squad" mystery?

Post by Einar Saukas »

the.beginner wrote: Tue Aug 09, 2022 8:33 pm Could it be because of the way my emulator draws the screen?
It reads and decodes the display file only once per frame at the end of the frame (after the 69888 clock cycles).
Arkanoid probably draws the ball AFTER each interrupt, but before the TV raster scan. So the ball appears on a real screen, but your emulator is missing it.

A simple solution for more accurate emulation is to copy each screen byte pair (pixel + attribute) into a separate internal buffer in your emulator, at the exact clock cycle that the TV raster scan would be reading it. Then change your emulator to read and decode the display file once per frame, except reading from your internal buffer instead of the Spectrum screen.
AndyC
Dynamite Dan
Posts: 1448
Joined: Mon Nov 13, 2017 5:12 am

Re: "Arkanoid - The Hit Squad" mystery?

Post by AndyC »

Yeah, most likely the ball is drawn during the frame, the original use of the floating bus was probably trying to optimize that. Building up the display as the CPU executes will probably fix it and get your emulator closer to being able to render multicolour effects too.
beginner
Drutt
Posts: 37
Joined: Sat May 21, 2022 10:23 pm

Re: "Arkanoid - The Hit Squad" mystery?

Post by beginner »

Hi @geecab , @Einar Saukas , @AndyC

Thanks for pointing me to the right direction :) .
I did some quick tests and I can confirm that you are indeed correct!


@geecab
geecab wrote: Tue Aug 09, 2022 10:01 pm Respect to you writing your own emulator 8-)
Thank you for your kind words. I appreciate it :)

Cheers!
User avatar
spider
Dynamite Dan
Posts: 1106
Joined: Wed May 01, 2019 10:59 am
Location: Derby, UK
Contact:

Re: "Arkanoid - The Hit Squad" mystery?

Post by spider »

Ah I had no idea it was your own emulator! :o :D

Much respect as said for "writing your own" :)
beginner
Drutt
Posts: 37
Joined: Sat May 21, 2022 10:23 pm

Re: "Arkanoid - The Hit Squad" mystery?

Post by beginner »

spider wrote: Wed Aug 10, 2022 8:31 pm Ah I had no idea it was your own emulator! :o :D

Much respect as said for "writing your own" :)
Much appreciated! :D

Cheers
beginner
Drutt
Posts: 37
Joined: Sat May 21, 2022 10:23 pm

Re: "Arkanoid - The Hit Squad" mystery?

Post by beginner »

Hi everybody,

I'm back with a small update on this matter.
Maybe it will be useful to some other beginner emulator developer, like myself :) .

Halfway through the implementation I realized that even though I am now doing cycle based / on the fly screen reading / decoding, there will be games that won't work properly since I do not handle memory contention at all, which would lead to some out of sync stuff happening.
After finishing the implementation I can now confirm that indeed there are games that work properly when decoding the screen file at the end of the frame but generate some undesired artifacts when decoding the screen on the fly.

If I am not mistaken (and please do correct me if I am wrong) in order to properly handle memory contention my emulator should be cycle based instead of instruction based as it is now.

That would require me to do some pretty big changes to the core.
What I ended up doing instead, was to implement both screen decoding methods and select the one to be used by a command line switch when the emulator is started. Not the best method and certainly not the most elegant but it does the job for now and allows me to play even more games :) .

As a side note, I think that a proper floating bus implementation would also require a proper memory contention handling.

Cheers!
AndyC
Dynamite Dan
Posts: 1448
Joined: Mon Nov 13, 2017 5:12 am

Re: "Arkanoid - The Hit Squad" mystery?

Post by AndyC »

Yeah, sounds about right.

You're basically following an accelerated path along how emulators were developed. The first ones just ran a frames worth of code, based on documented instruction timing and then rendered the video based on the current contents of video memory. It works, kind of, but as you notice isn't entirely faithful.

The next iterations tended to do something vaguely similar, but based on line-at-a-time rendering rather than entire frames. That way border stripes and various multicolour effects from back in the day mostly worked when they aren't too timing specific.

And then more modern iterations moved to proper emulation at the cycle level, allowing more accurate contention timings as well as display rendering of more nuanced colour change effects as seen in multicolour games.

Then the crazy next step is things like PAL emulation so that weird side effects of how the video is encoded can be exploited, as in things like Chromatrons Attack.
beginner
Drutt
Posts: 37
Joined: Sat May 21, 2022 10:23 pm

Re: "Arkanoid - The Hit Squad" mystery?

Post by beginner »

Thanks @AndyC :D .

This little project turned out to be more addictive than I would have thought. It is, however, also very satisfying :) .

Right now I am enjoying the "freshly baked" border stripes.
I decided that I'll always paint the borders on the fly / cycle based, no matter which one of the previously described methods I use to paint the rest of the screen. Just so I can have the stripes, even if sometimes they might be out of sync :D .

Cheers!
Post Reply