Skip to content

Commit 87f216f

Browse files
authored
Merge pull request 86Box#7951 from mw308/master
Re-enable the IN530 logo code + fixes
2 parents 77052f6 + 5454d9f commit 87f216f

4 files changed

Lines changed: 88 additions & 29 deletions

File tree

‎src/include/86box/machine.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ extern int machine_at_ms5169_init(const machine_t *);
13011301

13021302
/* SiS 530/5595 */
13031303
extern int machine_at_in530_init(const machine_t *);
1304-
extern int machine_in530_boot_logo_enabled(void);
1304+
extern int machine_in530_boot_logo(void);
13051305
#ifdef EMU_DEVICE_H
13061306
extern const device_t in530_device;
13071307
#endif

‎src/machine/m_at_sockets7.c‎

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ machine_at_k6bv3p_a_init(const machine_t *model)
791791

792792
/* SiS 530 / 5595 */
793793

794-
static int in530_boot_logo_enabled = 1;
794+
static int in530_boot_logo = 1;
795795

796796
static const device_config_t in530_config[] = {
797797
// clang-format off
@@ -856,18 +856,32 @@ static const device_config_t in530_config[] = {
856856
{ .files_no = 0 }
857857
}
858858
},
859-
/* Boot logo toggle doesn't work yet for the NEC, so disabling until it does */
860-
/*{
859+
860+
/* Logo module selector:
861+
0 = 40 (33 in NEC)
862+
1 = 33
863+
2 = 3E
864+
3 = 3F
865+
4 = 3D (missing in all BIOSes so used to disable NEC)
866+
5 = 3C
867+
*/
868+
{
861869
.name = "boot_logo",
862-
.description = "Enable Boot Logo",
863-
.type = CONFIG_BINARY,
870+
.description = "Boot Logo",
871+
.type = CONFIG_SELECTION,
864872
.default_string = NULL,
865873
.default_int = 1,
866874
.file_filter = NULL,
867875
.spinner = { 0 },
868-
.selection = { { 0 } },
876+
.selection = {
877+
{ .description = "Disabled", .value = 4 },
878+
{ .description = "Enabled", .value = 1 },
879+
{ .description = "Logo 2", .value = 2 },
880+
{ .description = "Logo 3", .value = 3 },
881+
{ .description = "" }
882+
},
869883
.bios = { { 0 } }
870-
},*/
884+
},
871885
{ .name = "", .description = "", .type = CONFIG_END }
872886
// clang-format on
873887
};
@@ -887,9 +901,9 @@ const device_t in530_device = {
887901
};
888902

889903
int
890-
machine_in530_boot_logo_enabled(void)
904+
machine_in530_boot_logo(void)
891905
{
892-
return in530_boot_logo_enabled;
906+
return in530_boot_logo;
893907
}
894908

895909
int
@@ -905,8 +919,7 @@ machine_at_in530_init(const machine_t *model)
905919
device_context(model->device);
906920
fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios"), 0);
907921
ret = bios_load_linear(fn, 0x000c0000, 262144, 0);
908-
/* Force full screen boot logo on for now */
909-
/* in530_boot_logo_enabled = device_get_config_int("boot_logo"); */
922+
in530_boot_logo = device_get_config_int("boot_logo");
910923
device_context_restore();
911924

912925
machine_at_common_init(model);

‎src/mem/sst_flash.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,15 +564,13 @@ sst_init(const device_t *info)
564564
} else
565565
fatal("Attempting to open the Flash file for reading with an empty invalid name\n");
566566

567-
/* This is currently forced on until the NEC variant can be fixed */
568-
/* Edit the rom to enable/disable the full screen logo */
567+
/* Set the requested logo display */
569568
if ((machines[machine].init == machine_at_in530_init) &&
570569
(info->local == (AMD | AMD29F002NBT | SIZE_2M))) {
571570
const uint8_t old = dev->array[0x3af70];
572571

573572
dev->array[0x3af70] &= 0xf0;
574-
if (machine_in530_boot_logo_enabled())
575-
dev->array[0x3af70] |= 0x01;
573+
dev->array[0x3af70] |= machine_in530_boot_logo() & 0x0f;
576574

577575
if (dev->array[0x3af70] != old)
578576
dev->dirty = 1;

‎src/qt/qt_deviceconfig.cpp‎

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,17 @@ enumerateSerialDevices()
123123
return serialDevices;
124124
}
125125

126-
QComboBox *cbox_memory = nullptr;
127-
QComboBox *cbox_memory_2 = nullptr;
126+
QComboBox *cbox_memory = nullptr;
127+
QComboBox *cbox_memory_2 = nullptr;
128128

129-
QComboBox *cbox_bios = nullptr;
129+
QComboBox *cbox_bios = nullptr;
130+
QComboBox *cbox_in530_bootlogo = nullptr;
130131

