HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

A forum about the Hatari ST/STE/Falcon emulator - the current version is v2.2.0

Moderators: simonsunnyboy, thothy, Moderator Team

Post Reply
User avatar
Emphii
Atari User
Atari User
Posts: 34
Joined: Wed Sep 08, 2010 6:07 pm
Location: Middle-Finland

HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by Emphii »

In the middle of my next project I noticed that screen, which uses DSP and CPU for data runs too quickly in HAtari compared to realhw. My settings are pretty much similar to my Falcon, so I expect at least that speed, maybe a little slower. And the data from DSP mmmaay not be exactly the same as on realhw.

Another thing I noticed. I tried the screenpointer trick to double the scanlines in hicolor-mode. Well - it didn't succeed. That same screen is in matter.

I can deliver the sample screen, if *one* needs it, but as it's a competition production, it cannot be spread widely. :wink:
--
Emphii/Extream
Plain 14MB F030 with 2GB (was 4GB) CF-modification (mem from Lynxman,thx man)
User avatar
dhedberg
Atari God
Atari God
Posts: 1184
Joined: Mon Aug 30, 2010 8:36 am
Contact:

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by dhedberg »

Hatari doesn't have full emulation of the Videl yet so your screen pointer trick in hi-color mode will not work.
Are you performing proper synchronization on both sides before DSP/CPU transfers? If not you'll most likely run into problems on accelerated machines (and in Hatari). If you're only going to support stock Falcons you may get away with less proper synchronization. Maybe release a special build for Hatari and accelerated Falcons?
Daniel, New Beat - http://newbeat.atari.org.
Like demos? Have a look at our new Falcon030 demo It's that time of the year again, or click here to feel the JOY.
User avatar
Emphii
Atari User
Atari User
Posts: 34
Joined: Wed Sep 08, 2010 6:07 pm
Location: Middle-Finland

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by Emphii »

Hi Daniel.

Thanks for really quick reply.
So I forget the screen pointer trick problems on HAtari, so far.

I think, I have some synchronization. On data movement DSP uses continuously jclr and cpu does btst. The rest time they are doing their own job.

My production is most certainly aimed to stock Falcons, as the commonly accepted specs are "plain 030/16MHz/4Mb/sv2k18" :wink:
--
Emphii/Extream
Plain 14MB F030 with 2GB (was 4GB) CF-modification (mem from Lynxman,thx man)
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2158
Joined: Sun Jul 31, 2011 1:11 pm

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by Eero Tamminen »

As already mentioned, Hatari Videl emulation is somewhat lacking. CPU, FPU, MMU, DSP & TT-RAM emulation should instruction-wise be correct, but unlike 68000 emulation, isn't yet cycle accurate.

In regards to cycle-accurate CPU<->DSP synchronization, sometimes enabling cache emulation (--cpu-exact yes) is closer to real machine, sometimes disabling it.
User avatar
dhedberg
Atari God
Atari God
Posts: 1184
Joined: Mon Aug 30, 2010 8:36 am
Contact:

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by dhedberg »

Emphii wrote:I think, I have some synchronization. On data movement DSP uses continuously jclr and cpu does btst. The rest time they are doing their own job.
When transferring data from the DSP to the CPU on a stock Falcon you only need synchronization for each DSP word transfer on the DSP side. The CPU is slower so only need to check $FFFFA202 for the first DSP word transferred (if you transfer more than one in one go).
Daniel, New Beat - http://newbeat.atari.org.
Like demos? Have a look at our new Falcon030 demo It's that time of the year again, or click here to feel the JOY.
User avatar
Emphii
Atari User
Atari User
Posts: 34
Joined: Wed Sep 08, 2010 6:07 pm
Location: Middle-Finland

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by Emphii »

