Author Topic: Emulator detection  (Read 5019 times)

0 Members and 1 Guest are viewing this topic.

Offline HAL 6128

  • 6128 Plus
  • ******
  • Posts: 516
  • Country: de
    • index.php?action=treasury
  • Liked: 256
  • Likes Given: 1349
Emulator detection
« on: 23:25, 29 September 15 »
Just a quick question:
I need a emulator detection for an application. I've read in the Wiki the possibility to read out port &FEFE: if the returning value is different to &FF (= real CPC) then it's an emulator. But some emulators (like WinApe, Caprice) return the same value like a real CPC.
Is there a better way to detect if an application works (or not) inside an emulator?

Thanks.
HAL6128
...proudly supported Schnapps Demo, Pentomino and NQ-Music-Disc with GFX

Offline andycadley

  • Supporter
  • 6128 Plus
  • *
  • Posts: 913
  • Liked: 445
  • Likes Given: 73
Re: Emulator detection
« Reply #1 on: 01:02, 30 September 15 »
I'd say pretty much any "reliable" emulator detection is a bug.

Offline Zoe Robinson

  • Supporter
  • 6128 Plus
  • *
  • Posts: 708
  • Country: gb
  • I become a minor egg
    • ZoeRobinson.com
  • Liked: 747
  • Likes Given: 729
Re: Emulator detection
« Reply #2 on: 01:21, 30 September 15 »
Surely the point of any emulator is to emulate the original hardware, so it would return any value the actual CPC would return?

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Emulator detection
« Reply #3 on: 11:24, 30 September 15 »
Surely the point of any emulator is to emulate the original hardware, so it would return any value the actual CPC would return?
exactly!
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Emulator detection
« Reply #4 on: 11:25, 30 September 15 »
Just a quick question:
I need a emulator detection for an application. I've read in the Wiki the possibility to read out port &FEFE: if the returning value is different to &FF (= real CPC) then it's an emulator. But some emulators (like WinApe, Caprice) return the same value like a real CPC.
Is there a better way to detect if an application works (or not) inside an emulator?

Thanks.
HAL6128


My question:  What are you doing that doesn't work on emulators?

If you would share the code with me I can make sure my emulator works with your code and that I can tell other people how to make their emulators work better too :)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline AMSDOS

  • Supporter
  • 6128 Plus
  • *
  • Posts: 3.915
  • Country: au
    • index.php?action=treasury
    • Programs for Turbo Pascal 3
  • Liked: 1123
  • Likes Given: 1900
Re: Emulator detection
« Reply #5 on: 12:21, 30 September 15 »
Sprites Alive sets a New Frame Flyback Event Block (&BCD7) if you used that (along with the New Frame Flyback Event Block) then do a OUT &7F00,&C4, the next bit of code following that could simply state emulator.
* Using the old Amstrad Languages :D   * with the Firmware :P
* I also like to problem solve code in BASIC :)   * And type-in Type-Ins! :D

Home Computing Weekly Programs
Popular Computing Weekly Programs
Your Computer Programs
Updated Other Program Links on Profile Page (Update April 16/15 phew!)
Programs for Turbo Pascal 3

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.804
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2910
  • Likes Given: 1747
Re: Emulator detection
« Reply #6 on: 12:31, 30 September 15 »
A way to detect emulators is to check the FDC count.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Emulator detection
« Reply #7 on: 14:28, 30 September 15 »
A way to detect emulators is to check the FDC count.
fdc count?

fdc timings?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.804
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2910
  • Likes Given: 1747
Re: Emulator detection
« Reply #8 on: 15:21, 30 September 15 »
The RPM is around 300 on a real CPC, but never return the same value.
Just knowing that allow to said witch emulator is running...

Best, on a 3" floppy the RPM decrease on each track from 0 to 39 (40, 41) because the belt...
On a 3"1/2 floppy, the value don't change so much. (on HxC too)

Last year, I have made a little program showing that, if you remember my screenshot showing all emulators detected?
« Last Edit: 15:25, 30 September 15 by TotO »
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.834
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4273
  • Likes Given: 450
Re: Emulator detection
« Reply #9 on: 15:29, 30 September 15 »
Best, on a 3" floppy the RPM decrease on each track from 0 to 39 (40, 41) because the belt...

How does the belt and track number have any relation to the RPM??

Bryce.

Offline Lazy Dude

  • Supporter
  • CPC6128
  • *
  • Posts: 298
  • Country: england
    • index.php?action=treasury
  • Liked: 92
  • Likes Given: 162
Re: Emulator detection
« Reply #10 on: 15:36, 30 September 15 »
That's a belter of a question.

I'd like to say that all the emulators I have tried in 464 mode always have a virtual disc drive attached, there is no option to 'disconnect'  this and have a standard 464.

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.804
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2910
  • Likes Given: 1747
