Skip to content

Commit be94eb8

Browse files
authored
Link I/O register & SGB definitions from tables (#406)
* Link SGB command definitions from command table * Link I/O register definitions from I/O range table
1 parent 0093d30 commit be94eb8

File tree

2 files changed

+39
-39
lines changed

2 files changed

+39
-39
lines changed

src/Memory_Map.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ A000 | BFFF | 8 KiB External RAM
1111
C000 | CFFF | 4 KiB Work RAM (WRAM) |
1212
D000 | DFFF | 4 KiB Work RAM (WRAM) | In CGB mode, switchable bank 1\~7
1313
E000 | FDFF | Mirror of C000\~DDFF (ECHO RAM) | Nintendo says use of this area is prohibited.
14-
FE00 | FE9F | Sprite attribute table ([OAM](<#VRAM Sprite Attribute Table (OAM)>)) |
14+
FE00 | FE9F | [Sprite attribute table (OAM)](<#VRAM Sprite Attribute Table (OAM)>) |
1515
FEA0 | FEFF | Not Usable | Nintendo says use of this area is prohibited
16-
FF00 | FF7F | I/O Registers |
16+
FF00 | FF7F | [I/O Registers](<#I/O Ranges>) |
1717
FF80 | FFFE | High RAM (HRAM) |
1818
FFFF | FFFF | [Interrupt](#Interrupts) Enable register (IE) |
1919

@@ -50,8 +50,8 @@ way.
5050

5151
Cartridge RAM is often battery buffered to hold saved game positions,
5252
high score tables, and other information when the Game Boy is turned
53-
off. For specific information read the chapter about Memory Bank
54-
Controllers.
53+
off. For specific information read the chapter about [Memory Bank
54+
Controllers](<#MBCs>).
5555

5656
## Echo RAM
5757

@@ -74,17 +74,17 @@ The Game Boy uses the following I/O ranges:
7474

7575
Start | End | First appeared | Purpose
7676
--------|---------|----------------|-------------
77-
$FF00 | | DMG | Controller
78-
$FF01 | $FF02 | DMG | Communication
79-
$FF04 | $FF07 | DMG | Divider and Timer
80-
$FF10 | $FF26 | DMG | Sound
81-
$FF30 | $FF3F | DMG | Waveform RAM
82-
$FF40 | $FF4B | DMG | LCD
83-
$FF4F | | CGB | VRAM Bank Select
77+
$FF00 | | DMG | [Joypad input](<#FF00 - P1/JOYP - Joypad (R/W)>)
78+
$FF01 | $FF02 | DMG | [Serial transfer](<#FF01 - SB - Serial transfer data (R/W)>)
79+
$FF04 | $FF07 | DMG | [Timer and divider](<#Timer and Divider Registers>)
80+
$FF10 | $FF26 | DMG | [Sound](<#Sound Controller>)
81+
$FF30 | $FF3F | DMG | [Wave pattern](<#FF30-FF3F - Wave Pattern RAM>)
82+
$FF40 | $FF4B | DMG | LCD [Control](<#FF40 - LCDC (LCD Control) (R/W)>), [Status](<#FF41 - STAT (LCD Status) (R/W)>), [Position, Scrolling](<#LCD Position and Scrolling>), and [Palettes](<#Palettes>)
83+
$FF4F | | CGB | [VRAM Bank Select](<#FF4F - VBK - CGB Mode Only - VRAM Bank (R/W)>)
8484
$FF50 | | DMG | Set to non-zero to disable boot ROM
8585
$FF51 | $FF55 | CGB | [VRAM DMA](<#LCD VRAM DMA Transfers>)
8686
$FF68 | $FF69 | CGB | [BG / OBJ Palettes](<#LCD Color Palettes (CGB only)>)
87-
$FF70 | | CGB | WRAM Bank Select
87+
$FF70 | | CGB | [WRAM Bank Select](<#FF70 - SVBK - CGB Mode Only - WRAM Bank>)
8888

8989
## FEA0-FEFF range
9090

src/SGB_Command_Summary.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22

33
## SGB System Command Table
44

5-
Code | Name | Explanation
6-
-----|----------|--------------
7-
$00 | PAL01 | Set SGB Palette 0 &amp; 1
8-
$01 | PAL23 | Set SGB Palette 2 &amp; 3
9-
$02 | PAL03 | Set SGB Palette 0 &amp; 3
10-
$03 | PAL12 | Set SGB Palette 1 &amp; 2
11-
$04 | ATTR_BLK | "Block" Area Designation Mode
12-
$05 | ATTR_LIN | "Line" Area Designation Mode
13-
$06 | ATTR_DIV | "Divide" Area Designation Mode
14-
$07 | ATTR_CHR | "1CHR" Area Designation Mode
15-
$08 | SOUND | Sound On/Off
16-
$09 | SOU_TRN | Transfer Sound PRG/DATA
17-
$0A | PAL_SET | Set SGB Palette Indirect
18-
$0B | PAL_TRN | Set System Color Palette Data
19-
$0C | ATRC_EN | Enable/disable Attraction Mode
20-
$0D | TEST_EN | Speed Function
21-
$0E | ICON_EN | SGB Function
22-
$0F | DATA_SND | SUPER NES WRAM Transfer 1
23-
$10 | DATA_TRN | SUPER NES WRAM Transfer 2
24-
$11 | MLT_REQ | Multiple Controllers Request
25-
$12 | JUMP | Set SNES Program Counter
26-
$13 | CHR_TRN | Transfer Character Font Data
27-
$14 | PCT_TRN | Set Screen Data Color Data
28-
$15 | ATTR_TRN | Set Attribute from ATF
29-
$16 | ATTR_SET | Set Data to ATF
30-
$17 | MASK_EN | Game Boy Window Mask
31-
$18 | OBJ_TRN | Super NES OBJ Mode
5+
Code | Name | Explanation
6+
-----|-------------------------------------------|--------------
7+
$00 | [PAL01](<#SGB Command 00h - PAL01>) | Set SGB Palette 0 &amp; 1
8+
$01 | [PAL23](<#SGB Command 01h - PAL23>) | Set SGB Palette 2 &amp; 3
9+
$02 | [PAL03](<#SGB Command 02h - PAL03>) | Set SGB Palette 0 &amp; 3
10+
$03 | [PAL12](<#SGB Command 03h - PAL12>) | Set SGB Palette 1 &amp; 2
11+
$04 | [ATTR_BLK](<#SGB Command 04h - ATTR_BLK>) | "Block" Area Designation Mode
12+
$05 | [ATTR_LIN](<#SGB Command 05h - ATTR_LIN>) | "Line" Area Designation Mode
13+
$06 | [ATTR_DIV](<#SGB Command 06h - ATTR_DIV>) | "Divide" Area Designation Mode
14+
$07 | [ATTR_CHR](<#SGB Command 07h - ATTR_CHR>) | "1CHR" Area Designation Mode
15+
$08 | [SOUND](<#SGB Command 08h - SOUND>) | Sound On/Off
16+
$09 | [SOU_TRN](<#SGB Command 09h - SOU_TRN>) | Transfer Sound PRG/DATA
17+
$0A | [PAL_SET](<#SGB Command 0Ah - PAL_SET>) | Set SGB Palette Indirect
18+
$0B | [PAL_TRN](<#SGB Command 0Bh - PAL_TRN>) | Set System Color Palette Data
19+
$0C | [ATRC_EN](<#SGB Command 0Ch - ATRC_EN>) | Enable/disable Attraction Mode
20+
$0D | [TEST_EN](<#SGB Command 0Dh - TEST_EN>) | Speed Function
21+
$0E | [ICON_EN](<#SGB Command 0Eh - ICON_EN>) | SGB Function
22+
$0F | [DATA_SND](<#SGB Command 0Fh - DATA_SND>) | SUPER NES WRAM Transfer 1
23+
$10 | [DATA_TRN](<#SGB Command 10h - DATA_TRN>) | SUPER NES WRAM Transfer 2
24+
$11 | [MLT_REQ](<#SGB Command 11h - MLT_REQ>) | Multiple Controllers Request
25+
$12 | [JUMP](<#SGB Command 12h - JUMP>) | Set SNES Program Counter
26+
$13 | [CHR_TRN](<#SGB Command 13h - CHR_TRN>) | Transfer Character Font Data
27+
$14 | [PCT_TRN](<#SGB Command 14h - PCT_TRN>) | Set Screen Data Color Data
28+
$15 | [ATTR_TRN](<#SGB Command 15h - ATTR_TRN>) | Set Attribute from ATF
29+
$16 | [ATTR_SET](<#SGB Command 16h - ATTR_SET>) | Set Data to ATF
30+
$17 | [MASK_EN](<#SGB Command 17h - MASK_EN>) | Game Boy Window Mask
31+
$18 | [OBJ_TRN](<#SGB Command 18h - OBJ_TRN>) | Super NES OBJ Mode

0 commit comments

Comments
 (0)