Friday, October 16, 2020

Total 4play - Leveraging Total Replay's amazing infrastructure

Total 4play is a hard drive based collection of arcade style games which have been modified to support digital joystick gameplay, specifically via the 4play card. This compilation has only been made possible due to an amazing bit of infrastructure, called Total Replay, which is what Total 4play is based upon.

Total Replay can be described as a menu selection system and compilation of Apple II games. Compilation sets of Apple II games have been done before but nothing comes close to having the features of Total Replay. To obtain valuable disk space other game compilations have, in the past, resorted to removing parts of the game such as the title screen to cram games together. In contrast, Total Replay aims to preserve all the original content. It uses relatively modern compression techniques and relentless byte saving optimisations to make up for the extra disk storage space needed. The software contains game help pages, original title pages, game demos, an intelligent game title text search engine, original box art where possible, a configurable cheat mode, Control-Reset feature that gets you back to the main menu, a quick loader and bug/compatibility fixes for certain storage media, memory and sound cards. These are just a few of its amazing features. In many ways this software is more than just a game compilation, it's a way to immerse one's self in retro gaming nostalgia but without all the annoyances of the era, such as compatibility issues and relatively slow loading times.

Version 1.0 of Total 4play has be released with twenty converted games. The majority of these games have already been converted to support the 4play. However, these conversions have been done on floppy disk images. There are several advantages to using the Total Replay infrastructure instead of using disk images. These advantages include :-

1. Better grouping of games in one easy usable format. Faster loading and switching between games. Seeing title screens and demos before starting the games.

2. Being able to use any slot of the Apple II for the 4play card. This was more difficult to achieve with individual floppy disk conversions.

3. Having information in the help page that describes which input format (keyboard, Apple II Joystick, Joyport or Gizmo) has been overwritten. Saving the need to look this information up from another source.

4. The second stage of the conversion process (the storage of the changes) is much simpler. In Total 4play this involves applying the changes to the game during the start up sequence where as with the individual floppy disk conversion this meant finding the right places on the disk to modify the code. Having code go across sectors or code that was duplicated multiple times on the disk or code that was compressed made the conversion difficult to perform.

You would have thought that after twenty or so conversions that the conversion process would get simpler due to reoccurring code. However, this has not been the case so far. Apart from the games that were sequels, the code has been different in every one of my conversions. It amazes me how many different ways something can be written in assembly language that performs the same function.

This project will be ongoing. The first round was to work out the infrastructure and get some experience in putting together the games where "stage one" of the conversion process had already been done. Therefore, these first twenty games might not be the best examples of where digital joystick gameplay shines. I missed including some games like "Boulder Dash II", "SuperPuckman" and "Super Taxman 2" because these games were not included in the Total Replay list. The next round of conversions is to work out how to include these into the infrastructure then work on games which make the most sense and the ones which I can still play with for hours on end ie "Snakebyte", "Mr Do.", "Hard Hat Mack", "Pooyan" etc.

Digital gameplay is not not for everyone. It does take away from that nostalgic Apple II experience but does bring that arcade experience closer to the home computer environment. Some people prefer playing games using game controllers over joysticks but my preference is for the arcade joystick, which in my opinion, adds another layer to the experience. For now my original Apple II joysticks have been put away and I'm happy to let other users play with the digital ones. These are much easier to replace.

A big thanks to everyone who made Total Replay possible and for your help in getting me started on my variant. I suspect that Total 4play is not going to be the last offshoot of this wonderful bit of infrastructure. It has the potential to transform many other gaming genres. Think "Total Adventure" or "Total Education". 

Total Replay:


Total 4play V1.0 (20 games):


Sunday, August 23, 2020

Modern Monitor Solutions - Display Lag

Early home computers were built around the concept of using televisions for a source of display. As monitors became more affordable, monochrome and then colour monitors became the norm. These solutions rely on CRT technology but as time goes on it becomes harder and harder to support, in terms of replacement or in terms of repair. Numerous creative solutions have been designed and built to cater for an ever-increasing demand of CRT screen replacements. A lot of these conversions have focused on getting an image that is as close as possible to the CRT looking display. However, is this being done at the expense of other factors such as the display lag? Do you find it difficult to match that high score you got as a teenager on your favourite game? If so, then maybe it's not due to old age. It may be due to your monitor solution. I compared the display lag on several of today's solutions and I found mixed results.

