MesaDX User's Manual

Version 0.04


Table of Contents

Table of Contents

Introduction
I.1: About this Document
I.2: Document Conventions
I.2.1: Hexadecimal and Binary Numbers
I.2.2: Bit and Byte Order
I.2.3: Reserved Bits
I.2.4: Instruction Format
I.3: Revision History
I.4: Acknowledgements

Chapter 1: Getting Started with MesaDX
1.1: Installing MesaDX
1.2: Associating Files with MesaDX

Chapter 2: System Configurations and Power-On
2.1: Creating a New System Configuration
2.2: (Quick Start) Loading ROM Images
2.3: Viewing the Current System Configuration
2.4: Power-On Self Test (POST)

Chapter 3: Running the Emulator
3.1: Resuming and Suspending Emulation
3.2: Control Pad 1
3.3: Shutdown

Chapter 4: Using the Views
4.1: Instruction Unassembly View
4.2: Processor (PROC) Registers View
4.3: Video Display Processor (VDP) Registers View
4.4: Programmable Sound Generator (PSG) Registers View
4.5: AGAMA Extension Registers (AXR) Views
4.5.1: External Debugger (EXTD) AXRs View
4.5.2: Processor (PROC) AXRs View
4.5.3: Memory and I/O Hub (HUB) AXRs View
4.5.4: Boot ROM (BROM) AXRs View
4.5.5: System RAM (SRAM) AXRs View
4.5.6: Sega Card (CARD) AXRs View
4.5.7: External Device 0 (EXT0) AXRs View
4.5.8: External Device 1 (EXT1) AXRs View
4.5.9: Video Display Processor (VDP) AXRs View
4.5.10: Programmable Sound Generator (PSG) View
4.5.11: FM Unit (FMU) AXRs View
4.6: Processor (PROC) Memory View
4.7: Video Display Processor (VDP) Memory View
4.8: Primary Video Output View
4.9: Tiles/Palette View
4.10: Breakpoints View
4.11: Debug Console View

Chapter 5: Advanced Debug Capabilities
5.1: SDSC Debug Console
5.2: Events
5.3: Determining Why the Emulator Suspended

