I’m working on getting a joystick port working on my Agon Light. They don’t come with joystick ports, but there is a set of GPIO pins that can be read through assembly.
![](https://ncot.uk/wp-content/uploads/2024/01/PXL_20240131_201457274.MP_-768x1024.jpg)
Here’s my setup, the Agon Light is in the white box, my trusty PowerPlay Cruiser joystick from the 90s is plugged into a quickly bodged together adapter.
This code lets me read the state of the GPIO pins to detect which ones are set by the joystick
unsigned char get_port(uint8_t port) {
unsigned char output;
__asm__ volatile (
"ld b, 0 \n"
"ld c, %1 \n"
"in a, (c) \n"
"ld %0, a"
: "=d"(output)
: "d"(port)
: "cc", "memory", "b", "c", "a"
);
return output;
}
Code language: JavaScript (javascript)
It kind of works, sort of…
2 responses to “Agon Light Joystick Test 1”