All the changes.

This commit is contained in:
OBattler
2025-07-21 06:07:34 +02:00
parent 509f3f12eb
commit af0498569c
16 changed files with 608 additions and 584 deletions

View File

@@ -3875,19 +3875,31 @@ FP_LOAD_IMM_Q(uint64_t v)
static __inline void
FP_FCHS(void)
{
addbyte(0x48); /* MOVABS RAX, 0x8000000000000000 */
addbyte(0xb8);
addquad(0x8000000000000000);
addbyte(0x66); /* MOVQ XMM15, RAX */
addbyte(0x4c);
addbyte(0x0f);
addbyte(0x6e);
addbyte(0xf8);
addbyte(0x48); /* XOR RAX, RAX */
addbyte(0x31);
addbyte(0xc0);
addbyte(0x8b); /*MOV EAX, TOP*/
addbyte(0x45);
addbyte((uint8_t) cpu_state_offset(TOP));
addbyte(0xf2); /*SUBSD XMM0, XMM0*/
addbyte(0xf3); /*MOVQ XMM0, ST[EAX*8]*/
addbyte(0x0f);
addbyte(0x5c);
addbyte(0xc0);
addbyte(0xf2); /*SUBSD XMM0, ST[EAX*8]*/
addbyte(0x0f);
addbyte(0x5c);
addbyte(0x7e);
addbyte(0x44);
addbyte(0xc5);
addbyte((uint8_t) cpu_state_offset(ST));
addbyte(0x66); /* PXOR XMM0, XMM15 */
addbyte(0x41);
addbyte(0x0F);
addbyte(0xEF);
addbyte(0xC7);
addbyte(0x80); /*AND tag[EAX], ~TAG_UINT64*/
addbyte(0x64);
addbyte(0x05);

View File

@@ -636,9 +636,10 @@ codegen_FCHS(codeblock_t *block, uop_t *uop)
int src_size_a = IREG_GET_SIZE(uop->src_reg_a_real);
if (REG_IS_D(dest_size) && REG_IS_D(src_size_a)) {
host_x86_MOVQ_XREG_XREG(block, REG_XMM_TEMP, src_reg_a);
host_x86_PXOR_XREG_XREG(block, dest_reg, dest_reg);
host_x86_SUBSD_XREG_XREG(block, dest_reg, REG_XMM_TEMP);
host_x86_MOVQ_XREG_XREG(block, dest_reg, src_reg_a);
host_x86_MOV64_REG_IMM(block, REG_RCX, 0x8000000000000000);
host_x86_MOVQ_XREG_REG(block, REG_XMM_TEMP, REG_RCX);
host_x86_PXOR_XREG_XREG(block, dest_reg, REG_XMM_TEMP);
}
# ifdef RECOMPILER_DEBUG
else

View File

@@ -1518,6 +1518,9 @@ load_other_removable_devices(void)
sprintf(temp, "zip_%02i_image_path", c + 1);
p = ini_section_get_string(cat, temp, "");
sprintf(temp, "zip_%02i_writeprot", c + 1);
zip_drives[c].read_only = ini_section_get_int(cat, temp, 0);
if (!strcmp(p, usr_path))
p[0] = 0x00;
@@ -1630,6 +1633,9 @@ load_other_removable_devices(void)
sprintf(temp, "mo_%02i_image_path", c + 1);
p = ini_section_get_string(cat, temp, "");
sprintf(temp, "mo_%02i_writeprot", c + 1);
mo_drives[c].read_only = ini_section_get_int(cat, temp, 0);
if (!strcmp(p, usr_path))
p[0] = 0x00;
@@ -3090,6 +3096,12 @@ save_other_removable_devices(void)
sprintf(temp, "zip_%02i_scsi_id", c + 1);
ini_section_delete_var(cat, temp);
sprintf(temp, "zip_%02i_writeprot", c + 1);
if (zip_drives[c].read_only)
ini_section_set_int(cat, temp, zip_drives[c].read_only);
else
ini_section_delete_var(cat, temp);
sprintf(temp, "zip_%02i_scsi_location", c + 1);
if (zip_drives[c].bus_type != ZIP_BUS_SCSI)
ini_section_delete_var(cat, temp);
@@ -3146,6 +3158,12 @@ save_other_removable_devices(void)
sprintf(temp, "mo_%02i_scsi_id", c + 1);
ini_section_delete_var(cat, temp);
sprintf(temp, "mo_%02i_writeprot", c + 1);
if (mo_drives[c].read_only)
ini_section_set_int(cat, temp, mo_drives[c].read_only);
else
ini_section_delete_var(cat, temp);
sprintf(temp, "mo_%02i_scsi_location", c + 1);
if (mo_drives[c].bus_type != MO_BUS_SCSI)
ini_section_delete_var(cat, temp);

View File

@@ -483,6 +483,7 @@ fdd_load(int drive, char *fn)
drive_empty[drive] = 0;
fdd_forced_seek(drive, 0);
fdd_changed[drive] = 1;
ui_sb_update_icon_wp(SB_FLOPPY | drive, ui_writeprot[drive]);
return;
}
c++;