Glossary
[A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [W] [X] [Y] [Z]



Introduction

This document is the official MesaDX for Windows 98 user's manual.

This document assumes some familiarty with the Sega Mark III, Sega Master System (SMS) and Sega Game Gear (GG) game consoles. See the Technical Documents section of S8-Dev for information about these systems.


I.1 About this Document

[To Be Completed]


I.2 Document Conventions

This document uses a specific notation for hexadecimal and binary numbers, symbolic representation of instructions, and data-structure formats. Familiarity with this notation is essential for effective use of MesaDX.

I.2.1 Hexadecimal and Binary Numbers

Hexadecimal (Base 16) numbers are represented using the WLA-DX format of the "$" symbol followed by a string of hexadecimal digits (1-9 and A-F). The hexadecimal digits 'A' through 'F' will always be upper-case. An example of a valid hexadecimal number representation is: $C0FF.

Binary (Base 2) numbers are represented using the WLA-DX format of the "%" symbol follwed by a string of binary digits (0 and 1). An example of a valid binary number representation is: %11100110.

I.2.2 Bit and Byte Order

Bits are numbered starting from right to left, (i.e., least-significant to most-significant.) All bytes consist of eight bits: 0 through 7.

The Sega Mark III Architecture (SM3A) is based on the Zilog Z80 microprocessor. This microprocessor is a little-endian machine, meaning that bytes of a word are numbered starting from the least-significant byte. As a result, the SM3A and AGAMA extensions are also little-endian. The least-significant byte in a word will always be stored to memory first, at the lower address, followed by the most-significant byte at the higher address.

Diagrams of data structures in memory will have lower memory addresses towards the bottom of the page, with higher addresses growing towards the top of the page.

I.2.3 Reserved Bits

In certain register layout descriptions, various bits will be marked as Reserved. These bits are reserved for future expansion of the AGAMA specification, and all reserved bits are implicitly RESET (0). Software should never attempt to SET these bits (to 1). Generally, if the modification of a read-only or reserved bit is attempted an error will occur and the entire write to the register will be discarded. Access to registers with reserved bits should follow the guidelines below:

I.2.4 Instruction Operands

The main processor used in the
Sega Mark III Architecture (SM3A) is the Zilog Z80 microprocessor. Therefore, the symbolic representation of instructions is taken directly from Z80 assembly language. The format is shown below:

label: mnemonic argument1, argument2

where:

When two operands are present, the right operand is the source and the left is the destination.

For example:

LOOP1:  LD HL, STARTVALUE

In this example, LOOP1 is a label, LD is the mnemonic identifier for the opcode, HL is the destination operand, and STARTVALUE is the source operand.

Note, though, that this specification deviates slightly from Z80 assembly language with regard to the accumulator (the "A" register). In Z80 assembly language, certain arithmetic instructions use an implied accumulator operand; the accumulator is not explicitly specified in the instruction. For example, the instruction: AND B implies the accumulator is both a source and a destination. In contrast, the assembly language used in this specification always specifies the accumulator. The same instruction is written as: AND A, B in this specification. The object codes for these instructions are identical, just the instruction notation differs.


I.3 Revision History

Version 0.04.00 (September 23, 2006): Updated for release of MesaDX version 0.04. MesaDX 0.04 includes an entirely new mechanism for specifying the system configuration which allows user to specify which devices are installed. This version also addes support for 32-bit color Windows display modes, memory editing, Graphics2 mode, the SMS2 VDP, and CodeMasters mapper.

Version 0.03.01 (April 2, 2004): Updated for release of MesaDX version 0.03a. MesaDX 0.03a includes several bug fixes and includes support for Power-On Configuration bit "SMS1 Bus".

Version 0.03.00 (March 13, 2004): Update for release of MesaDX version 0.03

Version 0.02.00 (August 26, 2001): Update for release of MesaDX version 0.02

Version 0.01.00 (June 10, 2001): Update for release of MesaDX version 0.01

Version 0.00.01: Formatting Changes.

Version 0.00.00: Initial version. Corresponding to MesaDX version 0.00


I.4 Acknowledgements

MesaDX could not have existed without the help of numerous people.

Super Majik Spiral Crew, Jon, and Richard Talbot-Watkins: Their documents describing the technical details of the Sega Master System and Sega Game Gear are the foundations of the public's current understanding of these systems.

Andrew Lindsay: Designer of the MK1. His help with the SMS memory system and ROM storage was invaluable. With this information I was able to design and build the SMSARCH, a SMS cartridge backup unit.

James McKay: Provided me with my first glimpse of the SMS memory architecture. Also, for providing miscellaneous information in a (publically released) e-mail converstation with "Neon Spiral Injector."

Bock (or Zoop or Omar Cornut): Bock has been a strong presence in the SMS/GG emulation community. His contributions have on many occasions inspired my own efforts. Additionally, his founding and continuous support of S8-Dev has been a great service to all of us still interested in software development for Sega 8-bit systems.

Maxim: Maxim has made numerous contributions to the world of Sega 8-bit emulation including utilities, demo programs, and technical documents. Maxim is an active member of the S8-Dev forum and can always be depended on to step up and answer the difficult technical questions. Maxim also wrote an outstanding document covering the TI SN76489 sound chip.

Charles MacDonald: Charles' unending work documenting the minutae of the various Video Display Processors used in various SM3A implementations has been invaluable during the development of MesaDX. Charles has also written many test programs and has on several occasions been kind enough to test demo programs on a real SMS.

Martin Konrad: Martin Konrad is the brains behind the SDSC Debug Console. He is also the author of an outstanding SMS debugging emulator, eSMS. eSMS is the first emulator to include an SDSC Debug Console. Hopefully, MesaDX will be the second.

Heliophobe: Heliophobe has made many technical contributions to Sega 8-bit emulation including demos and a SMS emulator for the Dreamcast: SMEG. Heliophobe has also provided feedback and suggestions for improving MesaDX, many of which have been implemented in MesaDX.

S8-Dev: All the members of S8-Dev deserve to be thanked, not only for their continuous interest in Sega 8-bit development, but also for perhaps being the only people in the world who might be interested in using an emulator like MesaDX

Quinntesson (Jeff Quinn, my brother, author of the Genesis/SegaCD/32X emulator AGES): His understanding and interest in the more technical aspects of emulation have greatly increased my own understanding of emulation. Our long conversations about all things emulation-related have proved to be invaluable during the (long) development of MesaDX.


Chapter 1: Getting Started with MesaDX

1.1 Installing MesaDX

Simply copy the MesaDX program file (MesaDX.exe), and the Kokin.dll to the desired destination folder.

Depending on your version of Windows you may also require two other DLL files: mfc70.dll and msvcr70.dll. Both of these are available in a separate downloadable ZIP archive on the MesaDX webpage. If MesaDX Version 0.04 reports that it is missing any other DLLs, please contact the MesaDX author.


1.2 Associating Files with MesaDX

MesaDX registers itself with the Windows registry allowing files with specific extensions to be associated with MesaDX. Currently, these associations are not made automatically; it is up to the user to inform Windows which file extensions to associate with MesaDX. Future revisions of this manual will include specific instructions on how to associate *.mdx files with MesaDX for interested users. Those Windows users who already know how to make such associations manually may do so at any time. Once an association is made, simply double-click the desired MesaDX System Configuration (*.mdx) file to launch an instance of MesaDX using that system configuration.

Also, compiled within the MesaDX executable are several icons that can be used for files of types: *.mdx, *.sms, and *.gg.



Chapter 2: System Configurations and Power-On

MesaDX Version 0.04 supports a sophisticated mechanism for configuring the emulator. MesaDX allows the user to specify Power-On Configuration information and control precisely which devices are installed in the system. Users also pick which memory image files to associate with certain devices. All of this information can then be saved in MesaDX System Configuration (*.mdx) files. These system configuration files are a first step in making MesaDX more project-based. As such, system configuration files created with MesaDX 0.04 will most-likely not be compatible with future versions of MesaDX. Furthermore, the new capability of specifying which devices to install prohibits the use of system configuration files created with MesaDX 0.03 or 0.03a with MesaDX 0.04.


2.1 Creating a New System Configuration

To create a new system configuration, simply select New Configuration... from the File menu in the main MesaDX application window (or use the Ctrl-N hot-key combination). The New System Configuration dialog box will appear.

The New System Configuration window is broken into two tabbed dialog box sections: the Devices section and the Power-On Configuration section.

The Devices page allows the user to specify which devices they'd like to have installed in the system. A list of all the devices in an AGAMA (Sega Mark 3, Sega Master System, or Game Gear) system is shown under "Installed Devices". For each of these devices the Device ID, Model number and Version number is shown, or the device is marked "Not Installed". By clicking the device mnemonic in this list, the user is then allowed to select which device emulator they would like to have installed in that device slot. The list of available device emulators for a particular device slot is shown in the "Select Device to Install" list. This list shows all the devices that are suitable for a particular device slot. For example, selecting "PROC" in the "Installed Devices" list will allow the user to select which processor emulator they'd like to use in the current system configuration. In this release of MesaDX (and the Kokin DLL), only one processor device emulator is provided, (the A080 model). The information about the provided processor emulators is shown in the "Select Device to Install" list, and since only one emulator is provided and the PROC is a require device, this device emulator will be selected automatically. For other device slots, more than one device emulator may be available. Clicking a device in the "Select Device to Install" list will select that device for installation in the device slot specified. Descriptions for each of the device emulators are also provided when the device is clicked. This description should provide the user with enough information to decide which device emulator they want to use in a particular system configuration. If a device is not required for a particular device slot, then the option "Not Installed" will also appear in the "Select Device to Install" list. Selecting "Not Installed" will leave that device slot empty. If a device requires a memory image file, then the "Data File" and "Back-up RAM File" entry boxes will be enabled. All devices for which the "Data File" box is enabled will require that a data file be specified. Not specifying a file will result in an error. The "Back-up RAM File" is optional. The other tab, the Power-On Configuration tab, allows the user to specify flags that control how the emulator devices power-on. You will notice that some of the power-on configuration flags are disabled and that the Suspended flag is permanently checked. The current version of MesaDX does not support AGAMA Monitor Mode or GG Mode, so these flags are disabled. Also, MesaDX currently requires that the emulator start in the suspended state so that various debug features can be initialized, which is why the Suspended flag is checked. It is possible that future versions of MesaDX will allow the user to select whether or not the emulator powers-on in the suspended state. Currently, though, the user is permitted to adjust the settings of the other power-on configuration options: the machine region, clock frequency, the bus type, and the boot device.

The Export Region flag is used to indicate the system's region setting. When the flag is unchecked, the system is a native Japanese NTSC system. When the flag is checked, the system is an export (U.S. NTSC) system. (European PAL systems are not yet supported in MesaDX.) The Export Region flag is checked by default in MesaDX Version 0.04, (representing the personal biases of the emulator author).

The 50 Hz flag is used to select whether the system VDP should use a 60 Hz or 50 Hz clock. 60 Hz clocks are used by NTSC systems. 50 HZ are used by PAL systems.

The SMS1 Bus flag is used to indicate the behavior of the system's processor bus. When the flag is checked, the system uses a SMS1-type bus. A SMS1 bus retains the last data value driven on the bus. In the case of a bus transaction where no devices respond, the data returned is the last data value that appeared on the bus. Usually, this data value is the last byte of the most-recently fetched instruction. If the flag is unchecked, the system uses a SMS2/GG-type bus. This bus will always return a $FF if no data is driven on the bus by a responding device.

The final option, the Boot Device menu, allows the user to specify which memory device is enabled (mapped into the Z80 address space) at power-on. The default is the Boot ROM, which represents the system's internal ROM or "BIOS". (BIOS is technically the wrong term since BIOS is an acronym for Basic Input/Output Service which doesn't really exist in the Sega Mark III Architecture. For this reason, all MesaDX documentation will refer to the built-in system ROM as Boot ROM, or BROM.)

