GBKiss.org

Infrared Communication

All GBKiss cartridges are capable of wireless communication over infrared.

Physical Layer

At the physical layer, infrared communication is handled by turning the infrared LED in each cartridge on and off for a fixed period of time. There seem to be three different pulse lengths:

  • 10 units (~75μs?): zero bit
  • 18 units (~150μs?): one bit
  • 35 units (~300μs?): stop bit

Network Layer

Each time a sender communicates with a receiver, it initiates a handshake, then sends a packet with the following data:

  • The literal bytes Hu ($72, $15).
  • The contents of its eight registers in the order falhedcb.

Transport Layer

On the receiving side, a listening device runs a loop, accepting register packets. Each time it receives a packet, it checks the sent a register and executes the numbered command from the IR op table with the sent registers.

The most useful operations are:

  • $00: close connection successfully
  • $08: read from remote WRAM
  • $0B: write to remote WRAM

Application Layer

By convention, before software begins listening for infrared communication, it first writes 2 identifier bytes to a fixed location in memory, then calls IRListen.

When the sender initiates communication, it first issues an IRRead call for the identifier address and checks if the identifier bytes are expected. If not, it terminates the connection.