I/O: Difference between revisions

From Glitch City Wiki
Jump to navigation Jump to search
Content added Content deleted
No edit summary
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''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 between 0xFF00 to 0xFF70.
'''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, [http://lavacutcontent.com/sugimori-masuda-developer-interview/ 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 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, [http://lavacutcontent.com/sugimori-masuda-developer-interview/ 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.
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==
==DMG mode==
*$FF00 - Joypad (also used for Super Game Boy command packets using P14 and P15 output lines)
*$FF00 - Joypad
*$FF01 - Serial transfer
*$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 $FF07 - Timer/divider
*$FF04 - Divider
*$FF10 $FF26 - Audio
*$FF05 - Timer counter
*$FF30 $FF3F - Wave pattern
*$FF06 - Timer modulo
*$FF40 $FF4B - LCD Control, Status, Position, Scrolling, Palettes
*$FF07 - Timer control
*$FF0F - Interrupt flag (interrupt vector 0058 is also requested after a Link Cable transfer{{elaborate}})
*$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)
*$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==
==CGB mode==
*$FF4D - CGB Double Speed Mode/Normal Speed Mode switch
*$FF4F - VRAM Bank Select
*$FF51 $FF55 - VRAM DMA
*$FF4F - VRAM bank select
*$FF68 $FF69 - BG/OBJ Palettes
*$FF51-$FF55 - VRAM DMA (HDMA)
**HDMA src hi
*$FF70 - WRAM Bank Select
**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)
<ref>[https://gbdev.gg8.se/wiki/articles/CGB_Registers GB Dev wiki CGB Registers]</ref><ref>BGB emulator</ref>
==High RAM pertaining to I/O==
[[Pokémon Red and Blue]]:<!--Check Yellow-->

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?

<ref>[https://datacrystal.romhacking.net/wiki/Pok%C3%A9mon_Red/Blue:RAM_map Datacrystal Pokémon Red/Blue RAM Map]</ref>

<!-- ==Game Boy Advance==-->
<!-- ==Game Boy Advance==-->
<!-- ==Nintendo DS==-->
<!-- ==Nintendo DS==-->
<!-- ==Nintendo 3DS==-->
<!-- ==Nintendo 3DS==-->
<!-- ==Nintendo Switch==-->
<!-- ==Nintendo Switch==-->

==External links==
==External links==
*[https://gbdev.gg8.se/wiki/articles/Joypad_Input Joypad input on Game Boy dev wiki]
*[https://gbdev.io/pandocs/Memory_Map.html#io-ranges Game Boy Memory Map - Pan Docs]
*[https://gbdev.io/pandocs/Memory_Map.html#io-ranges Game Boy Memory Map - Pan Docs]
*[https://shonumi.github.io/dandocs.html Dan Docs by Shonumi (obscure peripherals)]
*[https://shonumi.github.io/dandocs.html Dan Docs by Shonumi (obscure peripherals)]
==References==
<references/>
{{Stub}}
{{Stub}}
[[Category:Terminology]]
[[Category:Terminology]]

Latest revision as of 16:28, 8 November 2022

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.