This commit is contained in:
OBattler
2023-04-12 01:56:09 +02:00
5 changed files with 81 additions and 11 deletions

View File

@@ -2313,6 +2313,56 @@ mem_mapping_recalc(uint64_t base, uint64_t size)
}
flushmmucache_cr3();
#ifdef ENABLE_MEM_LOG
pclog("\nMemory map:\n");
mem_mapping_t *write = (mem_mapping_t *) -1, *read = (mem_mapping_t *) -1, *write_bus = (mem_mapping_t *) -1, *read_bus = (mem_mapping_t *) -1;
for (c = 0; c < (sizeof(write_mapping) / sizeof(write_mapping[0])); c++) {
if ((write_mapping[c] == write) && (read_mapping[c] == read) && (write_mapping_bus[c] == write_bus) && (read_mapping_bus[c] == read_bus))
continue;
write = write_mapping[c];
read = read_mapping[c];
write_bus = write_mapping_bus[c];
read_bus = read_mapping_bus[c];
pclog("%08X | ", c << MEM_GRANULARITY_BITS);
if (read) {
pclog("R%c%c%c %08X+% 8X",
read->read_b ? 'b' : ' ', read->read_w ? 'w' : ' ', read->read_l ? 'l' : ' ',
read->base, read->size);
} else {
pclog(" ");
}
if (write) {
pclog(" | W%c%c%c %08X+% 8X",
write->write_b ? 'b' : ' ', write->write_w ? 'w' : ' ', write->write_l ? 'l' : ' ',
write->base, write->size);
} else {
pclog(" | ");
}
pclog(" | %c\n", _mem_exec[c] ? 'X' : ' ');
if ((write != write_bus) || (read != read_bus)) {
pclog(" ^ bus | ");
if (read_bus) {
pclog("R%c%c%c %08X+% 8X",
read_bus->read_b ? 'b' : ' ', read_bus->read_w ? 'w' : ' ', read_bus->read_l ? 'l' : ' ',
read_bus->base, read_bus->size);
} else {
pclog(" ");
}
if (write_bus) {
pclog(" | W%c%c%c %08X+% 8X",
write_bus->write_b ? 'b' : ' ', write_bus->write_w ? 'w' : ' ', write_bus->write_l ? 'l' : ' ',
write_bus->base, write_bus->size);
} else {
pclog(" | ");
}
pclog(" |\n");
}
}
pclog("\n");
#endif
}
void
@@ -2578,7 +2628,8 @@ mem_init_ram_mapping(mem_mapping_t *mapping, uint32_t base, uint32_t size)
void
mem_reset(void)
{
uint32_t c, m;
uint32_t c;
size_t m;
memset(page_ff, 0xff, sizeof(page_ff));
@@ -2616,7 +2667,7 @@ mem_reset(void)
mem_size = 2097152;
#endif
m = 1024UL * mem_size;
m = 1024UL * (size_t) mem_size;
#if (!(defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64))
if (mem_size > 1048576) {

View File

@@ -385,6 +385,7 @@ if (UNIX AND NOT APPLE AND NOT HAIKU)
target_compile_definitions(ui PRIVATE XKBCOMMON_X11)
target_link_libraries(ui PRIVATE X11::xcb PUBLIC PkgConfig::XKBCOMMON_X11)
target_sources(ui PRIVATE xkbcommon_x11_keyboard.cpp)
set(QT5_PRIVATE_HEADERS ON)
endif()
endif()
endif()
@@ -406,9 +407,18 @@ if (UNIX AND NOT APPLE AND NOT HAIKU)
target_sources(ui PRIVATE xkbcommon_wl_keyboard.cpp)
endif()
target_compile_definitions(ui PRIVATE WAYLAND)
set(QT5_PRIVATE_HEADERS ON)
endif()
endif()
endif()
# Add private headers for Qt5 if required.
if (NOT USE_QT6 AND DEFINED QT5_PRIVATE_HEADERS)
find_package(Qt${QT_MAJOR}Gui)
if (Qt${QT_MAJOR}Gui_FOUND)
include_directories(${Qt${QT_MAJOR}Gui_PRIVATE_INCLUDE_DIRS})
endif()
endif()
endif()
set(QM_FILES)
file(GLOB po_files "${CMAKE_CURRENT_SOURCE_DIR}/languages/*.po")

View File

@@ -941,6 +941,15 @@ MainWindow::processKeyboardInput(bool down, uint32_t keycode)
}
break;
case 0x10b: /* Microsoft scroll up normal */
case 0x18b: /* Microsoft scroll down normal */
/* This abuses make/break codes. Send them manually, only on press. */
if (down) {
keyboard_send(0xe0);
keyboard_send(keycode & 0xff);
}
return;
case 0x11d: /* Right Ctrl */
if (rctrl_is_lalt)
keycode = 0x38; /* map to Left Alt */

View File

@@ -15,7 +15,7 @@
* Copyright 2023 RichardG.
*/
extern "C" {
#include <xkbcommon/xkbcommon-x11.h>
#include <xkbcommon/xkbcommon.h>
};
#include <unordered_map>

View File

@@ -24,7 +24,7 @@
#include <86box/86box.h>
#include <86box/i2c.h>
#define PIXEL_MM(px) ((uint16_t) (((px) *25.4) / 96))
#define PIXEL_MM(px) (((px) * 25.4) / 96.0)
#define STANDARD_TIMING(slot, width, aspect_ratio, refresh) \
do { \
edid->slot.horiz_pixels = ((width) >> 3) - 31; \
@@ -44,9 +44,9 @@
edid->slot.h_sync_pulse_lsb = (hsp) &0xff; \
edid->slot.v_front_porch_sync_pulse_lsb = (((vfp) &0x0f) << 4) | ((vsp) &0x0f); \
edid->slot.hv_front_porch_sync_pulse_msb = (((hfp) >> 2) & 0xc0) | (((hsp) >> 4) & 0x30) | (((vfp) >> 2) & 0x0c) | (((vsp) >> 4) & 0x03); \
edid->slot.h_size_lsb = horiz_mm & 0xff; \
edid->slot.v_size_lsb = vert_mm & 0xff; \
edid->slot.hv_size_msb = ((horiz_mm >> 4) & 0xf0) | ((vert_mm >> 8) & 0x0f); \
edid->slot.h_size_lsb = (uint8_t) horiz_mm; \
edid->slot.v_size_lsb = (uint8_t) vert_mm; \
edid->slot.hv_size_msb = ((((uint16_t) horiz_mm) >> 4) & 0xf0) | ((((uint16_t) vert_mm) >> 8) & 0x0f); \
} while (0)
enum {
@@ -133,7 +133,7 @@ ddc_init(void *i2c)
memset(edid, 0, sizeof(edid_t));
uint8_t *edid_bytes = (uint8_t *) edid;
uint16_t horiz_mm = PIXEL_MM(1366), vert_mm = PIXEL_MM(768);
double horiz_mm = PIXEL_MM(800), vert_mm = PIXEL_MM(600);
memset(&edid->magic[1], 0xff, sizeof(edid->magic) - 2);
@@ -142,11 +142,11 @@ ddc_init(void *i2c)
edid->mfg_week = 48;
edid->mfg_year = 2020 - 1990;
edid->edid_version = 0x01;
edid->edid_rev = 0x03; /* EDID 1.3 */
edid->edid_rev = 0x04; /* EDID 1.4, required for Xorg on Linux to use the preferred mode timing */
edid->input_params = 0x0e; /* analog input; separate sync; composite sync; sync on green */
edid->horiz_size = horiz_mm / 10;
edid->vert_size = vert_mm / 10;
edid->horiz_size = round(horiz_mm / 10.0);
edid->vert_size = round(vert_mm / 10.0);
edid->features = 0xeb; /* DPMS standby/suspend/active-off; RGB color; first timing is preferred; GTF/CVT */
edid->red_green_lsb = 0x81;