Difference between revisions of "PM Bios"

From SublabWiki
Jump to: navigation, search
m (The IRQ Vector Table)
(More details about the BIOS)
Line 3: Line 3:
 
The internal BIOS consists of a 4kB program image built to initialize the system, bring it out of sleep and various other system specific tasks.  Since the Pokemon Mini is never technically off, only suspended, BIOS is used for tasks like enabling power to the system and responding to various at rest IRQs.
 
The internal BIOS consists of a 4kB program image built to initialize the system, bring it out of sleep and various other system specific tasks.  Since the Pokemon Mini is never technically off, only suspended, BIOS is used for tasks like enabling power to the system and responding to various at rest IRQs.
  
The BIOS image begins with a 256 byte IRQ vector table, consisting of 128 16-bit vectors.  The system reserves 32 vectors for hardware IRQs, the rest are used for software calls.  It is worth noting that all IRQs are latched on the rising edge of an event, so button presses and IR receive is only latched when the IR receiver is active 1 or if a button has been press, but not released.
+
The BIOS image begins with a 256 byte IRQ vector table, consisting of 128 16-bit vectors (only first 76 are valid).  The system reserves 32 vectors for hardware IRQs, the rest are used for software calls.  It is worth noting that all IRQs are latched on the rising edge of an event, so button presses and IR receive is only latched when the IR receiver is active 1 or if a button has been press, but not released.
  
 
== The IRQ Vector Table ==
 
== The IRQ Vector Table ==
Line 10: Line 10:
 
|+ '''Bios IRQ Vector Table'''
 
|+ '''Bios IRQ Vector Table'''
 
!IRQ
 
!IRQ
 +
!BIOS
 
!Cart IRQ
 
!Cart IRQ
 
!IRQ Group
 
!IRQ Group
Line 16: Line 17:
 
|-
 
|-
 
|$00
 
|$00
 +
|0000:009A
 
|0
 
|0
| style="border:none;" colspan="2"|
+
| colspan="2" | Non-Maskable
|Reset
+
|System Start-up / System Reset
 
|-
 
|-
 
|$01
 
|$01
 +
|0002:00AB
 
|
 
|
|
+
| colspan="2" | Non-Maskable
|
+
|Unused
|
 
 
|-
 
|-
 
|$02
 
|$02
 +
|0004:00AB
 
|
 
|
|
+
| colspan="2" | Non-Maskable
|
+
|Unused
|
 
 
|-
 
|-
 
|$03
 
|$03
 +
|0006:01CF
 
|1
 
|1
 
|$20[7..6]
 
|$20[7..6]
 
|$27,7
 
|$27,7
|[[PM PRC|PRC Buffer Flipped]]
+
|[[PM PRC|PRC Frame Complete]]
 
|-
 
|-
 
|$04
 
|$04
 +
|0008:01E0
 
|2
 
|2
 
|$20[7..6]
 
|$20[7..6]
Line 45: Line 49:
 
|-
 
|-
 
|$05
 
|$05
 +
|000A:01F1
 
|3
 
|3
 
|$20[5..4]
 
|$20[5..4]
Line 51: Line 56:
 
|-
 
|-
 
|$06
 
|$06
 +
|000C:0202
 
|4
 
|4
 
|$20[5..4]
 
|$20[5..4]
Line 57: Line 63:
 
|-
 
|-
 
|$07
 
|$07
 +
|000E:0213
 
|5
 
|5
 
|$20[3..2]
 
|$20[3..2]
Line 63: Line 70:
 
|-
 
|-
 
|$08
 
|$08
 +
|0010:0224
 
|6
 
|6
 
|$20[3..2]
 
|$20[3..2]
Line 69: Line 77:
 
|-
 
|-
 
|$09
 
|$09
 +
|0012:0235
 
|7
 
|7
 
|$20[1..0]
 
|$20[1..0]
Line 75: Line 84:
 
|-
 
|-
 
|$0A
 
|$0A
 +
|0014:0246
 
|8
 
|8
 
|$20[1..0]
 
|$20[1..0]
Line 81: Line 91:
 
|-
 
|-
 
|$0B
 
|$0B
 +
|0016:025A
 
|9
 
|9
 
|$21[7..6]
 
|$21[7..6]
 
|$28,5
 
|$28,5
|32hz
+
|32Hz (From 256Hz Timer)
 
