more constants, dosbox version

This commit is contained in:
Jonathan Campbell 2025-05-04 15:57:35 -07:00
parent b986f25d4b
commit 905cb208a3
2 changed files with 6 additions and 3 deletions

View File

@ -59,6 +59,9 @@ extern uint16_t DOSBOXID_VAR dosbox_id_baseio;
#define DOSBOX_ID_REG_VERSION_STRING (0x00000002UL)
#define DOSBOX_ID_REG_VERSION_NUMBER (0x00000003UL)
#define DOSBOX_ID_REG_READ_EMTIME (0x00000004UL)
#define DOSBOX_ID_REG_DOSBOX_VERSION_MAJOR (0x00000005UL)
#define DOSBOX_ID_REG_DOSBOX_VERSION_MINOR (0x00000006UL)
#define DOSBOX_ID_REG_DOSBOX_VERSION_SUB (0x00000007UL)
#define DOSBOX_ID_REG_DEBUG_OUT (0x0000DEB0UL)
#define DOSBOX_ID_REG_DEBUG_CLEAR (0x0000DEB1UL)

View File

@ -718,19 +718,19 @@ void dosbox_integration_trigger_read() {
case DOSBOX_ID_REG_READ_EMTIME: /* current emulator time as 16.16 fixed point */
dosbox_int_register = (uint32_t)(PIC_FullIndex() * 0x10000);
break;
case 5: // DOSBox-X version number major (e.g. 2022)
case DOSBOX_ID_REG_DOSBOX_VERSION_MAJOR: // DOSBox-X version number major (e.g. 2022)
{
const char * ver = strchr(VERSION, '.');
dosbox_int_register = ver == NULL ? 0 : atoi(std::string(VERSION).substr(0, strlen(ver) - strlen(VERSION)).c_str());
break;
}
case 6: // DOSBox-X version number minor (e.g. 8)
case DOSBOX_ID_REG_DOSBOX_VERSION_MINOR: // DOSBox-X version number minor (e.g. 8)
{
const char * ver = strchr(VERSION, '.');
dosbox_int_register = ver == NULL ? 0 : atoi(ver + 1);
break;
}
case 7: // DOSBox-X version number sub (e.g. 0)
case DOSBOX_ID_REG_DOSBOX_VERSION_SUB: // DOSBox-X version number sub (e.g. 0)
{
const char * ver = strchr(VERSION, '.');
ver = strchr(ver + 1, '.');