Merge remote-tracking branch 'origin/master' into feature/recompiler_improvements

This commit is contained in:
OBattler
2025-12-21 20:58:18 +01:00
57 changed files with 3470 additions and 404 deletions

View File

@@ -1042,12 +1042,21 @@ usage:
path_append_filename(temp, exe_path, "assets");
asset_add_path(temp);
#ifdef __APPLE__
#if defined(__APPLE__)
// Add the standard asset path within the app bundle.
if (contents_path[0] != '\0') {
path_append_filename(temp, contents_path, "Resources/assets");
asset_add_path(temp);
}
#elif !defined(_WIN32)
// Add the standard asset paths within the AppImage.
p = getenv("APPDIR");
if (p && (p[0] != '\0')) {
path_append_filename(temp, p, "usr/local/share/" EMU_NAME "/assets");
asset_add_path(temp);
path_append_filename(temp, p, "usr/share/" EMU_NAME "/assets");
asset_add_path(temp);
}
#endif
plat_init_asset_paths();
@@ -2132,17 +2141,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

@@ -676,7 +676,6 @@ generate_call:
if ((recomp_op_table == recomp_opcodes) && (opcode == 0x48))
goto codegen_skip;
#endif
if (in_lock && ((opcode == 0x90) || (opcode == 0xec)))
goto codegen_skip;

View File