|-
 
|-
 
|$0C
 
|$0C
 +
|0018:026B
 
|10
 
|10
 
|$21[7..6]
 
|$21[7..6]
 
|$28,4
 
|$28,4
|8hz
+
|8Hz (From 256Hz Timer)
 
|-
 
|-
 
|$0D
 
|$0D
 +
|001A:027C
 
|11
 
|11
 
|$21[7..6]
 
|$21[7..6]
 
|$28,3
 
|$28,3
|2hz
+
|2Hz (From 256Hz Timer)
 
|-
 
|-
 
|$0E
 
|$0E
 +
|001C:028D
 
|12
 
|12
 
|$21[7..6]
 
|$21[7..6]
 
|$28,2
 
|$28,2
|1hz
+
|1Hz (From 256Hz Timer)
 
|-
 
|-
 
|$0F
 
|$0F
 +
|001E:029E
 
|13
 
|13
 
|$22[1..0]
 
|$22[1..0]
Line 111: Line 126:
 
|-
 
|-
 
|$10
 
|$10
 +
|0020:02AF
 
|14
 
|14
 
|$22[1..0]
 
|$22[1..0]
Line 117: Line 133:
 
|-
 
|-
 
|$11
 
|$11
 +
|0022:00AB
 
|
 
|
 
|
 
|
 
|$2A,5
 
|$2A,5
|  
+
|Unused
 
|-
 
|-
 
|$12
 
|$12
 +
|0024:00AB
 
|
 
|
 
|
 
|
 
|$2A,4
 
|$2A,4
|  
+
|Unused
 
|-
 
|-
 
|$13
 
|$13
| style="border:none;"|
+
|0026:043E
 +
|
 
|$21[5..4]
 
|$21[5..4]
 
|$28,1
 
|$28,1
Line 135: Line 154:
 
|-
 
|-
 
|$14
 
|$14
 +
|0028:02C0
 
|26
 
|26
 
|$21[5..4]
 
|$21[5..4]
Line 141: Line 161:
 
|-
 
|-
 
|$15
 
|$15
 +
|002A:03BA
 
|15
 
|15
 
|$21[3..2]
 
|$21[3..2]
Line 147: Line 168:
 
|-
 
|-
 
|$16
 
|$16
 +
|002C:02D1
 
|16
 
|16
 
|$21[3..2]
 
|$21[3..2]
Line 153: Line 175:
 
|-
 
|-
 
|$17
 
|$17
 +
|002E:02E2
 
|17
 
|17
 
|$21[3..2]
 
|$21[3..2]
Line 159: Line 182:
 
|-
 
|-
 
|$18
 
|$18
 +
|0030:02F3
 
|18
 
|18
 
|$21[3..2]
 
|$21[3..2]
Line 165: Line 189:
 
|-
 
|-
 
|$19
 
|$19
 +
|0032:0304
 
|19
 
|19
 
|$21[3..2]
 
|$21[3..2]
Line 171: Line 196:
 
|-
 
|-
 
|$1A
 
|$1A
 +
|0034:0315
 
|20
 
|20
 
|$21[3..2]
 
|$21[3..2]
Line 177: Line 203:
 
|-
 
|-
 
|$1B
 
|$1B
 +
|0036:0326
 
|21
 
|21
 
|$21[3..2]
 
|$21[3..2]
Line 183: Line 210:
 
|-
 
|-
 
|$1C
 
|$1C
 +
|0038:0337
 
|22
 
|22
 
|$21[3..2]
 
|$21[3..2]
Line 189: Line 217:
 
|-
 
|-
 
|$1D
 
|$1D
 +
|003A:0348
 
|23
 
|23
 
|
 
|
Line 195: Line 224:
 
|-
 
|-
 
|$1E
 
|$1E
 +
|003C:035C
 
|24
 
|24
 
|
 
|
Line 201: Line 231:
 
|-
 
|-
 
|$1F
 
|$1F
 +
|003E:036D
 
|25
 
|25
 
|
 
|
 
|$2A,0
 
|$2A,0
 
|
 
|
 +
|-
 +
!IRQ
 +
!BIOS
 +
! colspan="4" | (Software only) Description
 
|-
 
|-
 
|$20
 
