Lua 5.3 didn't need an x86 emulator. But now, it has one regardless.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sysconf.lua 914B

1234567891011121314151617181920212223242526272829303132333435363738
  1. -- machine info
  2. cpu_register_interrupt_handler(0x11, function()
  3. -- equipment list
  4. CPU["regs"][1] = RAM:r16(0x410)
  5. return true
  6. end)
  7. cpu_register_interrupt_handler(0x12, function()
  8. -- get memory size
  9. CPU["regs"][1] = RAM:r16(0x413)
  10. return true
  11. end)
  12. cpu_register_interrupt_handler(0x15, function(ax,ah,al)
  13. emu_debug(1, string.format("unknown sysconf: %02X\n", ah))
  14. CPU["regs"][1] = 0x8600 | (CPU["regs"][1] & 0xFF) -- AH = 0x86 (function not supported)
  15. cpu_set_flag(0) -- set carry
  16. return true
  17. end)
  18. function sysconf_init()
  19. local equipment = 0x0061
  20. local fdd_count = 1
  21. for i=0,3 do
  22. if disk_has(i) and fdd_count == i then
  23. fdd_count = i + 1
  24. end
  25. end
  26. equipment = equipment | ((fdd_count - 1) << 6)
  27. RAM:w16(0x410, equipment) -- equipment list
  28. RAM:w16(0x413, 640) -- memory size
  29. end
  30. RAM[0xFFFFE] = 0xFB
  31. local rdate = "07/06/98"
  32. for i=1,#rdate do RAM[0xFFFF4 + i] = string.byte(rdate, i, i) end