Along with the Boot Device option comes a Lock Boot Device flag. This flag will prevent the boot device from being mapped out of addressable memory via writes to port $3E, permanently locking the Boot Device into addressable memory. Once the memory devices have been configured, the Power On button should be click to being the emulation session. If a Power On problem occurs it is likely a result of a badly configured system. In general, the steps required to successfully create a system configuration are:

Once the system is powered-on, the system configuration can be saved. Select the Save or Save As... options from the File menu in the main MesaDX application window to save the system configuration.


2.2 (Quick Start) Loading ROM Images

The procedure described above for creating a new system configuration allows the user a great deal of flexibility, but sometimes that much flexibility is unnecessary. MesaDX Version 0.04 provides a quicker way of creating a system configuration when the user simply wants to load a ROM image file as a standard game cartridge.

To quickly load a ROM image as a cartridge, simply select Load ROM Image... from the File menu in the main MesaDX application window (or use the Ctrl-I hot-key combination). The New System Configuration dialog box will open, with the system pre-configured and ready for power-on. The user can select one of 6 different types of pre-configured system configurations in the "System Type" drop-down box. These include:

ConfigurationExport Region Flag 50Hz FlagVDP Type
SMS1 Export NTSC (American)SETCLEARKokinVDP_A124 (315-5124, SMS1-compatible)
SMS1 Export PAL (European)SETSETKokinVDP_A124 (315-5124, SMS1-compatible)
SMS1 Japan NTSC (Japanese)CLEARCLEARKokinVDP_A124 (315-5124, SMS1-compatible)
SMS2 Export NTSC (American)SETCLEARKokinVDP_A246 (315-5246, SMS2-compatible)
SMS2 Export PAL (European)SETSETKokinVDP_A246 (315-5246, SMS2-compatible)
SMS2 Japan NTSC (Japanese)CLEARCLEARKokinVDP_A246 (315-5246, SMS2-compatible)
Table 2.2.a: Summary of Available Pre-defined System Configurations

The default configuration is the first one, SMS1 Export NTSC (American). Selecting OK will power-on the system. However, if the user desires to view or modify the default configuration settings before power-on, then check the Show System Configuration box before clicking OK. Doing so will open the standard System Configuration dialog box when the user does click OK. All the devices will already be configured as appropriate based on the system configuration they chose. The user can now modify the system configuration as desired. Clicking OK here will then power on the system.

Technical Note

MesaDX correctly emulates the mechanism by which memory devices are mapped into and out of the processor's address space. Consequently, some commercial game software will not work correctly without an official Sega Boot ROM ("BIOS") image.

Most SMS Boot ROM code initializes the first byte of RAM (address $C000) with a bit mask indicating which memory devices are enabled, and some commercial game software depends on this value. MesaDX Version 0.04 does not pre-initialize $C000 and it's possible that the default value, if read by software, will confuse it into incorrectly disabling or enabling a memory device. To prevent this MesaDX provides the Lock Boot Device power-on configuration option. It is recommended that this option be used unless specifically testing Boot ROM ("BIOS") software that is intended to correctly detect and enable memory devices.


2.3 Viewing the Current System Configuration

Once a system configuration has been created, and the system has been powered-on, the configuration can be viewed by selecting System Configuration from the Configuration menu in the main MesaDX application window.

The System Configuration view contains the Power-On Configuration settings as well as a list of all the installed emulator devices. Along with the device mnemonic, each installed device has its Device ID, Model and Version numbers listed. These identifiers are not that important in this version of MesaDX, but they will be critical once AGAMA Monitor Mode is supported. Devices not currently installed in the emulation system are labelled as Not Installed.

For more information about each device, select a device mnemonic in the device list (even for devices not installed) and click the Details... button. A window showing the device mnemonic, ID, model and version numbers will open. The window will also contain a short description of the device. For memory devices, the data files installed as the memory contents will also be shown.


2.4 Power-On Self Test (POST)

When the emulation system first powers-on, each device executes a
Power-On Self Test to verify that everything is in working order. The tests vary from device to device, but for the most part the tests consist of verifying compile-time assumptions, checking that required devices are installed correctly, and ensuring that ROM image files are not too large for their respective devices. (For example, Sega Card devices only support ROM images of 32KB.) If one or more device's POST fails, a Power-On Self Test (POST) Summary window will open showing the POST results for each installed device.

The POST result code is available in the 4 most-significant bits of the devices Power-On Configuration Register (POCR). If the result code is non-zero, then the POST failed. The result codes are device-dependent and can be found in Appendix B: Power-On Self Test (POST) Code Summary in the Kokin User's Manual.

If all the devices pass POST the emulator has successfully powered-on and is ready to be used.


Chapter 3: Running the Emulator


3.1 Resuming and Suspending Emulation

Table 3.1.a lists the commands, along with their hot-key combinations, that are implemented in the current version of MesaDX for controlling emulation. All of these commands are also available under the Debug menu in the main menu bar.

CommandHot-Key
ResumeF5
SuspendShift+F5
Power-On (Hard-Reset)Ctrl+F12
StepF11
Table 3.1.a: Emulation Control Commands and Hot-Key Cominbations

The Resume and Suspend commands are mutually exclusive; only one is enabled at a time, depending on the current state of the emulator. Suspend is used to pause emulation. Each device is suspended and will no longer perform an active processing (only the PROC, VDP, and PSG perform active processing). Devices will still respond to bus transactions, though, so their state can be queried and modified by the user (through the various data views described in Chapter 4), if desired.

If the emulator is suspended, emulation can be resumed using the Resume command. The state of emulation (resumed or suspended) is shown in a small status pane in the lower right-hand corner of the main MesaDX application window.

The Power-On (Hard-Reset) command restarts the emulator in a way similar to turning the power off and then back on. Hard Reset differs from pushing the Reset button on the console. The Reset button is just a "soft-reset" and is implemented in the game software. Power-On (Hard-Reset) is the only way to get the emulator out of the Shutdown state. (Shutdown is discussed in more detail in section 3.3: Shutdown.)