131-
const _device_config_ *cfg_memory = nullptr;
132-
const _device_config_ *cfg_memory_2 = nullptr;
132+
const _device_config_ *cfg_memory = nullptr;
133+
const _device_config_ *cfg_memory_2 = nullptr;
133134

134-
const _device_config_ *cfg_bios = nullptr;
135+
const _device_config_ *cfg_bios = nullptr;
136+
const _device_config_ *cfg_in530_bootlogo = nullptr;
135137

136138
int bios_rows = 0;
137139

@@ -270,6 +272,11 @@ DeviceConfig::ProcessConfig(void *dc, const void *c, const bool is_dep)
270272
cbox_memory_2 = cbox;
271273
cfg_memory_2 = config;
272274
}
275+
if (!strcmp(config->name, "boot_logo") &&
276+
(cfg_dev != nullptr) && !strcmp(cfg_dev->internal_name, "in530")) {
277+
cbox_in530_bootlogo = cbox;
278+
cfg_in530_bootlogo = config;
279+
}
273280
break;
274281
}
275282
case CONFIG_BIOS:
@@ -441,7 +448,9 @@ DeviceConfig::ProcessConfig(void *dc, const void *c, const bool is_dep)
441448
++config;
442449
}
443450

444-
if ((cfg_memory != nullptr) && (cfg_bios != nullptr) && (bios != -1))
451+
if ((cbox_bios != nullptr) && (cfg_bios != nullptr) && (bios != -1) &&
452+
(((cfg_memory != nullptr) && (cbox_memory != nullptr)) ||
453+
((cfg_in530_bootlogo != nullptr) && (cbox_in530_bootlogo != nullptr))))
445454
connect(cbox_bios, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &DeviceConfig::on_comboIndexChanged);
446455

447456
on_comboIndexChanged(bios);
@@ -456,15 +465,17 @@ DeviceConfig::ConfigureDevice(const _device_ *device, int instance, Settings *se
456465

457466
cfg_dev = (device_t *) device;
458467

459-
cbox_memory = nullptr;
460-
cbox_memory_2 = nullptr;
468+
cbox_memory = nullptr;
469+
cbox_memory_2 = nullptr;
461470

462-
cbox_bios = nullptr;
471+
cbox_bios = nullptr;
472+
cbox_in530_bootlogo = nullptr;
463473

464-
cfg_memory = nullptr;
465-
cfg_memory_2 = nullptr;
474+
cfg_memory = nullptr;
475+
cfg_memory_2 = nullptr;
466476

467-
cfg_bios = nullptr;
477+
cfg_bios = nullptr;
478+
cfg_in530_bootlogo = nullptr;
468479

469480
bios_rows = 0;
470481

@@ -770,4 +781,41 @@ DeviceConfig::on_comboIndexChanged(int index)
770781
else
771782
cbox_memory_2->setEnabled(false);
772783
}
784+
785+
if ((cbox_in530_bootlogo != nullptr) && (cbox_bios != nullptr) &&
786+
(cfg_in530_bootlogo != nullptr) && (cfg_bios != nullptr) &&
787+
(cfg_dev != nullptr) && !strcmp(cfg_dev->internal_name, "in530") &&
788+
(cbox_bios->currentIndex() >= 0)) {
789+
const int bios_idx = cbox_bios->currentData().toInt();
790+
const char *bios_name = cfg_bios->bios[bios_idx].internal_name;
791+
const int selector = (cbox_in530_bootlogo->currentIndex() >= 0)
792+
? cbox_in530_bootlogo->currentData().toInt()
793+
: cfg_in530_bootlogo->default_int;
794+
795+
cbox_in530_bootlogo->clear();
796+
797+
auto add_logo = [this](const char *description, int value) {
798+
Models::AddEntry(cbox_in530_bootlogo->model(), tr(description), value);
799+
};
800+
801+
add_logo("Disabled", 4);
802+
803+
if (!strcmp(bios_name, "in530_pb_111j")) {
804+
add_logo("Packard Bell", 1);
805+
add_logo("NEC", 2);
806+
add_logo("PowerMate", 3);
807+
} else if (!strcmp(bios_name, "in530_pb_129")) {
808+
add_logo("Packard Bell", 1);
809+
add_logo("Japaq", 2);
810+
add_logo("PowerMate", 3);
811+
} else {
812+
/* Only one logo */
813+
add_logo("Enabled", 1);
814+
}
815+
816+
int current_index = cbox_in530_bootlogo->findData(selector);
817+
if (current_index < 0)
818+
current_index = cbox_in530_bootlogo->findData(cfg_in530_bootlogo->default_int);
819+
cbox_in530_bootlogo->setCurrentIndex(current_index);
820+
}
773821
}

0 commit comments

Comments
 (0)