Agon Light Joystick Test 1

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.


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;
}

It kind of works, sort of…

Subscribe

Support

Recent Content

  • Chromebook Facial Control Is Cool August 21, 2025

    ...
  • The Reason You Quit Coding Projects and What to Do About It August 21, 2025

    ...
  • The Dark Art of DOS Audio: PC Speaker Tricks and PWM Madness August 11, 2025

    ...