Finally, the Step command is used to single-step through instructions.


3.2 Control Pad 1

In MesaDX Version 0.04 the only peripheral device that is emulated is Control Pad 1. The control pad is standard SMS-type control pad consisting of a 4-way directional pad along with two buttons. Table 3.2.a shows which keyboard keys map to the control pad buttons. The table also shows which keys map to the consoles Pause and Reset buttons.

Keyboard KeyFunction
Up ArrowUP
Down ArrowDOWN
Left ArrowLEFT
Right ArrowRIGHT
ZBUTTON 2
XBUTTON 1
SpacebarPAUSE
HomeRESET
Table 3.2.a: Mapping of keys to emulator peripheral (controller) functions

Please note that in order to use these keys for controller 1, the Primary Video Output view must be the active window. (The Primary Video Output view opens automatically when a system configuration is loaded.) If another view is active, any keystrokes will be directed to that view (notably the arrow keys which are used to scroll certain views).

Future versions of MesaDX will support peripheral port 2 and other controller types.


3.3 Shutdown

When the emulator encounters a fatal error, or a compulsory event triggers and no handling mechanism is defined, the system will enter Shutdown. The only way to get out of the shutdown state is to perform a Power-On (Hard-Reset).

When the emulator enters Shutdown, a message box indicating the cause will be displayed. The message box will indicate the responsible device and give the shutdown code. Table 3.3.a below lists the shutdown codes defined in the current release of MesaDX along with a brief description of each code.

Shutdown CodeMnemonicDescription
1REENTERMONITORThe emulator attempted to re-enter monitor mode while it was in monitor mode.
2READAXRThe HUB attempted to read a device's AXR to determine how a triggered event was to be handled, and the read failed. (When a device event triggers the HUB must query the device to determine how the event is to be handled. See the AGAMA Specification for more information about events and event handling.)
3BROADCASTERRORThe HUB attempted to broadcast a system message to all the device and the broadcast failed for some reason.
4DEVICEEVENTA device event triggered and the event handling mechanism specified in the device's DEFR requested that the system go into Shutdown.
5NODEFRFLAGSA device event triggered but no event handling mechanism was specified in the device's DEFR.
6UNKNOWNDEFRFLAGA device event triggered but a reserved or undefined flag in the device's DEFR was set.
Table 3.3.a: Shutdown Codes and Descriptions

Most of the codes above apply to monitor mode, which is disabled in the current version of MesaDX, so Shutdown should occur very infrequently. In fact, the only time Shutdown should occur with the current version of MesaDX is if the SHUTDOWN event handling flag for a specific device event is set, or in other words, the user requested that the system shutdown (instead of suspending) in response to a certain event. Please note that all compulsory events have their SHUTDOWN flags set automatically, so if a compuslory event triggers and no other event handling mechanism is specified the system will shutdown.


Chapter 4: Using the Views

MesaDX provides a number of views that display important information about the emulator state. Each view is in its own window and can be re-sized or moved individually. Also, some views have scrolling capabilities. Scrolling is normally done by clicking the scroll-bar on the right edge of each view window, but the keyboard can also be used. Arrow keys scroll the view by one line. The Page Up or Page Dn keys scroll the view by one page.


4.1 Instruction Unassembly View

The Instruction Unassembly view can be opened by selecting Instruction Unassembly in the View menu in the main menu bar. This view displays unassembled instructions, starting from address 0x0000 and unassembling through to the end of memory (64KBytes). The unassembly view interprets all memory as code, and makes no effort to determine the location of data sections in the ROM image.

Technical Note

The Instruction View determines instruction boundaries by unassembling data from the beginning of memory (address $0000) through to the end.

Due to paging and data sections in memory, the instruction boundaries shown may not always be the true boundaries. As result, execution may sometimes appear to jump into the middle of an instruction as shown in the Instruction Unassembly view. If the processor's PC isn't equal to a current instruction boundary, use the "Expand Listing" option in the Instruction Unassembly view's toolbar to show instruction unassembly at each byte in memory. The current instruction will be highlighted in a gray box. (See below for more information on the "Expand Listing"option.)

Each unassembled instruction is one row in the view. The information for each instruction is arranged in columns. The left-most column contains the instruction's address in hexadecimal. The next column is the instruction object code, also in hexadecimal. Finally, the last column is the instruction mnemonic and operands. All immediate operands are displayed in hexadecimal.

The instruction pointed to by the current PC is highlighted in a gray box. This instruction is the next instruction to be executed. For some types of instructions a fourth column showing additional information will be displayed. For memory reference instructions, the current data in memory at the reference address will be shown. For jump or branch instructions the current and target PC will be shown. The forth column is only displayed for the current instruction.

The Instruction Unassembly view also includes a toolbar to ease navigation through the unassembly listing.

Type a memory address in the "Scroll to" box (and press 'Enter') to have the view scroll directly to nearest instruction on or before that address. Pressing 'Escape' will cancel the "Scroll to" operation.

Check the "Track PC" box to always keep the current instruction in view. (If the current instruction is not on a recognized instruction boundary, the view will jump to an address near the current instruction. Use the "Expand Listing" option to make all the instructions visible.)

Check the "Expand Listing" box to show the unassembly for every byte in memory. Instructions in black are those instructions that line on instruction boundaries based on unassembly starting from address $0000 in memory. Instructions printed in gray are instructions that do not lie on instruction boundaries based on unassembly starting from address $0000 in memory. (See the Technical Note above for more information about instruction boundaries.)


4.2 Processor (PROC) Registers View

The Processor (PROC) Registers view can be opened by selecting Processor (PROC) Registers from the View menu in the main menu bar. This view displays the current contents of the processor registers. It also shows the state of each flag in the flags register (the "F" register.) All register data is displayed in hexadecimal.

The Processor (PROC) Registers view can also be used to edit the values in registers or flags.

Registers can be edited by typing a new value into the register edit box and pressing 'Enter'. To cancel an edit, press 'Escape' instead. The Tab key can be used to cycle through the registers for editing.

The flags can be edited two ways. The first is to simply edit the value in the "AF" register as described above. This method requires that you know which bits correspond to which flags. The other way is to set the flag bits directly by clicking on the radio button for the desired settings in the right hand side of the register view. Note that the Parity and Overflow flag are really the same flag bit; setting (or reseting) one will like-wise set (or reset) the other.

Whenever a register or flag is changed during execution, the change is highlighted in red text. These highlights can be used to quickly determine when a register value changes. If a register's value didn't change during execution, the value will be displayed in the standard black text. Note that when executing a group of instructions using the Resume command, any changes to register values are highlighted, not just the changes made during the execution of the last instruction in the group.


