I received feedback from Irgendwer that game is great candidate for mouse support so I decided to add this quick fix. I checked Irgendwer’s routine which he used in his game ECKN+ and it took me about an hour or two to make it work… at least in emulator.
Gameplay video:

I don’t know any controller other than joystick, I believe I have not seen paddle in real not even mouse nor touch tablet connected to Atari, so basically I had no clue how it works.

Mouse interface I use is called CMI8 and it is also fully compatible with Atari Touch Tablet. Irgendwer told me that it just uses Paddle0 and Paddle1 for horizontal and vertical coordinates, so I read POT0($D200) and POT1($D201) and wrote respective values to addresses which hold X and Y positions of cursor.

Sounds pretty simple, actually it was quite simple… but it also required to setup input in Altirra emulator which was not something I do often, so it took some time to make it work.

Mouse click is read from 1 bit of $D300 (PORTA) so it required simple masking (AND #%00000100) to get state of mouseclick (Paddle0 trigger). Everything worked just fine until Irgendwer tried it on real hardware. Result was (as you might guess) that game was not responding to mouse movement at all.

Irgendwer told me I cannot simply read POTx values, because they require kind of initialization. His game ECKN+ uses OsRom and he read those values from shadow registers (which should make it work). Thing is that Xirius Defect does not use OsRom so I have no shadow registers to use. So I ran Altirra debugger and traced OsRom code where POT0 value is written to shadow register and found out that there is one more instruction which I was missing. After successful read of POTx registers there is need to write any value to POTGO ($D20B) which will reset reading of potentiometer values. I checked memory map in Mapping The Atari and saw that this information is there, but I read it too swiftly that I did not noticed that, especially when game was working in emulator without such reset.

Potentiometers can return values from 0-228 ($E4) which is quite ok when using mouse, but it has specific behavior when Atari Touch Tablet is used. It returns $E4 when you lift your pen from tablet so cursor then jump to right edge of playfield… this could be ignored, but atari touch technology from ’80 was not that good as touch panels these days so sometimes it does not detect pen on tablet when moving which results in cursor flicker/jump between current position and right edge of playfield. This glitch was removed simply by not updating cursor position when POTx returns value $E4.

Irgendwer reported this behavior to Phaeron (author of Altirra emulator) so upcoming version of Altirra will work same as real hardware (btw Atari800win plus 4.1 has same issue) and it will require potentiometer reset by POTGO in order to receive updated POTx values.

It took 2 weeks to make this “quick” fix working. It was really torture because of bug in both emulators.

Controller selection has been added to title screen (press Select key to change between joystick and CMI08/Atari Touch Tablet). Game starts after pressing Start key (it was joystick fire button in Abbuc version). Also delay between title screen and info screen has been added so no more info screen skipping.

I also experimented with ST/Amiga mouse driver, but it sucked a lot (movement was too quirky and it feels like mouse being operated by drunken monkey) so I removed it from game.

Those are changes made to Abbuc version of game, so now it carries version number 1.1.