Eero. Thanks for the pro tip. :) I disabled MMU emulation and took off cycle exacts and got these messages:
Exception 2 (e02cde) at e02cde -> e02ce6!
Exception 2 (e0184e) at e0184e -> e01836!
Exception 2 (e0184e) at e0184e -> e01836!
M68000 Bus Error writing at address $fffffa42 PC=$ad63a.
Exception 2 (ad63a) at ad63a -> ad650!

but screen runs on better speedratio. Still data from DSP is not correct, so it is hard to develop a stuff with this.

But I must say that I appreciate all the work team has done. Without you there probably would not be anything nice like this.


Daniel. That's a good tip. I'll check how much influence it has. Anyway, the amount of data in this mentioned screen does not take that much to transfer. There's still job for CPU to do. :) But this can come as a life saver in some other part.
--
Emphii/Extream
Plain 14MB F030 with 2GB (was 4GB) CF-modification (mem from Lynxman,thx man)
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2158
Joined: Sun Jul 31, 2011 1:11 pm

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by Eero Tamminen »

If you do proper synchronization for CPU<->DSP data transfers, the code is much more likely to work also on accelerated machines where CPU<->DSP speed ratio might differ.

Btw. When writing BadMood code, Douglas had some ifdefs for these transfers, so that he could disable some of the synchronizations when building a binary for the base Falcon.

Hatari profiler has even a mode for profiling these kind of synchronization points:

Code: Select all

> profile help
'profile' - profile CPU code
Usage:  profile <subcommand> [parameter]

	Subcommands:
...
	- loops <file> [CPU limit] [DSP limit]
...
	Detailed (spin) looping information can be collected by
	specifying to which file it should be saved, with optional
	limit(s) on how many bytes first and last instruction
	address of the loop can differ (0 = no limit).
(Many of the Hatari profiler features were originally developed for Douglas, to help optimizing Bad Mood for Falcon.)
Last edited by Eero Tamminen on Mon Dec 03, 2018 12:39 am, edited 1 time in total.
User avatar
npomarede
Atari God
Atari God
Posts: 1339
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by npomarede »

Emphii wrote:Eero. Thanks for the pro tip. :) I disabled MMU emulation and took off cycle exacts and got these messages:
Exception 2 (e02cde) at e02cde -> e02ce6!
Exception 2 (e0184e) at e0184e -> e01836!
Exception 2 (e0184e) at e0184e -> e01836!
M68000 Bus Error writing at address $fffffa42 PC=$ad63a.
Exception 2 (ad63a) at ad63a -> ad650!

but screen runs on better speedratio. Still data from DSP is not correct, so it is hard to develop a stuff with this.

But I must say that I appreciate all the work team has done. Without you there probably would not be anything nice like this.


Daniel. That's a good tip. I'll check how much influence it has. Anyway, the amount of data in this mentioned screen does not take that much to transfer. There's still job for CPU to do. :) But this can come as a life saver in some other part.
Hi
there were quite some changes for mmu emulation in latest devel Hatari version, I would suggest to try it instead of Hatari 2.1
You can get binay version of the devel versions here http://antarctica.no/~hatari/latest/

Nicolas
User avatar
Emphii
Atari User
Atari User
Posts: 34
Joined: Wed Sep 08, 2010 6:07 pm
Location: Middle-Finland

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by Emphii »

Hi Nicolas.

My windows won't let run those files. It blaims about missing rights (nope, that's incorrect) or it doesn't find some file / device.
--
Emphii/Extream
Plain 14MB F030 with 2GB (was 4GB) CF-modification (mem from Lynxman,thx man)
User avatar
npomarede
Atari God
Atari God
Posts: 1339
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by npomarede »

Sorry, I don't use windows myself. I guess that Windows is trying to prevent you from running "non valid" programs in case it could be a virus.
Maybe some Windows users can help you to run these beta version of Hatari.
Nicolas
czietz
Hardware Guru
Hardware Guru
Posts: 1223
Joined: Tue May 24, 2016 6:47 pm

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by czietz »

They run fine for me, Windows 10 x64, e.g. hatari-win64-release.exe from http://antarctica.no/~hatari/latest/win ... -r7255.zip.