4.3 Video Display Processor (VDP) Registers View

The Video Display Processor (VDP) Registers view can be opened by selecting Video Display Processor (VDP) Registers from the View menu in the main menu bar. This view displays the current contents of the VDP registers and palette registers. All register data is displayed in hexadecimal.

The Video Display Processor (VDP) Registers view can also be used to edit the values in the VDP or Palette registers.

Registers can be edited by typing a new value into the register edit box and pressing 'Enter'. To cancel an edit, press 'Escape' instead. The Tab key can be used to cycle through the registers for editing.

Like the Processor (PROC) Register view, changes in a register's value during execution are highlighted in red text. If a register's value didn't change during execution, the value will be displayed in the standard black text. Note that when executing a group of instructions using Resume command, any changes to register values are highlighted, not just the changes made during the execution of the last instruction in the group.


4.4 Programmable Sound Generator (PSG) Registers View

The Programmable Sound Generator's (PSG) Registers view can be opened by selecting Programmable Sound Generator (PSG) Registers from the View menu in the main menu bar. This view displays the current contents of the PSG registers. It also interprets the contents of the noise channel registers allowing the user to quickly interpret how the noise channel is configured. All register data is displayed in hexadecimal.

The Programmable Sound Generator (PSG) Registers view can also be used to edit the values in registers or noise channel settings.

Registers can be edited by typing a new value into the register edit box and pressing 'Enter'. To cancel an edit, press 'Escape' instead. The Tab key can be used to cycle through the registers for editing.

The noise channel configuration can be adjusted in two ways. The first is to simply edit the value the noise channel control register as described above. This method requires that you know which bits correspond to which settings. The other way is to set the control bits directly by clicking on the radio buttons for the desired settings in the right hand side of the register view.

Whenever a register or flag is changed during execution, the change is highlighted in red text. These highlights can be used to quickly determine when a register value changes. If a register's value didn't change during execution, the value will be displayed in the standard black text. Note that when executing a group of instructions using the Resume command, any changes to register values are highlighted, not just the changes made during the execution of the last instruction in the group.


4.5 AGAMA Extension Registers (AXR) Views

Each device in the Kokin emulator library is an AGAMA device and consequently contains a set of 256 AGAMA Extension Registers (AXR). These registers contain device status and configuration information and providing access to the device's AGAMA feature extensions.

The AXRs in each of the views described below can be edited by typing a new value into the register edit box and pressing 'Enter'. To cancel an edit, press 'Escape' instead. The Tab key can be used to cycle through the registers for editing.

Whenever a register is changed during execution, the change is highlighted in red text. These highlights can be used to quickly determine when a register value changes. If a register's value didn't change during execution, the value will be displayed in the standard black text. Note that when executing a group of instructions using the Resume command, any changes to register values are highlighted, not just the changes made during the execution of the last instruction in the group.

4.5.1 External Debugger (EXTD) AXRs View

No AXRs view for the External Debugger is available in the current version of MesaDX.

4.5.2 Processor (PROC) AXRs View

The Processor (PROC) AXRs view can be opened by selecting AGAMA Extensions Registers from the View menu in the main menu bar, and then selecting Processor (PROC) AXRs. All register data is displayed in hexadecimal.

Please see Chapter 2: KokinMIOH in the Kokin User's Manual for more information about the Memory and I/O Hub included in the Kokin emulation library.

4.5.3 Memory and I/O Hub (HUB) AXRs view

The Memory and I/O Hub (HUB) AXRs view can be opened by selecting AGAMA Extensions Registers from the View menu in the main menu bar, and then selecting Memory and I/O Hub (HUB) AXRs. All register data is displayed in hexadecimal.

Please see Chapter 3: KokinMIOH in the Kokin User's Manual for more information about the Memory and I/O Hub included in the Kokin emulation library.

4.5.4 Boot ROM (BROM) AXRs View

The Boot ROM (BROM) AXRs view can be opened by selecting AGAMA Extensions Registers from the View menu in the main menu bar, and then selecting Boot ROM (BROM) AXRs. All register data is displayed in hexadecimal.

Please see Chapter 6: KokinA235 in the Kokin User's Manual for more information about the memory device and mapper used to implement the BROM that is included in the Kokin emulation library.

4.5.5 System RAM (SRAM) AXRs View

The System RAM (SRAM) AXRs view can be opened by selecting AGAMA Extensions Registers from the View menu in the main menu bar, and then selecting System RAM (SRAM) AXRs. All register data is displayed in hexadecimal.

Please see Chapter 4: KokinSRAM in the Kokin User's Manual for more information about the System RAM device included in the Kokin emulation library.

4.5.6 Sega Card (CARD) AXRs View

The Sega Card (CARD) AXRs view can be opened by selecting AGAMA Extensions Registers from the View menu in the main menu bar, and then selecting Sega (CARD) AXRs. All register data is displayed in hexadecimal.

Please see Chapter 5: KokinCARD in the Kokin User's Manual for more information about the Sega Card device included in the Kokin emulation library.

4.5.7 External Device 0 (EXT0) AXRs View

The External Device 0 (EXT0) AXRs view can be opened by selecting AGAMA Extensions Registers from the View menu in the main menu bar, and then selecting External Device 0 (EXT0). All register data is displayed in hexadecimal.

Please see Chapter 6: KokinA235 in the Kokin User's Manual for more information about the memory device and mapper used to implement the EXT0 that is included in the Kokin emulation library.

4.5.8 External Device 1 (EXT1) AXRs View

This device is not implemented in this version of MesaDX, and no AXRs view is available.

4.5.9 Video Display Processor (VDP) AXRs View

The Video Display Processor (VDP) AXRs view can be opened by selecting AGAMA Extensions Registers from the View menu in the main menu bar, and then selecting Video Display Processor (VDP) AXRs. All register data is displayed in hexadecimal.

Please see Chapter 7: KokinVDP in the Kokin User's Manual for more information about the VDP device included in the Kokin emulation library.

4.5.10 Programmable Sound Generator (PSG) AXRs View

The Programmable Sound Generator (PSG) AXRs view can be opened by selecting AGAMA Extensions Registers from the View menu in the main menu bar, and then selecting Programmable Sound Generator (PSG) AXRs. All register data is displayed in hexadecimal.

Please see Chapter 8: KokinPSG in the Kokin User's Manual for more information about the PSG device included in the Kokin emulation library.

4.5.11 FM Unit (FMU) AXRs View

This device is not implemented in this version of MesaDX, and no AXRs view is available.


4.6 Processor (PROC) Memory View

The Processor (PROC) Memory view can be opened by selecting Processor (PROC) Memory from the View menu in the main menu bar. This view displays the current memory as viewed from the processor's perspective. The view shows the memory map as the processor would see it, with all paging, RAM mirroring, and device enabling in place. All memory data is displayed in hexadecimal.

To edit the memory contents, simply double-click on the byte or word that should be changed. An edit box will open allowing the user to enter a new value. Press the "Enter" key to commit the result. "ESC" will cancel the edit. The Processor (PROC) Memory view also includes a toolbar that allows some customization of the display.

Type a memory address in the "scroll to" box (and press 'Enter') to have the view scroll directly to a memory address. Pressing 'Escape' will cancel the "Scroll to" operation.

Chose between "Byte Width" or "Word Width" to select how the data should be displayed.

Check the "Display ASCII" box to show the ASCII characters for each byte of memory. Unprintable characters are shown as a period (.).


4.7 Video Display Processor (VDP) Memory View

The Video Display Processor (VDP) Memory view can be opened by selecting Video Display Processor (VDP) Memory from the View menu in the main menu bar. This view displays the current contents of VRAM. All memory data is displayed in hexadecimal.

To edit the memory contents, simply double-click on the byte that should be changed. An edit box will open allowing the user to enter a new value. Press the "Enter" key to commit the result. "ESC" will cancel the edit. The Processor (PROC) Memory view also includes a toolbar that allows some customization of the display.

Type a memory address in the "Scroll to" box (and press 'Enter') to have the view scroll directly to a memory address. Pressing 'Escape' will cancel the "Scroll to" operation.


4.8 Primary Video Output View

The Primary Video Output view can be opened by selecting Primary Video Output from the View menu in the main menu bar. The Primary Video Output view is opened automatically when a system configuration is opened and powered-on. This view displays the primary video output from the VDP which, in the current KokinVDP implemention, is the game screen. Note that the VDP only updates this view while the emulator is running (resumed).

Also, the Primary Video Output view is the target for peripheral (controller) input. See Table 3.2.a: Mapping of Keys to Emulator Peripheral (Controller) Functions for the mapping of keys to the emulator input functions. Please note that the Primary Video Output view must be the active window in order for user input to be considered controller intput directed toward the emulator.

The Primary Video Output view also includes a toolbar that allows some customization of the display.

Check the "Double Size (Magnify 2x)" box to double the size of the view.


4.9 Tiles/Palette View

The Tiles/Palette view can be opened by selecting Tiles/Palette from the View menu in the main menu bar. This view displays the secondary video output from the VDP which, in the current KokinVDP implemention, is a rendering of the current tiles in VRAM along with swatches of the current palette. Note that the VDP only updates this view while the emulator is running (resumed).

The Tiles/Palette view also includes a toolbar that allows some customization of the display.

Check the "Double Size (Magnify 2x)" box to double the size of the view.

If the VDP is in Mode4, checking the "Use Sprite Palette" box will instruct the VDP to render the tiles using the sprite palette (last 16 palette entries) instead of using the normal first 16 palette entries.

If the VDP is in Graphics2, then checking the "Use Sprite Palette" box will instruct the VDP to render the sprite patterns and the fixed Graphics2 palette. Unchecking the option will instruct the VDP to simply render the pattern table.

Note that the affect of checking (or unchecking) the "Use Sprite Palette" box will only be seen while the emulator is running (resumed) since the VDP renders this screen only while it is running. If the emulator is suspended when the box is checked or unchecked, the update won't occur until the next time the emulator resumes execution.


4.10 Breakpoints View

The Breakpoints view can be opened by selecting Breakpoints from the Debug menu in the main menu bar, or by using the hot-key combination Ctrl-B. This view contains a listing of all currently defined breakpoints as well as a toolbar for easy breakpoint management.

To add a breakpoint, click the Add button in the Breakpoint view's toolbar. An Add Breakpoint dialog box will open. The current version of MesaDX supports the following breakpoint types:

