Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Game Boy Printer
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Protocol== The communication between the Game Boy and the Game Boy Printer is via a simple serial link. Serial clock (provided by the Game Boy for the printer), serial data output (from Game Boy to printer) as well as serial data input (to Game Boy from printer). The Game Boy sends a packet to the printer, to which the printer responds with an acknowledgement as well as a status code.<ref>{{cite web|url=http://gbdev.gg8.se/wiki/articles/Gameboy_Printer|title=Gameboy Printer|website=GbdevWiki|access-date=2017-04-09|archive-date=2021-06-03|archive-url=https://web.archive.org/web/20210603211734/https://gbdev.gg8.se/wiki/articles/Gameboy_Printer|url-status=live}}</ref><ref>{{cite web|url=https://www.mikrocontroller.net/attachment/34801/gb-printer.txt|title=GB Printer interface specification|date=December 1, 2001|archive-url=https://web.archive.org/web/20090615192718/https://www.mikrocontroller.net/attachment/34801/gb-printer.txt|archive-date=June 15, 2009|url-status=live}}</ref><ref name=":0">{{cite web|url=https://shonumi.github.io/articles/art2.html|title=In Depth: The Game Boy Printer|date=September 7, 2016|website=Shonumi|access-date=April 11, 2017|archive-date=June 3, 2021|archive-url=https://web.archive.org/web/20210603211621/https://shonumi.github.io/articles/art2.html|url-status=live}}</ref> === Packet Format === Communication is via the Game Boy sending to the printer a simple packet structure as shown below. In general, between the first "sync_word" til the checksum is the Game Boy communicating to the printer. The last two bytes of the packet are for the printer to acknowledge and show its current status code. <!-- | BYTE POS : | 0 | 1 | 2 | 3 | 4 | 5 | 6 + X | 6 + X + 1 | 6 + X + 2 | 6 + X + 3 | 6 + X + 4 | |---------------|-----------|-----------|-----------|-------------|-----------|-----------|-----------|-----------|-----------|-----------|-----------| | SIZE | 2 Bytes | 1 Byte | 1 Byte | 1 Bytes | 1 Bytes | Variable | 2 Bytes | 1 Bytes | 1 Bytes | | DESCRIPTION | SYNC_WORD | COMMAND | COMPRESSION | DATA_LENGTH(X) | Payload | CHECKSUM | ACK | STATUS | | GB TO PRINTER | 0x88 | 0x33 | See Below | See Below | Low Byte | High Byte | See Below | See Below | 0x00 | 0x00 | | PRINTER TO GB | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x81 | See Below | --> {| class="wikitable" |- ! Byte Position !! 0 !! 1 !! 2 !! 3 !! 4 !! 5 !! 6+X !! 6+X+1 !! 6+X+2 !! 6+X+3 !! 6+X+4 |- | Size || 2 bytes || 2 bytes || 1 byte || 1 byte || 1 byte || 1 byte || Variable || 2 bytes || 2 bytes || 1 byte || 1 byte |- | Description || SYNC_WORD || SYNC_WORD || COMMAND || COMPRESSION || DATA_LENGTH(X) || DATA_LENGTH(X) || Payload || CHECKSUM || CHECKSUM || ACK || STATUS |- | GB TO PRINTER || 0x88 || 0x33 || See Below || See Below || Low Byte || High Byte || See Below || See Below || See Below || 0x00 || 0x00 |- | PRINTER TO GB || 0x00 || 0x00 || 0x00 || 0x00 || 0x00 || 0x00 || 0x00 || 0x00 || 0x00 || 0x81 || See Below |} * Command may be either Initialize (0x01), Data (0x04), Print (0x02), or Inquiry (0x0F). * Payload byte count size depends on the value of the `DATA_LENGTH` field. * Compression field is a compression indicator. No compression = 0x00 * Checksum is a simple sum of bytes in command, data length, and the data payload. * Status byte is a bit-field byte indicating various status of the printer itself. (e.g. If it is still printing) === Commands === ==== Initialize (0x01) ==== * Typical Payload Size = 0 This packet is sent without a data payload. It signals to the printer to clear the settings and prepare for the first data payload. ==== Data (0x04) ==== * Typical Payload Size = 640 The data packet is for transferring the image data to the printer data buffer. The typical size of the data payload is 640 bytes since it can store two printable rows of 20 standard Game Boy tile (2 bit color in 8x8 pixels grid), of which the Game Boy tile takes 16 bytes.<ref>{{Cite web|url=http://www.huderlem.com/demos/gameboy2bpp.html|title=Gameboy 2BPP Graphics Format|last=Huderle|first=Marcus|date=June 29, 2013|archive-url=https://web.archive.org/web/20180625064314/http://www.huderlem.com/demos/gameboy2bpp.html|archive-date=June 25, 2018|url-status=live|access-date=April 11, 2017}}</ref> ==== Print (0x02) ==== * Typical Payload Size = 4 This commands the printer to start printing. It also has 4 settings bytes for printing.<ref name=":0" /> {| class="wikitable" !Payload Byte !Type !Typical Value !note |- |0 |Unknown | 0x1 | |- |1 |Printing Margins |? |High Nibble for top margin. Low Nibble for bottom margin |- |2 |Palette |0xE4 | |- |3 |Print head strength |? |7 bit value |} ==== Inquiry (0x0F) ==== * Typical Payload Size = 0 Used for checking the printer status byte. This may be for checking if there is enough data in the printer buffer to start printing smoothly or if the printer is currently printing. === Printer Status Reply Byte === {| class="wikitable" |- ! Bit X ! Status Byte Bit Position Meaning |- | Bit 7 | Battery Too Low |- | Bit 6 | Other Error |- | Bit 5 | Paper Jam |- | Bit 4 | Packet Error |- | Bit 3 | Unprocessed Data |- | Bit 2 | Image Data Full |- | Bit 1 | Printer Busy |- | Bit 0 | Checksum Error |}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)