Welcome, Guest. Please login or register.

Author Topic: PC still playing Amiga catchup  (Read 221399 times)

Description:

0 Members and 48 Guests are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #89 from previous page: June 06, 2009, 12:31:25 PM »
Quote from: amigaksi;50955
You haven't shown PC doing faster joystick port input so we can move on to the next advantage Amiga has over PC.

You should disassemble the game and find its input handling code before claiming it is using 1kHz sampling. As I've pointed out, you can't base this assumption on attempting to see what minimum sampling rate you need to use to replicate it. I can produce a signal on a machine that I need to sample at 44kHz to get it sounding "just right", but this by no way suggests the signal source is operating at a comparable resolution.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #90 on: June 06, 2009, 01:09:55 PM »
Quote from: amigaksi;509560
Given the fact that you can get a millisecond state-change reading from a joystick, it should be clear that sampling at 1Khz is useful.  Just like sampling audio at higher rates is useful although most frequencies are accounted for even if you sample at 30Khz.

Sure, I'm not dismissing basic sampling theory here. What I am suggesting is that even if the joystick is capable of producing millisecond changes, are any amiga games applications actually sampling at that resolution? I really dont think it is likely. Most games have a lot more to do than read the joyport a thousand times a second.

Quote
Getting millisecond responses is not necessarily electrical property of micro switches.

Not necessarily no, but still more than likely. You then have the problem of figuring out which was a genuine pulse and which was a switch bounce. I don't really see how you can tell the difference, no matter how high a rate you sample at.

Quote
>3) You can't really infer what the sample rate of an application is just by attempting to sample the signal yourself and reproduce it the behaviour of the original application from it.

But you know it can be theoretically anything so the higher the sampling rate the better.  Heck, even if you consider it noise, it is actually happening and should be taken into account.

Well, you know it's not likely to be faster than the main loop of the application. Given common programming practises, it's also unlikely to be more than once per frame for most old amiga titles, though there may be examples to the contrary. I'd expect code that reads from the joyport register address once per frame and whatever value was there at that particular instant is taken at face value by the application.


Quote
>What you should try is sending simulated pulses at different rates to the joyport from another device from which you can control the pulse of and see wether or not the game is capable of responding to it in a predictable fashion.

It is being sent from a PC to an Amiga/Atari via a PCI parallel port.

Can you elaborate on that?

Look, here's a real experiment that can be attempted and repeated:

Why not try sending completely synthetic 1ms wide pulses once a second for the fire button and seeing how the game responds. If it fires every second then you know the sampling must be high enough (or at least has some clever latching). If, OTOH, it fires only very sporadically, it isn't likely to be sampling at a high rate.

By widening the pulse until you get your 1 fire event per second being registered systematically in your application you will get a better appraisal of what the sampling period is likely to be. It will at least be in the right order of magnitude.
« Last Edit: June 06, 2009, 01:19:05 PM by Karlos »
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #91 on: June 06, 2009, 03:19:19 PM »
Ignorant bliss is the world in which the sun is always shining, the Amiga is still the most popular home computer in Europe, PC's still have CGA displays, 286 processors, no sound beyond the beeper and nobody minds having to reset their computer, regardless of type, when it has a critical brainfart.

In some ways, I guess I'd really like the world to be like that still, but reality is pretty different. My amiga still brings me the joy of the days when things were that much simpler, however, the days of sneering at PC's is long gone for me. In the end, open hardware specifications and modular design won the day out there in the greater world of computing.
« Last Edit: June 06, 2009, 03:21:46 PM by Karlos »
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #92 on: June 06, 2009, 03:40:31 PM »
I'd prefer to see a controlled experiment of the type I suggested earlier. I'm even thinking to try it myself :)
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #93 on: June 06, 2009, 05:12:12 PM »
I know how to convert period to frequency, thanks. The point is that you are being very loose with your terminology.

No crystal timer is guaranteed to allow you to time something to exactly 556ns, no two amigas run at exactly the same speed, which is what your earleir posts were claming. No two PC's do either. They all operate within a certain tolerance

