![]() |
libElysianVMU 1.6.0
Full-featured, accurate, cross-platform library emulating the Dreamcast's Visual Memory Unit
|
Built-in OS and Firmware located within ROM.
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.
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 |
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.Return Values
ACC Value | Meaning |
---|---|
0x0 | Normal end |
0xFF | Abnormal end |
Clobbered Registers
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
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 |
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.Return Values
Read data (128 bytes): 0x80H to 0x0FF
Clobbered Registers
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
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
The following is a listing of all known system variables with their description
Address | Name | Description |
---|---|---|
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) |
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) |
80 | EVMU_ADDRESS_SYSTEM_STACK_BASE | First stack location |
81-FE | ||
FF | EVMU_ADDRESS_SYSTEM_STACK_END | Last stack location |