-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsysconf.lua
38 lines (32 loc) · 934 Bytes
/
sysconf.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
-- machine info
cpu_register_interrupt_handler(0x11, function()
-- equipment list
CPU["regs"][1] = RAM:r16(0x410)
return true
end)
cpu_register_interrupt_handler(0x12, function()
-- get memory size
CPU["regs"][1] = RAM:r16(0x413)
return true
end)
cpu_register_interrupt_handler(0x15, function(ax,ah,al)
emu_debug(1, string.format("unknown sysconf: %02X\n", ah))
CPU["regs"][1] = 0x8600 -bor- (CPU["regs"][1] -band- 0xFF) -- AH = 0x86 (function not supported)
cpu_set_flag(0) -- set carry
return true
end)
function sysconf_init()
local equipment = 0x0061
local fdd_count = 1
for i=0,3 do
if disk_has(i) and fdd_count == i then
fdd_count = i + 1
end
end
equipment = equipment -bor- ((fdd_count - 1) -blshift- 6)
RAM:w16(0x410, equipment) -- equipment list
RAM:w16(0x413, 640) -- memory size
end
RAM[0xFFFFE] = 0xFB
local rdate = "07/06/98"
for i=1,#rdate do RAM[0xFFFF4 + i] = string.byte(rdate, i, i) end