News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

.

Started by Phi2x, 18:49, 09 September 10

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

McKlain

I guess it's an improvement, I can't test the emu  :laugh:

Still there are a few thing that doesn't sound right, mainly the "hard" sounds and the noise generator. The noise sounds at a higher pitch than the real AY output, if you compare it with my recording. Another thing, can you make the output in stereo? That way you could check it side by side.

http://soundcloud.com/mcklain/take-off

And thank you  ;D

Phi2x

#251
.

McKlain

Wow, pretty good, sounds like the original one  :D

Now it just needs stereo  ;D

Phi2x

#253
.

arnoldemu

Quote from: phi2x on 10:43, 07 July 11
To go further into emulation, what's now needed is mimicking the synchronisation lag between the CRTC and the Gate Array output.
As I implemented CPCBox, there is actually no delay between those 2 chips. It makes things simpler for a code point of view, and it enables nice optimizations.

But at the end of it, it's not how the real thing works.
I tried my best to hack around to mitigate the side effects. But some demos are impossible to fix due to this synchronisation issue, and so it claims for proper emulation!

I've thought a little about it. Implications are enormous from a code point of view. Making proper emulation of this synchronization delay will be CPU intensive, and I'll have to ditch the optimization tricks I used that won't fit anymore. :(
Is it worth it, just to be able to fix a handful of demos? Given how slow CPCBox currently is, I'm not sure. But it's bothering the heck out of me. >:(

?? There are some delays.

it is known the the hsync is delayed by 2 crtc clocks before it leaves the gate-array, and is cut by the gate-array to a maximum of 6us.
this partly explains how the image is centralised in the display, and also why some values of hsync do not trigger interrupts.

I believe the same may be true of vsync, but I've not checked it.

do not forget the gate-array reads 2 bytes of memory for each crtc clock, it buffers these, then clocks them out to the display.

there is probably a delay in here, which explains why colours etc are delayed.

is it worth doing it for a few demos? depends on how far you want to go.

for me, I would do this.

I am currently investigating the dk'tronics ram expansion and how it's operation differs on a 464 compared to a 6128.
so I can emulate this in arnold correctly.

how far do you go with the timing of the instructions? do you do "inter instruction timings" where you consider that the i/o operations occur within the timing of the instruction? (e.g. outi, outd, the time for i/o happens before the instruction has finished executing), *this* will also explain why you have to work around the timings?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Phi2x

#255
.

Phi2x

#256
.

Executioner

Quote from: phi2x on 11:00, 07 July 11
That's another synchronisation issue: synchronisation between Z80 and GA. There is a 0.5µs lag between these 2 chips. Palette is modified right in the middle of a Z80 "µs cyle".
It's really the worst of those synchronization issues. And it's interesting to note that no emulator emulates this. I don't plan to do it either!

The display output shows the palette change 14 (MODE 2) pixels into the 16 pixels read in one go. I think this may be slightly different on the Plus also. So the actual change happens 14/16 * 4 T-States in, ie. It's aligned to 3.5 T-States. This could be emulated by getting the renderer to render the first 14 pixels, then do and internal palette update if necessary, but it would involve a lot of overhead just to get the emulation 2 MODE 2 pixels correct (only 1 pixel in MODE 1, and no difference in MODE 0).

Phi2x

#258
.

Devilmarkus

Well, I avoid that with a little, dirty trick :P
(Deinterlaced screenshot, so if you miss some pixels, go and search'em ;) )
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Phi2x

#260
.

McKlain

Java CPC is the sleeping beast.

Devilmarkus

I am still curious, why no emulator shows these effects properly, too:
First is completely missing in all emulators I tested,
and 2nd looks very worse...
(Still deinterlaced screenshots)

Accurate images:
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Phi2x

#263
.

Devilmarkus

Quote from: phi2x on 17:42, 08 July 11
I tried to get it working but with no luck at the moment. I can make those effects work but then there are glitches that appear in other demos, so i've not enabled it :(

It's easier as it seems ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Devilmarkus

Try a thing like this in your CRTC emulation:
(I only emulate CRTC 1 or 0 so you will understand what I do here)
// Some scrollers use register 8 (CRTC 0)
// and register 6 (CRTC 1). This routine makes them visible
// JavaCPC is the only known emulator which emulates booth correct!
    public void checkHDisp() {
        if (hDisp) {
            if (CRTCType == 0) {
                if ((reg[8] & 0x030) == 0x30) {
                    listener.hDispEnd();
                } else if ((reg[8] & 0x030) == 0x00) {
                    listener.hDispStart();
                }

            } else {
                if (reg[6] != 0) {
                    listener.hDispStart();
                } else {
                    listener.hDispEnd();
                }

            }
        }
    }


and call it every GateArray cycle...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Phi2x

#266
.

McKlain

It seems that everybody thinks that they get things right  :P

Phi2x

#268
.

Devilmarkus

Nice...
Now just fix Reg 6 / 8 registers ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Executioner

Oops, my post earlier was completely wrong. I was thinking of the HSYNC blanking timing on the standard CPC I think. The Grim documentation is accurate for palette changes.

@Markus, it appears JavaCPC most likely delays the palette change one whole extra microsecond for you to get the correct screen output on Vanity.

WinAPE also has a slight interrupt timing issue which I never tracked down. I'm not sure if it's common to all emulators, but I dicussed it with someone back on CPC Zone. About the only things I'd really like to get back from Malc are those posts.

Devilmarkus

Quote from: Executioner on 00:44, 09 July 11
@Markus, it appears JavaCPC most likely delays the palette change one whole extra microsecond for you to get the correct screen output on Vanity.

Its just done with a very dirty trick ;)
All other rasters behave like other emulators do, too...
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Phi2x

#272
.

Phi2x

#273
.

SyX

Thanks phix2!!!  :D

Wonderful Job!!!  ;D ;D ;D

I get a solid 30 fps, i think that it's great with so good emulation :)

Is there any way to load my own DSKs???

We are using in http://amstradcpc.es/ the javascript emulator of Antonio Villena, and i don't know if i told before in the CPCWiki, but thanks to Antonio, we made the database freely avalaible here for all the community, surely you can find useful for CPCBox, too.

Powered by SMFPacks Menu Editor Mod