Please, Emphii, provide more details: Which file exactly(!) from http://antarctica.no/~hatari/latest/ are you trying to run? Which Windows version do you use? What is the exact(!) error message?
User avatar
dhedberg
Atari God
Atari God
Posts: 1184
Joined: Mon Aug 30, 2010 8:36 am
Contact:

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by dhedberg »

Tried it as well (x64). Runs fine here on Windows 10.
Daniel, New Beat - http://newbeat.atari.org.
Like demos? Have a look at our new Falcon030 demo It's that time of the year again, or click here to feel the JOY.
User avatar
Emphii
Atari User
Atari User
Posts: 34
Joined: Wed Sep 08, 2010 6:07 pm
Location: Middle-Finland

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by Emphii »

czietz wrote:They run fine for me, Windows 10 x64, e.g. hatari-win64-release.exe from http://antarctica.no/~hatari/latest/win ... -r7255.zip.

Please, Emphii, provide more details: Which file exactly(!) from http://antarctica.no/~hatari/latest/ are you trying to run? Which Windows version do you use? What is the exact(!) error message?
I downloaded files from http://antarctica.no/~hatari/latest/windows/win64/ , except HMSA / debug marked files.

Today, after reading the Daniels blitter problem, I downloaded that commit packet and the release-marked file did not run, but the debug one did.

I also told my Windows that these files are ok (in file properties) to run.

And this is Windows 10 Pro 64-bit.

----
For the screen, this was tested against - Now it runs without forementioned exceptions, and fiddling with the settings, I can reach the original "slowness" of the screen. Still the data from DSP is incorrect (maybe something to do with the M-register?)
problemo.PNG
In console window you can notice ?-mark - I'm not using VDI screen, why it even wants to initialize it?
And the main problem with the data from the DSP is marked with * . This is crawling problem from right to left - It's not in constant place.

I really do appreciate the work you team do for us - "the consumers" :) It's an invaluable job.

**Edit: In case you want to know, what is reading instead of "Emulation Paused" it's this:
16MHz/030(PF)/- 4MB Falcon, TOS 4.04, RGB 50 Hz
You do not have the required permissions to view the files attached to this post.
--
Emphii/Extream
Plain 14MB F030 with 2GB (was 4GB) CF-modification (mem from Lynxman,thx man)
User avatar
npomarede
Atari God
Atari God
Posts: 1339
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by npomarede »

Emphii wrote:For the screen, this was tested against - Now it runs without forementioned exceptions, and fiddling with the settings, I can reach the original "slowness" of the screen. Still the data from DSP is incorrect (maybe something to do with the M-register?)
problemo.PNG
In console window you can notice ?-mark - I'm not using VDI screen, why it even wants to initialize it?
I'm not familiar with falcon settings, would need to look at the sources, but isn't horizontal resolution supposed to be a multiple of 16 in falcon video, so 600 is not OK ?
And the main problem with the data from the DSP is marked with * . This is crawling problem from right to left - It's not in constant place.

I really do appreciate the work you team do for us - "the consumers" :) It's an invaluable job.

**Edit: In case you want to know, what is reading instead of "Emulation Paused" it's this:
16MHz/030(PF)/- 4MB Falcon, TOS 4.04, RGB 50 Hz
Hard to tell for the DSP, as I don't have a real Falcon to check. As this is your code, maybe you have the possibility to create a log file when the demo runs to print the data you received from the DSP, then we could compare with the emulated version and try to see which part of the DSP code could be wrongly emulated ? (assuming it's a bug in the dsp part, it could be somewhere else)

Nicolas
User avatar
Emphii
Atari User
Atari User
Posts: 34
Joined: Wed Sep 08, 2010 6:07 pm
Location: Middle-Finland

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by Emphii »

