Working with Inputs

Reading the controllers in Minicube64 is super easy.

Controllers are read by using the INPUT registers located at memory address 0x0102 and 0x103 for the first and second controllers respectively.

Each controller is mapped to a byte, and each button to a single bit.

You can useINPUTandINPUT+1to read each controller separately.

Here is an example to test if the Start button on Controller 1 was triggered:

CheckStart:
    lda INPUT
    and #%00001000 ;or use #$80
    beq SkipStart
    ;do something
SkipStart:

With the and instruction you can test foor any specific bits. This means you can also check for multiple buttons at the same time, for example any button that is not directional:

CheckOther:
    lda INPUT
    and #%00001111
    beq SkipStart
    ;do something
SkipOther:

Controller 2 is not currently implemented.

Last updated