Merge branch '86Box:master' into pot-po-upd

This commit is contained in:
Nelson Kerber Hennemann Filho
2025-07-28 08:39:34 -03:00
committed by GitHub
10 changed files with 55 additions and 22 deletions

View File

@@ -121,11 +121,11 @@ typedef struct mke_t {
uint32_t data_to_push;
pc_timer_t timer;
uint8_t *ver;
} mke_t;
mke_t mke;
static uint8_t ver[10] = "CR-5630.75";
#ifdef ENABLE_MKE_LOG
int mke_do_log = ENABLE_MKE_LOG;
@@ -144,8 +144,8 @@ mke_log(const char *fmt, ...)
# define mke_log(fmt, ...)
#endif
#define CHECK_READY() \
{ \
#define CHECK_READY() \
{ \
if (mke->cdrom_dev->cd_status == CD_STATUS_EMPTY) { \
fifo8_push(&mke->errors_fifo, 0x03); \
return; \
@@ -614,7 +614,7 @@ mke_command(mke_t *mke, uint8_t value)
case CMD1_READ_VER:
/* SB2CD Expects 12 bytes, but drive only returns 11. */
fifo8_reset(&mke->info_fifo);
fifo8_push_all(&mke->info_fifo, ver, 10);
fifo8_push_all(&mke->info_fifo, mke->ver, 10);
fifo8_push(&mke->info_fifo, mke_cdrom_status(mke->cdrom_dev, mke));
break;
case CMD1_STATUS:
@@ -773,6 +773,22 @@ mke_init(const device_t *info)
if (!dev)
return NULL;
switch (device_get_config_int("firmware")) {
default:
case 0:
mke->ver = "CR-5630.75";
break;
case 1:
mke->ver = "CR-5630.80";
break;
case 2:
mke->ver = "CR-5620.75";
break;
case 3:
mke->ver = "CR-5620.80";
break;
}
fifo8_create(&mke->info_fifo, 128);
fifo8_create(&mke->data_fifo, 624240 * 2);
fifo8_create(&mke->errors_fifo, 8);
@@ -829,6 +845,23 @@ static const device_config_t mke_config[] = {
},
.bios = { { 0 } }
},
{
.name = "firmware",
.description = "Firmware Version",
.type = CONFIG_SELECTION,
.default_string = NULL,
.default_int = 0,
.file_filter = NULL,
.spinner = { 0 },
.selection = {
{ .description = "CR-563 0.75", .value = 0 },
{ .description = "CR-563 0.80", .value = 1 },
{ .description = "CR-562 0.75", .value = 2 },
{ .description = "CR-562 0.80", .value = 3 },
{ .description = "" }
},
.bios = { { 0 } }
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format off
};

View File

@@ -840,7 +840,7 @@ recalc_sltptr(scamp_t *dev)
recalc_ems(dev);
}
} else {
for (uint8_t i = 0; i < (sltptr / EMS_PGSIZE); i++)
for (uint32_t i = 0; i < (sltptr / EMS_PGSIZE); i++)
scamp_mem_update_state(dev, i * EMS_PGSIZE, EMS_PGSIZE, 0x00, MEM_FMASK_SLOTBUS);
for (uint8_t i = (sltptr / EMS_PGSIZE); i < 40; i++)

View File

@@ -841,7 +841,7 @@ wd76c10_pf_loc_recalc(wd76c10_t *dev)
uint8_t ems_page;
uint32_t base;
for (uint8_t i = (0x031 + pf_loc); i <= (0x037 + pf_loc); i++) {
for (uint16_t i = (0x031 + pf_loc); i <= (0x037 + pf_loc); i++) {
ems_page = (i - 0x10) & 0xf7;
dev->mem_pages[i] = ems_page;
base = ((uint32_t) i) << 14;

View File

@@ -539,10 +539,9 @@ pfq_write(void)
static uint8_t
pfq_read(void)
{
uint8_t temp, i;
uint8_t temp = pfq[0];
temp = pfq[0];
for (i = 0; i < (pfq_size - 1); i++)
for (int i = 0; i < (pfq_size - 1); i++)
pfq[i] = pfq[i + 1];
pfq_pos--;
cpu_state.pc = (cpu_state.pc + 1) & 0xffff;

View File

@@ -595,7 +595,7 @@ load_texture(const char *f, struct shader_texture *tex)
int bpp = 4;
GLubyte *data = (GLubyte *) malloc(width * height * bpp);
GLubyte *data = (GLubyte *) malloc((size_t) width * height * bpp);
int x, y, Y;
for (y = 0; y < height; ++y) {
@@ -1709,7 +1709,7 @@ OpenGLRenderer::render()
plat_tempfile(fn, NULL, (char*)".png");
strcat(path, fn);
unsigned char *rgba = (unsigned char *)calloc(1, width * height * 4);
unsigned char *rgba = (unsigned char *) calloc(1, (size_t) width * height * 4);
glw.glFinish();
glw.glReadPixels(window_rect.x, window_rect.y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, rgba);

View File

@@ -436,7 +436,8 @@ note_on(uint8_t note, uint8_t velocity, MIDI_CHANNEL_DATA *midi_channel, opl4_mi
const YRW801_REGION_DATA_PTR *region_ptr = &snd_yrw801_regions[0];
const YRW801_WAVE_DATA *wave_data[2];
VOICE_DATA *voice[2];
uint8_t i = 0, voices = 0;
int i = 0;
uint8_t voices = 0;
while (opl4_midi->gen_in_progress) { }

View File

@@ -511,7 +511,7 @@ bochs_vbe_outw(const uint16_t addr, const uint16_t val, void *priv)
svga_recalctimings(&dev->svga);
if (!(val & VBE_DISPI_NOCLEARMEM)) {
memset(dev->svga.vram, 0,
dev->vbe_regs[VBE_DISPI_INDEX_YRES] * dev->svga.rowoffset);
(size_t) dev->vbe_regs[VBE_DISPI_INDEX_YRES] * dev->svga.rowoffset);
}
} else
dev->svga.read_bank = dev->svga.write_bank = 0;

View File

@@ -1212,7 +1212,7 @@ svga_recalctimings(svga_t *svga)
int y_start = enable_overscan ? 0 : (svga->monitor->mon_overscan_y >> 1);
int x_start = enable_overscan ? 0 : (svga->monitor->mon_overscan_x >> 1);
video_wait_for_buffer_monitor(svga->monitor_index);
memset(svga->monitor->target_buffer->dat, 0, svga->monitor->target_buffer->w * svga->monitor->target_buffer->h * 4);
memset(svga->monitor->target_buffer->dat, 0, (size_t) svga->monitor->target_buffer->w * svga->monitor->target_buffer->h * 4);
video_blit_memtoscreen_monitor(x_start, y_start, svga->monitor->mon_xsize + x_add, svga->monitor->mon_ysize + y_add, svga->monitor_index);
video_wait_for_buffer_monitor(svga->monitor_index);
svga->dpms_ui = 1;

View File

@@ -746,7 +746,7 @@ svga_render_indexed_gfx(svga_t *svga, bool highres, bool combine8bits)
if (svga->render_line_offset) {
if (svga->render_line_offset > 0) {
memset(p, svga->overscan_color, charwidth * svga->render_line_offset * sizeof(uint32_t));
memset(p, svga->overscan_color, (size_t) charwidth * svga->render_line_offset * sizeof(uint32_t));
p += charwidth * svga->render_line_offset;
}
}
@@ -911,7 +911,7 @@ svga_render_indexed_gfx(svga_t *svga, bool highres, bool combine8bits)
if (svga->render_line_offset < 0) {
uint32_t *orig_line = &svga->monitor->target_buffer->line[svga->displine + svga->y_add][svga->x_add];
memmove(orig_line, orig_line + (charwidth * -svga->render_line_offset), (svga->hdisp) * 4);
memset((orig_line + svga->hdisp) - (charwidth * -svga->render_line_offset), svga->overscan_color, charwidth * -svga->render_line_offset * 4);
memset((orig_line + svga->hdisp) - (charwidth * -svga->render_line_offset), svga->overscan_color, (size_t) charwidth * -svga->render_line_offset * 4);
}
}

View File

@@ -1058,20 +1058,20 @@ loadfont_common(FILE *fp, int format)
for (uint16_t c = d; c < d + 256; c++) {
(void) !fread(&fontdatm[c][8], 1, 8, fp);
}
for (uint16_t c = d + 256; c < d + 512; c++) {
for (uint32_t c = d + 256; c < d + 512; c++) {
(void) !fread(&fontdatm[c][8], 1, 8, fp);
}
for (uint16_t c = d; c < d + 256; c++) {
for (uint32_t c = d; c < d + 256; c++) {
(void) !fread(&fontdatm[c][0], 1, 8, fp);
}
for (uint16_t c = d + 256; c < d + 512; c++) {
for (uint32_t c = d + 256; c < d + 512; c++) {
(void) !fread(&fontdatm[c][0], 1, 8, fp);
}
fseek(fp, 4096, SEEK_CUR); /* Skip blank section */
for (uint16_t c = d; c < d + 256; c++) {
for (uint32_t c = d; c < d + 256; c++) {
(void) !fread(&fontdat[c][0], 1, 8, fp);
}
for (uint16_t c = d + 256; c < d + 512; c++) {
for (uint32_t c = d + 256; c < d + 512; c++) {
(void) !fread(&fontdat[c][0], 1, 8, fp);
}
}