Difference between revisions of "Debug device"

From MSX Game Library

 
(13 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
Based on: https://openmsx.org/manual/user.html#debugdevice
 
Based on: https://openmsx.org/manual/user.html#debugdevice
  
== Improved debug device protocol ==
+
== Debug device protocol ==
<pre>
+
The additions are surrounded with <tt>[]</tt> prefix. This proposal is 100% compatible with the old one if unused bits was set to 0.
-----------------------------------------------------------------------------
+
 
 +
<syntaxhighlight lang="txt">
 +
=============================================================================
 
  Port 0x2E - Mode Set Register
 
  Port 0x2E - Mode Set Register
-----------------------------------------------------------------------------
+
=============================================================================
  7  6  5  4  3  2  1  0
+
7  6  5  4  3  2  1  0
  │  │  │  │  └───┴───┴───┴── Mode-specific parameters
+
│  │  │  │  └───┴───┴───┴── Mode-specific parameters
  │  │  └───┴────────────────── Output mode (0 = OFF, 1 = single byte, 2 = multi byte)
+
│  │  └───┴────────────────── Output mode (0 = OFF, 1 = single byte, 2 = multi byte, [3 = formatted string])
  │  └────────────────────────── Line feed mode (0 = line feed at mode change, 1 = no line feed)
+
│  └────────────────────────── Line feed mode (0 = line feed at mode change, 1 = no line feed)
  └────────────────────────────── Functionality (0 = output, 1 = command)
+
└────────────────────────────── [Functionality (0 = output, 1 = command)]
 
+
 
-----------------------------------------------------------------------------
 
-----------------------------------------------------------------------------
 
  Functionality = output, Output mode = single byte
 
  Functionality = output, Output mode = single byte
 
-----------------------------------------------------------------------------
 
-----------------------------------------------------------------------------
  7  6  5  4  3  2  1  0
+
7  6  5  4  3  2  1  0
       │  │   │  │  │  └── Hexadecimal mode (0 = OFF, 1 = ON)
+
        │  │  │  └── Hexadecimal mode (0 = OFF, 1 = ON)
       │  │   │  │  └────── Binary mode (0 = OFF, 1 = ON)
+
0   ?   0   1   │  │  └────── Binary mode (0 = OFF, 1 = ON)
  │  │  │  │  │  └────────── Decimal mode (0 = OFF, 1 = ON)
+
                │  └────────── Decimal mode (0 = OFF, 1 = ON)
  :  :  :  :  └────────────── ASCII mode (0 = OFF, 1 = ON)
+
                └────────────── ASCII mode (0 = OFF, 1 = ON)
 
+
 
-----------------------------------------------------------------------------
 
-----------------------------------------------------------------------------
 
  Functionality = output, Output mode = multi byte
 
  Functionality = output, Output mode = multi byte
 
-----------------------------------------------------------------------------
 
-----------------------------------------------------------------------------
  7  6  5  4  3  2  1  0
+
7  6  5  4  3  2  1  0
   │  │       │  │  └───┴── Mode (0 = hex, 1 = binary, 2 = decimal, 3 = ASCII mode)
+
        │  │  └───┴── Mode (0 = hex, 1 = binary, 2 = decimal, 3 = ASCII mode)
       │  │   │  └────────── Data width (0 = 8 bits; 1 = 16 bits)
+
0   ?   1   0   │  └────────── [Data width (0 = 8 bits; 1 = 16 bits)]
  :  :  :  :  └────────────── Signed (0 = unsigned, 1 = signed)
+
                └────────────── [Signed (0 = unsigned, 1 = signed)]
 +
 +
-----------------------------------------------------------------------------
 +
Functionality = output, Output mode = formatted string
 +
-----------------------------------------------------------------------------
 +
7  6  5  4  3  2  1  0
 +
‖  ‖  ‖  ‖  └───┴───┴───┴── Mode (0 = unpacked)
 +
0  ?  1  1
  
 +
Note: The data address must be sent via the data register. The address must point to the address of the formatting string, followed by the various parameters. 8-bit values are stored on 16-bits.
 +
 
-----------------------------------------------------------------------------
 
-----------------------------------------------------------------------------
 
  Functionality = command
 
  Functionality = command
 
-----------------------------------------------------------------------------
 
-----------------------------------------------------------------------------
  7  6  5  4  3  2  1  0
+
7  6  5  4  3  2  1  0
  :   └───┴───┴───┴───┴───┴───┴── Command ID (0x7F = break point)
+
  └───┴───┴───┴───┴───┴───┴── [Command ID (0x7F = break point, 0x00 = reboot)]
</pre>
+
1
 +
 
 +
=============================================================================
 +
Port 0x2F - Data Register
 +
=============================================================================
 +
 
 +
Note: 16-bit values are sent in little-endian order (low byte first).
 +
</syntaxhighlight>
 +
 
 
[[category:Proposal]]
 
[[category:Proposal]]

Latest revision as of 12:02, 9 May 2024

Proposal to improve the debugging protocol used by openMSX pseudo-device.

Based on: https://openmsx.org/manual/user.html#debugdevice

Debug device protocol

The additions are surrounded with [] prefix. This proposal is 100% compatible with the old one if unused bits was set to 0.

=============================================================================
 Port 0x2E - Mode Set Register
=============================================================================
 7   6   5   4   3   2   1   0
 │   │   │   │   └───┴───┴───┴── Mode-specific parameters
 │   │   └───┴────────────────── Output mode (0 = OFF, 1 = single byte, 2 = multi byte, [3 = formatted string])
 │   └────────────────────────── Line feed mode (0 = line feed at mode change, 1 = no line feed)
 └────────────────────────────── [Functionality (0 = output, 1 = command)]
 
-----------------------------------------------------------------------------
 Functionality = output, Output mode = single byte
-----------------------------------------------------------------------------
 7   6   5   4   3   2   1   0
 ‖   ‖   ‖   ‖   │   │   │   └── Hexadecimal mode (0 = OFF, 1 = ON)
 0   ?   0   1   │   │   └────── Binary mode (0 = OFF, 1 = ON)
                 │   └────────── Decimal mode (0 = OFF, 1 = ON)
                 └────────────── ASCII mode (0 = OFF, 1 = ON)
 
-----------------------------------------------------------------------------
 Functionality = output, Output mode = multi byte
-----------------------------------------------------------------------------
 7   6   5   4   3   2   1   0
 ‖   ‖   ‖   ‖   │   │   └───┴── Mode (0 = hex, 1 = binary, 2 = decimal, 3 = ASCII mode)
 0   ?   1   0   │   └────────── [Data width (0 = 8 bits; 1 = 16 bits)]
                 └────────────── [Signed (0 = unsigned, 1 = signed)]
 
-----------------------------------------------------------------------------
 Functionality = output, Output mode = formatted string
-----------------------------------------------------------------------------
 7   6   5   4   3   2   1   0
 ‖   ‖   ‖   ‖   └───┴───┴───┴── Mode (0 = unpacked)
 0   ?   1   1

Note: The data address must be sent via the data register. The address must point to the address of the formatting string, followed by the various parameters. 8-bit values are stored on 16-bits.
 
-----------------------------------------------------------------------------
 Functionality = command
-----------------------------------------------------------------------------
 7   6   5   4   3   2   1   0
 ‖   └───┴───┴───┴───┴───┴───┴── [Command ID (0x7F = break point, 0x00 = reboot)]
 1

=============================================================================
 Port 0x2F - Data Register
=============================================================================

Note: 16-bit values are sent in little-endian order (low byte first).