npomarede wrote:I'm not familiar with falcon settings, would need to look at the sources, but isn't horizontal resolution supposed to be a multiple of 16 in falcon video, so 600 is not OK ?
:wink: 800 is horizontal size, 600 is vertical size. But this was only curiosity, as I don't have "Use extended VDI screen" marked.
npomarede wrote: Hard to tell for the DSP, as I don't have a real Falcon to check. As this is your code, maybe you have the possibility to create a log file when the demo runs to print the data you received from the DSP, then we could compare with the emulated version and try to see which part of the DSP code could be wrongly emulated ? (assuming it's a bug in the dsp part, it could be somewhere else)

Nicolas
I'm doing my code with assembler, so no, no logging. I'll try this with other screens as well, but it takes a little more time as I really need to finish my demo. It runs fine on real hw, so I'm happy so far.

(and yes, as it's My code, there might be lurking nasty bugs that really doesn't show up on real machine :D )
--
Emphii/Extream
Plain 14MB F030 with 2GB (was 4GB) CF-modification (mem from Lynxman,thx man)
User avatar
LaurentS
Captain Atari
Captain Atari
Posts: 287
Joined: Mon Jan 05, 2009 5:41 pm

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by LaurentS »

Can you tell me more about the DSP bug ?
Any case test ?
Any source to look at ?
What is expected and what is measured on the real Hardware ?

I'd like to give it a try.

Regards
Laurent
User avatar
Emphii
Atari User
Atari User
Posts: 34
Joined: Wed Sep 08, 2010 6:07 pm
Location: Middle-Finland

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by Emphii »

Laurent - I sent PM to you. There are pretty much everything, you need for testing, I guess. If not, please don't hesitate to ask more.

btw. that version is not screenpointer tweaked.

**Edit: And everyhting compiles fine with Devpac 3.1 & Devpac DSP, they can be found from dhs.nu, if you don't have them.
--
Emphii/Extream
Plain 14MB F030 with 2GB (was 4GB) CF-modification (mem from Lynxman,thx man)
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2158
Joined: Sun Jul 31, 2011 1:11 pm

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by Eero Tamminen »

Emphii wrote:
npomarede wrote:I'm not familiar with falcon settings, would need to look at the sources, but isn't horizontal resolution supposed to be a multiple of 16 in falcon video, so 600 is not OK ?
:wink: 800 is horizontal size, 600 is vertical size. But this was only curiosity, as I don't have "Use extended VDI screen" marked.
Hatari TOS setup code seems to call VDI mode size checks even if VDI mode isn't enabled. I commited a fix for this, as warning about incorrect size can be thought to indicate VDI mode being enabled.
User avatar
LaurentS
Captain Atari
Captain Atari
Posts: 287
Joined: Mon Jan 05, 2009 5:41 pm

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by LaurentS »

Hi emphii

I've sent you a pmail too. There's one file missing
Regards
Laurent
User avatar
LaurentS
Captain Atari
Captain Atari
Posts: 287
Joined: Mon Jan 05, 2009 5:41 pm

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by LaurentS »

Hi,

I've given a look at the prg and I think I've got exactly the same behaviour on hatari and on my real falcon.
I can see the same "visual glitches" on the landscape.

I've taken a memory snapshot of the datas computed by the DSP for the first screen both with hatari and my falcon and the 2 buffers are strictly equals.

Can you explain me where to find the difference ?

Regards
Laurent
User avatar
Emphii
Atari User
Atari User
Posts: 34
Joined: Wed Sep 08, 2010 6:07 pm
Location: Middle-Finland

Re: HAtari 2.1.0, Falcon emulation and DSP and screenpointer update

Post by Emphii »

Hi Laurent, and sorry. :)

Change the line 624 as commented and uncomment line 625 in .s -file. That behaviour was "experimental" test, but I still can see same kind of "border" as in the picture above.

I've uploaded two new videos to you to compare, there you can see the behaviour, I'm facing.
--
Emphii/Extream
Plain 14MB F030 with 2GB (was 4GB) CF-modification (mem from Lynxman,thx man)
Post Reply

Return to “Hatari”