|$20
| colspan="3" style="border:none;"|
+
|0040:FF1F
|
+
| colspan="4" | User IRQ Routine at PC 0xFF1F
 
|-
 
|-
 
|$21
 
|$21
| colspan="3" style="border:none;"|
+
|0042:0713
|
+
| colspan="4" | Suspend System
 
|-
 
|-
 
|$22
 
|$22
| colspan="3" style="border:none;"|
+
|0044:077C
|
+
| colspan="4" | ?? (Involves Cartridge Eject)
 
|-
 
|-
 
|$23
 
|$23
| colspan="3" style="border:none;"|
+
|0046:078B
|
+
| colspan="4" | ?? (Involves Cartridge Eject)
 
|-
 
|-
 
|$24
 
|$24
| colspan="3" style="border:none;"|
+
|0048:079D
|
+
| colspan="4" | Shutdown System (Use this to exit your game!)
 
|-
 
|-
 
|$25
 
|$25
| colspan="3" style="border:none;"|
+
|004A:07B1
|
+
| colspan="4" | ?? (Involves Cartridge Eject)
 
|-
 
|-
 
|$26
 
|$26
| colspan="3" style="border:none;"|
+
|004C:07E9
|
+
| colspan="4" | Set default LCD Constrast (A = Contrast level 0x00 to 0x3F)
 
|-
 
|-
 
|$27
 
|$27
| colspan="3" style="border:none;"|
+
|004E:0802
|
+
| colspan="4" | Increase or decrease Contrast based of Zero flag (0 = Increase, 1 = Decrease)<br />
 +
Return A = 0x00 if succeed, 0xFF if not.
 
|-
 
|-
 
|$28
 
|$28
| colspan="3" style="border:none;"|
+
|0050:081B
|
+
| colspan="4" | Apply default LCD Constrast
 
|-
 
|-
 
|$29
 
|$29
| colspan="3" style="border:none;"|
+
|0052:0821
|
+
| colspan="4" | Get default LCD Contrast (return A)
 
|-
 
|-
 
|$2A
 
|$2A
| colspan="3" style="border:none;"|
+
|0054:0830
|
+
| colspan="4" | Set temporary LCD Constrast (A = Contrast level 0x00 to 0x3F)
 
|-
 
|-
 
|$2B
 
|$2B
| colspan="3" style="border:none;"|
+
|0056:084E
|
+
| colspan="4" | Turn LCD On
 
|-
 
|-
 
|$2C
 
|$2C
| colspan="3" style="border:none;"|
+
|0058:0871
|
+
| colspan="4" | Initialize LCD
 
|-
 
|-
 
|$2D
 
|$2D
| colspan="3" style="border:none;"|
+
|005A:08CB
|
+
| colspan="4" | Turn LCD Off
 
|-
 
|-
 
|$2E
 
|$2E
| colspan="3" style="border:none;"|
+
|005C:08EC
|
+
| colspan="4" | Check if Register 0x01 Bit 7 is set, if not, it set bit 6 and 7
 
|-
 
|-
 
|$2F
 
|$2F
| colspan="3" style="border:none;"|
+
|005E:0904
|
+
| colspan="4" | ?? (Involves Cartridge Eject)
 
|-
 
|-
 
|$30
 
|$30
| colspan="3" style="border:none;"|
+
|0060:0923
|
+
| colspan="4" | ?? (Involves Cartridge Eject)
 
|-
 
|-
 
|$31
 
|$31
| colspan="3" style="border:none;"|
+
|0062:092E
|
+
| colspan="4" | ?? (Involves Cartridge Eject)
 
|-
 
|-
 
|$32
 
|$32
| colspan="3" style="border:none;"|
+
|0064:0949
|
+
| colspan="4" | ?? (Involves Cartridge Eject)
 
|-
 
|-
 
|$33
 
|$33
| colspan="3" style="border:none;"|
+
|0066:0961
|
+
| colspan="4" | ?? (Involves Cartridge Eject)
 
|-
 
|-
 
|$34
 
|$34
| colspan="3" style="border:none;"|
+
|0068:097D
|
+
| colspan="4" | Nintendo Dev Card (??)
 
|-
 
|-
 
|$35
 
|$35
| colspan="3" style="border:none;"|
+
|006A:09E4
|
+
| colspan="4" | Nintendo Dev Card (??)
 
|-
 
|-
 
|$36
 
