Nurgle and Elmsoft



proudly present their first co-production:



Arnold TNG


A second Linux life at Warp speed



Based on the Arnold CPC emulator by Kevin Thacker

Coded during the nights and days at


Klassentreffen

May 29-31 2009, powered by Kangaroo MusiQue @ CMO.de


Arnold TNG is yet another CPC emulator for Linux, with a number of new features for power users:

The Warp factor

The CPC's Z80A CPU runs at 4 MHz. Imagine what would happen if it became more powerful: not via a higher clockspeed, but by completing instructions faster. So a 'NOP' instruction, which normally takes 4 cycles to complete (1 microsecond, Warp 1), might suddenly take only 1 cycle (0.25 microseconds, Warp 4), or even just 0.25 cycles (Warp 16). Interrupts still occur 300 times a second, the CRTC still draws 50 frames per second, but the Z80A simply provides much more computational power. In Arnold TNG, you can always press F7 to accelerate up to Warp 16, and F6 to slow down again. In fullscreen mode, the current Warp factor is shown on the right side.

The following things work at Warp >=2:

The following things do not work at Warp >=2:

Examples:


DrillerThe game Driller by Incentive Software introduced the fascinating 'Freescape' 3D engine, which took the Z80A to its limits, and was just a bit too slow. Now you can enjoy the game at Warp 16: Press X/S to set the step size to 50, press Z/A to set the rotation angle to 5 degrees, then use the cursor keys and N/M to fly around in a 3D world that is suddenly so smooth, that Amiga and Atari ST would be jealous. Note that the clock in the top right corner does not run faster, so you still got all the time you need to complete the game. The same holds for follow-up games like Total Eclipse.


DrillerThe famous racer Burnin' Rubber does not adapt like Driller above. At Warp 2, it runs not only twice as smooth, but also twice as fast. Surprisingly, the doubled smoothness ensures that the game is still perfectly playable and great fun. It's comparable to Nintendo's F-Zero concept: once you finished the tracks, you enter the next, faster league. The same holds for other cool CPC racers like Wec Le Mans, Chase HQ or Power Drift: The higher the Warp factor, the better they look. And how fast can you go?

Ideally, a CPC game should measure how long it takes to redraw the screen, and then adapt the game engine to proceed with just the right step size. In such a game, the Warp factor would only influence the smoothness, but not the speed. Please tell us about all the games you find that show this ideal behavior...



OpenGL fullscreen mode with smooth zooming


Arnold TNG uses the power of today's GPUs from nVIDIA and ATI to provide smooth OpenGL based zooming. Just press F2 to enter fullscreen mode, then use Ctrl+CursorUp to zoom in and Ctrl+CursorDown to zoom out. This way you can optimally fit the scene to the screen, no matter if it's a shrunk-down game or an overscan demo. Arnold TNG also detects the physical resolution of your screen, and ensures that the CPC screen is displayed with the correct aspect ratio, no matter if you are sitting in front of a 4:3 or 16:10 screen.

ZapTBalls1
ZapTBalls2
ZapTBalls3


Action at 60 frames per second

Despite their low resolution, many CPC games (Ghosts'n'Goblins..) and demos look great because they run with perfect smoothness and update the screen 50 times per second, in sync with the screen refresh rate. This normally doesn't work with emulators, since today's screens have a higher refresh rate, causing a loss of smoothness. Arnold TNG can make use of the fact that most screens can operate in a certain refresh rate range, for TFTs that's usually 60-75 Hz (most TFTs display the current refresh rate in the on screen menu). To get perfect smoothness, you need three things:

First, set your screen to the lowest refresh rate it can support (since TFT screens don't flicker, a lower refresh rate doesn't matter). E.g. for nVIDIA cards, the recipe is as follows:
You need to edit the /etc/X11/xorg.conf file. Before making any changes though, back it up so you can restore it if you break anything.


cp /etc/X11/xorg.conf /etc/X11/xorg.backup-working.conf

Now open up the file as root to edit it. Under Section "Screen", there will be a SubSection "Display" area. On the Modes line, put your desired resolution(s) followed by an underscore and then the desired refresh rate. For example, if you want to run at 1280x1024 at 60 Hz, put:


Modes "1280x1024_60"

Normally, though, this won't override the refresh rate if your monitor is telling the driver something else. To force the driver to ignore the monitor, paste this inside Section "Screen":


Option "UseEDIDFreqs" "False"

Finally, search for VertRefresh and make sure you are not trying to set a refresh rate higher than the largest number in that field. Always make sure your monitor is actually capable of the resolution and refresh rate combination you select before you override it manually or you may permanently damage it. Save the file, restart X with Ctrl-Alt-Backspace and you should be in your desired resolution/refresh rate combination.

Second, use /usr/bin/nvidia-settings to enable all 'Sync to VBlank' options you can find.

Third, run Arnold TNG with the refresh rate you set above plus 2, usually 62 frames per second:


./arnold -fps 62

As a result, you should now have perfect smoothness with linear interpolated scaling in fullscreen mode, which makes the emulator essentially indistinguishable from a real CPC. With one side-effect: the CPC runs 20% faster, which makes fast games like Zap'T'Balls a bit more challenging ;-)


Joystick emulation

In case you want to play on your notebook in the train and don't have you joystick with you, simply press F5 to toggle joystick emulation. Then the joystick is mapped to the cursor keys, the left Window key is Fire1, the left Alt key is Fire2.


How to get Arnold TNG for Linux

Arnold for Linux is maintained by Nurgle at this site. Until Nurgle has finished the next release, you can download the pre-compiled beta version of Arnold TNG here:

arnold_tng.zip

If you decide to re-run ./configure, you currently need to add -DHAVE_GL and -lGL to the makefile manually.
In case you want to know what has changed, here are the actual patches applied:

arnold.c

How to use Arnold TNG for Linux

Here is a usage example based on the game Zap'T'Balls - The Advanced Edition:


Have fun with your CPC!