Browse Source

fix backspace and down arrow key in curses mode

tags/0.1.1
Adrian Siekierka 2 years ago
parent
commit
1ec3ab3675
5 changed files with 7 additions and 5 deletions
  1. 2
    2
      emu_core.lua
  2. 2
    2
      emu_core_pre.lua
  3. 1
    1
      kbdmaps.lua
  4. 1
    0
      platform_curses.lua
  5. 1
    0
      platform_oc.lua

+ 2
- 2
emu_core.lua View File

@@ -2038,7 +2038,7 @@ local function upd_tick(cv)
local last_clock = clock
clock = cv

upd_count(last_clock)

-- handle pc speaker
if (kbd_get_spkr_latch() & 0x03) == 0x03 then
@@ -2051,7 +2051,7 @@ local function upd_tick(cv)
-- handle video
video_update()
keyboard_update()
pit_tick(clock, last_clock)
--pit_tick(clock, last_clock)
-- handle OC waits
cv = os.clock()
if (cv - clock) < 0.05 then

+ 2
- 2
emu_core_pre.lua View File

@@ -1,6 +1,6 @@
// #define DEBUG_IO
// #define DEBUG_INTRS
#define DEBUG_IPS
// #define DEBUG_IPS
// #define DEBUG_MEM_UNINITIALIZED
local ram_640k = {}
local io_ports = {}
@@ -2044,7 +2044,7 @@ local function upd_tick(cv)
-- handle video
video_update()
keyboard_update()
pit_tick(clock, last_clock)
--pit_tick(clock, last_clock)
-- handle OC waits
cv = os.clock()
if (cv - clock) < 0.05 then

+ 1
- 1
kbdmaps.lua View File

@@ -1,5 +1,5 @@
map_char_to_key = {}
map_char_to_key[258] = 0x40 -- down
map_char_to_key[258] = 0x50 -- down
map_char_to_key[260] = 0x4B -- left
map_char_to_key[259] = 0x48 -- up
map_char_to_key[261] = 0x4D -- right

+ 1
- 0
platform_curses.lua View File

@@ -41,6 +41,7 @@ function platform_getc()
local c = stdscr:getch()
if c == nil then return nil end
if type(c) == "string" then c = string.byte() end
if c == 263 then c = 8 end
emu_debug(2, string.format("getc %d", c))
if map_char_to_key[c] then
if c >= 0 and c < 128 then return c,map_char_to_key[c]

+ 1
- 0
platform_oc.lua View File

@@ -84,6 +84,7 @@ event.listen("key_up", function(name, addr, char, code, player)
end)

function platform_error(msg)
print(msg)
error(msg)
end


Loading…
Cancel
Save