@@ -258,6 +258,7 @@ RecompOpFn recomp_opcodes_d8[512] = {
RecompOpFn recomp_opcodes_d9[512] = {
// clang-format off
/* TODO: Fix the recompilation of D9 44 so Blood II's gameplay music no longer breaks! */
/*16-bit data*/
/* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/
/*00*/ ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -265,7 +266,7 @@ RecompOpFn recomp_opcodes_d9[512] = {
/*20*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*30*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW,
/*40*/ ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*40*/ ropFLDs, ropFLDs, ropFLDs, ropFLDs, NULL, ropFLDs, ropFLDs, ropFLDs, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*50*/ ropFSTs, ropFSTs, ropFSTs, ropFSTs, ropFSTs, ropFSTs, ropFSTs, ropFSTs, ropFSTPs, ropFSTPs, ropFSTPs, ropFSTPs, ropFSTPs, ropFSTPs, ropFSTPs, ropFSTPs,
/*60*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*70*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW,
@@ -287,7 +288,7 @@ RecompOpFn recomp_opcodes_d9[512] = {
/*20*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*30*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW,
/*40*/ ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, ropFLDs, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*40*/ ropFLDs, ropFLDs, ropFLDs, ropFLDs, NULL, ropFLDs, ropFLDs, ropFLDs, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*50*/ ropFSTs, ropFSTs, ropFSTs, ropFSTs, ropFSTs, ropFSTs, ropFSTs, ropFSTs, ropFSTPs, ropFSTPs, ropFSTPs, ropFSTPs, ropFSTPs, ropFSTPs, ropFSTPs, ropFSTPs,
/*60*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
/*70*/ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW, ropFSTCW,

View File

@@ -408,8 +408,7 @@ load_machine(void)
p = ini_section_get_string(cat, "cpu_family", NULL);
if (p) {
/* Migrate CPU family changes. */
if ((!strcmp(machines[machine].internal_name, "deskpro386") ||
!strcmp(machines[machine].internal_name, "deskpro386_05_1988")))
if (machines[machine].init == machine_at_deskpro386_init)
cpu_f = cpu_get_family("i386dx_deskpro386");
else
cpu_f = cpu_get_family(p);
@@ -1511,11 +1510,14 @@ load_floppy_and_cdrom_drives(void)
sprintf(temp, "fdd_%02i_check_bpb", c + 1);
ini_section_delete_var(cat, temp);
}
sprintf(temp, "fdd_%02i_audio", c + 1);
sprintf(temp, "fdd_%02i_audio", c + 1);
#ifndef DISABLE_FDD_AUDIO
p = ini_section_get_string(cat, temp, "none");
int prof = fdd_audio_get_profile_by_internal_name(p);
fdd_set_audio_profile(c, prof);
p = ini_section_get_string(cat, temp, "none");
if (!strcmp(p, "panasonic"))
d = fdd_audio_get_profile_by_internal_name("panasonic_ju4755_40t");
else
d = fdd_audio_get_profile_by_internal_name(p);
fdd_set_audio_profile(c, d);
#else
fdd_set_audio_profile(c, 0);
#endif

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

@@ -204,7 +204,7 @@ postcard_init(UNUSED(const device_t *info))
postcard_port = 0x84; /* ISA Compaq machines */
else if (strstr(machines[machine].name, "Olivetti"))
postcard_port = 0x378; /* Olivetti machines */
else if (!strcmp(machines[machine].internal_name, "isa486c"))
else if (machines[machine].init == machine_at_isa486c_init)
postcard_port = 0x5080; /* ASUS ISA-486C */
else
postcard_port = 0x80; /* AT and clone machines */

View File

@@ -422,7 +422,6 @@ extern int machine_get_type(int m);
extern int machine_get_chipset(int m);
extern void machine_close(void);
extern int machine_has_mouse(void);
extern int machine_is_sony(void);
extern uint8_t machine_compaq_p1_handler(void);
extern uint8_t machine_generic_p1_handler(void);

View File

@@ -50,7 +50,7 @@
/* Web URL info. */
#define EMU_SITE "86box.net"
#define EMU_SITE_W LSTR(EMU_SITE)
#define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest"
#define EMU_ROMS_URL "https://github.com/@CMAKE_PROJECT_NAME@/roms/releases/latest"
#define EMU_ROMS_URL_W LSTR(EMU_ROMS_URL)
#ifdef RELEASE_BUILD
# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@/"

View File

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

View File

@@ -653,14 +653,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 +767,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 +3254,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

@@ -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

@@ -432,6 +432,33 @@ static const device_config_t bx6_config[] = {
.size = 131072,
.files = { "roms/machines/bx6/BX6_EG.BIN", "" }
},
{
.name = "Award Modular BIOS v4.51PG - Revision CW",
.internal_name = "bx6_CW",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 131072,
.files = { "roms/machines/bx6/BX6_CW.bin", "" }
},
{
.name = "Award Modular BIOS v4.51PG - Revision GQ",
.internal_name = "bx6_GQ",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 131072,
.files = { "roms/machines/bx6/BX6_GQ.bin", "" }
},
{
.name = "Award Modular BIOS v4.51PG - Revision JL",
.internal_name = "bx6_JL",
.bios_type = BIOS_NORMAL,
.files_no = 1,
.local = 0,
.size = 131072,
.files = { "roms/machines/bx6/BX6_JL.bin", "" }
},
{
.name = "Award Modular BIOS v4.51PG - Revision QS",
.internal_name = "bx6_qs",

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

@@ -20715,12 +20715,6 @@ machine_has_mouse(void)
return (machines[machine].flags & MACHINE_MOUSE);
}
int
machine_is_sony(void)
{
return (!strcmp(machines[machine].internal_name, "pcv90"));
}
const char *
machine_get_nvr_name_ex(int m)
{

View File

@@ -55,64 +55,54 @@ rom_log(const char *fmt, ...)
# define rom_log(fmt, ...)
#endif
static void
add_path(rom_path_t *list, const char *path)
{
rom_path_t *rom_path = calloc(1, sizeof(rom_path_t));
/* Save the path, turning it into absolute if needed. */
if (!path_abs((char *) path)) {
plat_getcwd(rom_path->path, sizeof(rom_path->path));
path_append_filename(rom_path->path, rom_path->path, path);
} else {
strncpy(rom_path->path, path, sizeof(rom_path->path) - 1);
}
/* Ensure the path ends with a separator. */
path_slash(rom_path->path);
/* Iterate to the end of the list. */
if (list->path[0] != '\0') {
while (1) {
/* Check for duplicates. */
if (!strcmp(list->path, rom_path->path)) {
free(rom_path);
return;
}
if (list->next == NULL)
break;
list = list->next;
}
/* Add the new entry. */
list->next = rom_path;
} else {
/* Set path on the first entry. */
memcpy(list, rom_path, sizeof(rom_path_t));
free(rom_path);
}
}
void
rom_add_path(const char *path)
{
char cwd[1024] = { 0 };
rom_path_t *rom_path = &rom_paths;
if (rom_paths.path[0] != '\0') {
// Iterate to the end of the list.
while (rom_path->next != NULL) {
rom_path = rom_path->next;
}
// Allocate the new entry.
rom_path = rom_path->next = calloc(1, sizeof(rom_path_t));
}
// Save the path, turning it into absolute if needed.
if (!path_abs((char *) path)) {
plat_getcwd(cwd, sizeof(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.
path_slash(rom_path->path);
add_path(&rom_paths, path);
}
void
asset_add_path(const char *path)
{
char cwd[1024] = { 0 };
rom_path_t *asset_path = &asset_paths;
if (asset_paths.path[0] != '\0') {
// Iterate to the end of the list.
while (asset_path->next != NULL) {
asset_path = asset_path->next;
}
// Allocate the new entry.
asset_path = asset_path->next = calloc(1, sizeof(rom_path_t));
}
// Save the path, turning it into absolute if needed.
if (!path_abs((char *) path)) {
plat_getcwd(cwd, sizeof(cwd));
path_slash(cwd);
snprintf(asset_path->path, sizeof(asset_path->path), "%s%s", cwd, path);
} else {
snprintf(asset_path->path, sizeof(asset_path->path), "%s", path);
}
// Ensure the path ends with a separator.
path_slash(asset_path->path);
add_path(&asset_paths, path);
}
static int

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

File diff suppressed because it is too large Load Diff

View File

@@ -160,7 +160,7 @@ 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"
@@ -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"
@@ -292,7 +292,7 @@ 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"
@@ -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"
@@ -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 "%1 configuración de dispositivo"
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"
@@ -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

@@ -273,7 +273,7 @@ plat_getcwd(char *bufp, int max)
strncpy(bufp, exe_path, max);
# else
CharPointer(bufp, max) = QDir::homePath().toUtf8();
path_append_filename(bufp, bufp, "Library/86Box");
path_append_filename(bufp, bufp, "Library/" EMU_NAME);
# endif
#else
CharPointer(bufp, max) = QDir::currentPath().toUtf8();
@@ -828,10 +828,10 @@ plat_init_rom_paths(void)
for (auto &path : paths) {
#ifdef __APPLE__
rom_add_path(QDir(path).filePath("net.86Box.86Box/roms").toUtf8().constData());
rom_add_path(QDir(path).filePath("86Box/roms").toUtf8().constData());
rom_add_path(QDir(path).filePath("net." EMU_NAME "." EMU_NAME "/roms").toUtf8().constData());
rom_add_path(QDir(path).filePath(EMU_NAME "/roms").toUtf8().constData());
#else
rom_add_path(QDir(path).filePath("86Box/roms").toUtf8().constData());
rom_add_path(QDir(path).filePath(EMU_NAME "/roms").toUtf8().constData());
#endif
}
}
@@ -852,10 +852,10 @@ plat_init_asset_paths(void)
for (auto &path : paths) {
#ifdef __APPLE__
asset_add_path(QDir(path).filePath("net.86Box.86Box/assets").toUtf8().constData());
asset_add_path(QDir(path).filePath("86Box/assets").toUtf8().constData());
asset_add_path(QDir(path).filePath("net." EMU_NAME "." EMU_NAME "/assets").toUtf8().constData());
asset_add_path(QDir(path).filePath(EMU_NAME "/assets").toUtf8().constData());
#else
asset_add_path(QDir(path).filePath("86Box/assets").toUtf8().constData());
asset_add_path(QDir(path).filePath(EMU_NAME "/assets").toUtf8().constData());
#endif
}
}

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

@@ -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

@@ -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

@@ -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;
@@ -691,9 +688,9 @@ ui_msgbox_header(int flags, void *header, void *message)
if (!header) {
if (flags & MBX_ANSI)
header = (void *) "86Box";
header = (void *) EMU_NAME;
else
header = (void *) L"86Box";
header = (void *) EMU_NAME_W;
}
msgbtn.buttonid = 1;
@@ -736,7 +733,7 @@ plat_get_exe_name(char *s, int size)
{
char *basepath = SDL_GetBasePath();
snprintf(s, size, "%s%s", basepath, basepath[strlen(basepath) - 1] == '/' ? "86box" : "/86box");
snprintf(s, size, "%s%s", basepath, basepath[strlen(basepath) - 1] == '/' ? EMU_NAME : "/" EMU_NAME);
}
void
@@ -830,7 +827,7 @@ plat_init_rom_paths(void)
char xdg_rom_path[TMP_PATH_BUFSIZE] = {0};
size_t used = snprintf(xdg_rom_path, sizeof(xdg_rom_path), "%s/", xdg_data_home);
if (used < sizeof(xdg_rom_path))
used += snprintf(xdg_rom_path + used, sizeof(xdg_rom_path) - used, "86Box/");
used += snprintf(xdg_rom_path + used, sizeof(xdg_rom_path) - used, EMU_NAME "/");
if (used < sizeof(xdg_rom_path) && !plat_dir_check(xdg_rom_path))
plat_dir_create(xdg_rom_path);
if (used < sizeof(xdg_rom_path))
@@ -850,7 +847,7 @@ plat_init_rom_paths(void)
if (home) {
char home_rom_path[TMP_PATH_BUFSIZE] = {0};
size_t used = snprintf(home_rom_path, sizeof(home_rom_path),
"%s/.local/share/86Box/", home);
"%s/.local/share/" EMU_NAME "/", home);
if (used < sizeof(home_rom_path) && !plat_dir_check(home_rom_path))
plat_dir_create(home_rom_path);
if (used < sizeof(home_rom_path))
@@ -878,7 +875,7 @@ plat_init_rom_paths(void)
char real_xdg_rom_path[TMP_PATH_BUFSIZE] = {0};
size_t used = snprintf(real_xdg_rom_path,
sizeof(real_xdg_rom_path),
"%s/86Box/roms/", cur_xdg);
"%s/" EMU_NAME "/roms/", cur_xdg);
if (used < sizeof(real_xdg_rom_path))
rom_add_path(real_xdg_rom_path);
cur_xdg = strtok_r(NULL, ":", &saveptr);
@@ -887,8 +884,8 @@ plat_init_rom_paths(void)
free(xdg_rom_paths);
}
} else {
rom_add_path("/usr/local/share/86Box/roms/");
rom_add_path("/usr/share/86Box/roms/");
rom_add_path("/usr/local/share/" EMU_NAME "/roms/");
rom_add_path("/usr/share/" EMU_NAME "/roms/");
}
#else
char default_rom_path[TMP_PATH_BUFSIZE] = {0};
@@ -906,7 +903,7 @@ plat_init_asset_paths(void)
char xdg_asset_path[TMP_PATH_BUFSIZE] = {0};
size_t used = snprintf(xdg_asset_path, sizeof(xdg_asset_path), "%s/", xdg_data_home);
if (used < sizeof(xdg_asset_path))
used += snprintf(xdg_asset_path + used, sizeof(xdg_asset_path) - used, "86Box/");
used += snprintf(xdg_asset_path + used, sizeof(xdg_asset_path) - used, EMU_NAME "/");
if (used < sizeof(xdg_asset_path) && !plat_dir_check(xdg_asset_path))
plat_dir_create(xdg_asset_path);
if (used < sizeof(xdg_asset_path))
@@ -926,7 +923,7 @@ plat_init_asset_paths(void)
if (home) {
char home_asset_path[TMP_PATH_BUFSIZE] = {0};
size_t used = snprintf(home_asset_path, sizeof(home_asset_path),
"%s/.local/share/86Box/", home);
"%s/.local/share/" EMU_NAME "/", home);
if (used < sizeof(home_asset_path) && !plat_dir_check(home_asset_path))
plat_dir_create(home_asset_path);
if (used < sizeof(home_asset_path))
@@ -954,7 +951,7 @@ plat_init_asset_paths(void)
char real_xdg_asset_path[TMP_PATH_BUFSIZE] = {0};
size_t used = snprintf(real_xdg_asset_path,
sizeof(real_xdg_asset_path),
"%s/86Box/assets/", cur_xdg);
"%s/" EMU_NAME "/assets/", cur_xdg);
if (used < sizeof(real_xdg_asset_path))
asset_add_path(real_xdg_asset_path);
cur_xdg = strtok_r(NULL, ":", &saveptr);
@@ -963,8 +960,8 @@ plat_init_asset_paths(void)
free(xdg_asset_paths);
}
} else {
asset_add_path("/usr/local/share/86Box/assets/");
asset_add_path("/usr/share/86Box/assets/");
asset_add_path("/usr/local/share/" EMU_NAME "/assets/");
asset_add_path("/usr/share/" EMU_NAME "/assets/");
}
#else
char default_asset_path[TMP_PATH_BUFSIZE] = {0};
@@ -986,7 +983,7 @@ plat_get_global_data_dir(char *outbuf, const size_t len)
if (portable_mode) {
strncpy(outbuf, exe_path, len);
} else {
char *prefPath = SDL_GetPrefPath(NULL, "86Box");
char *prefPath = SDL_GetPrefPath(NULL, EMU_NAME);
strncpy(outbuf, prefPath, len);
SDL_free(prefPath);
}
@@ -1109,7 +1106,7 @@ unix_executeLine(char *line)
"pause - pause the the emulated system.\n"
"fullscreen - toggle fullscreen.\n"
"version - print version and license information.\n"
"exit - exit 86Box.\n");
"exit - exit " EMU_NAME ".\n");
} else if (strncasecmp(xargv[0], "exit", 4) == 0) {
exit_event = 1;
} else if (strncasecmp(xargv[0], "version", 7) == 0) {
@@ -1299,7 +1296,7 @@ monitor_thread(UNUSED(void *param))
char *line = NULL;
size_t n;
printf("86Box monitor console.\n");
printf(EMU_NAME " monitor console.\n");
while (!exit_event)
{
if (feof(stdin))
@@ -1307,10 +1304,10 @@ monitor_thread(UNUSED(void *param))
#ifdef ENABLE_READLINE
if (f_readline)
line = f_readline("(86Box) ");
line = f_readline("(" EMU_NAME ") ");
else {
#endif
printf("(86Box) ");
printf("(" EMU_NAME ") ");
(void) !getline(&line, &n, stdin);
#ifdef ENABLE_READLINE
}
@@ -1338,7 +1335,7 @@ main(int argc, char **argv)
if (ret == 0)
return 0;
if (!pc_init_roms()) {
ui_msgbox_header(MBX_FATAL, L"No ROMs found.", L"86Box could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory.");
ui_msgbox_header(MBX_FATAL, L"No ROMs found.", EMU_NAME_W L" could not find any usable ROM images.\n\nPlease download a ROM set and extract it into the \"roms\" directory.");
SDL_Quit();
return 6;
}
@@ -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

@@ -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

@@ -18,6 +18,7 @@
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include <math.h>
#include <stdatomic.h>
#include <86box/86box.h>
#include <86box/io.h>
@@ -5149,7 +5150,7 @@ static uint16_t texture_texel_fetch(mystique_t *mystique, int *tex_r, int *tex_g
*atransp = 0;
break;
case TEXCTL_TEXFORMAT_TW15:
src = ((uint16_t *) svga->vram)[((mystique->dwgreg.texorg >> 1) + (t * tex_pitch) + s) & mystique->vram_mask_w];
src = *(uint16_t*)((&svga->vram[(mystique->dwgreg.texorg + ((t * tex_pitch) + s) * 2) & mystique->vram_mask]));
*tex_r = ((src >> 10) & 0x1f) << 3;
*tex_g = ((src >> 5) & 0x1f) << 3;
*tex_b = (src & 0x1f) << 3;
@@ -5159,7 +5160,7 @@ static uint16_t texture_texel_fetch(mystique_t *mystique, int *tex_r, int *tex_g
*atransp = 0;
break;
case TEXCTL_TEXFORMAT_TW12:
src = ((uint16_t *) svga->vram)[((mystique->dwgreg.texorg >> 1) + (t * tex_pitch) + s) & mystique->vram_mask_w];
src = *(uint16_t*)((&svga->vram[(mystique->dwgreg.texorg + ((t * tex_pitch) + s) * 2) & mystique->vram_mask]));
*tex_r = ((src >> 8) & 0xf) << 4;
*tex_g = ((src >> 4) & 0xf) << 4;
*tex_b = (src & 0xf) << 4;
@@ -5173,7 +5174,7 @@ static uint16_t texture_texel_fetch(mystique_t *mystique, int *tex_r, int *tex_g
}
break;
case TEXCTL_TEXFORMAT_TW16:
src = ((uint16_t *) svga->vram)[((mystique->dwgreg.texorg >> 1) + (t * tex_pitch) + s) & mystique->vram_mask_w];
src = *(uint16_t*)((&svga->vram[(mystique->dwgreg.texorg + ((t * tex_pitch) + s) * 2) & mystique->vram_mask]));
*tex_r = (src >> 11) << 3;
*tex_g = ((src >> 5) & 0x3f) << 2;
*tex_b = (src & 0x1f) << 3;
@@ -5190,6 +5191,40 @@ static double lerp(double v0, double v1, double t) {
return (1. - t) * v0 + t * v1;
}
// Taken from GZDoom.
static inline double
FixedToFloat(int fixed)
{
return fixed * (1.0 / (1 << 16));
}
static inline void
persp_correct(mystique_t* mystique, int* s, int* t, int* q, double* s_frac, double* t_frac)
{
const int s_shift = 20 - (mystique->dwgreg.texwidth & TEXWIDTH_TW_MASK);
const int t_shift = 20 - (mystique->dwgreg.texheight & TEXHEIGHT_TH_MASK);
double s_d = ((*s) >> s_shift);
double t_d = ((*t) >> t_shift);
double q_d = FixedToFloat(*q);
double throwaway1 = 0;
double throwaway2 = 0;
if (q_d == 0.0)
q_d = INFINITY;
s_d *= 1. / q_d;
t_d *= 1. / q_d;
*s_frac = fabs(modf(s_d, &throwaway1));
*t_frac = fabs(modf(s_d, &throwaway2));
(void)throwaway1;
(void)throwaway2;
*s = s_d;
*t = t_d;
}
static int
texture_read(mystique_t *mystique, int *tex_r, int *tex_g, int *tex_b, int *atransp, int *tex_a)
{
@@ -5223,14 +5258,11 @@ texture_read(mystique_t *mystique, int *tex_r, int *tex_g, int *tex_b, int *atra
s_frac = (((int32_t) mystique->dwgreg.tmr[6]) & ((1 << s_shift) - 1)) / (double)(1 << s_shift);
t_frac = (((int32_t) mystique->dwgreg.tmr[7]) & ((1 << t_shift) - 1)) / (double)(1 << t_shift);
} else {
const int s_shift = (20 + 16) - (mystique->dwgreg.texwidth & TEXWIDTH_TW_MASK);
const int t_shift = (20 + 16) - (mystique->dwgreg.texheight & TEXHEIGHT_TH_MASK);
int64_t q = mystique->dwgreg.tmr[8] ? (0x100000000LL / (int64_t) (int32_t) mystique->dwgreg.tmr[8]) : 0;
int q = (int32_t)mystique->dwgreg.tmr[8];
s = (int32_t) mystique->dwgreg.tmr[6];
t = (int32_t) mystique->dwgreg.tmr[7];
s = ((int64_t) (int32_t) mystique->dwgreg.tmr[6] * q) >> s_shift;
t = ((int64_t) (int32_t) mystique->dwgreg.tmr[7] * q) >> t_shift;
s_frac = (((int64_t) (int32_t) mystique->dwgreg.tmr[6] * q) & ((1 << s_shift) - 1)) / (double)(1 << s_shift);
t_frac = (((int64_t) (int32_t) mystique->dwgreg.tmr[7] * q) & ((1 << t_shift) - 1)) / (double)(1 << t_shift);
persp_correct(mystique, &s, &t, &q, &s_frac, &t_frac);
}
if (mystique->dwgreg.texctl & TEXCTL_CLAMPU) {

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

@@ -1693,7 +1693,7 @@ svga_init(const device_t *info, svga_t *svga, void *priv, int memsize,
svga->dispontime = 1000ULL << 32;
svga->dispofftime = 1000ULL << 32;
svga->bpp = 8;
svga->vram = calloc(memsize + 8, 1);
svga->vram = calloc(memsize + 4096, 1);
svga->vram_max = memsize;
svga->vram_display_mask = svga->vram_mask = memsize - 1;
svga->decode_mask = 0x7fffff;

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,7 +227,7 @@ 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
@@ -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)
{