Merge branch '86Box:master' into ad1816

This commit is contained in:
win2kgamer
2025-12-22 19:03:33 -06:00
committed by GitHub
84 changed files with 3892 additions and 548 deletions

View File

@@ -36,7 +36,7 @@ if(MUNT_EXTERNAL)
endif()
project(86Box
VERSION 5.3
VERSION 5.4
DESCRIPTION "Emulator of x86-based systems"
HOMEPAGE_URL "https://86box.net"
LANGUAGES C CXX)

4
debian/changelog vendored
View File

@@ -1,5 +1,5 @@
86box (5.3) UNRELEASED; urgency=medium
86box (5.4) UNRELEASED; urgency=medium
* Bump release.
-- Jasmine Iwanek <jriwanek@gmail.com> Tue, 02 Dec 2025 15:24:58 +0100
-- Jasmine Iwanek <jriwanek@gmail.com> Tue, 23 Dec 2025 00:27:45 +0100

View File

@@ -2138,17 +2138,6 @@ set_screen_size_natural(void)
set_screen_size(monitors[i].mon_unscaled_size_x, monitors[i].mon_unscaled_size_y);
}
int
get_actual_size_x(void)
{
return (unscaled_size_x);
}
int
get_actual_size_y(void)
{
return (efscrnsz_y);
}
void
do_pause(int p)

View File