If you had stated your case in bus cycles, rather than nanoseconds, I wouldn't have pointed this out. As it goes, I was being deliberately pedantic in this regard so that you could appreciate how some of the pedantry in your argument sounded to the rest of us.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #94 on: June 06, 2009, 05:42:18 PM »
Quote from: amigaksi;509627
I still claim it's 558ns accurate.

You can claim it all you like, but that doesn't make it true. It's approximately 558ns. An accurate figure, determined by a high precision scope might record 555, 559. I totally agree with you that it doesn't matter in system since the circuitry will all be running at whatever speed the clock gives, but the claim it is accurate to 558ns is not true at all. You have to quote a margin of error for any real measurement.


Quote
All Amiga audio interrupts, cia interrupts, copper lists run at the same speed (NTSC).

They run in the same number of hardware cycles. As the hardware cycle durations are subject to the timing variances of the oscillator, from system to system they do not run at the same frequency and therefore not a the same speed.

Again, this is deliberate pedantry, but it is true that amiga chipset hardware does not run at exactly the same speed everywhere. It only runs with the same cycle pattern everywhere.

For example, some years ago, Redrumloa was experimenting with underclocking the main oscillator on the motherboard as he observied it was giving a speed up as based on common amiga benchmarking programs where the native chipset wasn't being used for video etc.

I was intrigued by his suggestion and a bit sceptical too, so I wrote some software to try and verify his observation. It turned out that all of the original benchmark programs were using EClock to time operations. So, as the system was downclocked, the benchmarks went up entirely as a result. The benchmark code was still running at the same speed but the clock timing it was simply running slower. I was able to test this assertion by using the PowerPC to measure a delay generated using the timer.device and observe that the actual delay generated was getting longer in tandem with the lowering clock speed.

Cycle for cycle, Reds underclocked system was still running the same pattern as any other, but it certainly would not have been accurate to 556 ns.
« Last Edit: June 06, 2009, 05:57:20 PM by Karlos »
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #95 on: June 06, 2009, 05:51:29 PM »
Quote from: amigaksi;509629
I would only be able to test that with games that allow you to fire more than once before the previous missile reaches its target or goes out of bounds.  But anyone can easily right an application that reads the joystick port and moves a sprite around within a few machine cycles and he doesn't have to wait for any VBI.

The 1 second periodicity was only an example. You could trigger it every 10 seconds. What matters is whether the game responds to the 1ms wide pulse whenever it is issued. If it doesn't then the game simply isn't sampling at a rate that guarantees a sample is read within a 1ms window - ie it isn't sampling at 1kHz. By gradually increasing your pulse width to the point where you get a consistent response (eg 9 in 10 pulses trigger the action) then you know you are in the right approximate resolution of the application's sample rate.

As for the rest, they could but that still does not demonstrate that any particular game title samples this quickly. You need to actually test with real applications that were written, not software you write purely to demonstrate that it is possible.

Quote
Joystick port is digital and can be read anytime unlike the potentiometers.

PS, see my other crazy idea to allow 1kHz sampling an analogue joystick. In case you can't find it, a quick recap:

Use the X/Y potentiometers to adjust the left/right volume of a simple hardware oscillator running at several kHz that is sampled by the soundcard at 44.1 kHz. Calculate the RMS power for frames of 441 samples (one frame for left and one frame for right) and look up the RMS value in a suitable calibration table to determine X and Y position.

Et voila, 1kHz sampling of analogue joystick and done using the soundcard just like the good old days :lol:
« Last Edit: June 06, 2009, 06:32:06 PM by Karlos »
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #96 on: June 07, 2009, 03:46:18 PM »
Quote from: smerf;509783
Hi,

@Karlos,

Huh!

I can tell how outdated your machines are, I upgraded my computers to an Atomic frequecy timing standard about 5 years ago. My machines are very stable and very accurate. My computer clocks are right on the money, they vary by maybe pico pico second every 20 years.

smerf


That's the sort of thing you'd expect in the Fallout universe, eh? :lol:
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #97 on: June 07, 2009, 04:46:49 PM »
Quote from: smerf;509791
Hi,

@Karlos,

you bet ya!

Hey don't knock out fallout 3 man, this is one of the best games I played in years, they just came out with a new episode that i bought for my son, now he is up in Alaska. Have to wait for him to get done playing so I can.


