mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 09:35:32 -07:00
Merge remote-tracking branch 'upstream/master' into newqt2
This commit is contained in:
55
.ci/build.sh
55
.ci/build.sh
@@ -568,59 +568,64 @@ then
|
||||
fi
|
||||
else
|
||||
cwd_root=$(pwd)
|
||||
cache_dir="$HOME/86box-build-cache"
|
||||
[ ! -d "$cache_dir" ] && mkdir -p "$cache_dir"
|
||||
|
||||
if grep -q "OPENAL:BOOL=ON" build/CMakeCache.txt
|
||||
then
|
||||
# Build openal-soft 1.21.1 manually to fix audio issues. This is a temporary
|
||||
# workaround until a newer version of openal-soft trickles down to Debian repos.
|
||||
if [ -d "openal-soft-1.21.1" ]
|
||||
prefix="$cache_dir/openal-soft-1.21.1"
|
||||
if [ -d "$prefix" ]
|
||||
then
|
||||
rm -rf openal-soft-1.21.1/build
|
||||
rm -rf "$prefix/build"
|
||||
else
|
||||
wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.21.1.tar.gz | tar zxf -
|
||||
wget -qO - https://github.com/kcat/openal-soft/archive/refs/tags/1.21.1.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix"
|
||||
fi
|
||||
cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S openal-soft-1.21.1 -B openal-soft-1.21.1/build || exit 99
|
||||
cmake --build openal-soft-1.21.1/build -j$(nproc) || exit 99
|
||||
cmake --install openal-soft-1.21.1/build || exit 99
|
||||
cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S "$prefix" -B "$prefix/build" || exit 99
|
||||
cmake --build "$prefix/build" -j$(nproc) || exit 99
|
||||
cmake --install "$prefix/build" || exit 99
|
||||
|
||||
# Build SDL2 without sound systems.
|
||||
sdl_ss=OFF
|
||||
else
|
||||
# Build FAudio 22.03 manually to remove the dependency on GStreamer. This is a temporary
|
||||
# workaround until a newer version of FAudio trickles down to Debian repos.
|
||||
if [ -d "FAudio-22.03" ]
|
||||
prefix="$cache_dir/FAudio-22.03"
|
||||
if [ -d "$prefix" ]
|
||||
then
|
||||
rm -rf FAudio-22.03/build
|
||||
rm -rf "$prefix/build"
|
||||
else
|
||||
wget -qO - https://github.com/FNA-XNA/FAudio/archive/refs/tags/22.03.tar.gz | tar zxf -
|
||||
wget -qO - https://github.com/FNA-XNA/FAudio/archive/refs/tags/22.03.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix"
|
||||
fi
|
||||
cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S FAudio-22.03 -B FAudio-22.03/build || exit 99
|
||||
cmake --build FAudio-22.03/build -j$(nproc) || exit 99
|
||||
cmake --install FAudio-22.03/build || exit 99
|
||||
cmake -G Ninja -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S "$prefix" -B "$prefix/build" || exit 99
|
||||
cmake --build "$prefix/build" -j$(nproc) || exit 99
|
||||
cmake --install "$prefix/build" || exit 99
|
||||
|
||||
# Build SDL2 with sound systems.
|
||||
sdl_ss=ON
|
||||
fi
|
||||
|
||||
# Build rtmidi without JACK support to remove the dependency on libjack.
|
||||
if [ -d "rtmidi-4.0.0" ]
|
||||
prefix="$cache_dir/rtmidi-4.0.0"
|
||||
if [ -d "$prefix" ]
|
||||
then
|
||||
rm -rf rtmidi-4.0.0/build
|
||||
rm -rf "$prefix/build"
|
||||
else
|
||||
wget -qO - http://www.music.mcgill.ca/~gary/rtmidi/release/rtmidi-4.0.0.tar.gz | tar zxf -
|
||||
wget -qO - https://github.com/thestk/rtmidi/archive/refs/tags/4.0.0.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix"
|
||||
fi
|
||||
cmake -G Ninja -D RTMIDI_API_JACK=OFF -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S rtmidi-4.0.0 -B rtmidi-4.0.0/build || exit 99
|
||||
cmake --build rtmidi-4.0.0/build -j$(nproc) || exit 99
|
||||
cmake --install rtmidi-4.0.0/build || exit 99
|
||||
cmake -G Ninja -D RTMIDI_API_JACK=OFF -D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" -S "$prefix" -B "$prefix/build" || exit 99
|
||||
cmake --build "$prefix/build" -j$(nproc) || exit 99
|
||||
cmake --install "$prefix/build" || exit 99
|
||||
|
||||
# Build SDL2 for joystick and FAudio support, with most components
|
||||
# disabled to remove the dependencies on PulseAudio and libdrm.
|
||||
if [ ! -d "SDL2-2.0.20" ]
|
||||
prefix="$cache_dir/SDL2-2.0.20"
|
||||
if [ ! -d "$prefix" ]
|
||||
then
|
||||
wget -qO - https://www.libsdl.org/release/SDL2-2.0.20.tar.gz | tar zxf -
|
||||
wget -qO - https://www.libsdl.org/release/SDL2-2.0.20.tar.gz | tar zxf - -C "$cache_dir" || rm -rf "$prefix"
|
||||
fi
|
||||
rm -rf sdlbuild
|
||||
mkdir sdlbuild
|
||||
rm -rf "$cache_dir/sdlbuild"
|
||||
cmake -G Ninja -D SDL_DISKAUDIO=OFF -D SDL_DIRECTFB_SHARED=OFF -D SDL_OPENGL=OFF -D SDL_OPENGLES=OFF -D SDL_OSS=OFF -D SDL_ALSA=$sdl_ss \
|
||||
-D SDL_ALSA_SHARED=$sdl_ss -D SDL_JACK=$sdl_ss -D SDL_JACK_SHARED=$sdl_ss -D SDL_ESD=OFF -D SDL_ESD_SHARED=OFF -D SDL_PIPEWIRE=$sdl_ss \
|
||||
-D SDL_PIPEWIRE_SHARED=$sdl_ss -D SDL_PULSEAUDIO=$sdl_ss -D SDL_PULSEAUDIO_SHARED=$sdl_ss -D SDL_ARTS=OFF -D SDL_ARTS_SHARED=OFF \
|
||||
@@ -628,10 +633,10 @@ else
|
||||
-D SDL_FUSIONSOUND_SHARED=OFF -D SDL_LIBSAMPLERATE=$sdl_ss -D SDL_LIBSAMPLERATE_SHARED=$sdl_ss -D SDL_X11=OFF -D SDL_X11_SHARED=OFF \
|
||||
-D SDL_WAYLAND=OFF -D SDL_WAYLAND_SHARED=OFF -D SDL_WAYLAND_LIBDECOR=OFF -D SDL_WAYLAND_LIBDECOR_SHARED=OFF -D SDL_WAYLAND_QT_TOUCH=OFF \
|
||||
-D SDL_RPI=OFF -D SDL_VIVANTE=OFF -D SDL_VULKAN=OFF -D SDL_KMSDRM=OFF -D SDL_KMSDRM_SHARED=OFF -D SDL_OFFSCREEN=OFF \
|
||||
-D SDL_HIDAPI_JOYSTICK=ON -D SDL_VIRTUAL_JOYSTICK=ON -D SDL_SHARED=ON -D SDL_STATIC=OFF -S SDL2-2.0.20 -B sdlbuild \
|
||||
-D SDL_HIDAPI_JOYSTICK=ON -D SDL_VIRTUAL_JOYSTICK=ON -D SDL_SHARED=ON -D SDL_STATIC=OFF -S "$prefix" -B "$cache_dir/sdlbuild" \
|
||||
-D "CMAKE_TOOLCHAIN_FILE=$cwd_root/toolchain.cmake" -D "CMAKE_INSTALL_PREFIX=$cwd_root/archive_tmp/usr" || exit 99
|
||||
cmake --build sdlbuild -j$(nproc) || exit 99
|
||||
cmake --install sdlbuild || exit 99
|
||||
cmake --build "$cache_dir/sdlbuild" -j$(nproc) || exit 99
|
||||
cmake --install "$cache_dir/sdlbuild" || exit 99
|
||||
|
||||
# Archive Discord Game SDK library.
|
||||
7z e -y -o"archive_tmp/usr/lib" discord_game_sdk.zip "lib/$arch_discord/discord_game_sdk.so"
|
||||
|
||||
54
src/86box.c
54
src/86box.c
@@ -91,7 +91,9 @@
|
||||
#include <86box/snd_speaker.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/ui.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/version.h>
|
||||
#include <86box/gdbstub.h>
|
||||
|
||||
@@ -396,9 +398,6 @@ pc_init(int argc, char *argv[])
|
||||
{
|
||||
char *ppath = NULL, *rpath = NULL;
|
||||
char *cfg = NULL, *p;
|
||||
#if !defined(__APPLE__) && !defined(_WIN32)
|
||||
char *appimage;
|
||||
#endif
|
||||
char temp[2048];
|
||||
struct tm *info;
|
||||
time_t now;
|
||||
@@ -411,17 +410,24 @@ pc_init(int argc, char *argv[])
|
||||
|
||||
/* Grab the executable's full path. */
|
||||
plat_get_exe_name(exe_path, sizeof(exe_path)-1);
|
||||
p = plat_get_filename(exe_path);
|
||||
p = path_get_filename(exe_path);
|
||||
*p = '\0';
|
||||
|
||||
#if !defined(_WIN32) && !defined(__APPLE__)
|
||||
/* Grab the actual path if we are an AppImage. */
|
||||
appimage = getenv("APPIMAGE");
|
||||
if (appimage && (appimage[0] != '\0')) {
|
||||
plat_get_dirname(exe_path, appimage);
|
||||
#if defined(__APPLE__)
|
||||
c = strlen(exe_path);
|
||||
if ((c >= 16) && !strcmp(&exe_path[c - 16], "/Contents/MacOS/")) {
|
||||
exe_path[c - 16] = '\0';
|
||||
p = path_get_filename(exe_path);
|
||||
*p = '\0';
|
||||
}
|
||||
#elif !defined(_WIN32)
|
||||
/* Grab the actual path if we are an AppImage. */
|
||||
p = getenv("APPIMAGE");
|
||||
if (p && (p[0] != '\0'))
|
||||
path_get_dirname(exe_path, p);
|
||||
#endif
|
||||
|
||||
path_slash(exe_path);
|
||||
|
||||
/*
|
||||
* Get the current working directory.
|
||||
*
|
||||
@@ -444,6 +450,8 @@ usage:
|
||||
printf("-C or --config path - set 'path' to be config file\n");
|
||||
#ifdef _WIN32
|
||||
printf("-D or --debug - force debug output logging\n");
|
||||
#endif
|
||||
#if 0
|
||||
printf("-E or --nographic - forces the old behavior\n");
|
||||
#endif
|
||||
printf("-F or --fullscreen - start in fullscreen mode\n");
|
||||
@@ -557,8 +565,8 @@ usage:
|
||||
|
||||
if (c != argc) goto usage;
|
||||
|
||||
plat_path_slash(usr_path);
|
||||
plat_path_slash(rom_path);
|
||||
path_slash(usr_path);
|
||||
path_slash(rom_path);
|
||||
|
||||
/*
|
||||
* If the user provided a path for files, use that
|
||||
@@ -567,7 +575,7 @@ usage:
|
||||
* make it absolute.
|
||||
*/
|
||||
if (ppath != NULL) {
|
||||
if (! plat_path_abs(ppath)) {
|
||||
if (! path_abs(ppath)) {
|
||||
/*
|
||||
* This looks like a relative path.
|
||||
*
|
||||
@@ -590,11 +598,11 @@ usage:
|
||||
}
|
||||
|
||||
// Add the VM-local ROM path.
|
||||
plat_append_filename(temp, usr_path, "roms");
|
||||
path_append_filename(temp, usr_path, "roms");
|
||||
rom_add_path(temp);
|
||||
|
||||
// Add the standard ROM path in the same directory as the executable.
|
||||
plat_append_filename(temp, exe_path, "roms");
|
||||
path_append_filename(temp, exe_path, "roms");
|
||||
rom_add_path(temp);
|
||||
|
||||
plat_init_rom_paths();
|
||||
@@ -606,7 +614,7 @@ usage:
|
||||
* make it absolute.
|
||||
*/
|
||||
if (rpath != NULL) {
|
||||
if (! plat_path_abs(rpath)) {
|
||||
if (! path_abs(rpath)) {
|
||||
/*
|
||||
* This looks like a relative path.
|
||||
*
|
||||
@@ -641,7 +649,7 @@ usage:
|
||||
* This can happen when people load a config
|
||||
* file using the UI, for example.
|
||||
*/
|
||||
p = plat_get_filename(cfg);
|
||||
p = path_get_filename(cfg);
|
||||
if (cfg != p) {
|
||||
/*
|
||||
* OK, the configuration file name has a
|
||||
@@ -656,19 +664,19 @@ usage:
|
||||
* Otherwise, assume the pathname given is
|
||||
* relative to whatever the usr_path is.
|
||||
*/
|
||||
if (plat_path_abs(cfg))
|
||||
if (path_abs(cfg))
|
||||
strcpy(usr_path, cfg);
|
||||
else
|
||||
strcat(usr_path, cfg);
|
||||
}
|
||||
|
||||
/* Make sure we have a trailing backslash. */
|
||||
plat_path_slash(usr_path);
|
||||
path_slash(usr_path);
|
||||
if (rom_path[0] != '\0')
|
||||
plat_path_slash(rom_path);
|
||||
path_slash(rom_path);
|
||||
|
||||
/* At this point, we can safely create the full path name. */
|
||||
plat_append_filename(cfg_path, usr_path, p);
|
||||
path_append_filename(cfg_path, usr_path, p);
|
||||
|
||||
/*
|
||||
* Get the current directory's name
|
||||
@@ -679,8 +687,8 @@ usage:
|
||||
*/
|
||||
if (strlen(vm_name) == 0) {
|
||||
char ltemp[1024] = { '\0'};
|
||||
plat_get_dirname(ltemp, usr_path);
|
||||
strcpy(vm_name, plat_get_filename(ltemp));
|
||||
path_get_dirname(ltemp, usr_path);
|
||||
strcpy(vm_name, path_get_filename(ltemp));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include <86box/config.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/scsi_device.h>
|
||||
#include <86box/cdrom_image_backend.h>
|
||||
@@ -286,7 +287,7 @@ cdrom_image_open(cdrom_t *dev, const char *fn)
|
||||
return image_open_abort(dev);
|
||||
|
||||
/* All good, reset state. */
|
||||
if (! strcasecmp(plat_get_extension((char *) fn), "ISO"))
|
||||
if (! strcasecmp(path_get_extension((char *) fn), "ISO"))
|
||||
dev->cd_status = CD_STATUS_DATA_ONLY;
|
||||
else
|
||||
dev->cd_status = CD_STATUS_STOPPED;
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <wchar.h>
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/cdrom_image_backend.h>
|
||||
|
||||
@@ -831,7 +832,7 @@ cdi_load_cue(cd_img_t *cdi, const char *cuefile)
|
||||
|
||||
/* Get a copy of the filename into pathname, we need it later. */
|
||||
memset(pathname, 0, MAX_FILENAME_LENGTH * sizeof(char));
|
||||
plat_get_dirname(pathname, cuefile);
|
||||
path_get_dirname(pathname, cuefile);
|
||||
|
||||
/* Open the file. */
|
||||
fp = plat_fopen(cuefile, "r");
|
||||
@@ -986,7 +987,7 @@ cdi_load_cue(cd_img_t *cdi, const char *cuefile)
|
||||
|
||||
if (!strcmp(type, "BINARY")) {
|
||||
memset(temp, 0, MAX_FILENAME_LENGTH * sizeof(char));
|
||||
plat_append_filename(filename, pathname, ansi);
|
||||
path_append_filename(filename, pathname, ansi);
|
||||
trk.file = track_file_init(filename, &error);
|
||||
}
|
||||
if (error) {
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
#include <86box/midi.h>
|
||||
#include <86box/snd_mpu401.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/plat_dir.h>
|
||||
#include <86box/ui.h>
|
||||
@@ -1422,12 +1423,12 @@ load_hard_disks(void)
|
||||
wcsncpy(hdd[c].fn, &wp[wcslen(usr_path)], sizeof_w(hdd[c].fn));
|
||||
} else
|
||||
#endif
|
||||
if (plat_path_abs(p)) {
|
||||
if (path_abs(p)) {
|
||||
strncpy(hdd[c].fn, p, sizeof(hdd[c].fn) - 1);
|
||||
} else {
|
||||
plat_append_filename(hdd[c].fn, usr_path, p);
|
||||
path_append_filename(hdd[c].fn, usr_path, p);
|
||||
}
|
||||
plat_path_normalize(hdd[c].fn);
|
||||
path_normalize(hdd[c].fn);
|
||||
|
||||
/* If disk is empty or invalid, mark it for deletion. */
|
||||
if (! hdd_is_valid(c)) {
|
||||
@@ -2841,7 +2842,7 @@ save_hard_disks(void)
|
||||
|
||||
sprintf(temp, "hdd_%02i_fn", c+1);
|
||||
if (hdd_is_valid(c) && (strlen(hdd[c].fn) != 0)) {
|
||||
plat_path_normalize(hdd[c].fn);
|
||||
path_normalize(hdd[c].fn);
|
||||
if (!strnicmp(hdd[c].fn, usr_path, strlen(usr_path)))
|
||||
config_set_string(cat, temp, &hdd[c].fn[strlen(usr_path)]);
|
||||
else
|
||||
|
||||
@@ -258,9 +258,6 @@ do_seg_load(x86seg *s, uint16_t *segdat)
|
||||
else
|
||||
cpu_cur_status |= CPU_STATUS_NOTFLATSS;
|
||||
}
|
||||
|
||||
if (s->base == 0xffffffff)
|
||||
fatal("do_seg_load(): %04X%04X%04X%04X\n", segdat[3], segdat[2], segdat[1], segdat[0]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <errno.h>
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/random.h>
|
||||
#include <86box/hdd.h>
|
||||
@@ -76,7 +77,7 @@ hdd_image_log(const char *fmt, ...)
|
||||
int
|
||||
image_is_hdi(const char *s)
|
||||
{
|
||||
if (! strcasecmp(plat_get_extension((char *) s), "HDI"))
|
||||
if (! strcasecmp(path_get_extension((char *) s), "HDI"))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
@@ -90,7 +91,7 @@ image_is_hdx(const char *s, int check_signature)
|
||||
uint64_t filelen;
|
||||
uint64_t signature;
|
||||
|
||||
if (! strcasecmp(plat_get_extension((char *) s), "HDX")) {
|
||||
if (! strcasecmp(path_get_extension((char *) s), "HDX")) {
|
||||
if (check_signature) {
|
||||
f = plat_fopen(s, "rb");
|
||||
if (!f)
|
||||
@@ -124,7 +125,7 @@ image_is_vhd(const char *s, int check_signature)
|
||||
{
|
||||
FILE* f;
|
||||
|
||||
if (! strcasecmp(plat_get_extension((char *) s), "VHD")) {
|
||||
if (! strcasecmp(path_get_extension((char *) s), "VHD")) {
|
||||
if (check_signature) {
|
||||
f = plat_fopen(s, "rb");
|
||||
if (!f)
|
||||
@@ -251,7 +252,7 @@ hdd_image_load(int id)
|
||||
|
||||
memset(empty_sector, 0, sizeof(empty_sector));
|
||||
if (fn) {
|
||||
plat_path_normalize(fn);
|
||||
path_normalize(fn);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/scsi_device.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/ui.h>
|
||||
#include <86box/hdc.h>
|
||||
@@ -332,7 +333,7 @@ mo_load_abort(mo_t *dev)
|
||||
int
|
||||
image_is_mdi(const char *s)
|
||||
{
|
||||
if (! strcasecmp(plat_get_extension((char *) s), "MDI"))
|
||||
if (! strcasecmp(path_get_extension((char *) s), "MDI"))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/ui.h>
|
||||
#include <86box/fdd.h>
|
||||
@@ -485,7 +486,7 @@ fdd_load(int drive, char *fn)
|
||||
|
||||
if (!fn)
|
||||
return;
|
||||
p = plat_get_extension(fn);
|
||||
p = path_get_extension(fn);
|
||||
if (!p)
|
||||
return;
|
||||
f = plat_fopen(fn, "rb");
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <86box/86box.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/config.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdd_86f.h>
|
||||
@@ -644,7 +645,7 @@ img_load(int drive, char *fn)
|
||||
int size;
|
||||
int i;
|
||||
|
||||
ext = plat_get_extension(fn);
|
||||
ext = path_get_extension(fn);
|
||||
|
||||
d86f_unregister(drive);
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#else
|
||||
# include <arpa/inet.h>
|
||||
# include <sys/socket.h>
|
||||
# include <errno.h>
|
||||
#endif
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
@@ -37,6 +38,7 @@
|
||||
#include <86box/io.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/gdbstub.h>
|
||||
|
||||
#define FAST_RESPONSE(s) \
|
||||
@@ -954,7 +956,7 @@ e14:
|
||||
/* Add our supported features to the end. */
|
||||
if (client->response_pos < (sizeof(client->response) - 1))
|
||||
client->response_pos += snprintf(&client->response[client->response_pos], sizeof(client->response) - client->response_pos,
|
||||
"PacketSize=%X;swbreak+;hwbreak+;qXfer:features:read+", sizeof(client->packet) - 1);
|
||||
"PacketSize=%lX;swbreak+;hwbreak+;qXfer:features:read+", sizeof(client->packet) - 1);
|
||||
break;
|
||||
} else if (!strcmp(client->response, "Xfer")) {
|
||||
/* Read the transfer object. */
|
||||
@@ -1101,6 +1103,7 @@ unknown:
|
||||
|
||||
case 'z': /* remove break/watchpoint */
|
||||
case 'Z': /* insert break/watchpoint */
|
||||
{
|
||||
gdbstub_breakpoint_t *breakpoint, *prev_breakpoint = NULL, **first_breakpoint;
|
||||
|
||||
/* Parse breakpoint type. */
|
||||
@@ -1222,6 +1225,7 @@ unknown:
|
||||
|
||||
/* Respond positively. */
|
||||
goto ok;
|
||||
}
|
||||
}
|
||||
end:
|
||||
/* Send response. */
|
||||
@@ -1655,7 +1659,11 @@ gdbstub_init()
|
||||
.sin_port = htons(port)
|
||||
};
|
||||
if (bind(gdbstub_socket, (struct sockaddr *) &bind_addr, sizeof(bind_addr)) == -1) {
|
||||
#ifdef _WIN32
|
||||
pclog("GDB Stub: Failed to bind on port %d (%d)\n", port, WSAGetLastError());
|
||||
#else
|
||||
pclog("GDB Stup: Failed to bind on port %d (%d)\n", port, errno);
|
||||
#endif
|
||||
gdbstub_socket = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
#ifndef EMU_GDBSTUB_H
|
||||
#define EMU_GDBSTUB_H
|
||||
#include <stdint.h>
|
||||
#include <86box/mem.h>
|
||||
|
||||
#define GDBSTUB_MEM_READ 0
|
||||
|
||||
7
src/include/86box/path.h
Normal file
7
src/include/86box/path.h
Normal file
@@ -0,0 +1,7 @@
|
||||
extern void path_get_dirname(char *dest, const char *path);
|
||||
extern char *path_get_filename(char *s);
|
||||
extern char *path_get_extension(char *s);
|
||||
extern void path_append_filename(char *dest, const char *s1, const char *s2);
|
||||
extern void path_slash(char *path);
|
||||
extern void path_normalize(char *path);
|
||||
extern int path_abs(char *path);
|
||||
@@ -105,15 +105,6 @@ extern int plat_chdir(char *path);
|
||||
extern void plat_tempfile(char *bufp, char *prefix, char *suffix);
|
||||
extern void plat_get_exe_name(char *s, int size);
|
||||
extern void plat_init_rom_paths();
|
||||
extern char *plat_get_basename(const char *path);
|
||||
extern void plat_get_dirname(char *dest, const char *path);
|
||||
extern char *plat_get_filename(char *s);
|
||||
extern char *plat_get_extension(char *s);
|
||||
extern void plat_append_filename(char *dest, const char *s1, const char *s2);
|
||||
extern void plat_put_backslash(char *s);
|
||||
extern void plat_path_slash(char *path);
|
||||
extern void plat_path_normalize(char *path);
|
||||
extern int plat_path_abs(char *path);
|
||||
extern int plat_dir_check(char *path);
|
||||
extern int plat_dir_create(char *path);
|
||||
extern void *plat_mmap(size_t size, uint8_t executable);
|
||||
@@ -169,47 +160,6 @@ extern int ioctl_open(uint8_t id, char d);
|
||||
extern void ioctl_reset(uint8_t id);
|
||||
extern void ioctl_close(uint8_t id);
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define thread_t plat_thread_t
|
||||
#define event_t plat_event_t
|
||||
#define mutex_t plat_mutex_t
|
||||
|
||||
#define thread_create plat_thread_create
|
||||
#define thread_wait plat_thread_wait
|
||||
#define thread_create_event plat_thread_create_event
|
||||
#define thread_set_event plat_thread_set_event
|
||||
#define thread_reset_event plat_thread_reset_event
|
||||
#define thread_wait_event plat_thread_wait_event
|
||||
#define thread_destroy_event plat_thread_destroy_event
|
||||
|
||||
#define thread_create_mutex plat_thread_create_mutex
|
||||
#define thread_create_mutex_with_spin_count plat_thread_create_mutex_with_spin_count
|
||||
#define thread_close_mutex plat_thread_close_mutex
|
||||
#define thread_wait_mutex plat_thread_wait_mutex
|
||||
#define thread_release_mutex plat_thread_release_mutex
|
||||
#endif
|
||||
|
||||
/* Thread support. */
|
||||
typedef void thread_t;
|
||||
typedef void event_t;
|
||||
typedef void mutex_t;
|
||||
|
||||
extern thread_t *thread_create(void (*thread_func)(void *param), void *param);
|
||||
extern int thread_wait(thread_t *arg);
|
||||
extern event_t *thread_create_event(void);
|
||||
extern void thread_set_event(event_t *arg);
|
||||
extern void thread_reset_event(event_t *arg);
|
||||
extern int thread_wait_event(event_t *arg, int timeout);
|
||||
extern void thread_destroy_event(event_t *arg);
|
||||
|
||||
#define MUTEX_DEFAULT_SPIN_COUNT 1024
|
||||
|
||||
extern mutex_t *thread_create_mutex(void);
|
||||
extern void thread_close_mutex(mutex_t *arg);
|
||||
extern int thread_test_mutex(mutex_t *arg);
|
||||
extern int thread_wait_mutex(mutex_t *arg);
|
||||
extern int thread_release_mutex(mutex_t *mutex);
|
||||
|
||||
/* Other stuff. */
|
||||
extern void startblit(void);
|
||||
extern void endblit(void);
|
||||
|
||||
46
src/include/86box/thread.h
Normal file
46
src/include/86box/thread.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define thread_t plat_thread_t
|
||||
#define event_t plat_event_t
|
||||
#define mutex_t plat_mutex_t
|
||||
|
||||
#define thread_create plat_thread_create
|
||||
#define thread_wait plat_thread_wait
|
||||
#define thread_create_event plat_thread_create_event
|
||||
#define thread_set_event plat_thread_set_event
|
||||
#define thread_reset_event plat_thread_reset_event
|
||||
#define thread_wait_event plat_thread_wait_event
|
||||
#define thread_destroy_event plat_thread_destroy_event
|
||||
|
||||
#define thread_create_mutex plat_thread_create_mutex
|
||||
#define thread_create_mutex_with_spin_count plat_thread_create_mutex_with_spin_count
|
||||
#define thread_close_mutex plat_thread_close_mutex
|
||||
#define thread_wait_mutex plat_thread_wait_mutex
|
||||
#define thread_release_mutex plat_thread_release_mutex
|
||||
#endif
|
||||
|
||||
/* Thread support. */
|
||||
typedef void thread_t;
|
||||
typedef void event_t;
|
||||
typedef void mutex_t;
|
||||
|
||||
extern thread_t *thread_create(void (*thread_func)(void *param), void *param);
|
||||
extern int thread_wait(thread_t *arg);
|
||||
extern event_t *thread_create_event(void);
|
||||
extern void thread_set_event(event_t *arg);
|
||||
extern void thread_reset_event(event_t *arg);
|
||||
extern int thread_wait_event(event_t *arg, int timeout);
|
||||
extern void thread_destroy_event(event_t *arg);
|
||||
|
||||
extern mutex_t *thread_create_mutex(void);
|
||||
extern void thread_close_mutex(mutex_t *arg);
|
||||
extern int thread_test_mutex(mutex_t *arg);
|
||||
extern int thread_wait_mutex(mutex_t *arg);
|
||||
extern int thread_release_mutex(mutex_t *mutex);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -211,28 +211,28 @@ const machine_t machines[] = {
|
||||
{ "[8088] VTech Laser Turbo XT", "ltxt", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_laserxt_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 256, 640, 256, 0,NULL, NULL },
|
||||
#endif
|
||||
/* Has a standard PS/2 KBC (so, use IBM PS/2 Type 1). */
|
||||
{ "[8088] Xi8088", "xi8088", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_xi8088_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_FLAGS_NONE, 64, 1024, 128, 127, xi8088_get_device},
|
||||
{ "[8088] Xi8088", "xi8088", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_xi8088_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_FLAGS_NONE, 64, 1024, 128, 127, xi8088_get_device, NULL },
|
||||
{ "[8088] Z-NIX PC-1600", "znic", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_znic_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 64, 640, 64, 0, NULL, NULL },
|
||||
{ "[8088] Zenith Data Systems Z-151/152/161", "zdsz151", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_z151_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 64, 0, NULL, NULL },
|
||||
{ "[8088] Zenith Data Systems Z-159", "zdsz159", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_z159_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 64, 0, NULL, NULL },
|
||||
{ "[8088] Zenith Data Systems SupersPort (Z-184)", "zdsupers", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_z184_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 128, 640, 128, 0, z184_get_device},
|
||||
{ "[8088] Zenith Data Systems SupersPort (Z-184)", "zdsupers", MACHINE_TYPE_8088, MACHINE_CHIPSET_DISCRETE, machine_xt_z184_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 128, 640, 128, 0, z184_get_device, NULL },
|
||||
{ "[GC100A] Philips P3120", "p3120", MACHINE_TYPE_8088, MACHINE_CHIPSET_GC100A, machine_xt_p3120_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8088, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_XTA, 256, 768, 256, 0, NULL, NULL },
|
||||
|
||||
/* 8086 Machines */
|
||||
{ "[8086] Amstrad PC1512", "pc1512", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc1512_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 8000000, 8000000, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 512, 640, 128, 63, pc1512_get_device},
|
||||
{ "[8086] Amstrad PC1640", "pc1640", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc1640_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 640, 640, 640, 63, pc1640_get_device},
|
||||
{ "[8086] Amstrad PC2086", "pc2086", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc2086_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, pc2086_get_device},
|
||||
{ "[8086] Amstrad PC3086", "pc3086", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc3086_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, pc3086_get_device},
|
||||
{ "[8086] Amstrad PC20(0)", "pc200", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc200_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 63, pc200_get_device},
|
||||
{ "[8086] Amstrad PPC512/640", "ppc512", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_ppc512_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 63, ppc512_get_device},
|
||||
{ "[8086] Amstrad PC1512", "pc1512", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc1512_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 8000000, 8000000, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 512, 640, 128, 63, pc1512_get_device, NULL },
|
||||
{ "[8086] Amstrad PC1640", "pc1640", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc1640_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 640, 640, 640, 63, pc1640_get_device, NULL },
|
||||
{ "[8086] Amstrad PC2086", "pc2086", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc2086_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, pc2086_get_device, NULL },
|
||||
{ "[8086] Amstrad PC3086", "pc3086", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc3086_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED | MACHINE_MOUSE, 640, 640, 640, 63, pc3086_get_device, NULL },
|
||||
{ "[8086] Amstrad PC20(0)", "pc200", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_pc200_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 63, pc200_get_device, NULL },
|
||||
{ "[8086] Amstrad PPC512/640", "ppc512", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_ppc512_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 512, 640, 128, 63, ppc512_get_device, NULL },
|
||||
{ "[8086] Compaq Deskpro", "deskpro", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_compaq_deskpro_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 128, 0, NULL, NULL },
|
||||
{ "[8086] Olivetti M21/24/24SP", "m24", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_m24_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 128, 640, 128, 0, m24_get_device},
|
||||
{ "[8086] Olivetti M21/24/24SP", "m24", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_m24_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO | MACHINE_MOUSE, 128, 640, 128, 0, m24_get_device, NULL },
|
||||
/* Has Olivetti KBC firmware. */
|
||||
{ "[8086] Olivetti M240", "m240", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_m240_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 128, 0, NULL, NULL },
|
||||
{ "[8086] Schetmash Iskra-3104", "iskra3104", MACHINE_TYPE_8086, MACHINE_CHIPSET_DISCRETE, machine_xt_iskra3104_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 128, 640, 128, 0, NULL, NULL },
|
||||
{ "[8086] Tandy 1000 SL/2", "tandy1000sl2", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_tandy1000sl2_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 512, 768, 128, 0, tandy1k_sl_get_device},
|
||||
{ "[8086] Tandy 1000 SL/2", "tandy1000sl2", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_tandy1000sl2_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO_FIXED, 512, 768, 128, 0, tandy1k_sl_get_device, NULL },
|
||||
{ "[8086] Victor V86P", "v86p", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_v86p_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO, 512, 1024, 128, 127, NULL, NULL },
|
||||
{ "[8086] Toshiba T1200", "t1200", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_t1200_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO, 1024, 2048,1024, 63, t1200_get_device},
|
||||
{ "[8086] Toshiba T1200", "t1200", MACHINE_TYPE_8086, MACHINE_CHIPSET_PROPRIETARY, machine_xt_t1200_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_VIDEO, 1024, 2048,1024, 63, t1200_get_device, NULL },
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_LASERXT)
|
||||
{ "[8086] VTech Laser XT3", "lxt3", MACHINE_TYPE_8086, MACHINE_CHIPSET_DISCRETE, machine_xt_lxt3_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_8086, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PC, MACHINE_FLAGS_NONE, 256, 640, 256, 0, NULL, NULL },
|
||||
@@ -255,7 +255,7 @@ const machine_t machines[] = {
|
||||
/* Uses Compaq KBC firmware. */
|
||||
{ "[ISA] Compaq Portable II", "portableii", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_at_portableii_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 640, 16384, 128, 127, NULL, NULL },
|
||||
/* Uses Compaq KBC firmware. */
|
||||
{ "[ISA] Compaq Portable III", "portableiii", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_at_portableiii_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_VIDEO, 640, 16384, 128, 127, at_cpqiii_get_device },
|
||||
{ "[ISA] Compaq Portable III", "portableiii", MACHINE_TYPE_286, MACHINE_CHIPSET_PROPRIETARY, machine_at_portableiii_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_VIDEO, 640, 16384, 128, 127, at_cpqiii_get_device, NULL },
|
||||
/* Has IBM AT KBC firmware. */
|
||||
{ "[ISA] MR BIOS 286 clone", "mr286", MACHINE_TYPE_286, MACHINE_CHIPSET_DISCRETE, machine_at_mr286_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_286, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 512, 16384, 128, 127, NULL, NULL },
|
||||
/* Has IBM AT KBC firmware. */
|
||||
@@ -322,7 +322,7 @@ const machine_t machines[] = {
|
||||
/* Has an AMI KBC firmware, the only photo of this is too low resolution
|
||||
for me to read what's on the KBC chip, so I'm going to assume AMI 'F'
|
||||
based on the other known HT18 AMI BIOS strings. */
|
||||
{ "[ALi M1217] Flytech 386", "flytech386", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M1217, machine_at_flytech386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 16384, 1024, 127, at_flytech386_get_device },
|
||||
{ "[ALi M1217] Flytech 386", "flytech386", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M1217, machine_at_flytech386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 16384, 1024, 127, at_flytech386_get_device, NULL },
|
||||
/* I'm going to assume this has a standard/generic IBM-compatible AT KBC
|
||||
firmware until the board is identified. */
|
||||
{ "[ALi M1217] MR BIOS 386SX clone", "mr1217", MACHINE_TYPE_386SX, MACHINE_CHIPSET_ALI_M1217, machine_at_mr1217_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 16384, 1024, 127, NULL, NULL },
|
||||
@@ -333,7 +333,7 @@ const machine_t machines[] = {
|
||||
/* Has an AMI KBC firmware, the only photo of this is too low resolution
|
||||
for me to read what's on the KBC chip, so I'm going to assume AMI 'F'
|
||||
based on the other known HT18 AMI BIOS strings. */
|
||||
{ "[HT18] AMA-932J", "ama932j", MACHINE_TYPE_386SX, MACHINE_CHIPSET_HT18, machine_at_ama932j_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE | MACHINE_VIDEO, 512, 8192, 128, 127, at_ama932j_get_device },
|
||||
{ "[HT18] AMA-932J", "ama932j", MACHINE_TYPE_386SX, MACHINE_CHIPSET_HT18, machine_at_ama932j_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE | MACHINE_VIDEO, 512, 8192, 128, 127, at_ama932j_get_device, NULL },
|
||||
/* Has an unknown KBC firmware with commands B8 and BB in the style of
|
||||
Phoenix MultiKey and AMIKey-3(!), but also commands E1 and EA with
|
||||
unknown functions. */
|
||||
@@ -351,13 +351,13 @@ const machine_t machines[] = {
|
||||
/* Uses Commodore (CBM) KBC firmware, to be implemented as identical to
|
||||
the IBM PS/2 Type 1 KBC firmware unless evidence emerges of any
|
||||
proprietary commands. */
|
||||
{ "[SCAMP] Commodore SL386SX-25", "cmdsl386sx25", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_cmdsl386sx25_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 8192, 512, 127, at_cmdsl386sx25_get_device },
|
||||
{ "[SCAMP] Commodore SL386SX-25", "cmdsl386sx25", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_cmdsl386sx25_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 1024, 8192, 512, 127, at_cmdsl386sx25_get_device, NULL },
|
||||
/* The closest BIOS string I find to this one's, differs only in one part,
|
||||
and ends in -8, so I'm going to assume that this, too, has an AMI '8'
|
||||
(AMI Keyboard BIOS Plus) KBC firmware. */
|
||||
{ "[SCAMP] DataExpert 386SX", "dataexpert386sx", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_dataexpert386sx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 10000000, 25000000, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 1024, 16384, 1024, 127, NULL, NULL },
|
||||
/* Has IBM PS/2 Type 1 KBC firmware. */
|
||||
{ "[SCAMP] Samsung SPC-6033P", "spc6033p", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_spc6033p_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 12288, 2048, 127, at_spc6033p_get_device },
|
||||
{ "[SCAMP] Samsung SPC-6033P", "spc6033p", MACHINE_TYPE_386SX, MACHINE_CHIPSET_VLSI_SCAMP, machine_at_spc6033p_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 12288, 2048, 127, at_spc6033p_get_device, NULL },
|
||||
/* Has an unknown AMI KBC firmware, I'm going to assume 'F' until a
|
||||
photo or real hardware BIOS string is found. */
|
||||
{ "[SCAT] KMX-C-02", "kmxc02", MACHINE_TYPE_386SX, MACHINE_CHIPSET_SCAT, machine_at_kmxc02_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386SX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 16384, 512, 127, NULL, NULL },
|
||||
@@ -383,7 +383,7 @@ const machine_t machines[] = {
|
||||
#if defined(DEV_BRANCH) && defined(USE_DESKPRO386)
|
||||
{ "[ISA] Compaq Deskpro 386", "deskpro386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_DISCRETE, machine_at_deskpro386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE, 1024, 14336, 1024, 127, NULL, NULL },
|
||||
#endif
|
||||
{ "[ISA] Compaq Portable III (386)", "portableiii386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_DISCRETE, machine_at_portableiii386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE | MACHINE_VIDEO, 1024, 14336, 1024, 127, at_cpqiii_get_device },
|
||||
{ "[ISA] Compaq Portable III (386)", "portableiii386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_DISCRETE, machine_at_portableiii386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_IDE | MACHINE_VIDEO, 1024, 14336, 1024, 127, at_cpqiii_get_device, NULL },
|
||||
/* Has IBM AT KBC firmware. */
|
||||
{ "[ISA] Micronics 09-00021", "micronics386", MACHINE_TYPE_386DX, MACHINE_CHIPSET_DISCRETE, machine_at_micronics386_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_386DX, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_AT, MACHINE_FLAGS_NONE, 512, 8192, 128, 127, NULL, NULL },
|
||||
/* Has AMIKey F KBC firmware. */
|
||||
@@ -437,9 +437,9 @@ const machine_t machines[] = {
|
||||
/* According to Deksor on the Win3x.org forum, the BIOS string ends in a -0,
|
||||
indicating an unknown KBC firmware. But it does send the AMIKey get version
|
||||
command, so it must expect an AMIKey. */
|
||||
{ "[VLSI 82C480] HP Vectra 486VL", "vect486vl", MACHINE_TYPE_486, MACHINE_CHIPSET_VLSI_VL82C480, machine_at_vect486vl_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, at_vect486vl_get_device },
|
||||
{ "[VLSI 82C480] HP Vectra 486VL", "vect486vl", MACHINE_TYPE_486, MACHINE_CHIPSET_VLSI_VL82C480, machine_at_vect486vl_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, at_vect486vl_get_device, NULL },
|
||||
/* Has a standard IBM PS/2 KBC firmware or a clone thereof. */
|
||||
{ "[VLSI 82C481] Siemens Nixdorf D824", "d824", MACHINE_TYPE_486, MACHINE_CHIPSET_VLSI_VL82C481, machine_at_d824_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, at_d824_get_device },
|
||||
{ "[VLSI 82C481] Siemens Nixdorf D824", "d824", MACHINE_TYPE_486, MACHINE_CHIPSET_VLSI_VL82C481, machine_at_d824_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET1, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 2048, 32768, 2048, 127, at_d824_get_device, NULL },
|
||||
|
||||
/* 486 machines - Socket 2 */
|
||||
/* 486 machines with just the ISA slot */
|
||||
@@ -447,7 +447,7 @@ const machine_t machines[] = {
|
||||
command C7 (OR input byte with received data byte). */
|
||||
{ "[ACC 2168] Packard Bell PB410A", "pb410a", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_ACC_2168, machine_at_pb410a_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE | MACHINE_VIDEO, 4096, 36864, 1024, 127, NULL, NULL },
|
||||
/* Uses an ACER/NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware (V4.01H). */
|
||||
{ "[ALi M1429G] Acer A1G", "acera1g", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_ALI_M1429G, machine_at_acera1g_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE_DUAL | MACHINE_VIDEO, 4096, 36864, 1024, 127, at_acera1g_get_device },
|
||||
{ "[ALi M1429G] Acer A1G", "acera1g", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_ALI_M1429G, machine_at_acera1g_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2, MACHINE_IDE_DUAL | MACHINE_VIDEO, 4096, 36864, 1024, 127, at_acera1g_get_device, NULL },
|
||||
/* This has an AMIKey-2, which is an updated version of type 'H'. */
|
||||
{ "[ALi M1429G] Kaimei SA-486 VL-BUS M.B.", "win486", MACHINE_TYPE_486_S2, MACHINE_CHIPSET_ALI_M1429G, machine_at_winbios1429_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_VLB, MACHINE_IDE, 1024, 32768, 1024, 127, NULL, NULL },
|
||||
/* Uses an Intel KBC with Phoenix MultiKey KBC firmware. */
|
||||
@@ -483,7 +483,7 @@ const machine_t machines[] = {
|
||||
|
||||
/* 486 machines which utilize the PCI bus */
|
||||
/* This has an AMIKey-2, which is an updated version of type 'H'. */
|
||||
{ "[ALi M1489] AAEON SBC-490", "sbc490", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_ALI_M1489, machine_at_sbc490_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 65536, 1024, 255, at_sbc490_get_device },
|
||||
{ "[ALi M1489] AAEON SBC-490", "sbc490", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_ALI_M1489, machine_at_sbc490_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 65536, 1024, 255, at_sbc490_get_device, NULL },
|
||||
/* Has the ALi M1487/9's on-chip keyboard controller which clones a standard AT
|
||||
KBC. */
|
||||
{ "[ALi M1489] ABIT AB-PB4", "abpb4", MACHINE_TYPE_486_S3, MACHINE_CHIPSET_ALI_M1489, machine_at_abpb4_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET3, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_PCI, MACHINE_IDE_DUAL, 1024, 65536, 1024, 255, NULL, NULL },
|
||||
@@ -593,7 +593,7 @@ const machine_t machines[] = {
|
||||
/* Has AMI MegaKey KBC firmware. */
|
||||
{ "[i430LX] Micro Star 586MC1", "586mc1", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_586mc1_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 2048, 131072, 2048, 127, NULL, NULL },
|
||||
/* This has the Phoenix MultiKey KBC firmware. */
|
||||
{ "[i430LX] Packard Bell PB520R", "pb520r", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_pb520r_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 139264, 2048, 127, at_pb520r_get_device },
|
||||
{ "[i430LX] Packard Bell PB520R", "pb520r", MACHINE_TYPE_SOCKET4, MACHINE_CHIPSET_INTEL_430LX, machine_at_pb520r_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET4, CPU_BLOCK_NONE, 60000000, 66666667, 5000, 5000, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 139264, 2048, 127, at_pb520r_get_device, NULL },
|
||||
|
||||
/* OPTi 596/597 */
|
||||
/* This uses an AMI KBC firmware in PS/2 mode (it sends command A5 with the
|
||||
@@ -666,24 +666,24 @@ const machine_t machines[] = {
|
||||
{ "[i430FX] Gateway 2000 Thor", "gw2katx", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_gw2katx_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL },
|
||||
/* The BIOS does not send a single non-standard KBC command, but the board has a SMC Super I/O
|
||||
chip with on-chip KBC and AMI MegaKey KBC firmware. */
|
||||
{ "[i430FX] HP Vectra VL 5 Series 4", "vectra54", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_vectra54_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 511, at_vectra54_get_device },
|
||||
{ "[i430FX] HP Vectra VL 5 Series 4", "vectra54", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_vectra54_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 2.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 511, at_vectra54_get_device, NULL },
|
||||
/* According to tests from real hardware: This has AMI MegaKey KBC firmware on the
|
||||
PC87306 Super I/O chip, command 0xA1 returns '5'.
|
||||
Command 0xA0 copyright string: (C)1994 AMI . */
|
||||
{ "[i430FX] Intel Advanced/ATX", "thor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_thor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_thor_get_device },
|
||||
{ "[i430FX] Intel Advanced/ATX", "thor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_thor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_thor_get_device, NULL },
|
||||
/* According to tests from real hardware: This has AMI MegaKey KBC firmware on the
|
||||
PC87306 Super I/O chip, command 0xA1 returns '5'.
|
||||
Command 0xA0 copyright string: (C)1994 AMI . */
|
||||
{ "[i430FX] Intel Advanced/ATX (MR BIOS)", "mrthor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_mrthor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, at_mrthor_get_device },
|
||||
{ "[i430FX] Intel Advanced/ATX (MR BIOS)", "mrthor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_mrthor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, at_mrthor_get_device, NULL },
|
||||
/* According to tests from real hardware: This has AMI MegaKey KBC firmware on the
|
||||
PC87306 Super I/O chip, command 0xA1 returns '5'.
|
||||
Command 0xA0 copyright string: (C)1994 AMI . */
|
||||
{ "[i430FX] Intel Advanced/EV", "endeavor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_endeavor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_endeavor_get_device },
|
||||
{ "[i430FX] Intel Advanced/EV", "endeavor", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_endeavor_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_endeavor_get_device, NULL },
|
||||
/* This has an AMIKey-2, which is an updated version of type 'H'. */
|
||||
{ "[i430FX] MSI MS-5119", "ms5119", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_ms5119_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL },
|
||||
/* This most likely uses AMI MegaKey KBC firmware as well due to having the same
|
||||
Super I/O chip (that has the KBC firmware on it) as eg. the Advanced/EV. */
|
||||
{ "[i430FX] Packard Bell PB640", "pb640", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_pb640_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_pb640_get_device },
|
||||
{ "[i430FX] Packard Bell PB640", "pb640", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_pb640_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_pb640_get_device, NULL },
|
||||
/* Has an AMI 'H' KBC firmware (1992). */
|
||||
{ "[i430FX] QDI FMB", "fmb", MACHINE_TYPE_SOCKET7_3V, MACHINE_CHIPSET_INTEL_430FX, machine_at_fmb_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_QDI_FMB, 50000000, 66666667, 3380, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL },
|
||||
|
||||
@@ -748,9 +748,9 @@ const machine_t machines[] = {
|
||||
{ "[i430VX] Biostar MB-8500TVX-A", "8500tvxa", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_8500tvxa_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2600, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL },
|
||||
/* The BIOS does not send a single non-standard KBC command, but the board has a SMC Super I/O
|
||||
chip with on-chip KBC and AMI MegaKey KBC firmware. */
|
||||
{ "[i430VX] Compaq Presario 2240", "presario2240", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_presario2240_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_presario2240_get_device },
|
||||
{ "[i430VX] Compaq Presario 2240", "presario2240", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_presario2240_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_presario2240_get_device, NULL },
|
||||
/* This most likely has AMI MegaKey as above. */
|
||||
{ "[i430VX] Compaq Presario 4500", "presario4500", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_presario4500_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_presario4500_get_device },
|
||||
{ "[i430VX] Compaq Presario 4500", "presario4500", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_presario4500_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2800, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL | MACHINE_VIDEO, 8192, 131072, 8192, 127, at_presario4500_get_device, NULL },
|
||||
/* The BIOS sends KBC command CB which is an AMI KBC command, so it has an AMI KBC firmware. */
|
||||
{ "[i430VX] Epox P55-VA", "p55va", MACHINE_TYPE_SOCKET7, MACHINE_CHIPSET_INTEL_430VX, machine_at_p55va_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET5_7, CPU_BLOCK_NONE, 50000000, 66666667, 2500, 3520, 1.5, 3.0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 131072, 8192, 127, NULL, NULL },
|
||||
/* The BIOS does not send a single non-standard KBC command. */
|
||||
@@ -905,7 +905,7 @@ const machine_t machines[] = {
|
||||
{ "[i440BX] HP Vectra VEi 8", "vei8", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_vei8_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192,1048576, 8192, 255, NULL, NULL },
|
||||
/* Has a National Semiconductors PC87309 Super I/O chip with on-chip KBC
|
||||
with most likely AMIKey-2 KBC firmware. */
|
||||
{ "[i440BX] Tyan Tsunami ATX", "s1846", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_s1846_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 112121212, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_SOUND, 8192,1048576, 8192, 255, at_s1846_get_device },
|
||||
{ "[i440BX] Tyan Tsunami ATX", "s1846", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_s1846_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 112121212, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_SOUND, 8192,1048576, 8192, 255, at_s1846_get_device, NULL },
|
||||
/* Has a Winbond W83977TF Super I/O chip with on-chip KBC with AMIKey-2 KBC
|
||||
firmware. */
|
||||
{ "[i440BX] Supermicro P6SBA", "p6sba", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440BX, machine_at_p6sba_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, NULL, NULL },
|
||||
@@ -913,10 +913,10 @@ const machine_t machines[] = {
|
||||
/* 440ZX */
|
||||
/* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC
|
||||
firmware. */
|
||||
{ "[i440ZX] MSI MS-6168", "ms6168", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440ZX, machine_at_ms6168_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_AV, 8192, 524288, 8192, 255, at_ms6168_get_device },
|
||||
{ "[i440ZX] MSI MS-6168", "ms6168", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440ZX, machine_at_ms6168_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 100000000, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_AV, 8192, 524288, 8192, 255, at_ms6168_get_device, NULL },
|
||||
/* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC
|
||||
firmware. */
|
||||
{ "[i440ZX] Packard Bell Bora Pro", "borapro", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440ZX, machine_at_borapro_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 66666667, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_AV, 8192, 524288, 8192, 255, at_borapro_get_device },
|
||||
{ "[i440ZX] Packard Bell Bora Pro", "borapro", MACHINE_TYPE_SLOT1, MACHINE_CHIPSET_INTEL_440ZX, machine_at_borapro_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK_NONE, 66666667, 66666667, 1800, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_AV, 8192, 524288, 8192, 255, at_borapro_get_device, NULL },
|
||||
|
||||
/* SMSC VictoryBX-66 */
|
||||
/* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC
|
||||
@@ -944,7 +944,7 @@ const machine_t machines[] = {
|
||||
/* 440BX */
|
||||
/* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC
|
||||
firmware. */
|
||||
{ "[i440BX] Tyan Trinity 371", "s1857", MACHINE_TYPE_SLOT1_370, MACHINE_CHIPSET_INTEL_440BX, machine_at_s1857_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1 | CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, at_s1857_get_device },
|
||||
{ "[i440BX] Tyan Trinity 371", "s1857", MACHINE_TYPE_SLOT1_370, MACHINE_CHIPSET_INTEL_440BX, machine_at_s1857_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1 | CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL, 8192, 786432, 8192, 255, at_s1857_get_device, NULL },
|
||||
|
||||
/* Slot 2 machines */
|
||||
/* 440GX */
|
||||
@@ -994,17 +994,17 @@ const machine_t machines[] = {
|
||||
{ "[VIA Apollo Pro 133A] Acorp 6VIA90AP", "6via90ap", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_6via90ap_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, MACHINE_MULTIPLIER_FIXED, MACHINE_PS2_A97, MACHINE_IDE_DUAL | MACHINE_AG, 16384, 3145728, 8192, 255, NULL, NULL },
|
||||
/* Has the VIA VT82C686B southbridge with on-chip KBC identical to the VIA
|
||||
VT82C42N. */
|
||||
{ "[VIA Apollo Pro 133A] ASUS CUV4X-LS", "cuv4xls", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_cuv4xls_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_PS2_NOI97, MACHINE_IDE_DUAL | MACHINE_SOUND, 16384, 4194304, 8192, 255, at_cuv4xls_get_device },
|
||||
{ "[VIA Apollo Pro 133A] ASUS CUV4X-LS", "cuv4xls", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_cuv4xls_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 150000000, 1300, 3500, 1.5, 8.0, MACHINE_PS2_NOI97, MACHINE_IDE_DUAL | MACHINE_SOUND, 16384, 4194304, 8192, 255, at_cuv4xls_get_device, NULL },
|
||||
/* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC
|
||||
firmware. */
|
||||
{ "[VIA Apollo Pro 133A] BCM GT694VA", "gt694va", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_gt694va_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_SOUND, 16384, 3145728, 8192, 255, at_gt694va_get_device },
|
||||
{ "[VIA Apollo Pro 133A] BCM GT694VA", "gt694va", MACHINE_TYPE_SOCKET370, MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, machine_at_gt694va_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SOCKET370, CPU_BLOCK_NONE, 66666667, 133333333, 1300, 3500, 1.5, 8.0, MACHINE_PS2_AGP, MACHINE_IDE_DUAL | MACHINE_SOUND, 16384, 3145728, 8192, 255, at_gt694va_get_device, NULL },
|
||||
|
||||
/* Miscellaneous/Fake/Hypervisor machines */
|
||||
/* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC
|
||||
firmware. */
|
||||
{ "[i440BX] Microsoft Virtual PC 2007", "vpc2007", MACHINE_TYPE_MISC, MACHINE_CHIPSET_INTEL_440BX, machine_at_vpc2007_init, 0, 0, MACHINE_AVAILABLE, 0 , CPU_PKG_SLOT1, CPU_BLOCK(CPU_PENTIUM2, CPU_CYRIX3S), 0, 66666667, 0, 0, 0, 0, MACHINE_PS2_PCI, MACHINE_IDE_DUAL, 8192, 1048576, 8192, 255, NULL, NULL },
|
||||
|
||||
{ NULL, NULL, MACHINE_TYPE_NONE, MACHINE_CHIPSET_NONE, NULL, 0, 0, MACHINE_AVAILABLE, 0 , 0, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_BUS_NONE, MACHINE_FLAGS_NONE, 0, 0, 0, 0, NULL }
|
||||
{ NULL, NULL, MACHINE_TYPE_NONE, MACHINE_CHIPSET_NONE, NULL, 0, 0, MACHINE_AVAILABLE, 0 , 0, CPU_BLOCK_NONE, 0, 0, 0, 0, 0, 0, MACHINE_BUS_NONE, MACHINE_FLAGS_NONE, 0, 0, 0, 0, NULL, NULL }
|
||||
};
|
||||
|
||||
int
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "cpu.h"
|
||||
#include <86box/mem.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/m_xt_xi8088.h>
|
||||
@@ -76,16 +77,16 @@ rom_add_path(const char* path)
|
||||
}
|
||||
|
||||
// Save the path, turning it into absolute if needed.
|
||||
if (!plat_path_abs((char*) path)) {
|
||||
if (!path_abs((char*) path)) {
|
||||
plat_getcwd(cwd, sizeof(cwd));
|
||||
plat_path_slash(cwd);
|
||||
path_slash(cwd);
|
||||
snprintf(rom_path->path, sizeof(rom_path->path), "%s%s", cwd, path);
|
||||
} else {
|
||||
snprintf(rom_path->path, sizeof(rom_path->path), "%s", path);
|
||||
}
|
||||
|
||||
// Ensure the path ends with a separator.
|
||||
plat_path_slash(rom_path->path);
|
||||
path_slash(rom_path->path);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +100,7 @@ rom_fopen(char *fn, char *mode)
|
||||
if (strstr(fn, "roms/") == fn) {
|
||||
/* Relative path */
|
||||
for (rom_path = &rom_paths; rom_path != NULL; rom_path = rom_path->next) {
|
||||
plat_append_filename(temp, rom_path->path, fn + 5);
|
||||
path_append_filename(temp, rom_path->path, fn + 5);
|
||||
|
||||
if ((fp = plat_fopen(temp, mode)) != NULL) {
|
||||
return fp;
|
||||
@@ -123,7 +124,7 @@ rom_getfile(char *fn, char *s, int size)
|
||||
if (strstr(fn, "roms/") == fn) {
|
||||
/* Relative path */
|
||||
for (rom_path = &rom_paths; rom_path != NULL; rom_path = rom_path->next) {
|
||||
plat_append_filename(temp, rom_path->path, fn + 5);
|
||||
path_append_filename(temp, rom_path->path, fn + 5);
|
||||
|
||||
if (rom_present(temp)) {
|
||||
strncpy(s, temp, size);
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/plat_dynld.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/network.h>
|
||||
|
||||
|
||||
@@ -122,6 +123,7 @@ static const unsigned char
|
||||
*(*f_pcap_next)(void *,void *);
|
||||
static int (*f_pcap_sendpacket)(void *,const unsigned char *,int);
|
||||
static void (*f_pcap_close)(void *);
|
||||
static int (*f_pcap_setnonblock)(void*, int, char*);
|
||||
static dllimp_t pcap_imports[] = {
|
||||
{ "pcap_lib_version", &f_pcap_lib_version },
|
||||
{ "pcap_findalldevs", &f_pcap_findalldevs },
|
||||
@@ -132,6 +134,7 @@ static dllimp_t pcap_imports[] = {
|
||||
{ "pcap_next", &f_pcap_next },
|
||||
{ "pcap_sendpacket", &f_pcap_sendpacket },
|
||||
{ "pcap_close", &f_pcap_close },
|
||||
{ "pcap_setnonblock", &f_pcap_setnonblock },
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
@@ -382,6 +385,9 @@ net_pcap_reset(const netcard_t *card, uint8_t *mac)
|
||||
pcap_log(" Unable to open device: %s!\n", network_host);
|
||||
return(-1);
|
||||
}
|
||||
if (f_pcap_setnonblock((void*)pcap, 1, errbuf) != 0)
|
||||
pcap_log("PCAP: failed nonblock %s\n", errbuf);
|
||||
|
||||
pcap_log("PCAP: interface: %s\n", network_host);
|
||||
|
||||
/* Create a MAC address based packet filter. */
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <86box/86box.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/network.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/timer.h>
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/ui.h>
|
||||
#include <86box/network.h>
|
||||
#include <86box/net_3c503.h>
|
||||
@@ -541,12 +542,12 @@ network_reset(void)
|
||||
|
||||
network_log("NETWORK: set up for %s, card='%s'\n",
|
||||
(network_type==NET_TYPE_SLIRP)?"SLiRP":"Pcap",
|
||||
net_cards[network_card].name);
|
||||
net_cards[network_card].device->name);
|
||||
|
||||
/* Add the (new?) card to the I/O system. */
|
||||
if (net_cards[network_card].device) {
|
||||
network_log("NETWORK: adding device '%s'\n",
|
||||
net_cards[network_card].name);
|
||||
net_cards[network_card].device->name);
|
||||
device_add(net_cards[network_card].device);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
#include <86box/machine.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/nvr.h>
|
||||
|
||||
@@ -213,7 +214,7 @@ nvr_path(char *str)
|
||||
plat_dir_create(temp);
|
||||
|
||||
/* Now append the actual filename. */
|
||||
plat_path_slash(temp);
|
||||
path_slash(temp);
|
||||
strcat(temp, str);
|
||||
|
||||
return(temp);
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
#include <86box/mem.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/pit.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/plat_dynld.h>
|
||||
#include <86box/ui.h>
|
||||
@@ -596,7 +597,7 @@ update_font(escp_t *dev)
|
||||
|
||||
/* Create a full pathname for the ROM file. */
|
||||
strcpy(path, dev->fontpath);
|
||||
plat_path_slash(path);
|
||||
path_slash(path);
|
||||
strcat(path, fn);
|
||||
|
||||
escp_log("Temp file=%s\n", path);
|
||||
@@ -2062,14 +2063,14 @@ escp_init(void *lpt)
|
||||
}
|
||||
|
||||
strcpy(dev->fontpath, exe_path);
|
||||
plat_path_slash(dev->fontpath);
|
||||
path_slash(dev->fontpath);
|
||||
strcat(dev->fontpath, "roms/printer/fonts/");
|
||||
|
||||
/* Create the full path for the page images. */
|
||||
plat_append_filename(dev->pagepath, usr_path, "printer");
|
||||
path_append_filename(dev->pagepath, usr_path, "printer");
|
||||
if (! plat_dir_check(dev->pagepath))
|
||||
plat_dir_create(dev->pagepath);
|
||||
plat_path_slash(dev->pagepath);
|
||||
path_slash(dev->pagepath);
|
||||
|
||||
dev->page_width = PAGE_WIDTH;
|
||||
dev->page_height = PAGE_HEIGHT;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/pit.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/plat_dynld.h>
|
||||
#include <86box/ui.h>
|
||||
@@ -152,7 +153,7 @@ convert_to_pdf(ps_t *dev)
|
||||
char input_fn[1024], output_fn[1024], *gsargv[9];
|
||||
|
||||
strcpy(input_fn, dev->printer_path);
|
||||
plat_path_slash(input_fn);
|
||||
path_slash(input_fn);
|
||||
strcat(input_fn, dev->filename);
|
||||
|
||||
strcpy(output_fn, input_fn);
|
||||
@@ -206,7 +207,7 @@ write_buffer(ps_t *dev, bool finish)
|
||||
plat_tempfile(dev->filename, NULL, ".ps");
|
||||
|
||||
strcpy(path, dev->printer_path);
|
||||
plat_path_slash(path);
|
||||
path_slash(path);
|
||||
strcat(path, dev->filename);
|
||||
|
||||
fp = plat_fopen(path, "a");
|
||||
@@ -365,10 +366,10 @@ ps_init(void *lpt)
|
||||
|
||||
/* Cache print folder path. */
|
||||
memset(dev->printer_path, 0x00, sizeof(dev->printer_path));
|
||||
plat_append_filename(dev->printer_path, usr_path, "printer");
|
||||
path_append_filename(dev->printer_path, usr_path, "printer");
|
||||
if (!plat_dir_check(dev->printer_path))
|
||||
plat_dir_create(dev->printer_path);
|
||||
plat_path_slash(dev->printer_path);
|
||||
path_slash(dev->printer_path);
|
||||
|
||||
timer_add(&dev->pulse_timer, pulse_timer, dev, 0);
|
||||
timer_add(&dev->timeout_timer, timeout_timer, dev, 0);
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/pit.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/printer.h>
|
||||
@@ -150,10 +151,10 @@ dump_page(prnt_t *dev)
|
||||
|
||||
/* Create the full path for this file. */
|
||||
memset(path, 0x00, sizeof(path));
|
||||
plat_append_filename(path, usr_path, "printer");
|
||||
path_append_filename(path, usr_path, "printer");
|
||||
if (! plat_dir_check(path))
|
||||
plat_dir_create(path);
|
||||
plat_path_slash(path);
|
||||
path_slash(path);
|
||||
strcat(path, dev->filename);
|
||||
|
||||
/* Create the file. */
|
||||
|
||||
@@ -148,6 +148,9 @@ add_library(ui STATIC
|
||||
qt_vulkanwindowrenderer.hpp
|
||||
qt_vulkanwindowrenderer.cpp
|
||||
|
||||
qt_vulkanrenderer.hpp
|
||||
qt_vulkanrenderer.cpp
|
||||
|
||||
../qt_resources.qrc
|
||||
)
|
||||
|
||||
|
||||
@@ -207,18 +207,12 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
qt_mouse_capture(mouse_capture);
|
||||
if (mouse_capture) {
|
||||
this->grabKeyboard();
|
||||
#ifdef WAYLAND
|
||||
if (QGuiApplication::platformName().contains("wayland")) {
|
||||
wl_mouse_capture(this->windowHandle());
|
||||
}
|
||||
#endif
|
||||
if (ui->stackedWidget->mouse_capture)
|
||||
ui->stackedWidget->mouse_capture(this->windowHandle());
|
||||
} else {
|
||||
this->releaseKeyboard();
|
||||
#ifdef WAYLAND
|
||||
if (QGuiApplication::platformName().contains("wayland")) {
|
||||
wl_mouse_uncapture();
|
||||
}
|
||||
#endif
|
||||
if (ui->stackedWidget->mouse_uncapture)
|
||||
ui->stackedWidget->mouse_uncapture();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -520,10 +514,11 @@ void MainWindow::closeEvent(QCloseEvent *event) {
|
||||
}
|
||||
qt_nvr_save();
|
||||
config_save();
|
||||
#if defined __unix__ && !defined __HAIKU__
|
||||
extern void xinput2_exit();
|
||||
if (QApplication::platformName() == "xcb") xinput2_exit();
|
||||
#endif
|
||||
if (ui->stackedWidget->mouse_exit)
|
||||
ui->stackedWidget->mouse_exit();
|
||||
|
||||
ui->stackedWidget->switchRenderer(RendererStack::Renderer::Software);
|
||||
|
||||
event->accept();
|
||||
}
|
||||
|
||||
|
||||
@@ -88,6 +88,7 @@ extern "C" {
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat_dynld.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/rom.h>
|
||||
@@ -140,7 +141,7 @@ void plat_get_exe_name(char *s, int size)
|
||||
|
||||
memcpy(s, exepath_temp.data(), std::min((qsizetype)exepath_temp.size(),(qsizetype)size));
|
||||
|
||||
plat_path_slash(s);
|
||||
path_slash(s);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
@@ -183,19 +184,24 @@ plat_dir_check(char *path)
|
||||
int
|
||||
plat_getcwd(char *bufp, int max)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
/* Working directory for .app bundles is undefined. */
|
||||
strncpy(bufp, exe_path, max);
|
||||
#else
|
||||
CharPointer(bufp, max) = QDir::currentPath().toUtf8();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
plat_get_dirname(char *dest, const char *path)
|
||||
path_get_dirname(char *dest, const char *path)
|
||||
{
|
||||
QFileInfo fi(path);
|
||||
CharPointer(dest, -1) = fi.dir().path().toUtf8();
|
||||
}
|
||||
|
||||
char *
|
||||
plat_get_extension(char *s)
|
||||
path_get_extension(char *s)
|
||||
{
|
||||
auto len = strlen(s);
|
||||
auto idx = QByteArray::fromRawData(s, len).lastIndexOf('.');
|
||||
@@ -206,7 +212,7 @@ plat_get_extension(char *s)
|
||||
}
|
||||
|
||||
char *
|
||||
plat_get_filename(char *s)
|
||||
path_get_filename(char *s)
|
||||
{
|
||||
#ifdef Q_OS_WINDOWS
|
||||
int c = strlen(s) - 1;
|
||||
@@ -228,7 +234,7 @@ plat_get_filename(char *s)
|
||||
}
|
||||
|
||||
int
|
||||
plat_path_abs(char *path)
|
||||
path_abs(char *path)
|
||||
{
|
||||
#ifdef Q_OS_WINDOWS
|
||||
if ((path[1] == ':') || (path[0] == '\\') || (path[0] == '/'))
|
||||
@@ -241,7 +247,7 @@ plat_path_abs(char *path)
|
||||
}
|
||||
|
||||
void
|
||||
plat_path_normalize(char* path)
|
||||
path_normalize(char* path)
|
||||
{
|
||||
#ifdef Q_OS_WINDOWS
|
||||
while (*path++ != 0)
|
||||
@@ -252,7 +258,7 @@ plat_path_normalize(char* path)
|
||||
}
|
||||
|
||||
void
|
||||
plat_path_slash(char *path)
|
||||
path_slash(char *path)
|
||||
{
|
||||
auto len = strlen(path);
|
||||
auto separator = '/';
|
||||
@@ -260,14 +266,14 @@ plat_path_slash(char *path)
|
||||
path[len] = separator;
|
||||
path[len+1] = 0;
|
||||
}
|
||||
plat_path_normalize(path);
|
||||
path_normalize(path);
|
||||
}
|
||||
|
||||
void
|
||||
plat_append_filename(char *dest, const char *s1, const char *s2)
|
||||
path_append_filename(char *dest, const char *s1, const char *s2)
|
||||
{
|
||||
strcpy(dest, s1);
|
||||
plat_path_slash(dest);
|
||||
path_slash(dest);
|
||||
strcat(dest, s2);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "evdev_mouse.hpp"
|
||||
|
||||
#include <QScreen>
|
||||
#include <QMessageBox>
|
||||
|
||||
#ifdef __APPLE__
|
||||
# include <CoreGraphics/CoreGraphics.h>
|
||||
@@ -51,21 +52,45 @@ RendererStack::RendererStack(QWidget *parent)
|
||||
ui->setupUi(this);
|
||||
|
||||
#if defined __unix__ && !defined __HAIKU__
|
||||
# ifdef WAYLAND
|
||||
if (QApplication::platformName().contains("wayland")) {
|
||||
wl_init();
|
||||
char *mouse_type = getenv("EMU86BOX_MOUSE"), auto_mouse_type[16];
|
||||
if (!mouse_type || (mouse_type[0] == '\0') || !stricmp(mouse_type, "auto")) {
|
||||
if (QApplication::platformName().contains("wayland"))
|
||||
strcpy(auto_mouse_type, "wayland");
|
||||
else if (QApplication::platformName() == "eglfs")
|
||||
strcpy(auto_mouse_type, "evdev");
|
||||
else if (QApplication::platformName() == "xcb")
|
||||
strcpy(auto_mouse_type, "xinput2");
|
||||
else
|
||||
auto_mouse_type[0] = '\0';
|
||||
mouse_type = auto_mouse_type;
|
||||
}
|
||||
|
||||
# ifdef WAYLAND
|
||||
if (!stricmp(mouse_type, "wayland")) {
|
||||
this->mouse_init = wl_init;
|
||||
this->mouse_poll = wl_mouse_poll;
|
||||
this->mouse_capture = wl_mouse_capture;
|
||||
this->mouse_uncapture = wl_mouse_uncapture;
|
||||
} else
|
||||
# endif
|
||||
# ifdef EVDEV_INPUT
|
||||
if (QApplication::platformName() == "eglfs") {
|
||||
evdev_init();
|
||||
}
|
||||
if (!stricmp(mouse_type, "evdev")) {
|
||||
this->mouse_init = evdev_init;
|
||||
this->mouse_poll = evdev_mouse_poll;
|
||||
} else
|
||||
# endif
|
||||
if (QApplication::platformName() == "xcb") {
|
||||
if (!stricmp(mouse_type, "xinput2")) {
|
||||
extern void xinput2_init();
|
||||
xinput2_init();
|
||||
extern void xinput2_poll();
|
||||
extern void xinput2_exit();
|
||||
this->mouse_init = xinput2_init;
|
||||
this->mouse_poll = xinput2_poll;
|
||||
this->mouse_exit = xinput2_exit;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (this->mouse_init)
|
||||
this->mouse_init();
|
||||
}
|
||||
|
||||
RendererStack::~RendererStack()
|
||||
@@ -105,23 +130,9 @@ RendererStack::mousePoll()
|
||||
mousedata.deltax = mousedata.deltay = mousedata.deltaz = 0;
|
||||
mouse_buttons = mousedata.mousebuttons;
|
||||
|
||||
# if defined __unix__ && !defined __HAIKU__
|
||||
# ifdef WAYLAND
|
||||
if (QApplication::platformName().contains("wayland"))
|
||||
wl_mouse_poll();
|
||||
# endif
|
||||
|
||||
# ifdef EVDEV_INPUT
|
||||
if (QApplication::platformName() == "eglfs")
|
||||
evdev_mouse_poll();
|
||||
else
|
||||
# endif
|
||||
if (QApplication::platformName() == "xcb") {
|
||||
extern void xinput2_poll();
|
||||
xinput2_poll();
|
||||
}
|
||||
# endif /* defined __unix__ */
|
||||
#endif /* !defined __APPLE__ */
|
||||
if (this->mouse_poll)
|
||||
this->mouse_poll();
|
||||
#endif /* !defined __APPLE__ */
|
||||
}
|
||||
|
||||
int ignoreNextMouseEvent = 1;
|
||||
@@ -271,13 +282,13 @@ RendererStack::createRenderer(Renderer renderer)
|
||||
rendererWindow = hw;
|
||||
connect(this, &RendererStack::blitToRenderer, hw, &OpenGLRenderer::onBlit, Qt::QueuedConnection);
|
||||
connect(hw, &OpenGLRenderer::initialized, [=]() {
|
||||
/* Buffers are awailable only after initialization. */
|
||||
/* Buffers are available only after initialization. */
|
||||
imagebufs = rendererWindow->getBuffers();
|
||||
endblit();
|
||||
emit rendererChanged();
|
||||
});
|
||||
connect(hw, &OpenGLRenderer::errorInitializing, [=]() {
|
||||
/* Renderer could initialize, fallback to software. */
|
||||
/* Renderer not could initialize, fallback to software. */
|
||||
imagebufs = {};
|
||||
endblit();
|
||||
QTimer::singleShot(0, this, [this]() { switchRenderer(Renderer::Software); });
|
||||
@@ -288,15 +299,35 @@ RendererStack::createRenderer(Renderer renderer)
|
||||
case Renderer::Vulkan:
|
||||
{
|
||||
this->createWinId();
|
||||
auto hw = new VulkanWindowRenderer(this);
|
||||
VulkanWindowRenderer *hw = nullptr;
|
||||
try {
|
||||
hw = new VulkanWindowRenderer(this);
|
||||
} catch(std::runtime_error& e) {
|
||||
auto msgBox = new QMessageBox(QMessageBox::Critical, "86Box", e.what() + QString("\nFalling back to software rendering."), QMessageBox::Ok);
|
||||
msgBox->setAttribute(Qt::WA_DeleteOnClose);
|
||||
msgBox->show();
|
||||
imagebufs = {};
|
||||
endblit();
|
||||
QTimer::singleShot(0, this, [this]() { switchRenderer(Renderer::Software); });
|
||||
break;
|
||||
};
|
||||
rendererWindow = hw;
|
||||
connect(this, &RendererStack::blitToRenderer, hw, &VulkanWindowRenderer::onBlit, Qt::QueuedConnection);
|
||||
connect(hw, &VulkanWindowRenderer::rendererInitialized, [=]() {
|
||||
/* Buffers are awailable only after initialization. */
|
||||
/* Buffers are available only after initialization. */
|
||||
imagebufs = rendererWindow->getBuffers();
|
||||
endblit();
|
||||
emit rendererChanged();
|
||||
});
|
||||
connect(hw, &VulkanWindowRenderer::errorInitializing, [=]() {
|
||||
/* Renderer could not initialize, fallback to software. */
|
||||
auto msgBox = new QMessageBox(QMessageBox::Critical, "86Box", QString("Failed to initialize Vulkan renderer.\nFalling back to software rendering."), QMessageBox::Ok);
|
||||
msgBox->setAttribute(Qt::WA_DeleteOnClose);
|
||||
msgBox->show();
|
||||
imagebufs = {};
|
||||
endblit();
|
||||
QTimer::singleShot(0, this, [this]() { switchRenderer(Renderer::Software); });
|
||||
});
|
||||
current.reset(this->createWindowContainer(hw, this));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -65,6 +65,12 @@ public:
|
||||
rendererWindow->onResize(width, height);
|
||||
}
|
||||
|
||||
void (*mouse_init)() = nullptr;
|
||||
void (*mouse_poll)() = nullptr;
|
||||
void (*mouse_capture)(QWindow *window) = nullptr;
|
||||
void (*mouse_uncapture)() = nullptr;
|
||||
void (*mouse_exit)() = nullptr;
|
||||
|
||||
signals:
|
||||
void blitToRenderer(int buf_idx, int x, int y, int w, int h);
|
||||
void rendererChanged();
|
||||
|
||||
1005
src/qt/qt_vulkanrenderer.cpp
Normal file
1005
src/qt/qt_vulkanrenderer.cpp
Normal file
File diff suppressed because it is too large
Load Diff
110
src/qt/qt_vulkanrenderer.hpp
Normal file
110
src/qt/qt_vulkanrenderer.hpp
Normal file
@@ -0,0 +1,110 @@
|
||||
#pragma once
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** BSD License Usage
|
||||
** Alternatively, you may use this file under the terms of the BSD license
|
||||
** as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||
** contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QVulkanWindow>
|
||||
#include <QImage>
|
||||
|
||||
#include "qt_vulkanwindowrenderer.hpp"
|
||||
|
||||
class VulkanRenderer2 : public QVulkanWindowRenderer
|
||||
{
|
||||
public:
|
||||
void* mappedPtr = nullptr;
|
||||
size_t imagePitch = 2048 * 4;
|
||||
VulkanRenderer2(QVulkanWindow *w);
|
||||
|
||||
void initResources() override;
|
||||
void initSwapChainResources() override;
|
||||
void releaseSwapChainResources() override;
|
||||
void releaseResources() override;
|
||||
|
||||
void startNextFrame() override;
|
||||
|
||||
private:
|
||||
VkShaderModule createShader(const QString &name);
|
||||
bool createTexture();
|
||||
bool createTextureImage(const QSize &size, VkImage *image, VkDeviceMemory *mem,
|
||||
VkImageTiling tiling, VkImageUsageFlags usage, uint32_t memIndex);
|
||||
bool writeLinearImage(const QImage &img, VkImage image, VkDeviceMemory memory);
|
||||
void ensureTexture();
|
||||
void updateSamplers();
|
||||
|
||||
QVulkanWindow *m_window;
|
||||
QVulkanDeviceFunctions *m_devFuncs;
|
||||
|
||||
VkDeviceMemory m_bufMem = VK_NULL_HANDLE;
|
||||
VkBuffer m_buf = VK_NULL_HANDLE;
|
||||
VkDescriptorBufferInfo m_uniformBufInfo[QVulkanWindow::MAX_CONCURRENT_FRAME_COUNT];
|
||||
|
||||
VkDescriptorPool m_descPool = VK_NULL_HANDLE;
|
||||
VkDescriptorSetLayout m_descSetLayout = VK_NULL_HANDLE;
|
||||
VkDescriptorSet m_descSet[QVulkanWindow::MAX_CONCURRENT_FRAME_COUNT];
|
||||
|
||||
VkPipelineCache m_pipelineCache = VK_NULL_HANDLE;
|
||||
VkPipelineLayout m_pipelineLayout = VK_NULL_HANDLE;
|
||||
VkPipeline m_pipeline = VK_NULL_HANDLE;
|
||||
|
||||
VkSampler m_sampler = VK_NULL_HANDLE;
|
||||
VkSampler m_linearSampler = VK_NULL_HANDLE;
|
||||
VkImage m_texImage = VK_NULL_HANDLE;
|
||||
VkDeviceMemory m_texMem = VK_NULL_HANDLE;
|
||||
bool m_texLayoutPending = false;
|
||||
VkImageView m_texView = VK_NULL_HANDLE;
|
||||
VkImage m_texStaging = VK_NULL_HANDLE;
|
||||
VkDeviceMemory m_texStagingMem = VK_NULL_HANDLE;
|
||||
bool m_texStagingPending = false;
|
||||
bool m_texStagingTransferLayout = false;
|
||||
QSize m_texSize;
|
||||
VkFormat m_texFormat;
|
||||
|
||||
QMatrix4x4 m_proj;
|
||||
float m_rotation = 0.0f;
|
||||
};
|
||||
@@ -7,16 +7,15 @@
|
||||
|
||||
#include <array>
|
||||
|
||||
#define VMA_IMPLEMENTATION
|
||||
#include "vk_mem_alloc.h"
|
||||
#include "qt_mainwindow.hpp"
|
||||
#include "qt_vulkanrenderer.hpp"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
#include <86box/86box.h>
|
||||
#include <86box/video.h>
|
||||
}
|
||||
|
||||
#if 0
|
||||
extern MainWindow* main_window;
|
||||
/*
|
||||
#version 450
|
||||
@@ -194,7 +193,7 @@ void main()
|
||||
static const uint8_t fragShaderCode[]
|
||||
{
|
||||
0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x08, 0x00,
|
||||
0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
|
||||
0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30,
|
||||
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@@ -231,18 +230,26 @@ static const uint8_t fragShaderCode[]
|
||||
0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x04, 0x00, 0x10, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x04, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x0b, 0x00, 0x00, 0x00,
|
||||
0x0e, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
|
||||
0x0f, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
|
||||
0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x0e, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00,
|
||||
0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x80, 0x3f, 0x15, 0x00, 0x04, 0x00, 0x15, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00,
|
||||
0x15, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x20, 0x00, 0x04, 0x00, 0x17, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0x06, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00,
|
||||
0x0b, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
|
||||
0x3d, 0x00, 0x04, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x11, 0x00, 0x00, 0x00, 0x57, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00,
|
||||
0x13, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x3e, 0x00, 0x03, 0x00, 0x09, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
|
||||
0x41, 0x00, 0x05, 0x00, 0x17, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
|
||||
0x09, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00,
|
||||
0x18, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00,
|
||||
0x38, 0x00, 0x01, 0x00
|
||||
};
|
||||
|
||||
class VulkanRenderer : public QVulkanWindowRenderer
|
||||
class VulkanRendererEmu : public QVulkanWindowRenderer
|
||||
{
|
||||
VulkanWindowRenderer* m_window{nullptr};
|
||||
QVulkanDeviceFunctions* m_devFuncs{nullptr};
|
||||
@@ -308,7 +315,7 @@ private:
|
||||
public:
|
||||
void* mappedPtr = nullptr;
|
||||
uint32_t imagePitch{2048 * 4};
|
||||
VulkanRenderer(VulkanWindowRenderer *w) : m_window(w), m_devFuncs(nullptr) { }
|
||||
VulkanRendererEmu(VulkanWindowRenderer *w) : m_window(w), m_devFuncs(nullptr) { }
|
||||
|
||||
void initResources() override
|
||||
{
|
||||
@@ -344,8 +351,8 @@ public:
|
||||
VmaAllocationCreateInfo allocInfo{};
|
||||
allocInfo.pUserData = allocInfo.pool = nullptr;
|
||||
allocInfo.requiredFlags = allocInfo.preferredFlags = 0;
|
||||
allocInfo.usage = VmaMemoryUsage::VMA_MEMORY_USAGE_UNKNOWN;
|
||||
allocInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT |
|
||||
allocInfo.usage = VmaMemoryUsage::VMA_MEMORY_USAGE_AUTO;
|
||||
allocInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT |
|
||||
VMA_ALLOCATION_CREATE_MAPPED_BIT;
|
||||
|
||||
if ((res = vmaCreateImage(allocator, &imageInfo, &allocInfo, &image, &allocation, &allocatedInfo)) != VK_SUCCESS) {
|
||||
@@ -363,6 +370,10 @@ public:
|
||||
imageViewInfo.subresourceRange.levelCount = 1;
|
||||
imageViewInfo.subresourceRange.baseArrayLayer = 0;
|
||||
imageViewInfo.subresourceRange.layerCount = 1;
|
||||
imageViewInfo.components.r = VK_COMPONENT_SWIZZLE_R;
|
||||
imageViewInfo.components.g = VK_COMPONENT_SWIZZLE_G;
|
||||
imageViewInfo.components.b = VK_COMPONENT_SWIZZLE_B;
|
||||
imageViewInfo.components.a = VK_COMPONENT_SWIZZLE_A;
|
||||
|
||||
if ((res = m_devFuncs->vkCreateImageView(m_window->device(), &imageViewInfo, nullptr, &imageView)) != VK_SUCCESS) {
|
||||
QMessageBox::critical(main_window, "86Box", "Could not create Vulkan image view. Switch to another renderer. " + Vulkan_GetResultString(res));
|
||||
@@ -408,7 +419,7 @@ public:
|
||||
rasterizer.rasterizerDiscardEnable = VK_FALSE;
|
||||
rasterizer.polygonMode = VK_POLYGON_MODE_FILL;
|
||||
rasterizer.lineWidth = 1.0f;
|
||||
rasterizer.cullMode = VK_CULL_MODE_NONE;
|
||||
rasterizer.cullMode = VK_CULL_MODE_BACK_BIT;
|
||||
rasterizer.frontFace = VK_FRONT_FACE_CLOCKWISE;
|
||||
rasterizer.depthBiasEnable = VK_FALSE;
|
||||
rasterizer.depthBiasConstantFactor = 0.0f;
|
||||
@@ -426,12 +437,12 @@ public:
|
||||
|
||||
VkPipelineColorBlendAttachmentState colorBlendAttachment{};
|
||||
colorBlendAttachment.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
|
||||
colorBlendAttachment.blendEnable = VK_FALSE;
|
||||
colorBlendAttachment.blendEnable = VK_TRUE;
|
||||
colorBlendAttachment.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
|
||||
colorBlendAttachment.dstColorBlendFactor = VK_BLEND_FACTOR_ZERO;
|
||||
colorBlendAttachment.dstColorBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
|
||||
colorBlendAttachment.colorBlendOp = VK_BLEND_OP_ADD;
|
||||
colorBlendAttachment.srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE;
|
||||
colorBlendAttachment.dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO;
|
||||
colorBlendAttachment.dstAlphaBlendFactor = VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA;
|
||||
colorBlendAttachment.alphaBlendOp = VK_BLEND_OP_ADD;
|
||||
|
||||
VkPipelineColorBlendStateCreateInfo colorBlending{};
|
||||
@@ -521,10 +532,10 @@ public:
|
||||
VkPipelineDepthStencilStateCreateInfo depthInfo{};
|
||||
depthInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
|
||||
depthInfo.pNext = nullptr;
|
||||
depthInfo.depthTestEnable = VK_FALSE;
|
||||
depthInfo.depthTestEnable = VK_TRUE;
|
||||
depthInfo.depthWriteEnable = VK_TRUE;
|
||||
depthInfo.depthBoundsTestEnable = VK_FALSE;
|
||||
depthInfo.depthCompareOp = VK_COMPARE_OP_ALWAYS;
|
||||
depthInfo.depthCompareOp = VK_COMPARE_OP_LESS_OR_EQUAL;
|
||||
depthInfo.stencilTestEnable = VK_FALSE;
|
||||
depthInfo.maxDepthBounds = 1.0f;
|
||||
|
||||
@@ -543,8 +554,6 @@ public:
|
||||
pipelineInfo.layout = pipelineLayout;
|
||||
pipelineInfo.renderPass = m_window->defaultRenderPass();
|
||||
pipelineInfo.subpass = 0;
|
||||
pipelineInfo.basePipelineHandle = VK_NULL_HANDLE;
|
||||
pipelineInfo.basePipelineIndex = -1;
|
||||
|
||||
if ((res = m_devFuncs->vkCreateGraphicsPipelines(m_window->device(), VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &pipeline)) != VK_SUCCESS) {
|
||||
m_devFuncs->vkDestroyShaderModule(m_window->device(), vertModule, nullptr);
|
||||
@@ -560,18 +569,17 @@ public:
|
||||
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
|
||||
samplerInfo.magFilter = VK_FILTER_LINEAR;
|
||||
samplerInfo.minFilter = VK_FILTER_LINEAR;
|
||||
samplerInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT;
|
||||
samplerInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT;
|
||||
samplerInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_REPEAT;
|
||||
samplerInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
|
||||
samplerInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
|
||||
samplerInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
|
||||
samplerInfo.anisotropyEnable = VK_FALSE;
|
||||
samplerInfo.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
|
||||
samplerInfo.unnormalizedCoordinates = VK_FALSE;
|
||||
samplerInfo.compareEnable = VK_TRUE;
|
||||
samplerInfo.compareEnable = VK_FALSE;
|
||||
samplerInfo.compareOp = VK_COMPARE_OP_ALWAYS;
|
||||
samplerInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR;
|
||||
samplerInfo.mipLodBias = 0.0f;
|
||||
samplerInfo.minLod = 0.0f;
|
||||
samplerInfo.maxLod = 0.25f;
|
||||
samplerInfo.maxLod = 0.0;
|
||||
|
||||
if ((res = m_devFuncs->vkCreateSampler(m_window->device(), &samplerInfo, nullptr, &sampler)) != VK_SUCCESS) {
|
||||
QMessageBox::critical(main_window, "86Box", "Could not create linear image sampler. Switch to another renderer. " + Vulkan_GetResultString(res));
|
||||
@@ -716,9 +724,12 @@ public:
|
||||
|
||||
void startNextFrame() override
|
||||
{
|
||||
m_devFuncs->vkDeviceWaitIdle(m_window->device());
|
||||
VkClearValue values[2];
|
||||
auto cmdBufs = m_window->currentCommandBuffer();
|
||||
memset(values, 0, sizeof(values));
|
||||
values[0].depthStencil = { 1, 0 };
|
||||
values[1].depthStencil = { 1, 0 };
|
||||
VkRenderPassBeginInfo info{};
|
||||
VkSubpassDependency deps{};
|
||||
info.pClearValues = values;
|
||||
@@ -749,8 +760,8 @@ public:
|
||||
|
||||
m_devFuncs->vkCmdPipelineBarrier(cmdBufs, srcflags, dstflags, 0, 0, nullptr, 0, nullptr, 1, &barrier);
|
||||
imageLayoutTransitioned = true;
|
||||
return m_window->frameReady();
|
||||
}
|
||||
vmaFlushAllocation(allocator, allocation, 0, VK_WHOLE_SIZE);
|
||||
VkViewport viewport{};
|
||||
viewport.x = m_window->destination.x();
|
||||
viewport.y = m_window->destination.y();
|
||||
@@ -776,6 +787,7 @@ public:
|
||||
m_devFuncs->vkDeviceWaitIdle(m_window->device());
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
VulkanWindowRenderer::VulkanWindowRenderer(QWidget* parent)
|
||||
: QVulkanWindow(parent->windowHandle())
|
||||
@@ -783,9 +795,17 @@ VulkanWindowRenderer::VulkanWindowRenderer(QWidget* parent)
|
||||
parentWidget = parent;
|
||||
instance.setLayers(QByteArrayList() << "VK_LAYER_KHRONOS_validation");
|
||||
instance.setExtensions(QByteArrayList() << "VK_EXT_debug_report");
|
||||
instance.create();
|
||||
if (!instance.create()) {
|
||||
throw std::runtime_error("Could not create Vulkan instance");
|
||||
}
|
||||
uint32_t physicalDevices = 0;
|
||||
instance.functions()->vkEnumeratePhysicalDevices(instance.vkInstance(), &physicalDevices, nullptr);
|
||||
if (physicalDevices == 0) {
|
||||
throw std::runtime_error("No physical devices available.");
|
||||
}
|
||||
qDebug() << instance.layers();
|
||||
setVulkanInstance(&instance);
|
||||
setPhysicalDeviceIndex(0);
|
||||
setFlags(Flag::PersistentResources);
|
||||
buf_usage = std::vector<std::atomic_flag>(1);
|
||||
buf_usage[0].clear();
|
||||
@@ -793,7 +813,7 @@ VulkanWindowRenderer::VulkanWindowRenderer(QWidget* parent)
|
||||
|
||||
QVulkanWindowRenderer* VulkanWindowRenderer::createRenderer()
|
||||
{
|
||||
renderer = new VulkanRenderer(this);
|
||||
renderer = new VulkanRenderer2(this);
|
||||
return renderer;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
#include <QVulkanWindow>
|
||||
|
||||
#include "qt_renderercommon.hpp"
|
||||
#include "qt_vulkanrenderer.hpp"
|
||||
|
||||
class VulkanRenderer;
|
||||
class VulkanRenderer2;
|
||||
|
||||
class VulkanWindowRenderer : public QVulkanWindow, public RendererCommon
|
||||
{
|
||||
@@ -16,6 +17,7 @@ public slots:
|
||||
void onBlit(int buf_idx, int x, int y, int w, int h);
|
||||
signals:
|
||||
void rendererInitialized();
|
||||
void errorInitializing();
|
||||
protected:
|
||||
virtual std::vector<std::tuple<uint8_t *, std::atomic_flag *>> getBuffers() override;
|
||||
void resizeEvent(QResizeEvent*) override;
|
||||
@@ -26,9 +28,10 @@ private:
|
||||
|
||||
QVulkanWindowRenderer* createRenderer() override;
|
||||
|
||||
friend class VulkanRenderer;
|
||||
friend class VulkanRendererEmu;
|
||||
friend class VulkanRenderer2;
|
||||
|
||||
VulkanRenderer* renderer;
|
||||
VulkanRenderer2* renderer;
|
||||
};
|
||||
|
||||
#endif // VULKANWINDOWRENDERER_HPP
|
||||
|
||||
BIN
src/qt/texture_frag.spv
Normal file
BIN
src/qt/texture_frag.spv
Normal file
Binary file not shown.
BIN
src/qt/texture_vert.spv
Normal file
BIN
src/qt/texture_vert.spv
Normal file
Binary file not shown.
19564
src/qt/vk_mem_alloc.h
19564
src/qt/vk_mem_alloc.h
File diff suppressed because it is too large
Load Diff
@@ -57,4 +57,8 @@
|
||||
<file>win/icons/send_cae.ico</file>
|
||||
<file>win/icons/settings.ico</file>
|
||||
</qresource>
|
||||
<qresource prefix="/">
|
||||
<file alias="/texture_vert.spv">qt/texture_vert.spv</file>
|
||||
<file alias="/texture_frag.spv">qt/texture_frag.spv</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
# include <86box/midi.h>
|
||||
# include <86box/plat.h>
|
||||
# include <86box/plat_dynld.h>
|
||||
# include <86box/thread.h>
|
||||
# include <86box/sound.h>
|
||||
# include <86box/ui.h>
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <86box/mem.h>
|
||||
#include <86box/midi.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/ui.h>
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <86box/machine.h>
|
||||
#include <86box/midi.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/snd_ac97.h>
|
||||
#include <86box/snd_azt2316a.h>
|
||||
#include <86box/timer.h>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <condition_variable>
|
||||
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
|
||||
struct event_cpp11_t
|
||||
{
|
||||
|
||||
@@ -27,8 +27,10 @@
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/mouse.h>
|
||||
#include <86box/config.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/plat_dynld.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/unix_sdl.h>
|
||||
@@ -293,24 +295,24 @@ plat_fopen64(const char *path, const char *mode)
|
||||
}
|
||||
|
||||
int
|
||||
plat_path_abs(char *path)
|
||||
path_abs(char *path)
|
||||
{
|
||||
return path[0] == '/';
|
||||
}
|
||||
|
||||
void
|
||||
plat_path_normalize(char* path)
|
||||
path_normalize(char* path)
|
||||
{
|
||||
/* No-op. */
|
||||
}
|
||||
|
||||
void
|
||||
plat_path_slash(char *path)
|
||||
path_slash(char *path)
|
||||
{
|
||||
if ((path[strlen(path)-1] != '/')) {
|
||||
strcat(path, "/");
|
||||
}
|
||||
plat_path_normalize(path);
|
||||
path_normalize(path);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -337,7 +339,7 @@ plat_get_basename(const char *path)
|
||||
return((char *)path);
|
||||
}
|
||||
char *
|
||||
plat_get_filename(char *s)
|
||||
path_get_filename(char *s)
|
||||
{
|
||||
int c = strlen(s) - 1;
|
||||
|
||||
@@ -352,7 +354,7 @@ plat_get_filename(char *s)
|
||||
|
||||
|
||||
char *
|
||||
plat_get_extension(char *s)
|
||||
path_get_extension(char *s)
|
||||
{
|
||||
int c = strlen(s) - 1;
|
||||
|
||||
@@ -370,10 +372,10 @@ plat_get_extension(char *s)
|
||||
|
||||
|
||||
void
|
||||
plat_append_filename(char *dest, const char *s1, const char *s2)
|
||||
path_append_filename(char *dest, const char *s1, const char *s2)
|
||||
{
|
||||
strcpy(dest, s1);
|
||||
plat_path_slash(dest);
|
||||
path_slash(dest);
|
||||
strcat(dest, s2);
|
||||
}
|
||||
|
||||
@@ -485,7 +487,7 @@ ui_sb_update_text()
|
||||
}
|
||||
|
||||
void
|
||||
plat_get_dirname(char *dest, const char *path)
|
||||
path_get_dirname(char *dest, const char *path)
|
||||
{
|
||||
int c = (int)strlen(path);
|
||||
char *ptr;
|
||||
@@ -758,7 +760,7 @@ plat_init_rom_paths()
|
||||
if (getenv("XDG_DATA_HOME")) {
|
||||
char xdg_rom_path[1024] = { 0 };
|
||||
strncpy(xdg_rom_path, getenv("XDG_DATA_HOME"), 1024);
|
||||
plat_path_slash(xdg_rom_path);
|
||||
path_slash(xdg_rom_path);
|
||||
strncat(xdg_rom_path, "86Box/", 1024);
|
||||
|
||||
if (!plat_dir_check(xdg_rom_path))
|
||||
@@ -791,7 +793,7 @@ plat_init_rom_paths()
|
||||
while ((cur_xdg_rom_path = local_strsep(&xdg_rom_paths, ";")) != NULL) {
|
||||
char real_xdg_rom_path[1024] = { '\0' };
|
||||
strcat(real_xdg_rom_path, cur_xdg_rom_path);
|
||||
plat_path_slash(real_xdg_rom_path);
|
||||
path_slash(real_xdg_rom_path);
|
||||
strcat(real_xdg_rom_path, "86Box/roms/");
|
||||
rom_add_path(real_xdg_rom_path);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <inttypes.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
|
||||
|
||||
typedef struct event_pthread_t
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <86box/pci.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/i2c.h>
|
||||
#include <86box/vid_ddc.h>
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/pit.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_pgc.h>
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/dma.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/i2c.h>
|
||||
#include <86box/vid_ddc.h>
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/pit.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_cga.h>
|
||||
#include <86box/vid_pgc.h>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <86box/pci.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/i2c.h>
|
||||
#include <86box/vid_ddc.h>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <86box/rom.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/i2c.h>
|
||||
#include <86box/vid_ddc.h>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
#include <86box/vid_voodoo_common.h>
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/i2c.h>
|
||||
#include <86box/vid_ddc.h>
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
#include <86box/vid_voodoo_common.h>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
#include <86box/vid_voodoo_common.h>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
#include <86box/vid_voodoo_common.h>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
#include <86box/vid_voodoo_common.h>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
#include <86box/vid_voodoo_common.h>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
#include <86box/vid_voodoo_common.h>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
#include <86box/vid_voodoo_common.h>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
#include <86box/vid_voodoo_common.h>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
#include <86box/vid_voodoo_common.h>
|
||||
|
||||
@@ -66,7 +66,9 @@
|
||||
#include <86box/rom.h>
|
||||
#include <86box/config.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_svga.h>
|
||||
|
||||
@@ -404,12 +406,12 @@ video_screenshot(uint32_t *buf, int start_x, int start_y, int row_len)
|
||||
memset(fn, 0, sizeof(fn));
|
||||
memset(path, 0, sizeof(path));
|
||||
|
||||
plat_append_filename(path, usr_path, SCREENSHOT_PATH);
|
||||
path_append_filename(path, usr_path, SCREENSHOT_PATH);
|
||||
|
||||
if (! plat_dir_check(path))
|
||||
plat_dir_create(path);
|
||||
|
||||
plat_path_slash(path);
|
||||
path_slash(path);
|
||||
|
||||
plat_tempfile(fn, NULL, ".png");
|
||||
strcat(path, fn);
|
||||
|
||||
@@ -64,6 +64,9 @@ ifeq ($(DEV_BUILD), y)
|
||||
ifndef MGA
|
||||
MGA := y
|
||||
endif
|
||||
ifndef OLIVETTI
|
||||
OLIVETTI := y
|
||||
endif
|
||||
ifndef OPEN_AT
|
||||
OPEN_AT := y
|
||||
endif
|
||||
@@ -73,18 +76,15 @@ ifeq ($(DEV_BUILD), y)
|
||||
ifndef SIO_DETECT
|
||||
SIO_DETECT := y
|
||||
endif
|
||||
ifndef VGAWONDER
|
||||
VGAWONDER := y
|
||||
endif
|
||||
ifndef TANDY_ISA
|
||||
TANDY_ISA := y
|
||||
endif
|
||||
ifndef VGAWONDER
|
||||
VGAWONDER := y
|
||||
endif
|
||||
ifndef XL24
|
||||
XL24 := y
|
||||
endif
|
||||
ifndef OLIVETTI
|
||||
OLIVETTI := y
|
||||
endif
|
||||
ifndef NEW_KBC
|
||||
NEW_KBC := n
|
||||
endif
|
||||
@@ -125,6 +125,9 @@ else
|
||||
ifndef MGA
|
||||
MGA := n
|
||||
endif
|
||||
ifndef OLIVETTI
|
||||
OLIVETTI := n
|
||||
endif
|
||||
ifndef OPEN_AT
|
||||
OPEN_AT := n
|
||||
endif
|
||||
@@ -134,18 +137,15 @@ else
|
||||
ifndef SIO_DETECT
|
||||
SIO_DETECT := n
|
||||
endif
|
||||
ifndef VGAWONDER
|
||||
VGAWONDER := n
|
||||
endif
|
||||
ifndef TANDY_ISA
|
||||
TANDY_ISA := n
|
||||
endif
|
||||
ifndef VGAWONDER
|
||||
VGAWONDER := n
|
||||
endif
|
||||
ifndef XL24
|
||||
XL24 := n
|
||||
endif
|
||||
ifndef OLIVETTI
|
||||
OLIVETTI := n
|
||||
endif
|
||||
ifndef NEW_KBC
|
||||
NEW_KBC := n
|
||||
endif
|
||||
|
||||
@@ -47,8 +47,10 @@
|
||||
#include <86box/video.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/path.h>
|
||||
#define GLOBAL
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/ui.h>
|
||||
#ifdef USE_VNC
|
||||
# include <86box/vnc.h>
|
||||
@@ -736,14 +738,14 @@ plat_remove(char *path)
|
||||
}
|
||||
|
||||
void
|
||||
plat_path_normalize(char* path)
|
||||
path_normalize(char* path)
|
||||
{
|
||||
/* No-op */
|
||||
}
|
||||
|
||||
/* Make sure a path ends with a trailing (back)slash. */
|
||||
void
|
||||
plat_path_slash(char *path)
|
||||
path_slash(char *path)
|
||||
{
|
||||
if ((path[strlen(path)-1] != '\\') &&
|
||||
(path[strlen(path)-1] != '/')) {
|
||||
@@ -754,7 +756,7 @@ plat_path_slash(char *path)
|
||||
|
||||
/* Check if the given path is absolute or not. */
|
||||
int
|
||||
plat_path_abs(char *path)
|
||||
path_abs(char *path)
|
||||
{
|
||||
if ((path[1] == ':') || (path[0] == '\\') || (path[0] == '/'))
|
||||
return(1);
|
||||
@@ -781,7 +783,7 @@ plat_get_basename(const char *path)
|
||||
|
||||
/* Return the 'directory' element of a pathname. */
|
||||
void
|
||||
plat_get_dirname(char *dest, const char *path)
|
||||
path_get_dirname(char *dest, const char *path)
|
||||
{
|
||||
int c = (int)strlen(path);
|
||||
char *ptr;
|
||||
@@ -804,7 +806,7 @@ plat_get_dirname(char *dest, const char *path)
|
||||
|
||||
|
||||
char *
|
||||
plat_get_filename(char *s)
|
||||
path_get_filename(char *s)
|
||||
{
|
||||
int c = strlen(s) - 1;
|
||||
|
||||
@@ -819,7 +821,7 @@ plat_get_filename(char *s)
|
||||
|
||||
|
||||
char *
|
||||
plat_get_extension(char *s)
|
||||
path_get_extension(char *s)
|
||||
{
|
||||
int c = strlen(s) - 1;
|
||||
|
||||
@@ -837,10 +839,10 @@ plat_get_extension(char *s)
|
||||
|
||||
|
||||
void
|
||||
plat_append_filename(char *dest, const char *s1, const char *s2)
|
||||
path_append_filename(char *dest, const char *s1, const char *s2)
|
||||
{
|
||||
strcpy(dest, s1);
|
||||
plat_path_slash(dest);
|
||||
path_slash(dest);
|
||||
strcat(dest, s2);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <wchar.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/config.h>
|
||||
#include <86box/path.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/ui.h>
|
||||
#include <86box/win.h>
|
||||
@@ -116,10 +117,10 @@ void win_get_icons_path(char* path_root)
|
||||
if (rom_path[0])
|
||||
strcpy(roms_root, rom_path);
|
||||
else
|
||||
plat_append_filename(roms_root, exe_path, "roms");
|
||||
path_append_filename(roms_root, exe_path, "roms");
|
||||
|
||||
plat_append_filename(path_root, roms_root, "icons");
|
||||
plat_path_slash(path_root);
|
||||
path_append_filename(path_root, roms_root, "icons");
|
||||
path_slash(path_root);
|
||||
}
|
||||
|
||||
void win_load_icon_set()
|
||||
@@ -137,13 +138,13 @@ void win_load_icon_set()
|
||||
|
||||
win_get_icons_path(path_root);
|
||||
strcat(path_root, icon_set);
|
||||
plat_path_slash(path_root);
|
||||
path_slash(path_root);
|
||||
|
||||
int i, count = sizeof(icon_files) / sizeof(_ICON_DATA),
|
||||
x = win_get_system_metrics(SM_CXSMICON, dpi), y = win_get_system_metrics(SM_CYSMICON, dpi);
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
plat_append_filename(temp, path_root, icon_files[i].filename);
|
||||
path_append_filename(temp, path_root, icon_files[i].filename);
|
||||
mbstoc16s(wtemp, temp, strlen(temp) + 1);
|
||||
|
||||
HICON ictemp;
|
||||
|
||||
@@ -54,6 +54,7 @@ typedef LONG atomic_flag;
|
||||
|
||||
#include <86box/86box.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/win.h>
|
||||
#include <86box/language.h>
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include <wchar.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/thread.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
||||
Reference in New Issue
Block a user