Re: Emulator detection
« Reply #11 on: 15:37, 30 September 15 »
How does the belt and track number have any relation to the RPM.
The belt allow the floppy to turn, but it is flexible and vagueness.
Depending if you are inside or outside the disc, this gap is more or less important and you never got the same RPM speed on a same track.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.804
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2910
  • Likes Given: 1747
Re: Emulator detection
« Reply #12 on: 15:40, 30 September 15 »
That's a belter of a question.

I'd like to say that all the emulators I have tried in 464 mode always have a virtual disc drive attached, there is no option to 'disconnect'  this and have a standard 464.
And a virtual PAL attached too... The memory is not properly handled for a 464.
As I know, only SugarBox handle all those things.
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.834
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4273
  • Likes Given: 450
Re: Emulator detection
« Reply #13 on: 15:50, 30 September 15 »
The belt allow the floppy to turn, but it is flexible and vagueness.
Depending if you are inside or outside the disc, this gap is more or less important and you never got the same RPM speed on a same track.

Ah, now I understand what you mean = The drift is more noticeable on the outer tracks. I thought you were claiming that the speed was actually changing depending on what track you were reading.

Bryce.

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.804
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2910
  • Likes Given: 1747
Re: Emulator detection
« Reply #14 on: 15:56, 30 September 15 »
Sorry, I'm tired and I have difficulty to explain things today.  :-\
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.503
  • Liked: 1048
  • Likes Given: 258
Re: Emulator detection
« Reply #15 on: 16:00, 30 September 15 »
On a 3" drive the speed is slightly changing according to the track, but this due to the head/disk contact resistance and motor torque.
Inner track (0) will spin faster than outer track (39). But the difference is in the 5 rmp range.
This should not be that visible on drive that use a direct drive like 3 1/2 drive.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Emulator detection
« Reply #16 on: 16:02, 30 September 15 »
The RPM is around 300 on a real CPC, but never return the same value.
Just knowing that allow to said witch emulator is running...

Best, on a 3" floppy the RPM decrease on each track from 0 to 39 (40, 41) because the belt...
On a 3"1/2 floppy, the value don't change so much. (on HxC too)

Last year, I have made a little program showing that, if you remember my screenshot showing all emulators detected?
I forgot about it :(

I understand now :)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.336
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2275
  • Likes Given: 3478
Re: Emulator detection
« Reply #17 on: 16:02, 30 September 15 »
And a virtual PAL attached too... The memory is not properly handled for a 464.
As I know, only SugarBox handle all those things.
So does Arnold WIP :)
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Offline TotO

  • 6128 Plus
  • ******
  • Posts: 3.804
  • Country: fr
    • ?area=showdonations;u=4
  • Liked: 2910
  • Likes Given: 1747
Re: Emulator detection
« Reply #18 on: 16:06, 30 September 15 »
@gerald: Are you sure about the motor torque? Because, if you goes up and down into the tracks number, the RPM value shift for the same track.
On my CPC, the tests shown that is more 2RPM than 5RPM between track 0 and track 39.
« Last Edit: 16:08, 30 September 15 by TotO »
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.186
  • Country: fr
  • Liked: 1145
  • Likes Given: 167
Re: Emulator detection
« Reply #19 on: 16:55, 30 September 15 »
In the Midline Process, from what I remember, I detected an emulator by getting the ID of the sector under the head, made a track seek, read the next sector, and checked that there was a difference of 2 in the ID. It was pretty reliable, but I guess emulators have improved since, so it may not be enough.
Targhan/Arkos

Arkos Tracker 2.0.0 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline dragon

  • 6128 Plus
  • ******
  • Posts: 1.491
  • Country: es
  • Liked: 634
  • Likes Given: 492
Re: Emulator detection
« Reply #20 on: 16:59, 30 September 15 »
Nothing
« Last Edit: 17:06, 30 September 15 by dragon »

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1982
  • Likes Given: 4650
Re: Emulator detection
« Reply #21 on: 17:39, 30 September 15 »
On a 3" drive the speed is slightly changing according to the track, but this due to the head/disk contact resistance and motor torque.
Inner track (0) will spin faster than outer track (39). But the difference is in the 5 rmp range.
This should not be that visible on drive that use a direct drive like 3 1/2 drive.


Isn't track 0 outside and track 39 inside (close to the center)?
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline gerald

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.503
  • Liked: 1048
  • Likes Given: 258
Re: Emulator detection
« Reply #22 on: 18:20, 30 September 15 »

Isn't track 0 outside and track 39 inside (close to the center)?
Yes  :D :doh:

Offline remax

  • 6128 Plus
  • ******
  • Posts: 1.121
  • Country: fr
  • Liked: 408
  • Likes Given: 451
Re: Emulator detection
« Reply #23 on: 19:11, 30 September 15 »

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1982
  • Likes Given: 4650
Re: Emulator detection
« Reply #24 on: 19:59, 30 September 15 »
Oh! You got a picture of my cat!  ;D
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus