libElysianVMU 1.6.0
Full-featured, accurate, cross-platform library emulating the Dreamcast's Visual Memory Unit
Loading...
Searching...
No Matches
BIOS

Built-in OS and Firmware located within ROM.

Firmware Subroutines

The VMU BIOS contains a series of built-in subroutines, which are exposed as public ROM entry-points which the user application may invoke to perform various system-related tasks.

To call one of these subroutines, use a NOT1 EXT, 0 instruction followed IMMEDIATELY by a JMPF instruction to the entry address. This swaps the CPU from executing out of flash to executing out of ROM and continues execution at the proper routine. Each routine has an advertised exit address where it will return control back to the user-application at a fixed address, as well as fixed input/output variables which will be passed through RAM bank 1.

Flash Memory Write

Writes a single contiguous page of data (128 bytes) to Flash, starting at the specified address.

Entry Address
ORG 0x100

Arguments

Address Name Function
0x7D fmadd_bank Flash Bank (must be 0)
0x7E fmadd_h Starting address upper byte
0x7F fmadd_l Starting address lower byte
0x80-0xFF input data Data to be written to flash
Warning
The fmadd address must be 128-byte page-aligned (bits 0-6 of the lower address reset to 0). Only a single full page can be written to at a time.
The routine requires flash bank be set to 0 or "normal operation is not assured."
Make sure to call the routine with STAD set to 0x00, or part of the screen will be overwritten.

Return Values

ACC Value Meaning
0x0 Normal end
0xFF Abnormal end

Clobbered Registers

Flash Memory Verify

Compares 128 bytes of data, starting at address 0x80 and ending at 0xFF to the data actually written to flash memory, performing a verification check. The same alignment requirements and warnings as with Flash Memory Write apply here.

Entry Address
ORG 0x110

Arguments

Address Name Function
0x7D fmadd_bank Flash Bank (must be 0)
0x7E fmadd_h Starting address upper byte
0x7F fmadd_l Starting address lower byte
0x80-0xFF input data Data to be written to flash

Return Values

ACC Value Meaning
0x0 No data mismatch
0x1-0xFF Data mismatch (any other value)

Clobbered Registers

Flash Memory Read

Reads a single contiguous page of data (128 bytes) from Flash, starting at the specified address.

Entry Address
ORG 0x120

Arguments

Address Name Function
0x7D fmadd_bank Flash Bank (must be 0)
0x7E fmadd_h Starting address upper byte
0x7F fmadd_l Starting address lower byte
Warning
The fmadd address must be 128-byte page-aligned (bits 0-6 of the lower address reset to 0). Only a single full page can be read from at a time.
The routine requires flash bank be set to 0 or "normal operation is not assured."

Return Values
Read data (128 bytes): 0x80H to 0x0FF

Clobbered Registers

Warning
This routine does not return any sort of error upon receiving invalid arguments, so there is no feedback if they are specified incorrectly. Make sure to call the routine with STAD set to 0x00, or part of the screen will be overwritten.

Clock Update

Entry Address
ORG 0x130

Arguments None

Return Values All values returned are stored in bank 0.

Address Name Description
0x17-0x18 year_h Year (hex)
0x19 month_h Month (hex)
0x1A day_h Day (hex)
0x1B hour_h Hour (hex)
0x1C min_h Minute (hex)
0x1D sec_h Second (hex)

Clobbered Registers

Mode Change

Yields control back to the BIOS, which changes modes (to clock mode) when the MODE button is pressed.

Entry Address
ORG 0x1f0

Arguments None

Return Values None

Clobbered Registers N/A

System Variables

The following is a listing of all known system variables with their description

Warning
These values are used by the BIOS to peform regular system operations and are not meant to be manipulated by the user, so writing invalid data to them can cause system instability.
Address Name Description
Date & Time
10 EVMU_ADDRESS_SYSTEM_YEAR_MSB_BCD BCD-Encoded Century (first two digits)
11 EVMU_ADDRESS_SYSTEM_YEAR_LSB_BCD BCD-Encoded Year (last two digits)
12 EVMU_ADDRESS_SYSTEM_MONTH_BCD BCD-Encoded Month (1-12)
13 EVMU_ADDRESS_SYSTEM_DAY_BCD BCD-Encoded Day (1-31)
14 EVMU_ADDRESS_SYSTEM_HOUR_BCD BCD-Encoded Hour (0-23)
15 EVMU_ADDRESS_SYSTEM_MINUTE_BCD BCD-Encoded Minute (0-59)
16 EVMU_ADDRESS_SYSTEM_SEC_BCD BCD-Encoded Second (0-59)
17 EVMU_ADDRESS_SYSTEM_YEAR_MSB Century (first two digits)
18 EVMU_ADDRESS_SYSTEM_YEAR_LSB Year (last two digits)
19 EVMU_ADDRESS_SYSTEM_MONTH Month (1-12)
1A EVMU_ADDRESS_SYSTEM_DAY Day (1-31)
1B EVMU_ADDRESS_SYSTEM_HOUR Hour (0-59)
1C EVMU_ADDRESS_SYSTEM_MINUTE Minute (0-59)
1D EVMU_ADDRESS_SYSTEM_SEC Second (0-59)
1E EVMU_ADDRESS_SYSTEM_HALF_SEC Half Second (0-1)
1F EVMU_ADDRESS_SYSTEM_LEAP_YEAR Leap Year (0 = no, 1 = yes)
General
30 EVMU_ADDRESS_SYSTEM_MODE Index for BIOS Mode
31 EVMU_ADDRESS_DATE_SET Date/Time Valid (0x0 = no, 0xFF = yes)
50 EVMU_ADDRESS_SYSTEM_QUART_YEAR_MSB Quarter Year MSB
51 EVMU_ADDRESS_SYSTEM_QUART_YEAR_LSB Quarter Year LSB
60 EVMU_ADDRESS_SYSTEM_CURSOR_POS_COL Menu Cursor column position
61 EVMU_ADDRESS_SYSTEM_CURSOR_POS_ROW Menu Cursor row position
6D EVMU_ADDRESS_SYSTEM_GAME_LAST_BLK Last block used by minigame
6E EVMU_ADDRESS_SYSTEM_BATTERY_CHECK Check Low battery (0x0 = yes, 0xFF = no)
Stack
80 EVMU_ADDRESS_SYSTEM_STACK_BASE First stack location
81-FE
Middle Stack
FF EVMU_ADDRESS_SYSTEM_STACK_END Last stack location