Moi, knock Fallout 3? Why my dear fellow, I have completed it twice and clocked over 250 hours in there in total :)

I have the first two DLC packs but I don't have Broken Steel yet. Needed to wean myself off the addiction a bit :)

Quote
You really need a good machine because it pounds the hardware don't you know.


It's not that bad. The lack of real time shadows means it runs a lot faster than some titles. If you want something that really pounds your hardware, run Crysis with all the detail jacked up. I dread to think how intensive it's lighting engine is alone.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #98 on: June 08, 2009, 08:37:31 PM »
Quote from: amigaksi;510012

>PS, see my other crazy idea to allow 1kHz sampling an analogue joystick. In case you can't find it, a quick recap:

>Use the X/Y potentiometers to adjust the left/right volume of a simple hardware oscillator running at several kHz that is sampled by the soundcard at 44.1 kHz. Calculate the RMS power for frames of 441 samples (one frame for left and one frame for right) and look up the RMS value in a suitable calibration table to determine X and Y position.

Computing an on-going RMS may slow things down though.  How about, just looking for a max/min value every millisecond or so and using up 4 channels to get a digital joystick out of it.

For a single pot value, doing 441 multiplications, 440 additions (most of which could be optimised using multiply add style instructions) and a square root might take at most a few hundred cycles. You can even get rid of the square root all together and just have the values in your calibration table squared and look up the nearest match. However, even with the square root, on a GHz class machine that's peanuts, you are looking at microseconds. Given that searching through the 441 samples will require as many memory accesses, which are by far the slowest operation in the task for a modern CPU it probably wouldn't be faster.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #99 on: June 08, 2009, 10:49:17 PM »
I wasn't encoding them into a single channel, I was suggesting the attenuation of the output of one mono oscillator separately into left and right (the volume levels for left and right representing representing X and Y respectively) and then analysing the RMS values of each 441 sample frame for left and right independently to infer the X/Y pot values.

The reason for RMS is to calculate a representative value since you'll never get an exact number of oscillator cycles (regardless of waveform shape) in a single frame.

If you are going to go to the trouble of 1kHz sampling of your analogue joystick, there's no point in doing it half arsed, eh?
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #100 on: June 08, 2009, 11:20:39 PM »
Quote from: bloodline;510045
Well... I can't really see the point of a joystick sampling at 1Khz... so it wouldn't make much difference, in reality... :)


What? Are you insane? :p
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #101 on: June 09, 2009, 12:27:59 AM »
That was a fine looking machine, to be fair :)

Pity Commodore never thought to market the Amiga comparatively. Idiots.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #102 on: June 12, 2009, 06:53:53 PM »
Quote
I would rather use some check for I/O port to escape from a critical timing/computational loop than calling some GetMessage() API function which may call thousands of other functions and may not even return!


Sure, because the hardware equivalent bus error, context switch to supervisor mode, exception frame generation, processing, return from exception - all if you are lucky, is just the most efficient thing ever.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #103 on: June 12, 2009, 11:49:36 PM »
All this harping on about API's being slow and metal banging being faster:

1) Metal banging is fun but fails the moment the metal changes, even slightly

2) Any loss of processor cycles involved in going down the API route is more than made up for in the fact that systems employing API access to devices tend to be running on CPU's orders of magnitude faster than the 68K.

Cycle for cycle, direct hardware access wins, but when your API is running on a machine that can execute billions of instructions per second, worrying about a function call that might execute a few dozen instructions to get the job done is quite simply nothing short of laughable.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: PC still playing Amiga catchup
« Reply #104 on: June 13, 2009, 10:48:28 AM »
Quote from: amigaksi;510955

>You have not shown that DirectX/OpenGL/OpenCL/Cuda/X are flawed.

That was not my argument, but there are bugs since they are up to version 10.0 DirectX or something around that number.


Let me get this straight. Something must be buggy since it exists in a high version number?

It's true that there are bugs in all versions of DX, like there are in any software (and hardware), but this isn't the reason it's up to V10. It's up to V10 due to the inclusion of more and more features.

You only have to look at the featureset of a typical DX10 game compared to one that'll work on DX3 to know that :lol:
int p; // A