In the Add Breakpoint dialog box, select the type of breakpoint desired, and then define the breakpoint location. If the location is a memory or port address, type the address in the Memory/Port Address edit box and type 'Enter' to commit the address ('Escape will discard the address). Otherwise, use the drop down boxes for the appropriate breakpoint type to select the breakpoint location. For the PSG, see Table 4.10.a for a list of the mnemonics used to refer to the different PSG registers. The register mnemonics for the other devices are self explanatory.

MnemonicRegister Name
C0FRChannel 0 Frequency Register
C0ARChannel 0 Attenuation Register
C1FRChannel 1 Frequency Register
C1ARChannel 1 Attenuation Register
C2FRChannel 2 Frequency Register
C2ARChannel 2 Attenuation Register
NCCRNoise Channel Control Register
NCARNoise Channel Attenuation Register
Table 4.10.a: PSG Register Mnemonics

Once the breakpoint type and location have been selected, click "OK" to add the breakpoint. The new breakpoint will appear in the Breakpoints view. The type and location of the breakpoint will be shown and the breakpoint will be enabled.

Once a breakpoint is added it can be removed or disabled.

Removing a breakpoint deletes it from the list. Once a breakpoint is removed it has to be added again using the Add button and the breakpoint type and location information will have to be re-entered. To remove a breakpoint, select the breakpoint from the list by clicking in the Type column in the row corresponding to the desired breakpoint. The breakpoint should be highlighted. Now, click the Remove button in the Breakpoints view toolbar. The breakpoint will be removed from the list and will no longer trigger.

However, if a breakpoint only needs to be temporarily removed, it is better to simply disable it. To disable a breakpoint, select the breakpoint from the list by clicking in the Type column in the row corresponding to the desired breakpoint. Now, the Enabled check box can be clicked to disable the breakpoint. The breakpoint information will remain in the breakpoints list, but the breakpoint will no longer trigger. To re-enable the breakpoint simply select the desired breakpoint and again and check the Enabled box in the toolbar. Enabling and disabling a breakpoint is a convenient way control breakpoint behavior without the need to keep re-entering breakpoint information.

To remove all breakpoints at once, click the Remove All button in the Breakpoints view toolbar.

Technical Note

The Breakpoints view requires the SUSPEND event handling flag for certain device events to be set.

The primary mechanism for supporting breakpoints in AGAMA devices is to specify that certain events should suspend emulation. Immediately after Power-On (Hard-Reset) MesaDX automatically sets the SUSPEND event flag for various device events so that the standard breakpoints will work. The following is a list of the device events whose SUSPEND flags are set automatically by MesaDX:

  • KOKINPROC_EVENT_BP_INCORRECTRESPONSESIZE
  • KOKINPROC_EVENT_BP_REGISTER_WRITE
  • KOKINPROC_EVENT_BP_REGISTER_READ
  • KOKINPROC_EVENT_BP_MEMORY_FETCH
  • KOKINPROC_EVENT_BP_MEMORY_WRITE
  • KOKINPROC_EVENT_BP_MEMORY_READ
  • KOKINPROC_EVENT_BP_PORT_OUT
  • KOKINPROC_EVENT_BP_PORT_IN
  • KOKINPROC_EVENT_BP_NORESPONSE_ON_MEMFETCH
  • KOKINPROC_EVENT_BP_NORESPONSE_ON_MEMWRITE
  • KOKINPROC_EVENT_BP_NORESPONSE_ON_MEMREAD
  • KOKINPROC_EVENT_BP_NORESPONSE_ON_PORTOUT
  • KOKINPROC_EVENT_BP_NORESPONSE_ON_PORTIN
  • KOKINPROC_EVENT_BP_NORESPONSE_ON_AXRWRITE
  • KOKINPROC_EVENT_BP_NORESPONSE_ON_AXRREAD
  • KOKINSRAM_EVENT_PT_MEMORY_FETCH
  • KOKINSRAM_EVENT_PT_MEMORY_WRITE
  • KOKINSRAM_EVENT_PT_MEMORY_READ
  • KOKINVDP_EVENT_BP_COMPATIBILITYWARNING
  • KOKINVDP_EVENT_BP_REGISTER_WRITE
  • KOKINVDP_EVENT_BP_PALETTE_WRITE
  • KOKINVDP_EVENT_BP_MEMORY_WRITE
  • KOKINVDP_EVENT_BP_MEMORY_READ
  • KOKINPSG_EVENT_BP_REGISTER_WRITE
The user is urged not to reset the SUSPEND flag for these device events.


4.11 Debug Console View

The Debug Console View is not available in MesaDX Version 0.04. Future versions of MesaDX will support include a SDSC Debug Console screen.


Chapter 5: Advanced Debug Capabilities


5.1: SDSC Debug Console

The SDSC Debug Console is not available in the current version of MesaDX. Future versions will support all the SDSC Debug Console functionality.


5.2: Events

The most fundamental debug features added to the SM3A via the AGAMA Extensions are events and event handling. Through the event handling mechanism both breakpoints and monitor mode can be implemented. This section covers a little bit about how events work and how to specify handling mechanisms for events. By programming events directly, the user can create many more types of breakpoints then just those currently supported in the Breakpoints view.

The current versions of MesaDX and the Kokin emulator library support two different mechanisms for handling events: SUSPEND and SHUTDOWN. If SUSPEND is specified for an event and the event triggers, the emulator will suspend execution, allowing the user to investigate the exact circumstance and instruction where the event triggered. If SHUTDOWN is specified for an event and the event triggers, the emulator will enter Shutdown mode. Once the emulator is in shutdown the only way to get out is to perform a Power-On (Hard-Reset). The user can still investigate the reasons the system entered shutdown, via the various device AXR views, but generally SUSPEND is preferred since emulation can be resumed from right where it left off. Note, though, that if no event handling mechanism is specified at all for an event and the event triggers, the system will automatically enter Shutdown.

Programming an event cause the system to either suspend or shutdown is accomplished via the device's Event Handling Code Register (EHCR) and EVent Handling Flags Register (EHFR). First, write the 8-bit event code for the desired event into the EHCR (use the device's AXR view for this). Once the write is committed the EHFR will be updated to reflect that event's current handling flags. Now, set either the SUSPEND flag (bit 8) or the SHUTDOWN flag (bit 10), or both. Note, though, that the SHUTDOWN bit is ignored unless no other handling flag is set, so setting both flags is unnecessary. Now, the next time the event triggers the system will either suspend or shutdown. In the case of suspend, though, the way the system resumes depends on the type of event. Event types are discussed next.

There are three kinds of events currently defined in the AGAMA specification: compulsory events, protection events, and breakpoint events. Each of these events behaves slightly differently and affects the way the system resumes.

Compulsory events always trigger. They cannot be silenced (via the COMPATIBLESILENT or MONITORSILENT flags in the EHFR). Generally a compulsory events indicate errors that the system cannot resolve on its own. The user will usually have to manually re-configure some portion of the system to prevent a compulsory event from triggering. An example of a compulsory event is the processor's INVALID_INSTR event that gets triggered whenever the processor encounters an unknown (or unsupported) opcode. Compulsory events have their SHUTDOWN flags set by default, so if no other handling mechanism is specified, the system will simply enter shutdown when a compulsory event triggers.

Protection events are the second kind of event. Protection events are generally used to prohibit certain actions, like data writes. When a protection event triggers it indicates that an illegal action was attempted. The event triggers to allow the user to respond to or investigate the action before any machine state is altered or corrupted. One example of a protection event is in the SRAM device which allows various types of protection to be applied to RAM. Unlike compulsory events, protection events can be silenced. However, the action that triggers the event is still prohibited. For example, if memory writes to RAM are protected, and the event is silenced, a write transaction will still occur, but the SRAM device will simply throw out the write data leaving memory unchanged. Protection events also have their SHUTDOWN flags set by default, so if no other handling mechanism is specified, the system will simply enter shutdown when a protection event triggers.

The third and final type of event is a breakpoint event. Breakpoint events are similar to protection events except that a silenced breakpoint event allows the action to proceed. Furthermore, the silence flags for breakpoint events are automatically set when the event triggers. This allows the user to investigate the cause of the breakpoint but then easily resume execution without having to worry about the breakpoint triggering again. Unlike compulsory and protection events, breakpoint events do not have their SHUTDOWN flags set. If no handling mechanism for a breakpoint event is specified the event is simply ignored.

Please see the AGAMA Specification for more information on events and event handling, and please see the Kokin User's Manual for information about specific device events.


5.3: Determining Why the Emulator Suspended

Given the number and kinds of breakpoints that can be specified (using the Breakpoints view or using event handling flags) it can be difficult to determine the exact breakpoint that triggered. Forunately, there are signs in the device AXRs that will precisely describe why emulation suspended.