View File

@@ -5,6 +5,7 @@ typedef struct dev_status_empty_active_t {
atomic_bool_t empty;
atomic_bool_t active;
atomic_bool_t write_active;
atomic_bool_t write_prot;
} dev_status_empty_active_t;
typedef struct dev_status_active_t {

View File

@@ -67,6 +67,7 @@ extern void ui_sb_update_tip(int meaning);
extern void ui_sb_update_icon(int tag, int active);
extern void ui_sb_update_icon_write(int tag, int write);
extern void ui_sb_update_icon_state(int tag, int state);
extern void ui_sb_update_icon_wp(int tag, int state);
extern void ui_sb_set_text_w(wchar_t *wstr);
extern void ui_sb_set_text(char *str);
extern void ui_sb_bugui(char *str);

View File

@@ -12,6 +12,8 @@ getIndicatorIcon(IconIndicator indicator)
return QIcon(":/settings/qt/icons/write_active.ico");
case Disabled:
return QIcon(":/settings/qt/icons/disabled.ico");
case WriteProtected:
return QIcon(":/settings/qt/icons/write_protected.ico");
default:
return QIcon();
}
@@ -26,11 +28,11 @@ getIconWithIndicator(const QIcon &icon, const QSize &size, QIcon::Mode iconMode,
return iconPixmap;
auto painter = QPainter(&iconPixmap);
auto indicatorPixmap = getIndicatorIcon(indicator == ReadWriteActive ? Active : indicator).pixmap(size);
auto indicatorPixmap = getIndicatorIcon((indicator == ReadWriteActive || indicator == WriteProtectedActive) ? Active : indicator).pixmap(size);
painter.drawPixmap(0, 0, indicatorPixmap);
if (indicator == ReadWriteActive) {
auto writeIndicatorPixmap = getIndicatorIcon(WriteActive).pixmap(size);
if (indicator == ReadWriteActive || indicator == WriteProtectedActive) {
auto writeIndicatorPixmap = getIndicatorIcon(indicator == WriteProtectedActive ? WriteProtected : WriteActive).pixmap(size);
painter.drawPixmap(0, 0, writeIndicatorPixmap);
}
painter.end();

View File

@@ -10,6 +10,8 @@ enum IconIndicator {
WriteActive,
ReadWriteActive,
Disabled,
WriteProtected,
WriteProtectedActive,
};
QPixmap getIconWithIndicator(const QIcon &icon, const QSize &size, QIcon::Mode iconMode, IconIndicator indicator);

View File

@@ -91,6 +91,8 @@ struct PixmapSetEmptyActive {
QPixmap read_write_active;
QPixmap empty_write_active;
QPixmap empty_read_write_active;
QPixmap wp;
QPixmap wp_active;
void load(const QIcon &icon);
};
struct Pixmaps {
@@ -168,6 +170,7 @@ struct StateEmptyActive {
bool empty = false;
bool active = false;
bool write_active = false;
bool wp = false;
void setActive(bool b)
{
@@ -193,6 +196,14 @@ struct StateEmptyActive {
empty = b;
refresh();
}
void setWriteProtected(bool b)
{
if (!label || b == wp)
return;
wp = b;
refresh();
}
void refresh()
{
if (!label)
@@ -203,7 +214,9 @@ struct StateEmptyActive {
else
label->setPixmap(write_active ? pixmaps->empty_write_active : (active ? pixmaps->empty_active : pixmaps->empty));
} else {
if (active && write_active)
if (wp)
label->setPixmap(active ? pixmaps->wp_active : pixmaps->wp);
else if (active && write_active)
label->setPixmap(pixmaps->read_write_active);
else
label->setPixmap(write_active ? pixmaps->write_active : (active ? pixmaps->active : pixmaps->normal));
@@ -241,6 +254,8 @@ void
PixmapSetEmptyActive::load(const QIcon &icon)
{
normal = getIconWithIndicator(icon, pixmap_size, QIcon::Normal, None);
wp = getIconWithIndicator(icon, pixmap_size, QIcon::Normal, WriteProtected);
wp_active = getIconWithIndicator(icon, pixmap_size, QIcon::Normal, WriteProtectedActive);
active = getIconWithIndicator(icon, pixmap_size, QIcon::Normal, Active);
write_active = getIconWithIndicator(icon, pixmap_size, QIcon::Normal, WriteActive);
read_write_active = getIconWithIndicator(icon, pixmap_size, QIcon::Normal, ReadWriteActive);
@@ -454,16 +469,23 @@ MachineStatus::refreshEmptyIcons()
if (!sbar_initialized)
return;
for (size_t i = 0; i < FDD_NUM; ++i)
for (size_t i = 0; i < FDD_NUM; ++i) {
d->fdd[i].setEmpty(machine_status.fdd[i].empty);
d->fdd[i].setWriteProtected(machine_status.fdd[i].write_prot);
}
for (size_t i = 0; i < CDROM_NUM; ++i)
d->cdrom[i].setEmpty(machine_status.cdrom[i].empty);
for (size_t i = 0; i < ZIP_NUM; i++)
for (size_t i = 0; i < ZIP_NUM; i++) {
d->zip[i].setEmpty(machine_status.zip[i].empty);
for (size_t i = 0; i < MO_NUM; i++)
d->zip[i].setWriteProtected(machine_status.zip[i].write_prot);
}
for (size_t i = 0; i < MO_NUM; i++) {
d->mo[i].setEmpty(machine_status.mo[i].empty);
d->mo[i].setWriteProtected(machine_status.mo[i].write_prot);
}
d->cassette.setEmpty(machine_status.cassette.empty);
d->cassette.setWriteProtected(machine_status.cassette.write_prot);
for (size_t i = 0; i < NET_CARD_MAX; i++)
d->net[i].setEmpty(machine_status.net[i].empty);
@@ -595,6 +617,7 @@ MachineStatus::refresh(QStatusBar *sbar)
if (cassette_enable) {
d->cassette.label = std::make_unique<ClickableLabel>();
d->cassette.setEmpty(QString(cassette_fname).isEmpty());
d->cassette.setWriteProtected(cassette_ui_writeprot);
d->cassette.refresh();
connect((ClickableLabel *) d->cassette.label.get(), &ClickableLabel::clicked, [](QPoint pos) {
MediaMenu::ptr->cassetteMenu->popup(pos - QPoint(0, MediaMenu::ptr->cassetteMenu->sizeHint().height()));
@@ -635,6 +658,7 @@ MachineStatus::refresh(QStatusBar *sbar)
}
d->fdd[i].label = std::make_unique<ClickableLabel>();
d->fdd[i].setEmpty(QString(floppyfns[i]).isEmpty());
d->fdd[i].setWriteProtected(ui_writeprot[i]);
d->fdd[i].setActive(false);
d->fdd[i].setWriteActive(false);
d->fdd[i].refresh();
@@ -669,6 +693,7 @@ MachineStatus::refresh(QStatusBar *sbar)
iterateZIP([this, sbar](int i) {
d->zip[i].label = std::make_unique<ClickableLabel>();
d->zip[i].setEmpty(QString(zip_drives[i].image_path).isEmpty());
d->zip[i].setWriteProtected(zip_drives[i].read_only);
d->zip[i].setActive(false);
d->zip[i].setWriteActive(false);
d->zip[i].refresh();
@@ -686,6 +711,7 @@ MachineStatus::refresh(QStatusBar *sbar)
iterateMO([this, sbar](int i) {
d->mo[i].label = std::make_unique<ClickableLabel>();
d->mo[i].setEmpty(QString(mo_drives[i].image_path).isEmpty());
d->mo[i].setWriteProtected(mo_drives[i].read_only);
d->mo[i].setActive(false);
d->mo[i].setWriteActive(false);
d->mo[i].refresh();

View File

@@ -282,6 +282,7 @@ MediaMenu::cassetteMount(const QString &filename, bool wp)
}
ui_sb_update_icon_state(SB_CASSETTE, filename.isEmpty() ? 1 : 0);
ui_sb_update_icon_wp(SB_CASSETTE, cassette_ui_writeprot);
mhm.addImageToHistory(0, ui::MediaType::Cassette, previous_image.filePath(), filename);
cassetteUpdateMenu();
ui_sb_update_tip(SB_CASSETTE);
@@ -446,6 +447,7 @@ MediaMenu::floppyMount(int i, const QString &filename, bool wp)
fdd_load(i, filenameBytes.data());
}
ui_sb_update_icon_state(SB_FLOPPY | i, filename.isEmpty() ? 1 : 0);
ui_sb_update_icon_wp(SB_FLOPPY | i, ui_writeprot[i]);
mhm.addImageToHistory(i, ui::MediaType::Floppy, previous_image.filePath(), filename);
floppyUpdateMenu(i);
ui_sb_update_tip(SB_FLOPPY | i);
@@ -822,6 +824,7 @@ MediaMenu::zipMount(int i, const QString &filename, bool wp)
mhm.addImageToHistory(i, ui::MediaType::Zip, zip_drives[i].prev_image_path, zip_drives[i].image_path);
ui_sb_update_icon_state(SB_ZIP | i, filename.isEmpty() ? 1 : 0);
ui_sb_update_icon_wp(SB_ZIP | i, wp);
zipUpdateMenu(i);
ui_sb_update_tip(SB_ZIP | i);
@@ -858,6 +861,7 @@ MediaMenu::zipReloadPrev(int i)
} else {
ui_sb_update_icon_state(SB_ZIP | i, 0);
}
ui_sb_update_icon_wp(SB_ZIP | i, zip_drives[i].read_only);
zipUpdateMenu(i);
ui_sb_update_tip(SB_ZIP | i);
@@ -869,7 +873,7 @@ void
MediaMenu::zipReload(int index, int slot)
{
const QString filename = mhm.getImageForSlot(index, slot, ui::MediaType::Zip);
zipMount(index, filename, false);
zipMount(index, filename, zip_drives[index].read_only);
zipUpdateMenu(index);
ui_sb_update_tip(SB_ZIP | index);
}
@@ -995,6 +999,7 @@ MediaMenu::moReloadPrev(int i)
} else {
ui_sb_update_icon_state(SB_MO | i, 0);
}
ui_sb_update_icon_state(SB_MO | i, mo_drives[i].read_only);
moUpdateMenu(i);
ui_sb_update_tip(SB_MO | i);

View File

@@ -262,6 +262,34 @@ ui_sb_set_ready(int ready)
}
}
void
ui_sb_update_icon_wp(int tag, int state)
{
const auto temp = static_cast<unsigned int>(tag);
const int category = static_cast<int>(temp & 0xfffffff0);
const int item = tag & 0xf;
switch (category) {
default:
break;
case SB_CASSETTE:
machine_status.cassette.write_prot = state > 0 ? true : false;
break;
case SB_FLOPPY:
machine_status.fdd[item].write_prot = state > 0 ? true : false;
break;
case SB_ZIP:
machine_status.zip[item].write_prot = state > 0 ? true : false;
break;
case SB_MO:
machine_status.mo[item].write_prot = state > 0 ? true : false;
break;
}
if (main_window != nullptr)
main_window->updateStatusEmptyIcons();
}
void
ui_sb_update_icon_state(int tag, int state)
{

View File

@@ -28,6 +28,7 @@
<file>qt/icons/zip.ico</file>
<file>qt/icons/zip_disabled.ico</file>
<file>qt/icons/active.ico</file>
<file>qt/icons/write_protected.ico</file>
<file>qt/icons/write_active.ico</file>
<file>qt/icons/disabled.ico</file>
<file>qt/icons/86Box-gray.ico</file>

View File

@@ -54,6 +54,12 @@
#define ESP_FIFO_SZ 16
#define ESP_CMDFIFO_SZ 32
enum ESPASCMode {
ESP_ASC_MODE_DIS = 0, /* Disconnected */
ESP_ASC_MODE_INI = 1, /* Initiator */
ESP_ASC_MODE_TGT = 2 /* Target */
};
#define ESP_TCLO 0x0
#define ESP_TCMID 0x1
#define ESP_FIFO 0x2
@@ -80,6 +86,13 @@
#define CMD_DMA 0x80
#define CMD_CMD 0x7f
#define CMD_GRP_MASK 0x70
#define CMD_GRP_MISC 0x00
#define CMD_GRP_INIT 0x01
#define CMD_GRP_TRGT 0x02
#define CMD_GRP_DISC 0x04
#define CMD_NOP 0x00
#define CMD_FLUSH 0x01
#define CMD_RESET 0x02
@@ -114,7 +127,7 @@
#define INTR_FC 0x08
#define INTR_BS 0x10
#define INTR_DC 0x20
#define INTR_ILL 0x40
#define INTR_IL 0x40
#define INTR_RST 0x80
#define SEQ_0 0x0
@@ -176,6 +189,7 @@ typedef struct esp_t {
uint8_t id, lun;
Fifo8 cmdfifo;
uint8_t cmdfifo_cdb_offset;
uint8_t asc_mode;
int data_ready;
int32_t xfer_counter;
@@ -435,12 +449,14 @@ esp_select(esp_t *dev)
esp_log("ESP SCSI no devices on ID %d, LUN %d\n", dev->id, dev->lun);
/* No such drive */
dev->rregs[ESP_RSTAT] = 0;
dev->asc_mode = ESP_ASC_MODE_DIS;
dev->rregs[ESP_RINTR] = INTR_DC;
esp_raise_irq(dev);
return -1;
} else
esp_log("ESP SCSI device present on ID %d, LUN %d\n", dev->id, dev->lun);
dev->asc_mode = ESP_ASC_MODE_INI;
return 0;
}
@@ -462,6 +478,7 @@ esp_transfer_data(esp_t *dev)
*/
dev->rregs[ESP_RINTR] |= (INTR_BS | INTR_FC);
dev->rregs[ESP_RSEQ] = SEQ_CD;
esp_raise_irq(dev);
break;
case CMD_SELATNS:
@@ -472,20 +489,24 @@ esp_transfer_data(esp_t *dev)
*/
dev->rregs[ESP_RINTR] |= INTR_BS;
dev->rregs[ESP_RSEQ] = SEQ_MO;
esp_raise_irq(dev);
break;
case CMD_TI:
case (CMD_TI | CMD_DMA):
/*
* Bus service interrupt raised because of initial change to
* DATA phase
* If the final COMMAND phase data was transferred using a TI
* command, clear ESP_CMD to terminate the TI command and raise
* the completion interrupt
*/
dev->rregs[ESP_CMD] = 0;
dev->rregs[ESP_RINTR] |= INTR_BS;
esp_raise_irq(dev);
break;
default:
break;
}
esp_raise_irq(dev);
}
/*
@@ -574,6 +595,7 @@ esp_do_message_phase(esp_t *dev)
/* We only support LUN 0 */
esp_log("LUN = %i\n", dev->lun);
dev->rregs[ESP_RSTAT] = 0;
dev->asc_mode = ESP_ASC_MODE_DIS;
dev->rregs[ESP_RINTR] = INTR_DC;
dev->rregs[ESP_RSEQ] = SEQ_0;
esp_raise_irq(dev);
@@ -631,6 +653,7 @@ esp_hard_reset(esp_t *dev)
fifo8_reset(&dev->cmdfifo);
dev->dma = 0;
dev->tchi_written = 0;
dev->asc_mode = ESP_ASC_MODE_DIS;
dev->rregs[ESP_CFG1] = dev->mca ? dev->HostID : 7;
esp_log("ESP Reset\n");
@@ -686,6 +709,7 @@ esp_do_dma(esp_t *dev)
switch (esp_get_phase(dev)) {
case STAT_MO:
len = MIN(len, fifo8_num_free(&dev->cmdfifo));
if (len) {
if (dev->mca) {
dma_set_drq(dev->DmaChannel, 1);
while (dev->dma_86c01.pos < len) {
@@ -698,6 +722,7 @@ esp_do_dma(esp_t *dev)
esp_pci_dma_memory_rw(dev, buf, len, WRITE_TO_DEVICE);
esp_set_tc(dev, esp_get_tc(dev) - len);
}
fifo8_push_all(&dev->cmdfifo, buf, len);
dev->cmdfifo_cdb_offset += len;
@@ -745,6 +770,7 @@ esp_do_dma(esp_t *dev)
case STAT_CD:
len = MIN(len, fifo8_num_free(&dev->cmdfifo));
if (len) {
if (dev->mca) {
dma_set_drq(dev->DmaChannel, 1);
while (dev->dma_86c01.pos < len) {
@@ -758,6 +784,7 @@ esp_do_dma(esp_t *dev)
fifo8_push_all(&dev->cmdfifo, buf, len);
esp_set_tc(dev, esp_get_tc(dev) - len);
}
dev->ti_size = 0;
if (esp_get_tc(dev) == 0) {
/* Command has been received */
@@ -775,6 +802,7 @@ esp_do_dma(esp_t *dev)
switch (dev->rregs[ESP_CMD]) {
case (CMD_TI | CMD_DMA):
if (len) {
if (dev->mca) {
dma_set_drq(dev->DmaChannel, 1);
while (dev->dma_86c01.pos < len) {
@@ -789,6 +817,7 @@ esp_do_dma(esp_t *dev)
esp_pci_dma_memory_rw(dev, sd->sc->temp_buffer + dev->buffer_pos, len, WRITE_TO_DEVICE);
esp_set_tc(dev, esp_get_tc(dev) - len);
}
dev->buffer_pos += len;
dev->xfer_counter -= len;
dev->ti_size += len;
@@ -834,6 +863,7 @@ esp_do_dma(esp_t *dev)
switch (dev->rregs[ESP_CMD]) {
case (CMD_TI | CMD_DMA):
if (len) {
if (dev->mca) {
dma_set_drq(dev->DmaChannel, 1);
while (dev->dma_86c01.pos < len) {
@@ -845,7 +875,7 @@ esp_do_dma(esp_t *dev)
dma_set_drq(dev->DmaChannel, 0);
} else
esp_pci_dma_memory_rw(dev, sd->sc->temp_buffer + dev->buffer_pos, len, READ_FROM_DEVICE);
}
dev->buffer_pos += len;
dev->xfer_counter -= len;
dev->ti_size -= len;
@@ -886,6 +916,7 @@ esp_do_dma(esp_t *dev)
if (len) {
buf[0] = dev->status;
/* Length already non-zero */
if (dev->mca) {
dma_set_drq(dev->DmaChannel, 1);
while (dev->dma_86c01.pos < len) {
@@ -925,6 +956,7 @@ esp_do_dma(esp_t *dev)
if (len) {
buf[0] = 0;
/* Length already non-zero */
if (dev->mca) {
dma_set_drq(dev->DmaChannel, 1);
while (dev->dma_86c01.pos < len) {
@@ -1323,6 +1355,37 @@ esp_callback(void *priv)
}
}
static int
esp_cmd_is_valid(esp_t *dev, uint8_t cmd)
{
uint8_t cmd_group = (cmd & CMD_GRP_MASK) >> 4;
/* Always allow misc commands */
if (cmd_group == CMD_GRP_MISC)
return 1;
switch (dev->asc_mode) {
case ESP_ASC_MODE_DIS:
/* Disconnected mode: only allow disconnected commands */
if (cmd_group == CMD_GRP_DISC)
return 1;
break;
case ESP_ASC_MODE_INI:
/* Initiator mode: allow initiator commands */
if (cmd_group == CMD_GRP_INIT)
return 1;
break;
default:
break;
}
return 0;
}
static uint32_t
esp_reg_read(esp_t *dev, uint32_t saddr)
{
@@ -1385,6 +1448,11 @@ esp_reg_write(esp_t *dev, uint32_t saddr, uint32_t val)
break;
case ESP_CMD:
dev->rregs[ESP_CMD] = val;
if (!esp_cmd_is_valid(dev, dev->rregs[saddr])) {
dev->rregs[ESP_RSTAT] |= INTR_IL;
esp_raise_irq(dev);
break;
}
if (val & CMD_DMA) {
dev->dma = 1;
@@ -1446,6 +1514,7 @@ esp_reg_write(esp_t *dev, uint32_t saddr, uint32_t val)
handle_satn_stop(dev);
break;
case CMD_MSGACC:
dev->asc_mode = ESP_ASC_MODE_DIS;
dev->rregs[ESP_RINTR] |= INTR_DC;
dev->rregs[ESP_RSEQ] = 0;
dev->rregs[ESP_RFLAGS] = 0;

View File

@@ -948,6 +948,11 @@ void (*f_rl_callback_handler_remove)(void) = NULL;
# define LIBEDIT_LIBRARY "libedit.so"
#endif
void ui_sb_update_icon_wp(int tag, int state)
{
/* No-op */
}
uint32_t
timer_onesec(uint32_t interval, UNUSED(void *param))
{

View File

@@ -85,6 +85,7 @@ paradise_in(uint16_t addr, void *priv)
{
paradise_t *paradise = (paradise_t *) priv;
svga_t *svga = &paradise->svga;
uint8_t max_sr = (paradise->type >= WD90C30) ? 0x15 : 0x12;
if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(svga->miscout & 1))
addr ^= 0x60;
@@ -94,7 +95,7 @@ paradise_in(uint16_t addr, void *priv)
if (svga->seqaddr > 7) {
if (paradise->type < WD90C11 || svga->seqregs[6] != 0x48)
return 0xff;
if (svga->seqaddr > 0x12)
if (svga->seqaddr > max_sr)
return 0xff;
return svga->seqregs[svga->seqaddr & 0x1f];
}
@@ -342,12 +343,12 @@ paradise_remap(paradise_t *paradise)
paradise->write_bank[3] = paradise->write_bank[2] + 0x8000;
} else if ((svga->gdcreg[6] & 0x0c) == 0x04) {
paradise->read_bank[0] = svga->gdcreg[0x0a] << 12;
paradise->read_bank[1] = svga->gdcreg[9] << 12;
paradise->read_bank[1] = (svga->gdcreg[9] << 12) + 0x8000;
paradise->read_bank[2] = paradise->read_bank[0];
paradise->read_bank[3] = paradise->read_bank[1];
paradise->write_bank[0] = svga->gdcreg[0x0a] << 12;
paradise->write_bank[1] = svga->gdcreg[9] << 12;
paradise->write_bank[1] = (svga->gdcreg[9] << 12) + 0x8000;
paradise->write_bank[2] = paradise->write_bank[0];
paradise->write_bank[3] = paradise->write_bank[1];
} else {
@@ -505,11 +506,11 @@ paradise_recalctimings(svga_t *svga)
if ((svga->gdcreg[6] & 1) || (svga->attrregs[0x10] & 1)) {
if ((svga->bpp >= 8) && !svga->lowres) {
svga->render = svga_render_8bpp_highres;
if (paradise->type != WD90C11)
if (paradise->type < WD90C11)
svga->vram_display_mask = (svga->crtc[0x2f] & 0x02) ? 0x3ffff : paradise->vram_mask;
}
}
if (paradise->type == WD90C11) switch (svga->crtc[0x2f] & 0x60) {
if (paradise->type >= WD90C11) switch (svga->crtc[0x2f] & 0x60) {
case 0x60: case 0x40:
svga->vram_display_mask = 0x3ffff;
break;
@@ -581,12 +582,11 @@ paradise_decode_addr(paradise_t *paradise, uint32_t addr, int write)
break;
}
if (memory_map_mode <= 1) {
if (write)
addr = (addr & 0x7fff) + paradise->write_bank[(addr >> 15) & 3];
else
addr = (addr & 0x7fff) + paradise->read_bank[(addr >> 15) & 3];
}
return addr;
}
@@ -669,7 +669,7 @@ paradise_read(uint32_t addr, void *priv)
uint32_t prev_addr;
uint32_t prev_addr2;
addr = paradise_decode_addr(paradise, addr, 1);
addr = paradise_decode_addr(paradise, addr, 0);
if (addr == 0xffffffff)
return 0xff;
@@ -704,7 +704,7 @@ paradise_readw(uint32_t addr, void *priv)
uint32_t prev_addr;
uint32_t prev_addr2;
addr = paradise_decode_addr(paradise, addr, 1);
addr = paradise_decode_addr(paradise, addr, 0);
if (addr == 0xffffffff)
return 0xffff;

File diff suppressed because it is too large Load Diff