|$36
| colspan="3" style="border:none;"|
+
|006C:0A4F
|
+
| colspan="4" | ?? (Involves Cartridge Eject)
 
|-
 
|-
 
|$37
 
|$37
| colspan="3" style="border:none;"|
+
|006E:0A76
|
+
| colspan="4" | Disable Cartridge Eject IRQ (Reg 0x24, Bit 1 = 0)
 
|-
 
|-
 
|$38
 
|$38
| colspan="3" style="border:none;"|
+
|0070:0A81
|
+
| colspan="4" | ?? (Involves Cartridge Eject)
 
|-
 
|-
 
|$39
 
|$39
| colspan="3" style="border:none;"|
+
|0072:0AA6
|
+
| colspan="4" | Disable Cartridge and LCD
 
|-
 
|-
 
|$3A
 
|$3A
| colspan="3" style="border:none;"|
+
|0074:0ACD
|
+
| colspan="4" | Recover from IRQ $39 (Enable Cartridge and LCD)
 
|-
 
|-
 
|$3B
 
|$3B
| colspan="3" style="border:none;"|
+
|0076:0AE6
|
+
| colspan="4" | ??
 
|-
 
|-
 
|$3C
 
|$3C
| colspan="3" style="border:none;"|
+
|0078:0AF9
|
+
| colspan="4" | Nintendo Dev Card (!?)
 
|-
 
|-
 
|$3D
 
|$3D
| colspan="3" style="border:none;"|
+
|007A:0B20
|
+
| colspan="4" | Test Register 0x53 Bit 1 and invert Zero flag
 
|-
 
|-
 
|$3E
 
|$3E
| colspan="3" style="border:none;"|
+
|007C:0B2E
|
+
| colspan="4" | Read structure, write 0xFF, compare values and optionally jump to subroutine<br />
 +
X point to a structure in memory:
 +
structure {
 +
  byte  type            ; 0x01 = Call subroutine, 0x00 = Don't call subroutine
 +
  triple write_0xFF_addr ; Address that 0xFF will be written
 +
  triple compare_addr    ; Address to read for compare
 +
  byte  compare_value  ; Value that must match the compare
 +
  triple subroutine      ; Use byte POP to receive flag of the compare
 +
}
 +
if type is 0x00, register A return 0x01 if compare is equal
 
|-
 
|-
 
|$3F
 
|$3F
| colspan="3" style="border:none;"|
+
|007E:0B8F
|
+
| colspan="4" | Set PRC Rate (A = 0 to 7)
 
|-
 
|-
 
|$40
 
|$40
| colspan="3" style="border:none;"|
+
|0080:0BA3
|
+
| colspan="4" | Get PRC Rate (return A)
 
|-
 
|-
 
|$41
 
|$41
| colspan="3" style="border:none;"|
+
|0082:0BB1
|
+
| colspan="4" | Test Register 0x01 Bit 3
 
|-
 
|-
 
|$42
 
|$42
| colspan="3" style="border:none;"|
+
|0084:047A
|
+
| colspan="4" | Nintendo Dev Card (Read IDs)
 
|-
 
|-
 
|$43
 
|$43
| colspan="3" style="border:none;"|
+
|0086:0493
|
+
| colspan="4" | Nintendo Dev Card (Reset)
 
|-
 
|-
 
|$44
 
|$44
| colspan="3" style="border:none;"|
+
|0088:04A4
|
+
| colspan="4" | Nintendo Dev Card (Program Byte)
 
|-
 
|-
 
|$45
 
|$45
| colspan="3" style="border:none;"|
+
|008A:04C8
|
+
| colspan="4" | Nintendo Dev Card (Erase Sector)
 
|-
 
|-
 
|$46
 
|$46
| colspan="3" style="border:none;"|
+
|008C:04F5
|
+
| colspan="4" | Nintendo Dev Card (Command 0xD0)
 
|-
 
|-
 
|$47
 
|$47
| colspan="3" style="border:none;"|
+
|008E:0506
|
+
| colspan="4" | Nintendo Dev Card (Command 0xD0 and Reset)
 
|-
 
|-
 
|$48
 
|$48
| colspan="3" style="border:none;"|
+
|0090:0517
|
+
| colspan="4" | Nintendo Dev Card (Command 0xC9)
 
|-
 
|-
 
|$49
 