The first place to look is the Hub's Last Message Information Register (LMIR) and Last Message Data Register (LMDR). The Hub's LMIR contains the Device ID and message code of the last message broadcast by the Hub. The Device ID is in the high 8-bits of the LMIR. The message code is in the low 8-bits of the LMIR. If the system just suspended the message code will almost certainly be $03, which is the code for the SUSPEND system message. (See the Kokin User's Manual for a complete list of all the system message codes.)

Once the Device ID is found from the Hub's LMIR, the Device Event Code Register (DECR), Device Event Address Register (DEAR), Device Event Data Register (DEDR), and the Device Event Flags Register (DEFR) for that device can be examined to determine why the device requested that the system suspend. See the Kokin User's Manual for information about each device's events and event codes.


Glossary

A


AGAMA
AGAMA is a specification for extending the Sega Mark III Architecture with software debug features. The 3 main enhancements AGAMA offers are: the AGAMA Extension Register (AXR) file, the addition of Monitor Mode, and the addition of the External Debugger (EXTD) device, which is used to control machine execution and insert and extract state from system devices.

AGAMA Device
Any system device containing both an AGAMA Extension Register file and which includes the functionality required to implement Monitor Mode. Each device in the Sega Mark III Architecture was enhanced with these two extensions to create the devices used in an AGAMA system.

AGAMA Extension Register (AXR)
One of 256 debug registers added to each AGAMA Device for the purposes of implementing software debug features.

AXR
See AGAMA Extension Register (AXR)


B


Big Endian
See Endian, Big

Breakpoint Events
See Events, Device


C


Compatible Mode
The normal Sega Mark III Architecture (SM3A) execution mode. Also see Monitor Mode.

Compulsory Events
See Events, Device


D



E


Endian, Big
A term describing computers or microprocessors that order multiple-byte data in memory by placing the most-significant byte at the lowest starting address and placing the other bytes in order of decreasing significance in consecutively higher memory addresses. The Motorola 68x00 family microprocessors are big endian. Also see Endian, Little.

Endian, Little
A term describing computers or microprocessors that order multiple-byte data in memory by placing the least-significant byte at the lowest starting address and placing the other bytes in order of significance in consecutively higher memory addresses. The Intel x86 family and the Zilog Z80 are examples of little-endian microprocessors. Also see Endian, Big.

Events, Device
Events denote important actions that take place in a device and can be use to trap for certain actions taking place. Events are device-specific. The AGAMA Specification currently defines three kinds of events: compulsory, protection, and breakpoint events. Compulsory events cannot be silenced and usually indicate an unrecoverable error. If no handling mechanism is specified, compulsory events will automatically result in system shutdown. Protection events indicate that a prohibited action was attempted. Protection events can be silenced, but the action will still be prohibited, (i.e., if a write protect event is silenced the data write still won't occur, and the event will not trigger). If no handling mechanism is specified, protection events will automatically result in system shutdown. Breakpoint events are used to indicate possibly interesting actions or occurring. Breakpoint events can be silenced, but unlike protection events, the action is allowed to proceed as normal. The SILENCE flag is automatically set for breakpoint events once the trigger. Breakpoint events are ignored if no event handling flag is set for them.

Export Region
See Region


F


Frame
See Page Frame


G


Game Gear, Sega
A portable game system based on the Sega Mark III Architecture (SM3A). The Game Gear has an improved VDP, stereo sound and a built-in controller and screen.


H


Hard Reset
See Reset, Hard

Hub Device
Any AGAMA Device connected to the system's HUB via the Hub Device Bus. All the devices in the system except the PROC, EXTD, and HUB are Hub Devices. They generally consist of memory, video and audio devices.

Hub Device Bus
The bus connecting all Hub Devices to the HUB.


I


Input/Output Ports
Software-accessible ports used for accessing a system device's registers or services.


J


Japan Region
See Region


K



L


Little Endian
See Endian, Little


M


Mark III, Sega
Initial implementation of the Sega Mark III Architecture (SM3A). The Mark III was only released in Japan.

Master System, Sega
Second implementation of the Sega Mark III Architecture (SM3A). The Master System was released world-wide. The Japanese version had an additional FM sound synthesizer in addition to the standard Programmable Sound Generator.

Monitor Mode
A special execution mode defined by the AGAMA Specification that exists underneath the normal Sega Mark III Architecture (SM3A) execution environment (compatible mode) that provides software with access to each device's AGAMA features and AXRs. Also see Compatible Mode.


N



O



P


Page
A 16KByte are of memory, typically ROM, that can be mapped in and out of processor-addressable memory space.

Page Frame
A region in main memory used for mapping pages. Page frames are 16KBytes in size and begin at 16KByte boundaries: $0000, $4000, $8000, and $C000.

Peripheral Ports
Connections on the Sega Mark III or Sega Master System that peripheral controllers or light guns plug into.

Power-On (Hard-Reset)
See Reset, Hard

Power-On Self Test (POST)
The Power-On Self Test is a series of tests each device performs at power-on to make sure everything is in working order. The tests generally include verifying compile-time assumptions, making sure all required devices are installed correctly, and ensuring that ROM image files are not too large.

Programmable Sound Generator (PSG)
The PSG is the main source of audio output in the Sega Mark III Architecture (SM3A). The PSG used in the SM3A is based off of Texas Instrument's SN76489 sound generator.

Protection Events
See Events, Device


Q



R


RAM
Random-Access Memory. RAM can be read and written.

Region
The region setting is used by software to determine the kind of machine it is running on. There are two region settings: Japan and Export. The region setting can be used by software to display text or graphics in the correct language for the user.

Reset, Hard
A Hard Reset is equivalent to powering the machine off and back on again. A hard reset re-initializes every portion of the machine state.

Reset, Soft
A soft reset is accomplished by pressing the console's Reset button. Soft resets are implemented in software. Pressing the console's Reset button sets a flag in the Hub that software can test and determine if reset code should be executed.

Resume
A mode where the emulator is actively running, in contrast to the Suspend mode.

ROM
Read-Only Memory. ROM is read-only and cannot be written to.


S


Sega Mark III Architecture (SM3A)
The Sega Mark III Architecture is a term covering the system design of three different game consoles: the Sega Mark III, the Sega Master System, and the Sega Game Gear. All three of these systems share a similar architecture from the programmer's perspective. This architecture has been dubbed the Sega Mark III Archtiecture for the purposes of the MesaDX project.

Shutdown
A mode where the emulator machine has encountered a fatal or unrecoverable error and is no longer able to operate correctly. A Power-On (Hard-Reset) is required to get the system out of shutdown.

Soft Reset
See Reset, Soft

Suspend
A mode where the emulator is not actively running, in contrast to the Resume mode. Suspended devices will still respond to bus transactions.


T



U



V


Video Display Processor (VDP)
The VDP is the source of all video output in the Sega Mark III Architecture (SM3A). The VDP used in the SM3A is based off of the Texas Instruments TMS9918 display processors.


W


WLA-DX
An assembler for various microprocessors, including the Zilog Z80, which includes special directives for handling Sega Master System memory mapping and ROM headers.


X



Y



Z


Zilog Z80 Microprocessor
The Zilog Z80 microprocessor an 8-bit processor based off of Intel's 8080 microprocessor. The Z80 is the main processor used in the Sega Mark III Architecture.