For those enthusiasts using retro computers for word processing, programming, communications and hardware hacking, the display lag will hardly matter but for the retro gamer it’s an important factor to consider. Everyone will have a different perspective on how authentic they wish their retro experience to be. To some, having to replace their CRT display with an LCD solution would seem unthinkable while to others playing a game on an emulator is nostalgic enough. It will all depend on your time, resources, budget and your level of the "Obsessive Compulsive Disorder". Which is more authentic, playing on a cycle accurate emulator or a physical computer with a modern-day monitor? This is what I wanted to find out.

Frame strip showing a three frame (60ms) delay.

It's generally considered that a lag of 30ms on a display is not going to be noticeable. When you consider one screen refresh will take 20ms when displaying at 50Hz or 16.67ms when displaying at 60Hz then you hope your monitor is not going to have a lag of more than a frame or two. Even 30ms sounds quite a long time to me, considering today's LCD gaming monitors tend to advertise lag to be under 15ms. If you are sitting in front of a computer with just one monitor, then you're probably not going to notice any lag. I first noticed it when developing the A2 Video Streamer which sends video signals over USB to display on a modern-day computer. I wasn't surprised to find that sending video data over a USB feed was going to cause a delay but what I do find surprising is seeing large delays in some modern-day monitor solutions, especially on those that I assumed to have no buffering. Every monitor is going to have lag. Even a CRT monitor. However, the lag on a CRT monitor is going to be in the nanosecond range. For now, I just wanted to test the display lag using tools I had at my disposal. What I wanted to do was to compare a CRT monitor with other video solutions to see how much difference there was. I figured I could do this with a bit of programming and a device to record the video of two monitors side by side.

I started off by writing a simple program that displays a two-digit number at the start of each text line. The number is updated by one and rewritten to the buffer page every time a vertical blank happens. That way the number represents each display frame. Vertical blanking is a pain to write on the Apple II because it is done differently for each of these groups of models 1.Apple II/II+, 2.Apple IIe, 3.Apple IIc/IIc+, 4.Apple IIGS. Since the II/II+ code either requires a hardware modification, extra hardware or substantial amount of programming (specifically lookup tables), I left the code supported only by the computers I had on hand. That is all but the II/II+. Once the program was written, tested and running, all I had to do was to setup each of my computers (IIc, IIe and IIGS) with two monitors at a time and video the results. To do this I used an iPhone and two apps, ProMovie and MoviePro. These apps allowed me to use a predefined frame rate (~50fps and ~200fps for 50Hz). The iPhone seemed like a reasonable option for the accuracy that I was after.

The selected recording frame rate, using the iPhone, was not exact nor was it an exact match to the Apple II's output frame rate, but this did not turn out to be an issue. When looking at the video frame by frame, it allows you to see a scan line coming down the page very slowly. The scan line differences from both monitors can then be compared. Watching the recording of a CRT monitor shows the frame numbers changing over the scan line. However, the recordings of the LCD monitors are not as clear. The change is more gradual, and I suspect this is because filtering is being done to merge the video frames. This makes the comparison process more difficult.

Due to the slight difference in scanning rates between the IIGS and the Video Overlay Card (VOC) we get to see some interesting line updates.

The results are as follows. I will update this list as more test data becomes available.