|$49
| colspan="3" style="border:none;"|
+
|0092:0529
|
+
| colspan="4" | Nintendo Dev Card (Command 0xC0)
 
|-
 
|-
 
|$4A
 
|$4A
| colspan="3" style="border:none;"|
+
|0094:053A
|
+
| colspan="4" | Nintendo Dev Card ([0x041048 + 96 * A] if 0x08 -> Command 0xC9)
 
|-
 
|-
 
|$4B
 
|$4B
| colspan="3" style="border:none;"|
+
|0096:0000
|
+
| colspan="4" | Invalid
 
|-
 
|-
 
|$4C
 
|$4C
| colspan="3" style="border:none;"|
+
|0098:0BBD
|
+
| colspan="4" | MOV [Y], $02 ; wait B*16 Cycles ; MOV [Y], $00
|-
 
|$4D
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$4E
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$4F
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$50
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$51
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$52
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$53
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$54
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$55
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$56
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$57
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$58
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$59
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$5A
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$5B
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$5C
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$5D
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$5E
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$5F
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$60
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$61
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$62
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$63
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$64
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$65
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$66
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$67
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$68
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$69
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$6A
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$6B
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$6C
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$6D
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$6E
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$6F
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$70
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$71
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$72
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$73
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$74
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$75
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$76
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$77
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$78
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$79
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$7A
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$7B
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$7C
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$7D
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$7E
 
| colspan="3" style="border:none;"|
 
|
 
|-
 
|$7F
 
| colspan="3" style="border:none;"|
 
|
 
 
|}
 
|}

Revision as of 17:26, 17 May 2009

The BIOS Overview

The internal BIOS consists of a 4kB program image built to initialize the system, bring it out of sleep and various other system specific tasks. Since the Pokemon Mini is never technically off, only suspended, BIOS is used for tasks like enabling power to the system and responding to various at rest IRQs.

The BIOS image begins with a 256 byte IRQ vector table, consisting of 128 16-bit vectors (only first 76 are valid). The system reserves 32 vectors for hardware IRQs, the rest are used for software calls. It is worth noting that all IRQs are latched on the rising edge of an event, so button presses and IR receive is only latched when the IR receiver is active 1 or if a button has been press, but not released.

The IRQ Vector Table

Bios IRQ Vector Table
IRQ BIOS Cart IRQ IRQ Group Hardware Strobe Description
$00 0000:009A 0 Non-Maskable System Start-up / System Reset
$01 0002:00AB Non-Maskable Unused
$02 0004:00AB Non-Maskable Unused
$03 0006:01CF 1 $20[7..6] $27,7 PRC Frame Complete
$04 0008:01E0 2 $20[7..6] $27,6 PRC Frame Divider Overflow
$05 000A:01F1 3 $20[5..4] $27,5 Timer2 Upper-8 Underflow
$06 000C:0202 4 $20[5..4] $27,4 Timer2 Lower-8 Underflow (8-bit only)
$07 000E:0213 5 $20[3..2] $27,3 Timer1 Upper-8 Underflow
$08 0010:0224 6 $20[3..2] $27,2 Timer1 Lower-8 Underflow (8-bit only)
$09 0012:0235 7 $20[1..0] $27,1 Timer3 Upper-8 Underflow
$0A 0014:0246 8 $20[1..0] $27,0 Timer3 Pivot
$0B 0016:025A 9 $21[7..6] $28,5 32Hz (From 256Hz Timer)
$0C 0018:026B 10 $21[7..6] $28,4 8Hz (From 256Hz Timer)
$0D 001A:027C 11 $21[7..6] $28,3 2Hz (From 256Hz Timer)
$0E 001C:028D 12 $21[7..6] $28,2 1Hz (From 256Hz Timer)
$0F 001E:029E 13 $22[1..0] $2A,7 IR Receiver
$10 0020:02AF 14 $22[1..0] $2A,6 Shock Sensor
$11 0022:00AB $2A,5 Unused
$12 0024:00AB $2A,4 Unused
$13 0026:043E $21[5..4] $28,1 Cartridge Ejected
$14 0028:02C0 26 $21[5..4] $28,0 Cartridge IRQ
$15 002A:03BA 15 $21[3..2] $29,7 Power Key
$16 002C:02D1 16 $21[3..2] $29,6 Right Key
$17 002E:02E2 17 $21[3..2] $29,5 Left Key
$18 0030:02F3 18 $21[3..2] $29,4 Down Key
$19 0032:0304 19 $21[3..2] $29,3 Up Key
$1A 0034:0315 20 $21[3..2] $29,2 C Key
$1B 0036:0326 21 $21[3..2] $29,1 B Key
$1C 0038:0337 22 $21[3..2] $29,0 A Key
$1D 003A:0348 23 $2A,2
$1E 003C:035C 24 $2A,1
$1F 003E:036D 25 $2A,0
IRQ BIOS (Software only) Description
$20 0040:FF1F User IRQ Routine at PC 0xFF1F
$21 0042:0713 Suspend System
$22 0044:077C  ?? (Involves Cartridge Eject)
$23 0046:078B  ?? (Involves Cartridge Eject)
$24 0048:079D Shutdown System (Use this to exit your game!)
$25 004A:07B1  ?? (Involves Cartridge Eject)
$26 004C:07E9 Set default LCD Constrast (A = Contrast level 0x00 to 0x3F)
$27 004E:0802 Increase or decrease Contrast based of Zero flag (0 = Increase, 1 = Decrease)

