update spec to add version

This commit is contained in:
~d6 2023-12-20 10:11:06 -05:00
parent ea29d3bce6
commit 3a1b8eca03
2 changed files with 13 additions and 13 deletions

View File

@ -110,11 +110,13 @@ following expansion layout:
- operation (1 byte): 03 (uuid extension)
- device (1 byte): 10 (console)
- uuid (16 bytes): 0123 1250 d878 4462 bc41 d092 7645 a2fa
- flags (2 byte): 0000 (may be updated by emulator)
- version (1 byte): 00 (set to non-zero by supporting emulators)
- flags (2 byte): 0000 (updated by supporting emulators)
after being loaded, flags will be 0x0000 if the console expansion is
not supported. otherwise, it will contain one or more of the following
flags:
after being loaded, version will be non-zero if console expansion is
supported, and zero otherwise. flags will contain bits describing the
available capabilities (0x0000 if console expansion is unsupported).
the flags are as follows:
- 0x0001: supports `execute`
- 0x0002: supports `kill`
@ -139,7 +141,7 @@ that determines whether the console expansion can be used:
@enable-uxn-console ...
@query 03 10 ( uuid ) 0123 1250 d878 4462 bc41 d092 7645 a2fa &flags 0000
@query 03 10 ( uuid ) 0123 1250 d878 4462 bc41 d092 7645 a2fa &flags 00 0000
note that uxn11 unconditionally enables the expanded console. so in
this case the uuid-based extension mechanism is only used to detect

View File

@ -132,14 +132,12 @@ system_expansion_uxn38_device(Uxn *u, Uint8 *ram, Uint16 addr)
{
Uint8 dev_id = ram[addr + 1];
Uint8 *uuid = &ram[addr + 2];
if(uuid_eq(uuid, console_uuid) != 0)
if(dev_id == 0x10) {
ram[addr + 18] = 0x00;
ram[addr + 19] = 0xff;
} else {
ram[addr + 18] = 0x00;
ram[addr + 19] = 0x00;
}
if(uuid_eq(uuid, console_uuid) != 0) {
int ok = dev_id == 0x10 ? 0xff : 0x00;
ram[addr + 18] = ok;
ram[addr + 19] = 0x00;
ram[addr + 20] = ok;
}
}
/* IO */