Model Video 1 Video 2 Lag (Frames)
IIe Composite -> IIc Monitor (Composite) AIIE 80COL64K MEMORY EXPANSION AND VIDEO -> Sony PVM-9045QM Monitor (Composite) 0
IIe Composite -> IIc Monitor (Composite) AIIE 80COL64K MEMORY EXPANSION AND VIDEO -> Sony Portable CD/DVD Player DVP-FX720 (Composite) 0.5
IIe Composite -> IIc Monitor (Composite) AIIE 80COL64K MEMORY EXPANSION AND VIDEO -> Dell U2410 Monitor (Composite) 3
IIc Composite -> IIc Monitor (Composite) Apple IIc Video Expansion -> PAL Modulator Adapter -> Sony PVM-9045QM Monitor (Composite) 0
IIc Composite -> IIc Monitor (Composite) Apple IIc Video Expansion -> BeagleBoneBlackHDMI -> Dell U2410 Monitor (HDMI) 2
IIc Composite -> IIc Monitor (Composite) Apple IIc Video Expansion -> A2 Video Streamer -> PC Laptop Inbuilt Monitor (USB) 2.5
IIGS Composite -> IIc Monitor (Composite) Video Overlay Card -> Sony PVM-9045QM Monitor (RGB) -0.5 to 0
IIGS Composite -> IIc Monitor (Composite) Video Overlay Card -> Sony PVM-9045QM Monitor (Composite) -0.5 to 0
IIGS Composite -> IIc Monitor (Composite) IIGS RGB -> IIGS Monitor (Analog RGB) 0
IIGS Composite -> IIc Monitor (Composite) VidHD -> DELL P2719H Monitor (HDMI) 1
IIGS Composite -> IIc Monitor (Composite) VidHD -> HP P242va Monitor (HDMI) 1
IIGS Composite -> IIc Monitor (Composite) IIGS RGB -> GBS-8200 -> Samsung SyncMaster 740N (VGA) 1
IIGS Composite -> IIc Monitor (Composite) VidHD -> DELL 2407WFPb Monitor (HDMI) 1.5
IIGS Composite -> IIc Monitor (Composite) VidHD -> Dell U2410 Monitor (HDMI) 1.5
IIGS Composite -> IIc Monitor (Composite) IIGS RGB -> GBS-8200 -> Dell U2410 Monitor (VGA) 2.5
IIGS Composite -> IIc Monitor (Composite) IIGS RGB -> GBS-8200 -> VGA to HDMI transcoder -> Dell U2410 Monitor (HDMI) 2.5
IIGS Composite -> IIc Monitor (Composite) IIGS RGB -> Dell U2410 Monitor (Component) 3

The frame counter disk image can be found here.

Friday, August 14, 2020

Game Controller - H.A.L. Labs Gizmo - Cloning the Cloner

In 1981 H.A.L. Labs released Taxman, a direct Pac-Man clone on the Apple II. Atari was not happy since they held the rights to Pac-Man so they asked H.A.L. Labs to stop selling the software. Atari took Taxman, changed the title and then went on to release the game as their own official Pac-Man for the Apple II platform. Not to be outdone, Taxman's developers re-created the game but this time they made sure that there were enough differences to keep it away from Atari's clutches. It was called Super Taxman 2 and in terms of game play, it was a big improvement. The ghost characters no longer looked like ghosts. The maze layouts were different. However, the running speed and the ghost artificial intelligence made it feel more like a real Pac-Man game.

In their pursuit of performance, the developers became frustrated with the slow speed of the Apple II's analog joystick. In response they created their own joystick solution. They built the Gizmo, which is an adaptor that allows you to use digital joysticks on the Apple II so long as the software is coded to detect the special hardware. In Super Taxman 2 there is no support to play using the Apple II Joystick. It's either the keyboard or the Gizmo. Some levels are so fast it's barely controllable. Try level 88 and you'll wonder if you are playing on a standard Apple II or if you're running via an accelerator.

It was the Gizmo adaptor which interested me the most. This adaptor allows a single digital joystick to be connected to the Apple II and be able to control specific software titles. I could only find two titles which have been adapted to use the Gizmo, Super Taxman 2 and Vindicator (a Robotron clone) also released by H.A.L. Labs. I was unable to locate any information on the construction of the Gizmo so I headed in the only direction I had available to me and that was to reverse engineer the hardware from the software. My investigation led me to conclude that the Gizmo works in a similar way to the Atari Joyport ( which is also an adaptor that allows digital joysticks to be used with the Apple II. However instead of multiplexing the Apple II game port's annunciator output onto three of the push button lines the Gizmo multiplexes the game port's three annunciator outputs onto a single push button line.

To test my assumptions, I put together a board and luckily it worked first go. Here is the schematic for the Gizmo and the truth table used by the software. I'm sure that H.A.L. Labs being in the business of cloning (not all their software titles mind you) are not going to pursue me for recreating their hardware. If the hardware had taken off then doing this back in the day may have been a different story.

If you fancy getting that high speed digital joystick experience without having to go through the pain of creating an adaptor for just two software titles then you will find that I have modified the games to work with the 4play card ( Since the Gizmo only supports one trigger button it's a pain to play the game Vindicator. This game contains two fire actions (one for shooting and one for the screen bomb). Having to use the keyboard to access the screen bomb annoyed me greatly so in the 4play conversion the screen bomb is mapped to the second trigger button. This makes playing the game much more enjoyable.