Return A = 0x00 if succeed, 0xFF if not.

$28 0050:081B Apply default LCD Constrast
$29 0052:0821 Get default LCD Contrast (return A)
$2A 0054:0830 Set temporary LCD Constrast (A = Contrast level 0x00 to 0x3F)
$2B 0056:084E Turn LCD On
$2C 0058:0871 Initialize LCD
$2D 005A:08CB Turn LCD Off
$2E 005C:08EC Check if Register 0x01 Bit 7 is set, if not, it set bit 6 and 7
$2F 005E:0904  ?? (Involves Cartridge Eject)
$30 0060:0923  ?? (Involves Cartridge Eject)
$31 0062:092E  ?? (Involves Cartridge Eject)
$32 0064:0949  ?? (Involves Cartridge Eject)
$33 0066:0961  ?? (Involves Cartridge Eject)
$34 0068:097D Nintendo Dev Card (??)
$35 006A:09E4 Nintendo Dev Card (??)
$36 006C:0A4F  ?? (Involves Cartridge Eject)
$37 006E:0A76 Disable Cartridge Eject IRQ (Reg 0x24, Bit 1 = 0)
$38 0070:0A81  ?? (Involves Cartridge Eject)
$39 0072:0AA6 Disable Cartridge and LCD
$3A 0074:0ACD Recover from IRQ $39 (Enable Cartridge and LCD)
$3B 0076:0AE6  ??
$3C 0078:0AF9 Nintendo Dev Card (!?)
$3D 007A:0B20 Test Register 0x53 Bit 1 and invert Zero flag
$3E 007C:0B2E Read structure, write 0xFF, compare values and optionally jump to subroutine
X point to a structure in memory:
structure {
 byte   type            ; 0x01 = Call subroutine, 0x00 = Don't call subroutine
 triple write_0xFF_addr ; Address that 0xFF will be written
 triple compare_addr    ; Address to read for compare
 byte   compare_value   ; Value that must match the compare
 triple subroutine      ; Use byte POP to receive flag of the compare
}
if type is 0x00, register A return 0x01 if compare is equal
$3F 007E:0B8F Set PRC Rate (A = 0 to 7)
$40 0080:0BA3 Get PRC Rate (return A)
$41 0082:0BB1 Test Register 0x01 Bit 3
$42 0084:047A Nintendo Dev Card (Read IDs)
$43 0086:0493 Nintendo Dev Card (Reset)
$44 0088:04A4 Nintendo Dev Card (Program Byte)
$45 008A:04C8 Nintendo Dev Card (Erase Sector)
$46 008C:04F5 Nintendo Dev Card (Command 0xD0)
$47 008E:0506 Nintendo Dev Card (Command 0xD0 and Reset)
$48 0090:0517 Nintendo Dev Card (Command 0xC9)
$49 0092:0529 Nintendo Dev Card (Command 0xC0)
$4A 0094:053A Nintendo Dev Card ([0x041048 + 96 * A] if 0x08 -> Command 0xC9)
$4B 0096:0000 Invalid
$4C 0098:0BBD MOV [Y], $02 ; wait B*16 Cycles ; MOV [Y], $00