I/O

From Glitch City Wiki
Jump to navigation Jump to search

I/O (input/output) refers to how a computer communicates with the outside world. In the Game Boy/Color's Z80-based processor, registers for the input/output range are allocated 0xFF00 to 0xFF70 on the memory map.

The Game Boy/Color will interact with various components on an external Game Pak, such as the ROM, RAM, Memory Bank Controller, Real-Time Clock, while I/O is also used for details independent of the Game Pak, such as the sound/speaker, internal infrared port (Game Boy Color only). There is also an I/O register for OAM DMA, represented by FF46 on the memory map.

The Game Boy/Color has included a huge amount of communication peripherals. One of the most commonly used is the Link Cable; which inspired the Pokémon concept as Satoshi Tajiri was a bug catcher during his childhood, and there were also inspirations from Menko card games, and kaijuu media such as Kamen Rider, Ultraman. Additionally, the Game Boy Color (but not the Game Boy Advance) included a built-in infrared port.

The Japanese version of Pokémon Crystal communicated over the Internet using a mobile phone and the Mobile GB Adapter, but the Mobile GB Adapter fell into relative obscurity and never left Japan.

DMG mode

  • $FF00 - Joypad (also used for Super Game Boy command packets using P14 and P15 output lines)
  • $FF01 - Serial transfer (used for the Link Cable, also used in the Turbo File GB's communication protocol)
  • $FF02 - Serial control (used for the Link Cable, also used in the Mobile GB Adapter (64KB/s, bits 0 and 1 high), and the DMG-07 4-Player Adapter for "ping" packets)
  • $FF04 - Divider
  • $FF05 - Timer counter
  • $FF06 - Timer modulo
  • $FF07 - Timer control
  • $FF0F - Interrupt flag (interrupt vector 0058 is also requested after a Link Cable transfer[elaboration needed])
  • $FF10-$FF26 - Audio
    • $FF10-$FF14 - NR10-NR14
    • $FF16-$FF1E - NR21-NR34
    • $FF20-$FF23 - NR41-NR44
    • $FF24-$FF26 - NR50-NR52
  • $FF30-$FF3F - Wave pattern
  • $FF40 - LCD control
  • $FF41 - LCD stat
  • $FF42 - Scroll y
  • $FF43 - Scroll x
  • $FF44 - LY
  • $FF45 - LYC
  • $FF46 - OAM DMA
  • $FF47 - Bg pal
  • $FF48 - Obj pal 0
  • $FF49 - Obj pal 1
  • $FF4A - Win y
  • $FF4B - Win x
  • $FF50 - Is boot ROM disabled? (non-zero if true)
  • $FF72 - Unknown
  • $FF73 - Unknown
  • $FF75 - Unknown (only bits 4-6 are read/write enabled)
  • $FF76 - PCM12 - PCM amplitudes 1 & 2 (Read Only) (low nybble: copy of sound channel #1's PCM amplitude, high: copy of sound channel #2's)
  • $FF77 - PCM34 - PCM amplitudes 3 & 4 (Read Only) (same as $FF76 but with channels 3/4)

CGB mode

  • $FF4D - CGB Double Speed Mode/Normal Speed Mode switch
  • $FF4F - VRAM bank select
  • $FF51-$FF55 - VRAM DMA (HDMA)
    • HDMA src hi
    • HDMA src low
    • HDMA dest hi
    • HDMA dest low
    • HDMA count
  • $FF56 - Infrared port RP Register (infrared is also used with the Pokémon Pikachu 2 virtual pet, Pocket Sakura, Full Changer, Chee-Chai Alien spectrum communicator)
    • Bit 0: Is the Game Boy Color's infrared light on/off? (read/write)
    • Bit 1: Infrared signal (0=receiving it, 1=normal/no signal) (read only)
    • Bit 2-5: Unknown/unused?
    • Bit 6-7: Enable signal read? (0=disable, 3=enable) (read/write). It is also capable of resetting bit 1 to 0 when disabled and re-enabled under certain conditions.
  • $FF68-$FF69 - BG/OBJ palettes
    • $FF68 - Bg pal sel
    • $FF69 - Bg pal data
    • $FF6A - Obj pal sel
    • $FF6B - Obj pal data
    • $FF6C - Unknown
  • $FF70 - WRAM bank select
  • $FF74 - Unknown

Also relevant

  • $FFFF - Interrupt enable register (IE)

[1][2]

High RAM pertaining to I/O

Pokémon Red and Blue:

In the High RAM (HRAM) (FF80-FFFE):

  • FFB1 - Previous frame's joypad input
  • FFB2 - Which buttons were released on this frame?
  • FFB3 - Which buttons were pressed on this frame?
  • FFB4 - Which buttons were held on this frame?
  • FFB5 - Low sensitivity joypad output. (This is controlled by FFB6 and FFB7)
  • FFB6 - Nothing if zero and A or B is held, else buttons held for more than half a second are pressed twelve times/s. No influence if FFB7 is zero.
  • FFB7 - (If zero): Newly-pressed buttons are contained in FFB5.
  • FFF8 - Input for joypad
  • FFF9 - Is joypad polling disabled?

[3]


External links

References

This article or section is a stub. You can help Glitch City Wiki by expanding it.