@@ -192,11 +192,7 @@ codegen_allocator_clean_blocks(UNUSED(struct mem_block_t *block))
{
#if defined __ARM_EABI__ || defined __aarch64__ || defined _M_ARM64
while (1) {
# ifndef _MSC_VER
__clear_cache(&mem_block_alloc[block->offset], &mem_block_alloc[block->offset + MEM_BLOCK_SIZE]);
# else
FlushInstructionCache(GetCurrentProcess(), &mem_block_alloc[block->offset], MEM_BLOCK_SIZE);
# endif
if (block->next)
block = &mem_blocks[block->next - 1];
else

View File

@@ -446,16 +446,14 @@ typedef struct {
# define CPU_STATUS_MASK 0xffff0000
#endif
#ifdef _MSC_VER
# define COMPILE_TIME_ASSERT(expr) /*nada*/
#ifdef EXTREME_DEBUG
# define COMPILE_TIME_ASSERT(expr) typedef char COMP_TIME_ASSERT[(expr) ? 1 : 0];
#else
# ifdef EXTREME_DEBUG
# define COMPILE_TIME_ASSERT(expr) typedef char COMP_TIME_ASSERT[(expr) ? 1 : 0];
# else
# define COMPILE_TIME_ASSERT(expr) /*nada*/
# endif
# define COMPILE_TIME_ASSERT(expr) /*nada*/
#endif
COMPILE_TIME_ASSERT(sizeof(cpu_state_t) <= 128)
#define cpu_state_offset(MEMBER) ((uint8_t) ((uintptr_t) &cpu_state.MEMBER - (uintptr_t) &cpu_state - 128))

View File

@@ -33,9 +33,6 @@
#endif
#include "x87_timings.h"
#ifdef _MSC_VER
# include <intrin.h>
#endif
#include "x87_ops_conv.h"
#ifdef ENABLE_FPU_LOG
@@ -390,8 +387,7 @@ x87_compare(double a, double b)
if ((fpu_type < FPU_287XL) && !(cpu_state.npxc & 0x1000) && ((a == INFINITY) || (a == -INFINITY)) && ((b == INFINITY) || (b == -INFINITY)))
eb = ea;
# if !defined(_MSC_VER) || defined(__clang__)
/* Memory barrier, to force GCC to write to the input parameters
/* Memory barrier, to force GCC to write to the input parameters
* before the compare rather than after */
__asm volatile(""
:
@@ -406,17 +402,7 @@ x87_compare(double a, double b)
"fnstsw %0\n"
: "=m"(result)
: "m"(ea), "m"(eb));
# else
_ReadWriteBarrier();
_asm
{
fld eb
fld ea
fclex
fcompp
fnstsw result
}
# endif
return result & (FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3);
#else
@@ -451,7 +437,6 @@ x87_ucompare(double a, double b)
#ifdef X87_INLINE_ASM
uint32_t result;
# if !defined(_MSC_VER) || defined(__clang__)
/* Memory barrier, to force GCC to write to the input parameters
* before the compare rather than after */
__asm volatile(""
@@ -467,17 +452,6 @@ x87_ucompare(double a, double b)
"fnstsw %0\n"
: "=m"(result)
: "m"(a), "m"(b));
# else
_ReadWriteBarrier();
_asm
{
fld b
fld a
fclex
fcompp
fnstsw result
}
# endif
return result & (FPU_SW_C0 | FPU_SW_C2 | FPU_SW_C3);
#else

View File

@@ -33,7 +33,7 @@ typedef struct cart_t {
uint32_t base;
} cart_t;
char cart_fns[2][512];
char cart_fns[2][MAX_IMAGE_PATH_LEN];
char *cart_image_history[2][CART_IMAGE_HISTORY];
static cart_t carts[2];

View File

@@ -43,7 +43,7 @@
pc_cassette_t *cassette;
char cassette_fname[512];
char cassette_fname[MAX_IMAGE_PATH_LEN];
char cassette_mode[512];
char * cassette_image_history[CASSETTE_IMAGE_HISTORY];
unsigned long cassette_pos;

View File

@@ -37,7 +37,6 @@
#include <86box/fdd.h>
#include <86box/fdc.h>
#include <86box/pci.h>
#include <86box/video.h>
#include <86box/keyboard.h>
#define STAT_PARITY 0x80
@@ -2786,18 +2785,14 @@ static void
kbc_at_reset(void *priv)
{
atkbc_t *dev = (atkbc_t *) priv;
uint8_t kbc_ven = dev->flags & KBC_VEN_MASK;
dev->status = STAT_UNLOCKED;
dev->mem[0x20] = 0x01;
dev->mem[0x20] |= CCB_TRANSLATE;
dev->command_phase = 0;
/* Set up the correct Video Type bits. */
if (!is286 || (kbc_ven == KBC_VEN_ACER))
dev->p1 = video_is_mda() ? 0xb0 : 0xf0;
else
dev->p1 = video_is_mda() ? 0xf0 : 0xb0;
/* Video Type is now handled in the machine P1 handler. */
dev->p1 = 0xf0;
kbc_at_log("ATkbc: P1 = %02x\n", dev->p1);
/* Disabled both the keyboard and auxiliary ports. */
@@ -2918,7 +2913,6 @@ kbc_at_init(const device_t *info)
dev->is_asic = !!(info->local & KBC_FLAG_IS_ASIC);
dev->is_type2 = !!(info->local & KBC_FLAG_IS_TYPE2);
video_reset(gfxcard[0]);
kbc_at_reset(dev);
dev->handlers[0].read = kbc_at_port_1_read;

View File

@@ -784,6 +784,9 @@ fdc_sis(fdc_t *fdc)
static void
fdc_soft_reset(fdc_t *fdc)
{
/* Reset boot status to POST on controller soft reset */
fdd_boot_status_reset();
if (fdc->power_down) {
timer_set_delay_u64(&fdc->timer, 1000 * TIMER_USEC);
fdc->interrupt = -5;
@@ -2403,6 +2406,9 @@ fdc_reset(void *priv)
fdc_t *fdc = (fdc_t *) priv;
/* Reset boot status to POST on controller reset */
fdd_boot_status_reset();
default_rwc = (fdc->flags & FDC_FLAG_START_RWC_1) ? 1 : 0;
fdc->enable_3f1 = 1;

View File

@@ -101,7 +101,10 @@ typedef struct fdd_pending_op_t {
static fdd_pending_op_t fdd_pending[FDD_NUM];
char floppyfns[FDD_NUM][512];
/* BIOS boot status tracking */
static bios_boot_status_t bios_boot_status = BIOS_BOOT_POST;
char floppyfns[FDD_NUM][MAX_IMAGE_PATH_LEN];
char *fdd_image_history[FDD_NUM][FLOPPY_IMAGE_HISTORY];
pc_timer_t fdd_poll_time[FDD_NUM];
@@ -212,9 +215,9 @@ int fdd_do_log = ENABLE_FDD_LOG;
static void
fdd_log(const char *fmt, ...)
{
va_list ap, ap_copy;
va_list ap;
char timebuf[32];
char fullbuf[1056]; // 32 + 1024 bytes for timestamp + message
char fullbuf[1056]; /* 32 + 1024 bytes for timestamp + message */
if (fdd_do_log) {
uint32_t ticks = plat_get_ticks();
@@ -224,27 +227,58 @@ fdd_log(const char *fmt, ...)
snprintf(timebuf, sizeof(timebuf), "[%07u.%03u] ", seconds, milliseconds);
va_start(ap, fmt);
va_copy(ap_copy, ap);
strcpy(fullbuf, timebuf);
vsnprintf(fullbuf + strlen(timebuf), sizeof(fullbuf) - strlen(timebuf), fmt, ap_copy);
va_end(ap_copy);
vsnprintf(fullbuf + strlen(timebuf), sizeof(fullbuf) - strlen(timebuf), fmt, ap);
va_end(ap);
va_start(ap, fmt);
va_end(ap);
char *msg = fullbuf;
va_start(ap, fmt);
pclog_ex("%s", (va_list) &msg);
va_end(ap);
pclog("%s", fullbuf);
}
}
#else
# define fdd_log(fmt, ...)
#endif
/*
* BIOS boot status functions
*
* These functions track whether the system is in BIOS POST (Power-On Self Test)
* or has transitioned to normal operation. The POST state is set on:
* - System hard reset (fdd_reset)
* - FDC soft reset (fdd_boot_status_reset)
*
* POST is considered complete when the first floppy read operation occurs,
* indicating that BIOS has finished POST and is attempting to boot.
*/
bios_boot_status_t
fdd_get_boot_status(void)
{
return bios_boot_status;
}
void
fdd_set_boot_status(bios_boot_status_t status)
{
if (bios_boot_status != status) {
fdd_log("BIOS boot status changed: %s -> %s\n",
bios_boot_status == BIOS_BOOT_POST ? "POST" : "NORMAL",
status == BIOS_BOOT_POST ? "POST" : "NORMAL");
bios_boot_status = status;
}
}
void
fdd_boot_status_reset(void)
{
fdd_log("BIOS boot status reset to POST\n");
bios_boot_status = BIOS_BOOT_POST;
}
int
fdd_is_post_complete(void)
{
return (bios_boot_status == BIOS_BOOT_NORMAL);
}
void
fdd_set_audio_profile(int drive, int profile)
{
@@ -690,6 +724,7 @@ fdd_close(int drive)
drives[drive].format = NULL;
drives[drive].byteperiod = NULL;
drives[drive].stop = NULL;
fdd_seek_in_progress[drive] = 0;
d86f_destroy(drive);
ui_sb_update_icon_state(SB_FLOPPY | drive, 1);
}
@@ -778,9 +813,15 @@ fdd_get_bitcell_period(int rate)
void
fdd_reset(void)
{
/* Reset boot status to POST on system reset */
fdd_boot_status_reset();
for (uint8_t i = 0; i < FDD_NUM; i++) {
drives[i].id = i;
timer_add(&(fdd_poll_time[i]), fdd_poll, &drives[i], 0);
/* Clear any pending seek state */
fdd_seek_in_progress[i] = 0;
}
}
@@ -789,6 +830,11 @@ fdd_readsector(int drive, int sector, int track, int side, int density, int sect
{
fdd_log("fdd_readsector(%d, %d, %d, %d, %d, %d)\n", drive, sector, track, side, density, sector_size);
/* First floppy read operation marks POST as complete */
if (bios_boot_status == BIOS_BOOT_POST) {
fdd_set_boot_status(BIOS_BOOT_NORMAL);
}
if (fdd_seek_in_progress[drive]) {
fdd_log("Seek in progress on drive %d, deferring READ (trk=%d->%d, side=%d, sec=%d)\n",
drive, fdd[drive].track, track, side, sector);

View File

@@ -38,39 +38,6 @@
static fdd_audio_profile_config_t audio_profiles[FDD_AUDIO_PROFILE_MAX];
static int audio_profile_count = 0;
/* Audio sample structure */
typedef struct {
char filename[512];
int16_t *buffer;
int samples;
float volume;
} audio_sample_t;
typedef struct {
int position;
int active;
} single_step_state_t;
/* Multi-track seek audio state */
typedef struct {
int position;
int active;
int duration_samples;
int from_track;
int to_track;
int track_diff;
} multi_seek_state_t;
/* Drive type specific audio samples */
typedef struct {
audio_sample_t spindlemotor_start;
audio_sample_t spindlemotor_loop;
audio_sample_t spindlemotor_stop;
/* Individual seek samples for each track count (indexed 0-78 for 1-79 tracks) */
audio_sample_t seek_up[MAX_SEEK_SAMPLES];
audio_sample_t seek_down[MAX_SEEK_SAMPLES];
} drive_audio_samples_t;
/* Dynamic sample storage for each profile */
static drive_audio_samples_t profile_samples[FDD_AUDIO_PROFILE_MAX];
@@ -86,28 +53,115 @@ static multi_seek_state_t seek_state[FDD_NUM][MAX_CONCURRENT_SEEKS] = {};
extern uint64_t motoron[FDD_NUM];
extern char exe_path[2048];
extern int fdd_get_audio_profile(int drive);
/* Forward declaration */
static int16_t *load_wav(const char *filename, int *sample_count);
# ifdef ENABLE_FDD_LOG
int fdc_do_log = ENABLE_FDD_LOG;
extern uint8_t *rom;
extern uint32_t biosmask;
extern uint32_t biosaddr;
typedef enum {
BIOS_VENDOR_UNKNOWN = 0,
BIOS_VENDOR_AMI,
BIOS_VENDOR_AWARD,
BIOS_VENDOR_PHOENIX,
BIOS_VENDOR_IBM,
BIOS_VENDOR_COMPAQ,
BIOS_VENDOR_OTHER
} bios_vendor_t;
#ifdef ENABLE_FDD_LOG
int fdd_audio_do_log = ENABLE_FDD_LOG;
static void
fdd_log(const char *fmt, ...)
{
va_list ap;
if (fdc_do_log) {
if (fdd_audio_do_log) {
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
}
# else
#else
# define fdd_log(fmt, ...)
# endif
#endif
/* Detect BIOS vendor by scanning ROM for signature strings */
static bios_vendor_t
fdd_audio_detect_bios_vendor(void)
{
if (!rom || biosmask == 0)
return BIOS_VENDOR_UNKNOWN;
/* Search for BIOS vendor strings in ROM */
for (uint32_t i = 0; i < (biosmask + 1); i++) {
/* AMI BIOS signatures */
if ((i + 7) < (biosmask + 1)) {
if (memcmp(&rom[i], "AMIBIOS", 7) == 0) {
fdd_log("FDD Audio: Detected AMI BIOS\n");
return BIOS_VENDOR_AMI;
}
if (memcmp(&rom[i], "American Megatrends", 19) == 0) {
fdd_log("FDD Audio: Detected AMI BIOS (American Megatrends)\n");
return BIOS_VENDOR_AMI;
}
}
/* Award BIOS signatures */
if ((i + 5) < (biosmask + 1)) {
if (memcmp(&rom[i], "Award", 5) == 0) {
fdd_log("FDD Audio: Detected Award BIOS\n");
return BIOS_VENDOR_AWARD;
}
}
/* Phoenix BIOS signatures */
if ((i + 7) < (biosmask + 1)) {
if (memcmp(&rom[i], "Phoenix", 7) == 0) {
fdd_log("FDD Audio: Detected Phoenix BIOS\n");
return BIOS_VENDOR_PHOENIX;
}
}
/* IBM BIOS signatures */
if ((i + 3) < (biosmask + 1)) {
if (memcmp(&rom[i], "IBM", 3) == 0 && (i + 10) < (biosmask + 1)) {
if (memcmp(&rom[i], "IBM CORP", 8) == 0) {
fdd_log("FDD Audio: Detected IBM BIOS\n");
return BIOS_VENDOR_IBM;
}
}
}
/* Compaq BIOS signatures */
if ((i + 6) < (biosmask + 1)) {
if (memcmp(&rom[i], "COMPAQ", 6) == 0) {
fdd_log("FDD Audio: Detected Compaq BIOS\n");
return BIOS_VENDOR_COMPAQ;
}
}
}
fdd_log("FDD Audio: BIOS vendor unknown\n");
return BIOS_VENDOR_UNKNOWN;
}
/* Determine if this BIOS uses POST-mode FDC seeks */
static int
fdd_audio_get_bios_vendor(void)
{
static bios_vendor_t detected_vendor = BIOS_VENDOR_UNKNOWN;
static int detection_done = 0;
/* Only detect once */
if (!detection_done) {
detected_vendor = fdd_audio_detect_bios_vendor();
detection_done = 1;
}
return detected_vendor;
}
/* Logging function for audio profile parameters */
static void
@@ -271,13 +325,67 @@ fdd_audio_load_profiles(void)
snprintf(key, sizeof(key), "seek_down_%dtrack_volume", track_count);
profile->seek_down[track_count - 1].volume = ini_section_get_double(section, key, 1.0);
/* POST mode seek down samples */
snprintf(key, sizeof(key), "post_seek_down_%dtrack_file", track_count);
filename = ini_section_get_string(section, key, "");
strncpy(profile->post_seek_down[track_count - 1].filename, filename,
sizeof(profile->post_seek_down[track_count - 1].filename) - 1);
profile->post_seek_down[track_count - 1].filename[sizeof(profile->post_seek_down[track_count - 1].filename) - 1] = '\0';
snprintf(key, sizeof(key), "post_seek_down_%dtrack_volume", track_count);
profile->post_seek_down[track_count - 1].volume = ini_section_get_double(section, key, 1.0);
/* BIOS vendor-specific POST mode seek samples */
static const char *bios_prefixes[] = {
NULL, /* BIOS_VENDOR_UNKNOWN */
"amibios", /* BIOS_VENDOR_AMI */
"award", /* BIOS_VENDOR_AWARD */
"phoenix", /* BIOS_VENDOR_PHOENIX */
"ibm", /* BIOS_VENDOR_IBM */
"compaq", /* BIOS_VENDOR_COMPAQ */
NULL /* BIOS_VENDOR_OTHER */
};
for (int vendor = 1; vendor < BIOS_VENDOR_COUNT; vendor++) {
if (!bios_prefixes[vendor])
continue;
/* BIOS-specific POST mode seek up samples */
snprintf(key, sizeof(key), "%s_post_seek_up_%dtrack_file", bios_prefixes[vendor], track_count);
filename = ini_section_get_string(section, key, "");
strncpy(profile->bios_post_seek_up[vendor][track_count - 1].filename, filename,
sizeof(profile->bios_post_seek_up[vendor][track_count - 1].filename) - 1);
profile->bios_post_seek_up[vendor][track_count - 1].filename[sizeof(profile->bios_post_seek_up[vendor][track_count - 1].filename) - 1] = '\0';
snprintf(key, sizeof(key), "%s_post_seek_up_%dtrack_volume", bios_prefixes[vendor], track_count);
profile->bios_post_seek_up[vendor][track_count - 1].volume = ini_section_get_double(section, key, 1.0);
/* BIOS-specific POST mode seek down samples */
snprintf(key, sizeof(key), "%s_post_seek_down_%dtrack_file", bios_prefixes[vendor], track_count);
filename = ini_section_get_string(section, key, "");
strncpy(profile->bios_post_seek_down[vendor][track_count - 1].filename, filename,
sizeof(profile->bios_post_seek_down[vendor][track_count - 1].filename) - 1);
profile->bios_post_seek_down[vendor][track_count - 1].filename[sizeof(profile->bios_post_seek_down[vendor][track_count - 1].filename) - 1] = '\0';
snprintf(key, sizeof(key), "%s_post_seek_down_%dtrack_volume", bios_prefixes[vendor], track_count);
profile->bios_post_seek_down[vendor][track_count - 1].volume = ini_section_get_double(section, key, 1.0);
/* BIOS-specific POST mode seek time in milliseconds */
snprintf(key, sizeof(key), "%s_post_seek_%dtrack_time_ms", bios_prefixes[vendor], track_count);
profile->bios_post_seek_time_ms[vendor][track_count - 1] = ini_section_get_double(section, key, 0.0);
}
/* Seek time in milliseconds - used for FDC timing, not sample playback */
snprintf(key, sizeof(key), "seek_%dtrack_time_ms", track_count);
profile->seek_time_ms[track_count - 1] = ini_section_get_double(section, key, 6.0 * track_count);
/* POST mode seek time in milliseconds */
snprintf(key, sizeof(key), "post_seek_%dtrack_time_ms", track_count);
profile->post_seek_time_ms[track_count - 1] = ini_section_get_double(section, key, 0.0);
}
/* Load timing configurations */
profile->total_tracks = ini_section_get_int(section, "total_tracks", 80);
profile->total_tracks = ini_section_get_int(section, "total_tracks", 0);
audio_profile_count++;
}
@@ -362,7 +470,7 @@ load_profile_samples(int profile_id)
&samples->seek_up[idx].samples);
if (samples->seek_up[idx].buffer) {
fdd_log(" Loaded seek_up[%d]: %s (%d samples, volume %.2f)\n",
track_count, config->seek_up[idx].filename,
idx, config->seek_up[idx].filename,
samples->seek_up[idx].samples, config->seek_up[idx].volume);
}
}
@@ -375,10 +483,76 @@ load_profile_samples(int profile_id)
&samples->seek_down[idx].samples);
if (samples->seek_down[idx].buffer) {
fdd_log(" Loaded seek_down[%d]: %s (%d samples, volume %.2f)\n",
track_count, config->seek_down[idx].filename,
idx, config->seek_down[idx].filename,
samples->seek_down[idx].samples, config->seek_down[idx].volume);
}
}
/* Load POST mode seek samples if configured */
if (config->post_seek_up[idx].filename[0]) {
if (samples->post_seek_up[idx].buffer == NULL) {
strcpy(samples->post_seek_up[idx].filename, config->post_seek_up[idx].filename);
samples->post_seek_up[idx].volume = config->post_seek_up[idx].volume;
samples->post_seek_up[idx].buffer = load_wav(config->post_seek_up[idx].filename,
&samples->post_seek_up[idx].samples);
if (samples->post_seek_up[idx].buffer) {
fdd_log(" Loaded POST seek_up[%d] (%d-track): %s (%d samples, volume %.2f)\n",
idx, track_count, config->post_seek_up[idx].filename,
samples->post_seek_up[idx].samples, config->post_seek_up[idx].volume);
}
}
}
if (config->post_seek_down[idx].filename[0]) {
if (samples->post_seek_down[idx].buffer == NULL) {
strcpy(samples->post_seek_down[idx].filename, config->post_seek_down[idx].filename);
samples->post_seek_down[idx].volume = config->post_seek_down[idx].volume;
samples->post_seek_down[idx].buffer = load_wav(config->post_seek_down[idx].filename,
&samples->post_seek_down[idx].samples);
if (samples->post_seek_down[idx].buffer) {
fdd_log(" Loaded POST seek_down[%d] (%d-track): %s (%d samples, volume %.2f)\n",
idx, track_count, config->post_seek_down[idx].filename,
samples->post_seek_down[idx].samples, config->post_seek_down[idx].volume);
}
}
}
#ifdef ENABLE_FDD_LOG
/* Load BIOS vendor-specific POST mode seek samples if configured */
static const char *bios_names[] = {
"UNKNOWN", "AMI", "AWARD", "PHOENIX", "IBM", "COMPAQ", "OTHER"
};
#endif
for (int vendor = 1; vendor < BIOS_VENDOR_COUNT; vendor++) {
if (config->bios_post_seek_up[vendor][idx].filename[0]) {
if (samples->bios_post_seek_up[vendor][idx].buffer == NULL) {
strcpy(samples->bios_post_seek_up[vendor][idx].filename, config->bios_post_seek_up[vendor][idx].filename);
samples->bios_post_seek_up[vendor][idx].volume = config->bios_post_seek_up[vendor][idx].volume;
samples->bios_post_seek_up[vendor][idx].buffer = load_wav(config->bios_post_seek_up[vendor][idx].filename,
&samples->bios_post_seek_up[vendor][idx].samples);
if (samples->bios_post_seek_up[vendor][idx].buffer) {
fdd_log(" Loaded %s POST seek_up[%d] (%d-track): %s (%d samples, volume %.2f)\n",
bios_names[vendor], idx, track_count, config->bios_post_seek_up[vendor][idx].filename,
samples->bios_post_seek_up[vendor][idx].samples, config->bios_post_seek_up[vendor][idx].volume);
}
}
}
if (config->bios_post_seek_down[vendor][idx].filename[0]) {
if (samples->bios_post_seek_down[vendor][idx].buffer == NULL) {
strcpy(samples->bios_post_seek_down[vendor][idx].filename, config->bios_post_seek_down[vendor][idx].filename);
samples->bios_post_seek_down[vendor][idx].volume = config->bios_post_seek_down[vendor][idx].volume;
samples->bios_post_seek_down[vendor][idx].buffer = load_wav(config->bios_post_seek_down[vendor][idx].filename,
&samples->bios_post_seek_down[vendor][idx].samples);
if (samples->bios_post_seek_down[vendor][idx].buffer) {
fdd_log(" Loaded %s POST seek_down[%d] (%d-track): %s (%d samples, volume %.2f)\n",
bios_names[vendor], idx, track_count, config->bios_post_seek_down[vendor][idx].filename,
samples->bios_post_seek_down[vendor][idx].samples, config->bios_post_seek_down[vendor][idx].volume);
}
}
}
}
}
}
@@ -461,6 +635,21 @@ fdd_audio_get_seek_time(int drive, int track_count, int is_seek_down)
/* Return configured seek time in microseconds */
if (track_count > 0 && track_count <= MAX_SEEK_SAMPLES) {
/* In POST mode, check for BIOS-specific timing first */
if (fdd_get_boot_status() == BIOS_BOOT_POST) {
int bios_vendor = fdd_audio_get_bios_vendor();
/* Check BIOS vendor-specific timing first */
if (bios_vendor > 0 && bios_vendor < BIOS_VENDOR_COUNT &&
profile->bios_post_seek_time_ms[bios_vendor][track_count - 1] > 0.0) {
return profile->bios_post_seek_time_ms[bios_vendor][track_count - 1] * 1000.0;
}
/* Fall back to generic POST timing */
if (profile->post_seek_time_ms[track_count - 1] > 0.0) {
return profile->post_seek_time_ms[track_count - 1] * 1000.0;
}
}
return profile->seek_time_ms[track_count - 1] * 1000.0;
}
@@ -489,6 +678,7 @@ fdd_audio_init(void)
seek_state[i][j].from_track = -1;
seek_state[i][j].to_track = -1;
seek_state[i][j].track_diff = 0;
seek_state[i][j].sample_to_play = NULL;
}
}
@@ -546,6 +736,30 @@ fdd_audio_close(void)
samples->seek_down[track_count].buffer = NULL;
samples->seek_down[track_count].samples = 0;
}
if (samples->post_seek_up[track_count].buffer) {
free(samples->post_seek_up[track_count].buffer);
samples->post_seek_up[track_count].buffer = NULL;
samples->post_seek_up[track_count].samples = 0;
}
if (samples->post_seek_down[track_count].buffer) {
free(samples->post_seek_down[track_count].buffer);
samples->post_seek_down[track_count].buffer = NULL;
samples->post_seek_down[track_count].samples = 0;
}
/* Free BIOS vendor-specific POST seek samples */
for (int vendor = 0; vendor < BIOS_VENDOR_COUNT; vendor++) {
if (samples->bios_post_seek_up[vendor][track_count].buffer) {
free(samples->bios_post_seek_up[vendor][track_count].buffer);
samples->bios_post_seek_up[vendor][track_count].buffer = NULL;
samples->bios_post_seek_up[vendor][track_count].samples = 0;
}
if (samples->bios_post_seek_down[vendor][track_count].buffer) {
free(samples->bios_post_seek_down[vendor][track_count].buffer);
samples->bios_post_seek_down[vendor][track_count].buffer = NULL;
samples->bios_post_seek_down[vendor][track_count].samples = 0;
}
}
}
}
@@ -629,16 +843,81 @@ fdd_audio_play_multi_track_seek(int drive, int from_track, int to_track)
track_diff = max_seek_tracks;
}
/* Get the appropriate seek sample */
int idx = track_diff - 1;
audio_sample_t *sample_to_use = is_seek_down ? &samples->seek_down[idx] : &samples->seek_up[idx];
int boot_status = fdd_get_boot_status();
int bios_vendor = fdd_audio_get_bios_vendor();
int idx = track_diff - 1;
int real_track_diff = to_track - from_track;
audio_sample_t *sample_to_use = NULL;
if (boot_status == BIOS_BOOT_POST) {
if (bios_vendor == BIOS_VENDOR_AMI) {
/* AMI BIOS POST mode: use AMI-specific samples if available */
/* AMI BIOS quirk: for single-track seeks down (except 10->9), do not play audio */
if (real_track_diff == -1 && (from_track != 10 || to_track != 9)) {
fdd_log("FDD Audio Drive %d: AMI BIOS quirk: for single-track seeks down (except 10->9), do not play audio\n", drive);
return;
}
/* For 10->9 seek, use the 1-track sample (which should be the 10-0 sound) */
sample_to_use = is_seek_down ? &samples->bios_post_seek_down[bios_vendor][idx] : &samples->bios_post_seek_up[bios_vendor][idx];
if (sample_to_use->buffer && sample_to_use->samples > 0) {
fdd_log("FDD Audio Drive %d: Using AMI BIOS POST mode seek sample (idx=%d, %s)\n",
drive, idx, is_seek_down ? "DOWN" : "UP");
} else {
/* Fall back to generic POST sample */
sample_to_use = is_seek_down ? &samples->post_seek_down[idx] : &samples->post_seek_up[idx];
if (sample_to_use->buffer && sample_to_use->samples > 0) {
fdd_log("FDD Audio Drive %d: AMI BIOS sample not available, using generic POST sample (idx=%d, %s)\n",
drive, idx, is_seek_down ? "DOWN" : "UP");
} else {
/* Fall back to normal sample */
fdd_log("FDD Audio Drive %d: POST sample not available, using normal sample\n", drive);
sample_to_use = is_seek_down ? &samples->seek_down[idx] : &samples->seek_up[idx];
}
}
} else if (bios_vendor > 0 && bios_vendor < BIOS_VENDOR_COUNT) {
/* Other known BIOS vendors: try vendor-specific samples first */
sample_to_use = is_seek_down ? &samples->bios_post_seek_down[bios_vendor][idx] : &samples->bios_post_seek_up[bios_vendor][idx];
if (sample_to_use->buffer && sample_to_use->samples > 0) {
fdd_log("FDD Audio Drive %d: Using BIOS vendor %d POST mode seek sample (idx=%d, %s)\n",
drive, bios_vendor, idx, is_seek_down ? "DOWN" : "UP");
} else {
/* Fall back to generic POST sample */
sample_to_use = is_seek_down ? &samples->post_seek_down[idx] : &samples->post_seek_up[idx];
if (sample_to_use->buffer && sample_to_use->samples > 0) {
fdd_log("FDD Audio Drive %d: BIOS-specific sample not available, using generic POST sample (idx=%d, %s)\n",
drive, idx, is_seek_down ? "DOWN" : "UP");
} else {
/* Fall back to normal sample */
fdd_log("FDD Audio Drive %d: POST sample not available, using normal sample\n", drive);
sample_to_use = is_seek_down ? &samples->seek_down[idx] : &samples->seek_up[idx];
}
}
} else {
/* Unknown BIOS vendor POST mode */
sample_to_use = is_seek_down ? &samples->post_seek_down[idx] : &samples->post_seek_up[idx];
if (!sample_to_use->buffer || sample_to_use->samples == 0) {
fdd_log("FDD Audio Drive %d: POST sample not available, using normal sample\n", drive);
sample_to_use = is_seek_down ? &samples->seek_down[idx] : &samples->seek_up[idx];
} else {
fdd_log("FDD Audio Drive %d: Using POST mode seek sample (idx=%d, %s)\n",
drive, idx, is_seek_down ? "DOWN" : "UP");
}
}
} else {
/* Use normal samples */
sample_to_use = is_seek_down ? &samples->seek_down[idx] : &samples->seek_up[idx];
}
/* Only proceed if we have the appropriate sample */
if (!sample_to_use || !sample_to_use->buffer || sample_to_use->samples == 0)
return;
fdd_log("FDD Audio Drive %d: Multi-track seek %d -> %d (%d tracks, %s)\n",
drive, from_track, to_track, track_diff, is_seek_down ? "DOWN" : "UP");
fdd_log("FDD Audio Drive %d: Multi-track seek %d -> %d (%d tracks, %s, POST=%d)\n",
drive, from_track, to_track, track_diff, is_seek_down ? "DOWN" : "UP", boot_status);
/* Find an available seek slot */
int slot = -1;
@@ -662,6 +941,7 @@ fdd_audio_play_multi_track_seek(int drive, int from_track, int to_track)
seek_state[drive][slot].from_track = from_track;
seek_state[drive][slot].to_track = to_track;
seek_state[drive][slot].track_diff = track_diff;
seek_state[drive][slot].sample_to_play = sample_to_use;
fdd_log("FDD Audio Drive %d: Started seek in slot %d, duration %d samples\n",
drive, slot, sample_to_use->samples);
@@ -867,30 +1147,26 @@ fdd_audio_callback(int16_t *buffer, int length)
if (!seek_state[drive][slot].active)
continue;
int track_diff = seek_state[drive][slot].track_diff;
if (track_diff > 0 && track_diff <= MAX_SEEK_SAMPLES) {
int idx = track_diff - 1;
int is_seek_down = (seek_state[drive][slot].to_track < seek_state[drive][slot].from_track);
audio_sample_t *seek_sample = is_seek_down ? &samples->seek_down[idx] : &samples->seek_up[idx];
audio_sample_t *seek_sample = seek_state[drive][slot].sample_to_play;
if (seek_sample && seek_sample->buffer && seek_state[drive][slot].position < seek_sample->samples) {
/* Mix seek sound with existing audio */
float seek_left = (float) seek_sample->buffer[seek_state[drive][slot].position * 2] / 131072.0f * seek_sample->volume;
float seek_right = (float) seek_sample->buffer[seek_state[drive][slot].position * 2 + 1] / 131072.0f * seek_sample->volume;
if (seek_sample && seek_sample->buffer && seek_state[drive][slot].position < seek_sample->samples) {
/* Mix seek sound with existing audio */
float seek_left = (float) seek_sample->buffer[seek_state[drive][slot].position * 2] / 131072.0f * seek_sample->volume;
float seek_right = (float) seek_sample->buffer[seek_state[drive][slot].position * 2 + 1] / 131072.0f * seek_sample->volume;
left_sample += seek_left;
right_sample += seek_right;
left_sample += seek_left;
right_sample += seek_right;
seek_state[drive][slot].position++;
} else {
/* Seek sound finished */
seek_state[drive][slot].active = 0;
seek_state[drive][slot].position = 0;
seek_state[drive][slot].duration_samples = 0;
seek_state[drive][slot].from_track = -1;
seek_state[drive][slot].to_track = -1;
seek_state[drive][slot].track_diff = 0;
}
seek_state[drive][slot].position++;
} else {
/* Seek sound finished */
seek_state[drive][slot].active = 0;
seek_state[drive][slot].position = 0;
seek_state[drive][slot].duration_samples = 0;
seek_state[drive][slot].from_track = -1;
seek_state[drive][slot].to_track = -1;
seek_state[drive][slot].track_diff = 0;
seek_state[drive][slot].sample_to_play = NULL;
}
}
@@ -983,30 +1259,26 @@ fdd_audio_callback(int16_t *buffer, int length)
if (!seek_state[drive][slot].active)
continue;
int track_diff = seek_state[drive][slot].track_diff;
if (track_diff > 0 && track_diff <= MAX_SEEK_SAMPLES) {
int idx = track_diff - 1;
int is_seek_down = (seek_state[drive][slot].to_track < seek_state[drive][slot].from_track);
audio_sample_t *seek_sample = is_seek_down ? &samples->seek_down[idx] : &samples->seek_up[idx];
audio_sample_t *seek_sample = seek_state[drive][slot].sample_to_play;
if (seek_sample && seek_sample->buffer && seek_state[drive][slot].position < seek_sample->samples) {
/* Mix seek sound with existing audio */
int16_t seek_left = (int16_t) ((float) seek_sample->buffer[seek_state[drive][slot].position * 2] / 4.0f * seek_sample->volume);
int16_t seek_right = (int16_t) ((float) seek_sample->buffer[seek_state[drive][slot].position * 2 + 1] / 4.0f * seek_sample->volume);
if (seek_sample && seek_sample->buffer && seek_state[drive][slot].position < seek_sample->samples) {
/* Mix seek sound with existing audio */
int16_t seek_left = (int16_t) ((float) seek_sample->buffer[seek_state[drive][slot].position * 2] / 4.0f * seek_sample->volume);
int16_t seek_right = (int16_t) ((float) seek_sample->buffer[seek_state[drive][slot].position * 2 + 1] / 4.0f * seek_sample->volume);
left_sample += seek_left;
right_sample += seek_right;
left_sample += seek_left;
right_sample += seek_right;
seek_state[drive][slot].position++;
} else {
/* Seek sound finished */
seek_state[drive][slot].active = 0;
seek_state[drive][slot].position = 0;
seek_state[drive][slot].duration_samples = 0;
seek_state[drive][slot].from_track = -1;
seek_state[drive][slot].to_track = -1;
seek_state[drive][slot].track_diff = 0;
}
seek_state[drive][slot].position++;
} else {
/* Seek sound finished */
seek_state[drive][slot].active = 0;
seek_state[drive][slot].position = 0;
seek_state[drive][slot].duration_samples = 0;
seek_state[drive][slot].from_track = -1;
seek_state[drive][slot].to_track = -1;
seek_state[drive][slot].track_diff = 0;
seek_state[drive][slot].sample_to_play = NULL;
}
}

View File

@@ -18,11 +18,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#ifndef _MSC_VER
#include <unistd.h>
#else
#include <io.h>
#endif
#define HAVE_STDARG_H
#include <86box/86box.h>
#include <86box/timer.h>

View File

@@ -47,7 +47,7 @@
/* Recently used images */
#define MAX_PREV_IMAGES 10
#define MAX_IMAGE_PATH_LEN 2048
#define MAX_IMAGE_PATH_LEN 4096
/* Max UUID Length */
#define MAX_UUID_LEN 64

View File

@@ -21,7 +21,7 @@ extern "C" {
#define CART_IMAGE_HISTORY 10
extern char cart_fns[2][512];
extern char cart_fns[2][MAX_IMAGE_PATH_LEN];
extern char *cart_image_history[2][CART_IMAGE_HISTORY];
extern void cart_load(int drive, char *fn);

View File

@@ -157,7 +157,7 @@ void pc_cas_advance(pc_cassette_t *cas);
extern pc_cassette_t *cassette;
extern char cassette_fname[512];
extern char cassette_fname[MAX_IMAGE_PATH_LEN];
extern char cassette_mode[512];
extern char * cassette_image_history[CASSETTE_IMAGE_HISTORY];
extern unsigned long cassette_pos;

View File

@@ -323,8 +323,8 @@ typedef struct cdrom {
void *priv;
char image_path[1024];
char prev_image_path[1280];
char image_path[MAX_IMAGE_PATH_LEN];
char prev_image_path[MAX_IMAGE_PATH_LEN + 256];
uint32_t sound_on;
uint32_t cdrom_capacity;

View File

@@ -26,6 +26,12 @@
#define SEEK_RECALIBRATE -999
#define DEFAULT_SEEK_TIME_MS 10.0
/* BIOS boot status - used to detect POST vs normal operation */
typedef enum {
BIOS_BOOT_POST = 0, /* System is in POST (Power-On Self Test) */
BIOS_BOOT_NORMAL = 1 /* POST complete, normal operation */
} bios_boot_status_t;
#ifdef __cplusplus
extern "C" {
#endif
@@ -90,7 +96,7 @@ typedef struct DRIVE {
} DRIVE;
extern DRIVE drives[FDD_NUM];
extern char floppyfns[FDD_NUM][512];
extern char floppyfns[FDD_NUM][MAX_IMAGE_PATH_LEN];
extern char *fdd_image_history[FDD_NUM][FLOPPY_IMAGE_HISTORY];
extern pc_timer_t fdd_poll_time[FDD_NUM];
extern int ui_writeprot[FDD_NUM];
@@ -118,6 +124,12 @@ extern int fdd_hole(int drive);
extern void fdd_stop(int drive);
extern void fdd_do_writeback(int drive);
/* BIOS boot status functions */
extern bios_boot_status_t fdd_get_boot_status(void);
extern void fdd_set_boot_status(bios_boot_status_t status);
extern void fdd_boot_status_reset(void);
extern int fdd_is_post_complete(void);
extern int motorspin;
extern uint64_t motoron[FDD_NUM];

View File

@@ -16,6 +16,7 @@
#define EMU_FDD_AUDIO_H
#include <stdint.h>
#include <86box/fdd.h>
#ifdef __cplusplus
extern "C" {
@@ -29,6 +30,9 @@ extern "C" {
/* Maximum number of simultaneous seek sounds per drive */
#define MAX_CONCURRENT_SEEKS 8
/* Number of BIOS vendors (for BIOS-specific samples) */
#define BIOS_VENDOR_COUNT 7
/* Audio sample configuration structure */
typedef struct {
char filename[512];
@@ -45,7 +49,15 @@ typedef struct {
audio_sample_config_t spindlemotor_stop;
audio_sample_config_t seek_up[MAX_SEEK_SAMPLES];
audio_sample_config_t seek_down[MAX_SEEK_SAMPLES];
double seek_time_ms[MAX_SEEK_SAMPLES]; /* Seek time in milliseconds for each track count */
audio_sample_config_t post_seek_up[MAX_SEEK_SAMPLES];
audio_sample_config_t post_seek_down[MAX_SEEK_SAMPLES];
/* BIOS vendor-specific POST seek samples [vendor][track] */
audio_sample_config_t bios_post_seek_up[BIOS_VENDOR_COUNT][MAX_SEEK_SAMPLES];
audio_sample_config_t bios_post_seek_down[BIOS_VENDOR_COUNT][MAX_SEEK_SAMPLES];
double seek_time_ms[MAX_SEEK_SAMPLES];
double post_seek_time_ms[MAX_SEEK_SAMPLES];
/* BIOS vendor-specific POST seek times [vendor][track] */
double bios_post_seek_time_ms[BIOS_VENDOR_COUNT][MAX_SEEK_SAMPLES];
int total_tracks; /* 40 or 80 */
} fdd_audio_profile_config_t;
@@ -76,6 +88,45 @@ typedef struct {
uint32_t data_size;
} wav_header_t;
/* Audio sample structure */
typedef struct {
char filename[512];
int16_t *buffer;
int samples;
float volume;
} audio_sample_t;
typedef struct {
int position;
int active;
} single_step_state_t;
/* Multi-track seek audio state */
typedef struct {
int position;
int active;
int duration_samples;
int from_track;
int to_track;
int track_diff;
audio_sample_t *sample_to_play;
} multi_seek_state_t;
/* Drive type specific audio samples */
typedef struct {
audio_sample_t spindlemotor_start;
audio_sample_t spindlemotor_loop;
audio_sample_t spindlemotor_stop;
/* Individual seek samples for each track count (indexed 0-78 for 1-79 tracks) */
audio_sample_t seek_up[MAX_SEEK_SAMPLES];
audio_sample_t seek_down[MAX_SEEK_SAMPLES];
audio_sample_t post_seek_up[MAX_SEEK_SAMPLES];
audio_sample_t post_seek_down[MAX_SEEK_SAMPLES];
/* BIOS vendor-specific POST seek samples [vendor][track] */
audio_sample_t bios_post_seek_up[BIOS_VENDOR_COUNT][MAX_SEEK_SAMPLES];
audio_sample_t bios_post_seek_down[BIOS_VENDOR_COUNT][MAX_SEEK_SAMPLES];
} drive_audio_samples_t;
/* Fade duration: 75ms at 48kHz = 3600 samples */
#define FADE_DURATION_MS 75
#define FADE_SAMPLES (48000 * FADE_DURATION_MS / 1000)
@@ -89,6 +140,8 @@ extern const char* fdd_audio_get_profile_internal_name(int id);
extern int fdd_audio_get_profile_by_internal_name(const char *internal_name);
extern double fdd_audio_get_seek_time(int drive, int track_count, int is_seek_down);
extern void load_profile_samples(int profile_id);
extern int fdd_get_audio_profile(int drive);
extern bios_boot_status_t fdd_get_boot_status(void);
#else

View File

@@ -161,7 +161,7 @@ typedef struct hard_disk_t {
void *priv;
char fn[1024]; /* Name of current image file */
char fn[MAX_IMAGE_PATH_LEN]; /* Name of current image file */
/* Differential VHD parent file */
char vhd_parent[1280];

View File

@@ -113,8 +113,8 @@ typedef struct mo_drive_t {
FILE *fp;
void *priv;
char image_path[1024];
char prev_image_path[1024];
char image_path[MAX_IMAGE_PATH_LEN];
char prev_image_path[MAX_IMAGE_PATH_LEN + 256];
char *image_history[MO_IMAGE_HISTORY];

View File

@@ -69,19 +69,10 @@ extern int strnicmp(const char *s1, const char *s2, size_t n);
# define fseeko64 fseeko
# define ftello64 ftello
# define off64_t off_t
#elif defined(_MSC_VER)
// # define fopen64 fopen
# define fseeko64 _fseeki64
# define ftello64 _ftelli64
# define off64_t off_t
#endif
#ifdef _MSC_VER
# define UNUSED(arg) arg
#else
/* A hack (GCC-specific?) to allow us to ignore unused parameters. */
# define UNUSED(arg) __attribute__((unused)) arg
#endif
/* Return the size (in wchar's) of a wchar_t array. */
#define sizeof_w(x) (sizeof((x)) / sizeof(wchar_t))
@@ -90,28 +81,23 @@ extern int strnicmp(const char *s1, const char *s2, size_t n);
# include <atomic>
# define atomic_flag_t std::atomic_flag
# define atomic_bool_t std::atomic_bool
extern "C" {
#else
# include <stdatomic.h>
# define atomic_flag_t atomic_flag
# define atomic_bool_t atomic_bool
#endif
#if defined(_MSC_VER)
# define ssize_t intptr_t
#endif
#ifdef _MSC_VER
# define fallthrough do {} while (0) /* fallthrough */
#if __has_attribute(fallthrough)
# define fallthrough __attribute__((fallthrough))
#else
# if __has_attribute(fallthrough)
# define fallthrough __attribute__((fallthrough))
# else
# if __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__))
# endif
# define fallthrough do {} while (0) /* fallthrough */
# if __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__))
# endif
# define fallthrough do {} while (0) /* fallthrough */
#endif
#endif
/* Global variables residing in the platform module. */

View File

@@ -16,18 +16,16 @@
#define EMU_PLAT_FALLTHROUGH_H
#ifndef EMU_PLAT_H
#ifdef _MSC_VER
# define fallthrough do {} while (0) /* fallthrough */
#if __has_attribute(fallthrough)
# define fallthrough __attribute__((fallthrough))
#else
# if __has_attribute(fallthrough)
# define fallthrough __attribute__((fallthrough))
# else
# if __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__))
# endif
# define fallthrough do {} while (0) /* fallthrough */
# if __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__))
# endif
# define fallthrough do {} while (0) /* fallthrough */
#endif
#endif
#endif /*EMU_PLAT_FALLTHROUGH_H*/

View File

@@ -19,12 +19,9 @@
#define EMU_PLAT_UNUSED_H
#ifndef EMU_PLAT_H
#ifdef _MSC_VER
# define UNUSED(arg) arg
#else
/* A hack (GCC-specific?) to allow us to ignore unused parameters. */
# define UNUSED(arg) __attribute__((unused)) arg
#endif
#endif
#endif
#endif /*EMU_PLAT_UNUSED_H*/

View File

@@ -91,8 +91,8 @@ typedef struct rdisk_drive_t {
FILE *fp;
void *priv;
char image_path[1024];
char prev_image_path[1024];
char image_path[MAX_IMAGE_PATH_LEN];
char prev_image_path[MAX_IMAGE_PATH_LEN + 256];
char *image_history[RDISK_IMAGE_HISTORY];

View File

@@ -18,6 +18,7 @@
// Defines
#define MDA_CRTC_NUM_REGISTERS 32
#define MDA_VRAM 0x1000
// Enums & structures

View File

@@ -8,11 +8,7 @@
#ifndef VIDEO_VOODOO_CODEGEN_X86_64_H
#define VIDEO_VOODOO_CODEGEN_X86_64_H
#ifdef _MSC_VER
# include <intrin.h>
#else
# include <xmmintrin.h>
#endif
#include <xmmintrin.h>
#define BLOCK_NUM 8
#define BLOCK_MASK (BLOCK_NUM - 1)
@@ -653,14 +649,15 @@ codegen_texture_fetch(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *pa
static inline void
voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params, voodoo_state_t *state, int depthop)
{
int block_pos = 0;
int z_skip_pos = 0;
int a_skip_pos = 0;
int amask_skip_pos = 0;
int chroma_skip_pos = 0;
int depth_jump_pos = 0;
int depth_jump_pos2 = 0;
int loop_jump_pos = 0;
int block_pos = 0;
int z_skip_pos = 0;
int a_skip_pos = 0;
int amask_skip_pos = 0;
int stipple_skip_pos = 0;
int chroma_skip_pos = 0;
int depth_jump_pos = 0;
int depth_jump_pos2 = 0;
int loop_jump_pos = 0;
#if 0
xmm_01_w = (__m128i)0x0001000100010001ull;
xmm_ff_w = (__m128i)0x00ff00ff00ff00ffull;
@@ -766,6 +763,69 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
addquad((uint64_t) (uintptr_t) &i_00_ff_w);
loop_jump_pos = block_pos;
if (params->fbzMode & FBZ_STIPPLE) {
/* Stipple enabled. */
if (params->fbzMode & FBZ_STIPPLE_PATT) {
/* x64's BT instruction is too slow. So use TEST instead. */
addbyte(0x4c); /* MOV RBX, R14(real_y)*/
addbyte(0x89);
addbyte(0xf3);
addbyte(0x83); /* AND EBX, 3 */
addbyte(0xe3);
addbyte(0x03);
addbyte(0xc1); /* SHL EBX, 3 */
addbyte(0xe3);
addbyte(0x03);
addbyte(0x8b); /*MOV EAX, state->x[EDI]*/
addbyte(0x87);
addlong(offsetof(voodoo_state_t, x));
addbyte(0xf7); /* NOT EAX */
addbyte(0xd0);
addbyte(0x83); /* AND EAX, 7 */
addbyte(0xe0);
addbyte(0x07);
addbyte(0x09); /* OR EAX, EBX */
addbyte(0xc3);
addbyte(0x88); /* MOV CL, AL */
addbyte(0xc1);
addbyte(0xb8); /* MOV EAX, 1*/
addlong(1);
addbyte(0xd3); /* SHL EAX, CL */
addbyte(0xe0);
addbyte(0x85); /* TEST state->stipple[EDI], EAX */
addbyte(0x87);
addlong(offsetof(voodoo_state_t, stipple));
addbyte(0x0f); /* JZ stipple_skip_pos */
addbyte(0x84);
stipple_skip_pos = block_pos;
addlong(0);
} else {
addbyte(0xd1); /* ROR state->stipple[EDI], 1*/
addbyte(0x8f);
addlong(offsetof(voodoo_state_t, stipple));
addbyte(0xf7); /* TEST state->stipple[EDI], 0x80000000 */
addbyte(0x87);
addlong(offsetof(voodoo_state_t, stipple));
addlong(0x80000000);
addbyte(0x0f); /* JZ stipple_skip_pos */
addbyte(0x84);
stipple_skip_pos = block_pos;
addlong(0);
}
}
addbyte(0x4c); /*MOV RSI, R15*/
addbyte(0x89);
addbyte(0xfe);
@@ -3190,6 +3250,8 @@ voodoo_generate(uint8_t *code_block, voodoo_t *voodoo, voodoo_params_t *params,
*(uint32_t *) &code_block[chroma_skip_pos] = (block_pos - chroma_skip_pos) - 4;
if (amask_skip_pos)
*(uint32_t *) &code_block[amask_skip_pos] = (block_pos - amask_skip_pos) - 4;
if (stipple_skip_pos)
*(uint32_t *) &code_block[stipple_skip_pos] = (block_pos - stipple_skip_pos) - 4;
addbyte(0x4c); /*MOV RSI, R15*/
addbyte(0x89);

View File

@@ -8,11 +8,7 @@
#ifndef VIDEO_VOODOO_CODEGEN_X86_H
#define VIDEO_VOODOO_CODEGEN_X86_H
#ifdef _MSC_VER
# include <intrin.h>
#else
# include <xmmintrin.h>
#endif
#include <xmmintrin.h>
#define BLOCK_NUM 8
#define BLOCK_MASK (BLOCK_NUM - 1)

View File

@@ -667,6 +667,8 @@ typedef struct voodoo_t {
struct voodoo_set_t *set;
uint32_t launch_pending;
uint8_t fifo_thread_run;
uint8_t render_thread_run[4];

View File

@@ -358,6 +358,7 @@ enum {
enum {
FBZ_CHROMAKEY = (1 << 1),
FBZ_STIPPLE = (1 << 2),
FBZ_W_BUFFER = (1 << 3),
FBZ_DEPTH_ENABLE = (1 << 4),
@@ -366,6 +367,8 @@ enum {
FBZ_DEPTH_WMASK = (1 << 10),
FBZ_DITHER_2x2 = (1 << 11),
FBZ_STIPPLE_PATT = (1 << 12),
FBZ_ALPHA_MASK = (1 << 13),
FBZ_DRAW_FRONT = 0x0000,

View File

@@ -58,6 +58,21 @@ enum {
VIDEO_AGP
};
typedef enum video_font_format_e
{
FONT_FORMAT_MDA = 0,
FONT_FORMAT_PC200 = 1,
FONT_FORMAT_CGA = 2,
FONT_FORMAT_WY700 = 3,
FONT_FORMAT_MDSI_GENIUS = 4,
FONT_FORMAT_TOSHIBA_3100E = 5,
FONT_FORMAT_KSC6501 = 6,
FONT_FORMAT_SIGMA = 7,
FONT_FORMAT_PC1512_T1000 = 8,
FONT_FORMAT_IM1024 = 9,
FONT_FORMAT_PRAVETZ = 10,
} video_font_format;
#define VIDEO_FLAG_TYPE_CGA 0
#define VIDEO_FLAG_TYPE_MDA 1
#define VIDEO_FLAG_TYPE_SPECIAL 2
@@ -202,8 +217,6 @@ extern int video_fullscreen;
extern int video_fullscreen_scale;
extern uint8_t fontdat[2048][8]; /* IBM CGA font */
extern uint8_t fontdatm[2048][16]; /* IBM MDA font */
extern uint8_t fontdat2[2048][8]; /* IBM CGA 2nd instance font */
extern uint8_t fontdatm2[2048][16]; /* IBM MDA 2nd instance font */
extern uint8_t fontdatw[512][32]; /* Wyse700 font */
extern uint8_t fontdat8x12[256][16]; /* MDSI Genius font */
extern uint8_t fontdat12x18[256][36]; /* IM1024 font */
@@ -253,9 +266,6 @@ extern int video_get_video_from_internal_name(char *s);
extern int video_card_get_flags(int card);
extern int video_is_mda(void);
extern int video_is_cga(void);
extern int video_is_ega_vga(void);
extern int video_is_8514(void);
extern int video_is_xga(void);
extern void video_inform_monitor(int type, const video_timings_t *ptr, int monitor_index);
extern int video_get_type_monitor(int monitor_index);
@@ -288,12 +298,8 @@ extern uint8_t video_force_resize_get_monitor(int monitor_index);
extern void video_force_resize_set_monitor(uint8_t res, int monitor_index);
extern void video_update_timing(void);
extern void loadfont_ex(char *fn, int format, int offset);
extern void loadfont(char *fn, int format);
extern int get_actual_size_x(void);
extern int get_actual_size_y(void);
#define LOAD_FONT_NO_OFFSET 0
extern void video_load_font(char *fn, int format, int offset);
extern uint32_t video_color_transform(uint32_t color);
#define video_inform(type, video_timings_ptr) video_inform_monitor(type, video_timings_ptr, monitor_index_global)

View File

@@ -3020,7 +3020,7 @@ machine_amstrad_init(const machine_t *model, int type)
if (gfxcard[0] == VID_INTERNAL)
switch (type) {
case AMS_PC1512:
loadfont("roms/machines/pc1512/40078", 8);
video_load_font("roms/machines/pc1512/40078", FONT_FORMAT_PC1512_T1000, LOAD_FONT_NO_OFFSET);
device_context(&vid_1512_device);
ams->language = device_get_config_int("language");
vid_init_1512(ams);
@@ -3029,7 +3029,7 @@ machine_amstrad_init(const machine_t *model, int type)
break;
case AMS_PPC512:
loadfont("roms/machines/ppc512/40109", 1);
video_load_font("roms/machines/ppc512/40109", FONT_FORMAT_PC200, LOAD_FONT_NO_OFFSET);
device_context(&vid_ppc512_device);
ams->language = device_get_config_int("language");
vid_init_200(ams);
@@ -3038,7 +3038,7 @@ machine_amstrad_init(const machine_t *model, int type)
break;
case AMS_PC1640:
loadfont(FONT_IBM_MDA_437_PATH, 0);
video_load_font(FONT_IBM_MDA_437_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
device_context(&vid_1640_device);
ams->language = device_get_config_int("language");
vid_init_1640(ams);
@@ -3047,7 +3047,7 @@ machine_amstrad_init(const machine_t *model, int type)
break;
case AMS_PC200:
loadfont("roms/machines/pc200/40109", 1);
video_load_font("roms/machines/pc200/40109", FONT_FORMAT_PC200, LOAD_FONT_NO_OFFSET);
device_context(&vid_200_device);
ams->language = device_get_config_int("language");
vid_init_200(ams);

View File

@@ -33,9 +33,9 @@
#include <stdint.h>
#include <stdio.h>
#include <time.h>
#include <86box/86box.h>
#include <86box/timer.h>
#include <86box/fdd.h>
#include <86box/86box.h>
#include <86box/device.h>
#include <86box/fdc.h>
#include <86box/fdc_ext.h>

View File

@@ -897,7 +897,7 @@ machine_pcjr_init(UNUSED(const machine_t *model))
/* Initialize the video controller. */
video_reset(gfxcard[0]);
loadfont(FONT_IBM_MDA_437_PATH, 0);
video_load_font(FONT_IBM_MDA_437_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
device_context(&pcjr_device);
pcjr_vid_init(pcjr);
device_context_restore();

View File

@@ -77,9 +77,9 @@ machine_v86p_init(const machine_t *model)
return ret;
if (rom_id == 2)
loadfont("roms/machines/v86p/V86P.FON", 8);
video_load_font("roms/machines/v86p/V86P.FON", FONT_FORMAT_PC1512_T1000, LOAD_FONT_NO_OFFSET);
else
loadfont("roms/machines/v86p/v86pfont.rom", 8);
video_load_font("roms/machines/v86p/v86pfont.rom", FONT_FORMAT_PC1512_T1000, LOAD_FONT_NO_OFFSET);
machine_common_init(model);

View File

@@ -2154,7 +2154,7 @@ machine_xt_maz1016_init(const machine_t *model)
if (bios_only || !ret)
return ret;
loadfont("roms/machines/maz1016/crt-8.bin", 0);
video_load_font("roms/machines/maz1016/crt-8.bin", FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
machine_xt_clone_init(model, 0);

View File

@@ -2018,7 +2018,7 @@ m19_vid_init(m19_vid_t *vid)
#endif
/* OGC emulation part begin */
loadfont("roms/machines/m19/MBM2764-30 8514 107 AB PCF3.BIN", 7);
video_load_font("roms/machines/m19/MBM2764-30 8514 107 AB PCF3.BIN", FONT_FORMAT_SIGMA, LOAD_FONT_NO_OFFSET);
/* composite is not working yet */
vid->ogc.cga.composite = 0; // (display_type != CGA_RGB);
vid->ogc.cga.revision = device_get_config_int("composite_type");

View File

@@ -846,7 +846,7 @@ machine_xt_t1000_init(const machine_t *model)
t1000.ems_port_index = 7; /* EMS disabled */
/* Load the T1000 CGA Font ROM. */
loadfont("roms/machines/t1000/t1000font.bin", 2);
video_load_font("roms/machines/t1000/t1000font.bin", FONT_FORMAT_CGA, LOAD_FONT_NO_OFFSET);
/*
* The ROM drive is optional.
@@ -928,7 +928,7 @@ machine_xt_t1200_init(const machine_t *model)
t1000.ems_port_index = 7; /* EMS disabled */
/* Load the T1000 CGA Font ROM. */
loadfont("roms/machines/t1000/t1000font.bin", 2);
video_load_font("roms/machines/t1000/t1000font.bin", FONT_FORMAT_CGA, LOAD_FONT_NO_OFFSET);
/* Map the EMS page frame */
for (uint8_t pg = 0; pg < 4; pg++) {

View File

@@ -52,9 +52,7 @@
#include <stdlib.h>
#include <wchar.h>
#include <time.h>
#ifndef _MSC_VER
#include <sys/time.h>
#endif
#include <stdbool.h>
#define HAVE_STDARG_H
#include <86box/86box.h>

View File

@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <wchar.h>
#define HAVE_STDARG_H
#include <86box/86box.h>
#include <86box/scsi_device.h>
#include <86box/cdrom.h>
#include <86box/log.h>

3001
src/qt/languages/ca-ES.po Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -160,19 +160,19 @@ msgid "RGB (no brown)"
msgstr "RGB (sin marrón)"
msgid "&RGB Grayscale"
msgstr "RGB &Grises"
msgstr "RGB &grises"
msgid "Generic RGBI color monitor"
msgstr "Monitor a colores RGBI genérico"
msgid "&Amber monitor"
msgstr "Monitor Ámb&ar"
msgstr "Monitor ámb&ar"
msgid "&Green monitor"
msgstr "Monitor &Verde"
msgstr "Monitor &verde"
msgid "&White monitor"
msgstr "Monitor &Blanco"
msgstr "Monitor &blanco"
msgid "Grayscale &conversion type"
msgstr "&Conversión a grises"
@@ -241,10 +241,10 @@ msgid "&New image…"
msgstr "&Nueva imagen…"
msgid "&Existing image…"
msgstr "Imagen &Existente…"
msgstr "Imagen &existente…"
msgid "Existing image (&Write-protected)…"
msgstr "Imagen Existente (&Sólo-lectura)…"
msgstr "Imagen existente (&Sólo-lectura)…"
msgid "&Record"
msgstr "&Grabar"
@@ -283,16 +283,16 @@ msgid "Preferences"
msgstr "Preferencias"
msgid "Sound Gain"
msgstr "Ganancia de Sonido"
msgstr "Ganancia de sonido"
msgid "New Image"
msgstr "Nueva Imagen"
msgstr "Nueva imagen"
msgid "Settings"
msgstr "Configuraciones"
msgid "Specify Main Window Dimensions"
msgstr "Especificar Dimensiones de la Ventana Principal"
msgstr "Especificar dimensiones de la ventana principal"
msgid "OK"
msgstr "Aceptar"
@@ -376,7 +376,7 @@ msgid "Enabled (UTC)"
msgstr "Habilitado (UTC)"
msgid "Dynamic Recompiler"
msgstr "Recompilador Dinámico"
msgstr "Recompilador dinámico"
msgid "CPU frame size"
msgstr "Tamaño de blocos de CPU"
@@ -682,7 +682,7 @@ msgid "&Removable disk %1 (%2): %3"
msgstr "&Disco removible %1 (%2): %3"
msgid "Removable disk images"
msgstr "Imagenes de disco removible"
msgstr "Imágenes de disco removible"
msgid "Image %1"
msgstr "Imagen %1"
@@ -709,10 +709,10 @@ msgid "All images"
msgstr "Todas las imagenes"
msgid "Basic sector images"
msgstr "Basic sector images"
msgstr "Imaáenes básicas de sector"
msgid "Surface images"
msgstr "Surface images"
msgstr "Imágenes de superficie"
msgid "Machine \"%hs\" is not available due to missing ROMs in the roms/machines directory. Switching to an available machine."
msgstr "La máquina \"%hs\" no está disponible debido a ROMs faltantes en el directorio roms/machines. Cambiando a una máquina disponible."
@@ -733,7 +733,7 @@ msgid "Display"
msgstr "Vídeo"
msgid "Input devices"
msgstr "Dispositivos de Entrada"
msgstr "Dispositivos de entrada"
msgid "Sound"
msgstr "Sonido"
@@ -754,10 +754,10 @@ msgid "Parallel ports:"
msgstr "Puertos paralelos:"
msgid "Storage controllers"
msgstr "Controladoras de Almacenamiento"
msgstr "Controladoras de almacenamiento"
msgid "Hard disks"
msgstr "Discos Duros"
msgstr "Discos duros"
msgid "Disks:"
msgstr "Discos:"
@@ -946,7 +946,7 @@ msgid "MO images"
msgstr "Imágenes de MO"
msgid "Welcome to 86Box!"
msgstr "¡Bienvenido a 86Box!"
msgstr "¡Bienvenido en 86Box!"
msgid "Internal device"
msgstr "Dispositivo interno"
@@ -991,7 +991,7 @@ msgid "Hardware not available"
msgstr "Equipo no disponible"
msgid "Make sure %1 is installed and that you are on a %1-compatible network connection."
msgstr "Asegúrate de que %1 está instalado y de que estás en una conexión de red compatible con %1."
msgstr "Asegúree de que %1 está instalado y de que estás en una conexión de red compatible con %1."
msgid "Invalid configuration"
msgstr "Configuración inválida"
@@ -1018,7 +1018,7 @@ msgid "CD-ROM images"
msgstr "Imágenes de CD-ROM"
msgid "%1 Device Configuration"
msgstr "%1 Configuración de Dispositivo"
msgstr "Configuración de dispositivo %1"
msgid "Monitor in sleep mode"
msgstr "Monitor en modo ahorro"
@@ -1042,7 +1042,7 @@ msgid "C&assette: %1"
msgstr "C&assette: %1"
msgid "Cassette images"
msgstr "Imágenes de Cassette"
msgstr "Imágenes de cassette"
msgid "Cartridge %1: %2"
msgstr "Cartucho %1: %2"
@@ -1051,7 +1051,7 @@ msgid "Car&tridge %1: %2"
msgstr "Car&tucho %1: %2"
msgid "Cartridge images"
msgstr "Imágenes de Cartucho"
msgstr "Imágenes de cartucho"
msgid "Resume execution"
msgstr "Retomar la ejecución"
@@ -1072,13 +1072,13 @@ msgid "Hard reset"
msgstr "Hard reset"
msgid "Force shutdown"
msgstr "Apagqar forzadamente"
msgstr "Apagar forzadamente"
msgid "Start"
msgstr "Iniciar"
msgid "&Force shutdown"
msgstr "&Apagqar forzadamente"
msgstr "&Apagar forzadamente"
msgid "&Start"
msgstr "&Iniciar"
@@ -1192,7 +1192,7 @@ msgid "System location:"
msgstr "Ubicación del sistema:"
msgid "System name and location"
msgstr "Nombre y ubicaciónd el sistema"
msgstr "Nombre y ubicación del sistema"
msgid "Enter the name of the system and choose the location"
msgstr "Escribir el nombre del sistema y escoger la ubicación"
@@ -1363,10 +1363,10 @@ msgid "Custom (large)…"
msgstr "A medida (grande)…"
msgid "Add New Hard Disk"
msgstr "Añadir Nuevo Disco Duro"
msgstr "Añadir nuevo disco duro"
msgid "Add Existing Hard Disk"
msgstr "Añadir Disco Duro Existente"
msgstr "Añadir disco duro existente"
msgid "HDI disk images cannot be larger than 4 GB."
msgstr "Las imágenes de disco HDI no pueden superar los 4 GB."
@@ -1375,7 +1375,7 @@ msgid "Disk images cannot be larger than 127 GB."
msgstr "Las imágenes de disco no pueden superar los 127 GB."
msgid "Hard disk images"
msgstr "Imágenes de Disco Duro"
msgstr "Imágenes de disco duro"
msgid "Unable to read file"
msgstr "No se pudo leer el archivo"
@@ -2122,7 +2122,7 @@ msgid "MPU-401 Address"
msgstr "Dirección del MPU-401"
msgid "MPU-401 IRQ"
msgstr "IQ del MPU-401"
msgstr "IRQ del MPU-401"
msgid "Receive MIDI input"
msgstr "Recebir entrada MIDI"
@@ -2218,7 +2218,7 @@ msgid "Display type"
msgstr "Tipo de pantalla"
msgid "Composite type"
msgstr "Tipo de pantalla compuesta"
msgstr "Tipo de pantalla compósita"
msgid "RGB type"
msgstr "Tipo de pantalla RGB"
@@ -2446,7 +2446,7 @@ msgid "256 KB"
msgstr "256 KB"
msgid "Composite"
msgstr "Compuesto"
msgstr "Compósito"
msgid "True color"
msgstr "Verdadero color"
@@ -2482,13 +2482,13 @@ msgid "sRGB interpolation"
msgstr "Interpolación sRGB"
msgid "Linear interpolation"
msgstr "Interpolación lineare"
msgstr "Interpolación lineal"
msgid "Has secondary 8x8 character set"
msgstr "Tiene conjunto de carácteres 8x8 secundário"
msgid "Has Quadcolor II daughter board"
msgstr "Tiene tarjeta hija Quadcolor II"
msgstr "Tiene placa hija Quadcolor II"
msgid "Alternate monochrome contrast"
msgstr "Contraste monocromo alternativo"
@@ -2569,7 +2569,7 @@ msgid "Obsidian SB50 + Amethyst (2 TMUs)"
msgstr "Obsidian SB50 + Amethyst (2 unidades TMU)"
msgid "8-bit"
msgstr "8 bitss"
msgstr "8 bits"
msgid "16-bit"
msgstr "16 bits"
@@ -2596,7 +2596,7 @@ msgid "Generic Text Printer"
msgstr "Impresora genérica de texto"
msgid "Generic ESC/P 2 Dot-Matrix Printer"
msgstr "Impresora matricial ESC/P 2 genérica"
msgstr "Impresora genérica matricial ESC/P 2"
msgid "Generic PostScript Printer"
msgstr "Impresora genérica PostScript"
@@ -2698,7 +2698,7 @@ msgid "Unable to find Dot-Matrix fonts"
msgstr "No fué posible encontrar las fuentes matriciales"
msgid "TrueType fonts in the \"roms/printer/fonts\" directory are required for the emulation of the Generic ESC/P 2 Dot-Matrix Printer."
msgstr "Las fuentes TrueType en el directorio \"roms/printer/fonts\" son necesarias para la emulación de la impresora matricial ESC/P 2 genérica."
msgstr "Las fuentes TrueType en el directorio \"roms/printer/fonts\" son necesarias para la emulación de la impresora genérica matricial ESC/P 2."
msgid "Inhibit multimedia keys"
msgstr "Inhibir teclas multimedia"
@@ -2863,10 +2863,10 @@ msgid "Unknown Status"
msgstr "Estado desconocido"
msgid "No Machines Found!"
msgstr "¡No fueron encontradas máquinas!"
msgstr "¡No fueran encontradas máquinas!"
msgid "Check for updates on startup"
msgstr "Contorlar actualizaciones al iniciar"
msgstr "Verificar actualizaciones al iniciar"
msgid "Unable to determine release information"
msgstr "No fué posible determinar informaciones de la versión"
@@ -2953,19 +2953,19 @@ msgid "Sharpness"
msgstr "Nitidez"
msgid "&CGA composite settings…"
msgstr "Configuración del modo compuesto &CGA…"
msgstr "Configuración del modo compósito &CGA…"
msgid "CGA composite settings"
msgstr "Configuración del modo compuesto CGA"
msgstr "Configuración del modo compósito CGA"
msgid "Monitor EDID"
msgstr "EDID du moniteur"
msgstr "EDID del monitor"
msgid "Export…"
msgstr "Exporter…"
msgstr "Exportar…"
msgid "Export EDID"
msgstr "EDID exportieren"
msgstr "Exportar el EDID"
msgid "EDID file \"%ls\" is too large."
msgstr "El archivo EDID \"%ls\" es demasiado grande."
@@ -2980,7 +2980,7 @@ msgid "Color scheme"
msgstr "Esquema de colores"
msgid "Light"
msgstr "Luz"
msgstr "Claro"
msgid "Dark"
msgstr "Oscuro"

View File

@@ -17,6 +17,7 @@
#include <cstdint>
extern "C" {
#include <86box/86box.h>
#include <86box/hdd.h>
#include <86box/scsi.h>
#include <86box/cdrom.h>

View File

@@ -17,9 +17,9 @@
#include "qt_machinestatus.hpp"
extern "C" {
#include <86box/86box.h>
#include <86box/hdd.h>
#include <86box/timer.h>
#include <86box/86box.h>
#include <86box/device.h>
#include <86box/cartridge.h>
#include <86box/cassette.h>

View File

@@ -47,6 +47,7 @@ QTranslator *ProgSettings::qtTranslator = nullptr;
QVector<QPair<QString, QString>> ProgSettings::languages = {
{ "system", "(System Default)" },
{ "ca-ES", "Catalan (Spain)" },
{ "zh-CN", "Chinese (Simplified)" },
{ "zh-TW", "Chinese (Traditional)" },
{ "hr-HR", "Croatian (Croatia)" },

View File

@@ -19,9 +19,13 @@
#include <cstdlib>
#include <cstring>
extern "C" {
#include "86box/86box.h"
#include "86box/hdd.h"
#include "86box/scsi.h"
#include "86box/cdrom.h"
}
#include "qt_settings_bus_tracking.hpp"
SettingsBusTracking::SettingsBusTracking()

View File

@@ -149,7 +149,7 @@ SettingsFloppyCDROM::SettingsFloppyCDROM(QWidget *parent)
#ifndef DISABLE_FDD_AUDIO
// Get the profile name from the configuration system
const char *name = fdd_audio_get_profile_internal_name(prof);
const char *name = fdd_audio_get_profile_name(prof);
if (name) {
profName = QString(name);
} else {
@@ -449,7 +449,7 @@ SettingsFloppyCDROM::on_comboBoxFloppyAudio_activated(int)
#ifndef DISABLE_FDD_AUDIO
// Get the profile name from the configuration system
const char *name = fdd_audio_get_profile_internal_name(prof);
const char *name = fdd_audio_get_profile_name(prof);
if (name) {
profName = name;
} else {

View File

@@ -18,6 +18,7 @@
#include "ui_qt_settingsotherremovable.h"
extern "C" {
#include <86box/86box.h>
#include <86box/timer.h>
#include <86box/scsi_device.h>
#include <86box/mo.h>

View File

@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/">
<file>86box_ca-ES.qm</file>
<file>86box_cs-CZ.qm</file>
<file>86box_de-DE.qm</file>
<file>86box_en-US.qm</file>

View File

@@ -149,11 +149,11 @@ VMManagerDetails::VMManagerDetails(QWidget *parent)
cadButton->setEnabled(false);
cadButton->setToolTip(tr("Ctrl+Alt+Del"));
ui->toolButtonHolder->layout()->addWidget(configureButton);
ui->toolButtonHolder->layout()->addWidget(startPauseButton);
ui->toolButtonHolder->layout()->addWidget(resetButton);
ui->toolButtonHolder->layout()->addWidget(stopButton);
ui->toolButtonHolder->layout()->addWidget(startPauseButton);
ui->toolButtonHolder->layout()->addWidget(cadButton);
ui->toolButtonHolder->layout()->addWidget(configureButton);
ui->notesTextEdit->setEnabled(false);

View File

@@ -22,6 +22,7 @@ add_library(plat OBJECT
unix.c
unix_serial_passthrough.c
unix_netsocket.c
../qt/sdl_joystick.c
)
if (NOT CPPTHREADS)

View File

@@ -12,10 +12,10 @@
# After a successful build, you can install the RPMs as follows:
# sudo dnf install RPMS/$(uname -m)/86Box-3* RPMS/noarch/86Box-roms*
%global romver 5.3
%global romver 5.4
Name: 86Box
Version: 5.3
Version: 5.4
Release: 1%{?dist}
Summary: Classic PC emulator
License: GPLv2+
@@ -121,5 +121,5 @@ popd
%{_datadir}/%{name}/roms
%changelog
* Sat Aug 31 Jasmine Iwanek <jriwanek[AT]gmail.com> 5.3-1
* Sat Aug 31 Jasmine Iwanek <jriwanek[AT]gmail.com> 5.4-1
- Bump release

View File

@@ -11,7 +11,7 @@
</categories>
<launchable type="desktop-id">net.86box.86Box.desktop</launchable>
<releases>
<release version="5.3" date="2025-12-02"/>
<release version="5.4" date="2025-12-23"/>
</releases>
<content_rating type="oars-1.1" />
<description>

View File

@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <wchar.h>
#define HAVE_STDARG_H
#include <86box/86box.h>
#include <86box/scsi_device.h>
#include <86box/cdrom.h>
#include <86box/log.h>

View File

@@ -67,9 +67,6 @@ int fixed_size_x = 640;
int fixed_size_y = 480;
extern int title_set;
extern wchar_t sdl_win_title[512];
plat_joystick_state_t plat_joystick_state[MAX_PLAT_JOYSTICKS];
joystick_state_t joystick_state[GAMEPORT_MAX][MAX_JOYSTICKS];
int joysticks_present;
SDL_mutex *blitmtx;
SDL_threadID eventthread;
static int exit_event = 0;
@@ -1689,24 +1686,6 @@ plat_language_code_r(UNUSED(int id), UNUSED(char *outbuf), UNUSED(int len))
return;
}
void
joystick_init(void)
{
/* No-op. */
}
void
joystick_close(void)
{
/* No-op. */
}
void
joystick_process(uint8_t gp)
{
/* No-op. */
}
void
startblit(void)
{

View File

@@ -51,16 +51,10 @@ rdtsc(void)
#if defined(__x86_64__)
unsigned int hi;
unsigned int lo;
# ifdef _MSC_VER
__asm {
rdtsc
mov hi, edx ; EDX:EAX is already standard return!!
mov lo, eax
}
# else
__asm__ __volatile__("rdtsc"
: "=a"(lo), "=d"(hi));
# endif
return ((unsigned long long) lo) | (((unsigned long long) hi) << 32);
#else
return time(NULL);

View File

@@ -574,16 +574,16 @@ ati28800k_init(const device_t *info)
default:
case 0:
rom_init(&ati28800->bios_rom, BIOS_ATIKOR_PATH, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
loadfont(FONT_ATIKOR_PATH, 6);
video_load_font(FONT_ATIKOR_PATH, FONT_FORMAT_KSC6501, LOAD_FONT_NO_OFFSET);
break;
case 1:
rom_init_interleaved(&ati28800->bios_rom, BIOS_ATIKOR_4620P_PATH_L, BIOS_ATIKOR_4620P_PATH_H, 0xc0000,
0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
loadfont(FONT_ATIKOR_4620P_PATH, 6);
video_load_font(FONT_ATIKOR_4620P_PATH, FONT_FORMAT_KSC6501, LOAD_FONT_NO_OFFSET);
break;
case 2:
rom_init(&ati28800->bios_rom, BIOS_ATIKOR_6033P_PATH, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
loadfont(FONT_ATIKOR_6033P_PATH, 6);
video_load_font(FONT_ATIKOR_6033P_PATH, FONT_FORMAT_KSC6501,LOAD_FONT_NO_OFFSET);
break;
}

View File

@@ -782,13 +782,13 @@ cga_standalone_init(UNUSED(const device_t *info))
switch(device_get_config_int("font")) {
case 0:
loadfont(FONT_IBM_MDA_437_PATH, 0);
video_load_font(FONT_IBM_MDA_437_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 1:
loadfont(FONT_IBM_MDA_437_NORDIC_PATH, 0);
video_load_font(FONT_IBM_MDA_437_NORDIC_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 4:
loadfont(FONT_TULIP_DGA_PATH, 0);
video_load_font(FONT_TULIP_DGA_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
}
@@ -802,7 +802,7 @@ cga_pravetz_init(const device_t *info)
{
cga_t *cga = cga_standalone_init(info);
loadfont("roms/video/cga/PRAVETZ-VDC2.BIN", 10);
video_load_font("roms/video/cga/PRAVETZ-VDC2.BIN", FONT_FORMAT_PRAVETZ, LOAD_FONT_NO_OFFSET);
io_removehandler(0x03dd, 0x0001, cga_in, NULL, NULL, cga_out, NULL, NULL, cga);
io_sethandler(0x03dd, 0x0001, cga_pravetz_in, NULL, NULL, cga_pravetz_out, NULL, NULL, cga);

View File

@@ -562,7 +562,7 @@ nga_init(UNUSED(const device_t *info))
charset = device_get_config_int("charset");
loadfont_ex("roms/video/nga/ncr_nga_35122.bin", 1, 4096 * charset);
video_load_font("roms/video/nga/ncr_nga_35122.bin", 1, 4096 * charset);
nga->cga.composite = 0;
nga->cga.snow_enabled = device_get_config_int("snow_enabled");

View File

@@ -592,7 +592,7 @@ ogc_init(UNUSED(const device_t *info))
memset(ogc, 0x00, sizeof(ogc_t));
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_ogc);
loadfont("roms/video/ogc/ogc graphics board go380 258 pqbq.bin", 1);
video_load_font("roms/video/ogc/ogc graphics board go380 258 pqbq.bin", FONT_FORMAT_PC200, LOAD_FONT_NO_OFFSET);
/* FIXME: composite is not working yet */
#if 0

View File

@@ -828,13 +828,13 @@ quadcolor_standalone_init(UNUSED(const device_t *info))
switch(device_get_config_int("font")) {
case 0:
loadfont(FONT_IBM_MDA_437_PATH, 0);
video_load_font(FONT_IBM_MDA_437_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 1:
loadfont(FONT_IBM_MDA_437_NORDIC_PATH, 0);
video_load_font(FONT_IBM_MDA_437_NORDIC_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 4:
loadfont(FONT_TULIP_DGA_PATH, 0);
video_load_font(FONT_TULIP_DGA_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
}

View File

@@ -650,7 +650,7 @@ static void *
t1000_init(UNUSED(const device_t *info))
{
t1000_t *t1000 = calloc(1, sizeof(t1000_t));
loadfont("roms/machines/t1000/t1000font.bin", 8);
video_load_font("roms/machines/t1000/t1000font.bin", FONT_FORMAT_PC1512_T1000, LOAD_FONT_NO_OFFSET);
cga_init(&t1000->cga);
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_t1000);

View File

@@ -654,7 +654,7 @@ void *
t3100e_init(UNUSED(const device_t *info))
{
t3100e_t *t3100e = calloc(1, sizeof(t3100e_t));
loadfont("roms/machines/t3100e/t3100e_font.bin", 5);
video_load_font("roms/machines/t3100e/t3100e_font.bin", FONT_FORMAT_TOSHIBA_3100E, LOAD_FONT_NO_OFFSET);
cga_init(&t3100e->cga);
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_t3100e);

View File

@@ -924,13 +924,13 @@ v6355_standalone_init(const device_t *info) {
switch(device_get_config_int("font")) {
case 0:
loadfont(FONT_IBM_MDA_437_PATH, 0);
video_load_font(FONT_IBM_MDA_437_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 1:
loadfont(FONT_IBM_MDA_437_NORDIC_PATH, 0);
video_load_font(FONT_IBM_MDA_437_NORDIC_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 4:
loadfont(FONT_TULIP_DGA_PATH, 0);
video_load_font(FONT_TULIP_DGA_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
}

View File

@@ -850,7 +850,7 @@ et4000_init(const device_t *info)
et4000k_in, NULL, NULL, et4000k_out, NULL, NULL, dev);
io_sethandler(0x32cb, 1,
et4000k_in, NULL, NULL, et4000k_out, NULL, NULL, dev);
loadfont(KOREAN_FONT_ROM_PATH, 6);
video_load_font(KOREAN_FONT_ROM_PATH, FONT_FORMAT_KSC6501, LOAD_FONT_NO_OFFSET);
fn = KOREAN_BIOS_ROM_PATH;
break;
@@ -884,7 +884,7 @@ et4000_init(const device_t *info)
et4000_kasan_in, NULL, NULL, et4000_kasan_out, NULL, NULL, dev);
io_sethandler(0x0258, 2,
et4000_kasan_in, NULL, NULL, et4000_kasan_out, NULL, NULL, dev);
loadfont(KASAN_FONT_ROM_PATH, 6);
video_load_font(KASAN_FONT_ROM_PATH, FONT_FORMAT_KSC6501, LOAD_FONT_NO_OFFSET);
fn = KASAN_BIOS_ROM_PATH;
break;

View File

@@ -744,7 +744,7 @@ genius_init(UNUSED(const device_t *info))
/* 160k video RAM */
genius->vram = malloc(0x28000);
loadfont(BIOS_ROM_PATH, 4);
video_load_font(BIOS_ROM_PATH, FONT_FORMAT_MDSI_GENIUS, LOAD_FONT_NO_OFFSET);
timer_add(&genius->timer, genius_poll, genius, 1);

View File

@@ -542,19 +542,19 @@ hercules_init(UNUSED(const device_t *info))
switch(device_get_config_int("font")) {
case 0:
loadfont(FONT_IBM_MDA_437_PATH, 0);
video_load_font(FONT_IBM_MDA_437_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 1:
loadfont(FONT_IBM_MDA_437_NORDIC_PATH, 0);
video_load_font(FONT_IBM_MDA_437_NORDIC_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 2:
loadfont(FONT_KAM_PATH, 0);
video_load_font(FONT_KAM_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 3:
loadfont(FONT_KAMCL16_PATH, 0);
video_load_font(FONT_KAMCL16_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 4:
loadfont(FONT_TULIP_DGA_PATH, 0);
video_load_font(FONT_TULIP_DGA_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
}

View File

@@ -994,19 +994,19 @@ incolor_init(UNUSED(const device_t *info))
switch(device_get_config_int("font")) {
case 0:
loadfont(FONT_IBM_MDA_437_PATH, 0);
video_load_font(FONT_IBM_MDA_437_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 1:
loadfont(FONT_IBM_MDA_437_NORDIC_PATH, 0);
video_load_font(FONT_IBM_MDA_437_NORDIC_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 2:
loadfont(FONT_KAM_PATH, 0);
video_load_font(FONT_KAM_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 3:
loadfont(FONT_KAMCL16_PATH, 0);
video_load_font(FONT_KAMCL16_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 4:
loadfont(FONT_TULIP_DGA_PATH, 0);
video_load_font(FONT_TULIP_DGA_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
}

View File

@@ -631,19 +631,19 @@ herculesplus_init(UNUSED(const device_t *info))
switch(device_get_config_int("font")) {
case 0:
loadfont(FONT_IBM_MDA_437_PATH, 0);
video_load_font(FONT_IBM_MDA_437_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 1:
loadfont(FONT_IBM_MDA_437_NORDIC_PATH, 0);
video_load_font(FONT_IBM_MDA_437_NORDIC_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 2:
loadfont(FONT_KAM_PATH, 0);
video_load_font(FONT_KAM_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 3:
loadfont(FONT_KAMCL16_PATH, 0);
video_load_font(FONT_KAMCL16_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 4:
loadfont(FONT_TULIP_DGA_PATH, 0);
video_load_font(FONT_TULIP_DGA_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
}

View File

@@ -1036,7 +1036,7 @@ im1024_init(UNUSED(const device_t *info))
dev = (im1024_t *) malloc(sizeof(im1024_t));
memset(dev, 0x00, sizeof(im1024_t));
loadfont(BIOS_ROM_PATH, 9);
video_load_font(BIOS_ROM_PATH, FONT_FORMAT_IM1024, LOAD_FONT_NO_OFFSET);
dev->fifo_len = 4096;
dev->fifo = (uint8_t *) malloc(dev->fifo_len);

View File

@@ -686,7 +686,7 @@ readfontxtbl(fontx_tbl *table, int size, FILE *fp)
}
static int
LoadFontxFile(const char *fn, void *priv)
jega_load_font(const char *fn, void *priv)
{
fontx_h fhead;
fontx_tbl *ftbl;
@@ -793,7 +793,7 @@ jega_standalone_init(const device_t *info)
rom_init(&jega->bios_rom, JEGA_PATH_BIOS, 0xc0000, 0x8000, 0x7fff, 0, 0);
memset(&jega->jfont_dbcs_16, 0, DBCS16_FILESIZE);
LoadFontxFile(JEGA_PATH_FONTDBCS, jega);
jega_load_font(JEGA_PATH_FONTDBCS, jega);
jega_commoninit(info, jega, 0);
@@ -807,7 +807,7 @@ jvga_standalone_init(const device_t *info)
rom_init(&jega->bios_rom, JVGA_PATH_BIOS, 0xc0000, 0x8000, 0x7fff, 0, 0);
memset(&jega->jfont_dbcs_16, 0, DBCS16_FILESIZE);
LoadFontxFile(JVGA_PATH_FONTDBCS, jega);
jega_load_font(JVGA_PATH_FONTDBCS, jega);
jega_commoninit(info, jega, 1);
@@ -1024,7 +1024,7 @@ if386jega_init(const device_t *info)
rom_init(&jega->bios_rom, IF386_PATH_VBIOS, 0xc0000, 0x8000, 0x7fff, 0, 0);
memset(&jega->jfont_dbcs_16, 0, DBCS16_FILESIZE);
LoadFontxFile(JEGA_PATH_FONTDBCS, jega);
jega_load_font(JEGA_PATH_FONTDBCS, jega);
jega_commoninit(info, jega, 0);

View File

@@ -414,27 +414,27 @@ mda_init(mda_t *mda)
void *
mda_standalone_init(UNUSED(const device_t *info))
{
mda_t *mda = malloc(sizeof(mda_t));
memset(mda, 0, sizeof(mda_t));
mda_t *mda = calloc(1, sizeof(mda_t));
video_inform(VIDEO_FLAG_TYPE_MDA, &timing_mda);
mda->vram = malloc(0x1000);
mda->vram = malloc(MDA_VRAM);
switch (device_get_config_int("font")) {
case 0:
loadfont(FONT_IBM_MDA_437_PATH, 0);
video_load_font(FONT_IBM_MDA_437_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 1:
loadfont(FONT_IBM_MDA_437_NORDIC_PATH, 0);
video_load_font(FONT_IBM_MDA_437_NORDIC_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 2:
loadfont(FONT_KAM_PATH, 0);
video_load_font(FONT_KAM_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 3:
loadfont(FONT_KAMCL16_PATH, 0);
video_load_font(FONT_KAMCL16_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
case 4:
loadfont(FONT_TULIP_DGA_PATH, 0);
video_load_font(FONT_TULIP_DGA_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
break;
}

View File

@@ -3149,7 +3149,7 @@ da2_poll(void *priv)
}
static void
da2_loadfont(char *fname, void *priv)
da2_video_load_font(char *fname, void *priv)
{
da2_t *da2 = (da2_t *) priv;
uint8_t buf;
@@ -3267,10 +3267,10 @@ da2_init(UNUSED(const device_t *info))
da2->mmio.font = malloc(DA2_FONTROM_SIZE);
switch (da2->mmio.charset) {
case DA2_DCONFIG_CHARSET_HANT:
da2_loadfont(DA2_FONTROM_PATH_HANT, da2);
da2_video_load_font(DA2_FONTROM_PATH_HANT, da2);
break;
case DA2_DCONFIG_CHARSET_JPAN:
da2_loadfont(DA2_FONTROM_PATH_JPAN, da2);
da2_video_load_font(DA2_FONTROM_PATH_JPAN, da2);
/* Add magic code for OS/2 J1.3. This disables BitBlt's text drawing function. */
da2->mmio.font[0x1AFFE] = 0x80;
da2->mmio.font[0x1AFFF] = 0x01;

View File

@@ -794,7 +794,7 @@ sigma_init(UNUSED(const device_t *info))
sigma->enable_nmi = device_get_config_int("enable_nmi");
loadfont(ROM_SIGMA_FONT, 7);
video_load_font(ROM_SIGMA_FONT, FONT_FORMAT_SIGMA, LOAD_FONT_NO_OFFSET);
rom_init(&sigma->bios_rom, ROM_SIGMA_BIOS, bios_addr, 0x2000,
0x1FFF, 0, MEM_MAPPING_EXTERNAL);
/* The BIOS ROM is overlaid by RAM, so remove its default mapping

View File

@@ -91,7 +91,7 @@ svga_render_blank(svga_t *svga)
line_width -= svga->x_add;
}
if (((svga->hdisp + svga->scrollcache) > 0) && (line_width >= 0))
if ((line_ptr != NULL) && ((svga->hdisp + svga->scrollcache) > 0) && (line_width >= 0))
memset(line_ptr, 0, line_width);
}
@@ -106,7 +106,7 @@ svga_render_overscan_left(svga_t *svga)
uint32_t *line_ptr = svga->monitor->target_buffer->line[svga->displine + svga->y_add];
if (svga->x_add >= 0) for (int i = 0; i < svga->x_add; i++)
if ((line_ptr != NULL) && (svga->x_add >= 0)) for (int i = 0; i < svga->x_add; i++)
*line_ptr++ = svga->overscan_color;
}
@@ -121,10 +121,15 @@ svga_render_overscan_right(svga_t *svga)
if (svga->scrblank || (svga->hdisp <= 0))
return;
uint32_t *line_ptr = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add + svga->hdisp];
uint32_t *line_ptr = svga->monitor->target_buffer->line[svga->displine + svga->y_add];
right = overscan_x - svga->left_overscan;
for (int i = 0; i < right; i++)
*line_ptr++ = svga->overscan_color;
if (line_ptr != NULL) {
line_ptr += svga->x_add + svga->hdisp;
for (int i = 0; i < right; i++)
*line_ptr++ = svga->overscan_color;
}
}
void

View File

@@ -360,7 +360,7 @@ video_reset(int card)
card, machine_has_flags(machine, MACHINE_VIDEO) ? 1 : 0);
monitor_index_global = 0;
loadfont(FONT_IBM_MDA_437_PATH, 0);
video_load_font(FONT_IBM_MDA_437_PATH, FONT_FORMAT_MDA, LOAD_FONT_NO_OFFSET);
for (uint8_t i = 1; i < GFXCARD_MAX; i ++) {
if ((card != VID_NONE) && !machine_has_flags(machine, MACHINE_VIDEO_ONLY) &&
@@ -482,21 +482,3 @@ video_is_cga(void)
{
return (video_get_type() == VIDEO_FLAG_TYPE_CGA);
}
int
video_is_ega_vga(void)
{
return (video_get_type() == VIDEO_FLAG_TYPE_SPECIAL);
}
int
video_is_8514(void)
{
return (video_get_type() == VIDEO_FLAG_TYPE_8514);
}
int
video_is_xga(void)
{
return (video_get_type() == VIDEO_FLAG_TYPE_XGA);
}

View File

@@ -1438,9 +1438,30 @@ banshee_polyfill_continue(voodoo_t *voodoo, uint32_t data)
}
}
static inline void
banshee_do_2d_launch(voodoo_t *voodoo)
{
voodoo->launch_pending = 0;
voodoo->banshee_blt.rops[0] = voodoo->banshee_blt.command >> 24;
voodoo->banshee_blt.patoff_x = (voodoo->banshee_blt.command & COMMAND_PATOFF_X_MASK) >> COMMAND_PATOFF_X_SHIFT;
voodoo->banshee_blt.patoff_y = (voodoo->banshee_blt.command & COMMAND_PATOFF_Y_MASK) >> COMMAND_PATOFF_Y_SHIFT;
voodoo->banshee_blt.cur_x = 0;
voodoo->banshee_blt.cur_y = 0;
voodoo->banshee_blt.dstX = ((int32_t) (voodoo->banshee_blt.dstXY << 19)) >> 19;
voodoo->banshee_blt.dstY = ((int32_t) (voodoo->banshee_blt.dstXY << 3)) >> 19;
voodoo->banshee_blt.srcX = ((int32_t) (voodoo->banshee_blt.srcXY << 19)) >> 19;
voodoo->banshee_blt.srcY = ((int32_t) (voodoo->banshee_blt.srcXY << 3)) >> 19;
voodoo->banshee_blt.old_srcX = voodoo->banshee_blt.srcX;
voodoo->banshee_blt.host_data_remainder = 0;
voodoo->banshee_blt.host_data_count = 0;
}
static void
banshee_do_2d_blit(voodoo_t *voodoo, int count, uint32_t data)
{
if (voodoo->launch_pending) {
banshee_do_2d_launch(voodoo);
}
switch (voodoo->banshee_blt.command & COMMAND_CMD_MASK) {
case COMMAND_CMD_NOP:
break;
@@ -1691,21 +1712,7 @@ voodoo_2d_reg_writel(voodoo_t *voodoo, uint32_t addr, uint32_t val)
case 0x70:
voodoo_wait_for_render_thread_idle(voodoo);
voodoo->banshee_blt.command = val;
voodoo->banshee_blt.rops[0] = val >> 24;
#if 0
bansheeblt_log("command=%x %08x\n", voodoo->banshee_blt.command & COMMAND_CMD_MASK, val);
#endif
voodoo->banshee_blt.patoff_x = (val & COMMAND_PATOFF_X_MASK) >> COMMAND_PATOFF_X_SHIFT;
voodoo->banshee_blt.patoff_y = (val & COMMAND_PATOFF_Y_MASK) >> COMMAND_PATOFF_Y_SHIFT;
voodoo->banshee_blt.cur_x = 0;
voodoo->banshee_blt.cur_y = 0;
voodoo->banshee_blt.dstX = ((int32_t) (voodoo->banshee_blt.dstXY << 19)) >> 19;
voodoo->banshee_blt.dstY = ((int32_t) (voodoo->banshee_blt.dstXY << 3)) >> 19;
voodoo->banshee_blt.srcX = ((int32_t) (voodoo->banshee_blt.srcXY << 19)) >> 19;
voodoo->banshee_blt.srcY = ((int32_t) (voodoo->banshee_blt.srcXY << 3)) >> 19;
voodoo->banshee_blt.old_srcX = voodoo->banshee_blt.srcX;
voodoo->banshee_blt.host_data_remainder = 0;
voodoo->banshee_blt.host_data_count = 0;
voodoo->launch_pending = 1;
switch (voodoo->banshee_blt.command & COMMAND_CMD_MASK) {
#if 0
@@ -1725,6 +1732,7 @@ voodoo_2d_reg_writel(voodoo_t *voodoo, uint32_t addr, uint32_t val)
#endif
case COMMAND_CMD_POLYFILL:
banshee_do_2d_launch(voodoo);
if (val & COMMAND_INITIATE) {
voodoo->banshee_blt.dstXY = voodoo->banshee_blt.srcXY;
voodoo->banshee_blt.dstX = voodoo->banshee_blt.srcX;
@@ -1733,6 +1741,10 @@ voodoo_2d_reg_writel(voodoo_t *voodoo, uint32_t addr, uint32_t val)
banshee_polyfill_start(voodoo);
break;
case COMMAND_CMD_HOST_TO_SCREEN_BLT:
case COMMAND_CMD_HOST_TO_SCREEN_STRETCH_BLT:
break;
default:
if (val & COMMAND_INITIATE) {
banshee_do_2d_blit(voodoo, -1, 0);
@@ -1779,6 +1791,9 @@ voodoo_2d_reg_writel(voodoo_t *voodoo, uint32_t addr, uint32_t val)
#if 0
bansheeblt_log("launch %08x %08x %08x %08x\n", voodoo->banshee_blt.command, voodoo->banshee_blt.commandExtra, voodoo->banshee_blt.srcColorkeyMin, voodoo->banshee_blt.srcColorkeyMax);
#endif
if (voodoo->launch_pending) {
banshee_do_2d_launch(voodoo);
}
switch (voodoo->banshee_blt.command & COMMAND_CMD_MASK) {
case COMMAND_CMD_SCREEN_TO_SCREEN_BLT:
voodoo->banshee_blt.srcXY = val;

View File

@@ -218,14 +218,7 @@ skip_pixel_blit:
break;
case BLIT_COMMAND_CPU_TO_SCREEN:
voodoo->blt.dst_x = voodoo->bltDstX;
voodoo->blt.dst_y = voodoo->bltDstY;
voodoo->blt.cur_x = 0;
voodoo->blt.size_x = size_x;
voodoo->blt.size_y = size_y;
voodoo->blt.x_dir = x_dir;
voodoo->blt.y_dir = y_dir;
voodoo->blt.dst_stride = (voodoo->bltCommand & BLTCMD_DST_TILED) ? ((voodoo->bltDstXYStride & 0x3f) * 32 * 2) : (voodoo->bltDstXYStride & 0xff8);
voodoo->launch_pending = 1;
break;
case BLIT_COMMAND_RECT_FILL:
@@ -234,13 +227,13 @@ skip_pixel_blit:
int dst_x = voodoo->bltDstX;
if (SLI_ENABLED) {
if ((!(voodoo->initEnable & INITENABLE_SLI_MASTER_SLAVE) && (voodoo->blt.dst_y & 1)) || ((voodoo->initEnable & INITENABLE_SLI_MASTER_SLAVE) && !(voodoo->blt.dst_y & 1)))
if ((!(voodoo->initEnable & INITENABLE_SLI_MASTER_SLAVE) && (dst_y & 1)) || ((voodoo->initEnable & INITENABLE_SLI_MASTER_SLAVE) && !(dst_y & 1)))
goto skip_line_fill;
dst = (uint16_t *) &voodoo->fb_mem[dst_base_addr + (dst_y >> 1) * dst_stride];
} else
dst = (uint16_t *) &voodoo->fb_mem[dst_base_addr + dst_y * dst_stride];
for (int x = 0; x <= size_x; x++) {
for (int x = 0; x < size_x; x++) {
if (voodoo->bltCommand & BLIT_CLIPPING_ENABLED) {
if (dst_x < voodoo->bltClipLeft || dst_x >= voodoo->bltClipRight || dst_y < voodoo->bltClipLowY || dst_y >= voodoo->bltClipHighY)
goto skip_pixel_fill;
@@ -303,6 +296,18 @@ voodoo_v2_blit_data(voodoo_t *voodoo, uint32_t data)
if ((voodoo->bltCommand & BLIT_COMMAND_MASK) != BLIT_COMMAND_CPU_TO_SCREEN)
return;
if (voodoo->launch_pending) {
voodoo->blt.dst_x = voodoo->bltDstX;
voodoo->blt.dst_y = voodoo->bltDstY;
voodoo->blt.cur_x = 0;
voodoo->blt.size_x = voodoo->bltSizeX;
voodoo->blt.size_y = voodoo->bltSizeY;
voodoo->blt.x_dir = (voodoo->bltSizeX > 0) ? 1 : -1;
voodoo->blt.y_dir = (voodoo->bltSizeY > 0) ? 1 : -1;
voodoo->blt.dst_stride = (voodoo->bltCommand & BLTCMD_DST_TILED) ? ((voodoo->bltDstXYStride & 0x3f) * 32 * 2) : (voodoo->bltDstXYStride & 0xff8);
voodoo->launch_pending = 0;
}
if (SLI_ENABLED) {
addr = base_addr + (voodoo->blt.dst_y >> 1) * voodoo->blt.dst_stride;
dst = (uint16_t *) &voodoo->fb_mem[addr];

View File

@@ -645,6 +645,8 @@ skip_draw:
if (voodoo->dirty_line_high > voodoo->dirty_line_low || force_blit)
svga_doblit(voodoo->h_disp, voodoo->v_disp - 1, voodoo->svga);
else if (voodoo->svga->override)
voodoo->svga->monitor->mon_renderedframes++;
if (voodoo->clutData_dirty) {
voodoo->clutData_dirty = 0;
voodoo_calc_clutData(voodoo);

View File

@@ -254,6 +254,19 @@ voodoo_fb_writew(uint32_t addr, uint16_t val, void *priv)
int colbfog_g = 0;
int colbfog_b = 0;
if (params->fbzMode & FBZ_STIPPLE) {
if (params->fbzMode & FBZ_STIPPLE_PATT) {
int index = ((y & 3) << 3) | (~x & 7);
if (!(params->stipple & (1 << index)))
goto skip_pixel;
} else {
voodoo->params.stipple = (voodoo->params.stipple << 1) | (voodoo->params.stipple >> 31);
if (!(voodoo->params.stipple & 0x80000000)) {
goto skip_pixel;
}
}
}
if (params->fbzMode & FBZ_DEPTH_ENABLE) {
uint16_t old_depth = *(uint16_t *) (&voodoo->fb_mem[write_addr_aux & voodoo->fb_mask]);
@@ -449,6 +462,19 @@ voodoo_fb_writel(uint32_t addr, uint32_t val, void *priv)
int colbfog_g = 0;
int colbfog_b = 0;
if (params->fbzMode & FBZ_STIPPLE) {
if (params->fbzMode & FBZ_STIPPLE_PATT) {
int index = ((y & 3) << 3) | (~(x + c) & 7);
if (!(params->stipple & (1 << index)))
goto skip_pixel;
} else {
voodoo->params.stipple = (voodoo->params.stipple << 1) | (voodoo->params.stipple >> 31);
if (!(voodoo->params.stipple & 0x80000000)) {
goto skip_pixel;
}
}
}
if (params->fbzMode & FBZ_DEPTH_ENABLE) {
uint16_t old_depth = *(uint16_t *) (&voodoo->fb_mem[write_addr_aux & voodoo->fb_mask]);

View File

@@ -88,6 +88,8 @@ typedef struct voodoo_state_t {
uint32_t texBaseAddr;
int lod_frac[2];
int stipple;
} voodoo_state_t;
#ifdef ENABLE_VOODOO_RENDER_LOG
@@ -990,6 +992,20 @@ voodoo_half_triangle(voodoo_t *voodoo, voodoo_params_t *params, voodoo_state_t *
w_depth = 0xffff;
}
if (params->fbzMode & FBZ_STIPPLE) {
if (params->fbzMode & FBZ_STIPPLE_PATT) {
int index = ((real_y & 3) << 3) | (~x & 7);
if (!(state->stipple & (1 << index)))
goto skip_pixel;
} else {
state->stipple = (state->stipple << 1) | (state->stipple >> 31);
if (!(state->stipple & 0x80000000)) {
goto skip_pixel;
}
}
}
#if 0
w_depth = CLAMP16(w_depth);
#endif
@@ -1560,6 +1576,7 @@ voodoo_render_log("voodoo_triangle %i %i %i : vA %f, %f vB %f, %f vC %f, %f f
if (lodbias & 0x20)
lodbias |= ~0x3f;
state.tmu[1].lod = LOD + (lodbias << 6);
state.stipple = params->stipple;
voodoo_half_triangle(voodoo, params, &state, vertexAy_adjusted, vertexCy_adjusted, odd_even);
}

View File

@@ -886,7 +886,7 @@ wy700_init(UNUSED(const device_t *info))
/* 128k video RAM */
wy700->vram = malloc(0x20000);
loadfont("roms/video/wyse700/wy700.rom", 3);
video_load_font("roms/video/wyse700/wy700.rom", FONT_FORMAT_WY700, LOAD_FONT_NO_OFFSET);
timer_add(&wy700->timer, wy700_poll, wy700, 1);

View File

@@ -8,37 +8,8 @@
*
* Main video-rendering module.
*
* Video timing settings -
*
* 8-bit - 1mb/sec
* B = 8 ISA clocks
* W = 16 ISA clocks
* L = 32 ISA clocks
*
* Slow 16-bit - 2mb/sec
* B = 6 ISA clocks
* W = 8 ISA clocks
* L = 16 ISA clocks
*
* Fast 16-bit - 4mb/sec
* B = 3 ISA clocks
* W = 3 ISA clocks
* L = 6 ISA clocks
*
* Slow VLB/PCI - 8mb/sec (ish)
* B = 4 bus clocks
* W = 8 bus clocks
* L = 16 bus clocks
*
* Mid VLB/PCI -
* B = 4 bus clocks
* W = 5 bus clocks
* L = 10 bus clocks
*
* Fast VLB/PCI -
* B = 3 bus clocks
* W = 3 bus clocks
* L = 4 bus clocks
* Video timings are set individually by the graphics cards.
*
*
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -79,8 +50,6 @@ uint8_t edatlookup[4][4];
uint8_t egaremap2bpp[256];
uint8_t fontdat[2048][8]; /* IBM CGA font */
uint8_t fontdatm[2048][16]; /* IBM MDA font */
uint8_t fontdat2[2048][8]; /* IBM CGA 2nd instance font */
uint8_t fontdatm2[2048][16]; /* IBM MDA 2nd instance font */
uint8_t fontdatw[512][32]; /* Wyse700 font */
uint8_t fontdat8x12[256][16]; /* MDSI Genius font */
uint8_t fontdat12x18[256][36]; /* IM1024 font */
@@ -793,30 +762,6 @@ hline(bitmap_t *b, int x1, int y, int x2, uint32_t col)
b->line[y][x] = col;
}
void
blit(UNUSED(bitmap_t *src), UNUSED(bitmap_t *dst), UNUSED(int x1), UNUSED(int y1), UNUSED(int x2), UNUSED(int y2), UNUSED(int xs), UNUSED(int ys))
{
//
}
void
stretch_blit(UNUSED(bitmap_t *src), UNUSED(bitmap_t *dst), UNUSED(int x1), UNUSED(int y1), UNUSED(int xs1), UNUSED(int ys1), UNUSED(int x2), UNUSED(int y2), UNUSED(int xs2), UNUSED(int ys2))
{
//
}
void
rectfill(UNUSED(bitmap_t *b), UNUSED(int x1), UNUSED(int y1), UNUSED(int x2), UNUSED(int y2), UNUSED(uint32_t col))
{
//
}
void
set_palette(UNUSED(PALETTE p))
{
//
}
void
destroy_bitmap(bitmap_t *b)
{
@@ -1005,10 +950,18 @@ video_force_resize_set_monitor(uint8_t res, int monitor_index)
}
void
loadfont_common(FILE *fp, int format)
video_load_font(char *fn, int format, int offset)
{
FILE *fp;
fp = rom_fopen(fn, "rb");
if (fp == NULL)
return;
fseek(fp, offset, SEEK_SET);
switch (format) {
case 0: /* MDA */
case FONT_FORMAT_MDA: /* MDA */
for (uint16_t c = 0; c < 256; c++) /* 8x14 MDA in 8x8 cell (lines 0-7) */
for (uint8_t d = 0; d < 8; d++)
fontdatm[c][d] = fgetc(fp) & 0xff;
@@ -1021,7 +974,7 @@ loadfont_common(FILE *fp, int format)
fontdat[c][d] = fgetc(fp) & 0xff;
break;
case 1: /* PC200 */
case FONT_FORMAT_PC200: /* PC200 */
for (uint8_t d = 0; d < 4; d++) {
/* There are 4 fonts in the ROM */
for (uint16_t c = 0; c < 256; c++) /* 8x14 MDA in 8x16 cell */
@@ -1033,26 +986,25 @@ loadfont_common(FILE *fp, int format)
}
break;
default:
case 2: /* CGA */
case FONT_FORMAT_CGA: /* CGA */
for (uint16_t c = 0; c < 256; c++)
for (uint8_t d = 0; d < 8; d++)
fontdat[c][d] = fgetc(fp) & 0xff;
break;
case 3: /* Wyse 700 */
case FONT_FORMAT_WY700: /* Wyse 700 */
for (uint16_t c = 0; c < 512; c++)
for (uint8_t d = 0; d < 32; d++)
fontdatw[c][d] = fgetc(fp) & 0xff;
break;
case 4: /* MDSI Genius */
case FONT_FORMAT_MDSI_GENIUS: /* MDSI Genius */
for (uint16_t c = 0; c < 256; c++)
for (uint8_t d = 0; d < 16; d++)
fontdat8x12[c][d] = fgetc(fp) & 0xff;
break;
case 5: /* Toshiba 3100e */
case FONT_FORMAT_TOSHIBA_3100E: /* Toshiba 3100e */
for (uint16_t d = 0; d < 2048; d += 512) { /* Four languages... */
for (uint16_t c = d; c < d + 256; c++) {
(void) !fread(&fontdatm[c][8], 1, 8, fp);
@@ -1076,7 +1028,7 @@ loadfont_common(FILE *fp, int format)
}
break;
case 6: /* Korean KSC-5601 */
case FONT_FORMAT_KSC6501: /* Korean KSC-5601 */
if (!fontdatksc5601)
fontdatksc5601 = malloc(16384 * sizeof(dbcs_font_t));
@@ -1089,7 +1041,7 @@ loadfont_common(FILE *fp, int format)
}
break;
case 7: /* Sigma Color 400 */
case FONT_FORMAT_SIGMA: /* Sigma Color 400 */
/* The first 4k of the character ROM holds an 8x8 font */
for (uint16_t c = 0; c < 256; c++) {
(void) !fread(&fontdat[c][0], 1, 8, fp);
@@ -1098,62 +1050,32 @@ loadfont_common(FILE *fp, int format)
/* The second 4k holds an 8x16 font */
for (uint16_t c = 0; c < 256; c++) {
if (fread(&fontdatm[c][0], 1, 16, fp) != 16)
fatal("loadfont(): Error reading 8x16 font in Sigma Color 400 mode, c = %i\n", c);
fatal("video_load_font(): Error reading 8x16 font in Sigma Color 400 mode, c = %i\n", c);
}
break;
case 8: /* Amstrad PC1512, Toshiba T1000/T1200 */
case FONT_FORMAT_PC1512_T1000: /* Amstrad PC1512, Toshiba T1000/T1200 */
for (uint16_t c = 0; c < 2048; c++) /* Allow up to 2048 chars */
for (uint8_t d = 0; d < 8; d++)
fontdat[c][d] = fgetc(fp) & 0xff;
break;
case 9: /* Image Manager 1024 native font */
case FONT_FORMAT_IM1024: /* Image Manager 1024 native font */
for (uint16_t c = 0; c < 256; c++)
(void) !fread(&fontdat12x18[c][0], 1, 36, fp);
break;
case 10: /* Pravetz */
case FONT_FORMAT_PRAVETZ: /* Pravetz */
for (uint16_t c = 0; c < 1024; c++) /* Allow up to 1024 chars */
for (uint8_t d = 0; d < 8; d++)
fontdat[c][d] = fgetc(fp) & 0xff;
break;
case 11: /* PC200 */
for (uint8_t d = 0; d < 4; d++) {
/* There are 4 fonts in the ROM */
for (uint16_t c = 0; c < 256; c++) /* 8x14 MDA in 8x16 cell */
(void) !fread(&fontdatm2[256 * d + c][0], 1, 16, fp);
for (uint16_t c = 0; c < 256; c++) { /* 8x8 CGA in 8x16 cell */
(void) !fread(&fontdat2[256 * d + c][0], 1, 8, fp);
fseek(fp, 8, SEEK_CUR);
}
}
break;
}
(void) fclose(fp);
}
void
loadfont_ex(char *fn, int format, int offset)
{
FILE *fp;
fp = rom_fopen(fn, "rb");
if (fp == NULL)
return;
fseek(fp, offset, SEEK_SET);
loadfont_common(fp, format);
}
void
loadfont(char *fn, int format)
{
loadfont_ex(fn, format, 0);
}
uint32_t
video_color_transform(uint32_t color)
{

View File

@@ -1,6 +1,6 @@
{
"name": "86box",
"version-string": "5.3",
"version-string": "5.4",
"homepage": "https://86box.net/",
"documentation": "https://86box.readthedocs.io/",
"license": "GPL-2.0-or-later",