Added the Packard Bell Legend 300SX.

This commit is contained in:
OBattler
2025-06-13 19:42:59 +02:00
parent 51882035af
commit 8482937f9f
11 changed files with 574 additions and 57 deletions

View File

@@ -30,6 +30,7 @@
#include <86box/vid_svga.h>
#include <86box/vid_svga_render.h>
#include <86box/plat_unused.h>
#include "cpu.h"
#define BIOS_037C_PATH "roms/video/oti/bios.bin"
#define BIOS_067_AMA932J_PATH "roms/machines/ama932j/OTI067.BIN"
@@ -38,13 +39,13 @@
#define BIOS_077_PATH "roms/video/oti/oti077.vbi"
#define BIOS_077_ACER100T_PATH "roms/machines/acer100t/oti077_acer100t.BIN"
enum {
OTI_037C = 0,
OTI_067 = 2,
OTI_067_AMA932J = 3,
OTI_067_M300 = 4,
OTI_077 = 5,
OTI_037C = 0,
OTI_037_PBL300SX = 1,
OTI_067 = 2,
OTI_067_AMA932J = 3,
OTI_067_M300 = 4,
OTI_077 = 5,
OTI_077_ACER100T = 6
};
@@ -76,14 +77,15 @@ oti_out(uint16_t addr, uint8_t val, void *priv)
uint8_t idx;
uint8_t enable;
if (!oti->chip_id && !(oti->enable_register & 1) && (addr != 0x3C3))
if (!oti->chip_id && !(oti->enable_register & 1) && (addr != 0x3c3))
return;
if ((((addr & 0xFFF0) == 0x3D0 || (addr & 0xFFF0) == 0x3B0) && addr < 0x3de) && !(svga->miscout & 1))
if (((((addr & 0xfff0) == 0x3d0) || ((addr & 0xfff0) == 0x3b0)) && (addr < 0x3de)) &&
!(svga->miscout & 1))
addr ^= 0x60;
switch (addr) {
case 0x3C3:
case 0x3c3:
if (!oti->chip_id) {
oti->enable_register = val & 1;
return;
@@ -95,20 +97,20 @@ oti_out(uint16_t addr, uint8_t val, void *priv)
case 0x3c7:
case 0x3c8:
case 0x3c9:
if (oti->chip_id == OTI_077 || oti->chip_id == OTI_077_ACER100T)
if ((oti->chip_id == OTI_077) || (oti->chip_id == OTI_077_ACER100T))
sc1148x_ramdac_out(addr, 0, val, svga->ramdac, svga);
else
svga_out(addr, val, svga);
return;
case 0x3D4:
case 0x3d4:
if (oti->chip_id)
svga->crtcreg = val & 0x3f;
else
svga->crtcreg = val; /* FIXME: The BIOS wants to set the test bit? */
return;
case 0x3D5:
case 0x3d5:
if (oti->chip_id && (svga->crtcreg & 0x20))
return;
idx = svga->crtcreg;
@@ -124,7 +126,8 @@ oti_out(uint16_t addr, uint8_t val, void *priv)
if ((idx < 0x0e) || (idx > 0x10)) {
if (idx == 0x0c || idx == 0x0d) {
svga->fullchange = 3;
svga->memaddr_latch = ((svga->crtc[0xc] << 8) | svga->crtc[0xd]) + ((svga->crtc[8] & 0x60) >> 5);
svga->memaddr_latch = ((svga->crtc[0xc] << 8) | svga->crtc[0xd]) +
((svga->crtc[8] & 0x60) >> 5);
} else {
svga->fullchange = changeframecount;
svga_recalctimings(svga);
@@ -133,14 +136,14 @@ oti_out(uint16_t addr, uint8_t val, void *priv)
}
break;
case 0x3DE:
case 0x3de:
if (oti->chip_id)
oti->index = val & 0x1f;
else
oti->index = val;
return;
case 0x3DF:
case 0x3df:
idx = oti->index;
if (!oti->chip_id)
idx &= 0x1f;
@@ -223,14 +226,14 @@ oti_in(uint16_t addr, void *priv)
addr ^= 0x60;
switch (addr) {
case 0x3C2:
case 0x3c2:
if ((svga->vgapal[0].r + svga->vgapal[0].g + svga->vgapal[0].b) >= 0x50)
temp = 0;
else
temp = 0x10;
break;
case 0x3C3:
case 0x3c3:
if (oti->chip_id)
temp = svga_in(addr, svga);
else
@@ -248,11 +251,11 @@ oti_in(uint16_t addr, void *priv)
case 0x3CF:
return svga->gdcreg[svga->gdcaddr & 0xf];
case 0x3D4:
case 0x3d4:
temp = svga->crtcreg;
break;
case 0x3D5:
case 0x3d5:
if (oti->chip_id) {
if (svga->crtcreg & 0x20)
temp = 0xff;
@@ -262,17 +265,19 @@ oti_in(uint16_t addr, void *priv)
temp = svga->crtc[svga->crtcreg & 0x1f];
break;
case 0x3DA:
case 0x3da:
if (oti->chip_id) {
temp = svga_in(addr, svga);
break;
}
svga->attrff = 0;
/*The OTI-037C BIOS waits for bits 0 and 3 in 0x3da to go low, then reads 0x3da again
and expects the diagnostic bits to equal the current border colour. As I understand
it, the 0x3da active enable status does not include the border time, so this may be
an area where OTI-037C is not entirely VGA compatible.*/
/*
The OTI-037C BIOS waits for bits 0 and 3 in 0x3da to go low, then reads 0x3da again
and expects the diagnostic bits to equal the current border colour. As I understand
it, the 0x3da active enable status does not include the border time, so this may be
an area where OTI-037C is not entirely VGA compatible.
*/
svga->cgastat &= ~0x30;
/* copy color diagnostic info from the overscan color register */
switch (svga->attrregs[0x12] & 0x30) {
@@ -307,13 +312,13 @@ oti_in(uint16_t addr, void *priv)
temp = svga->cgastat;
break;
case 0x3DE:
case 0x3de:
temp = oti->index;
if (oti->chip_id)
temp |= (oti->chip_id << 5);
break;
case 0x3DF:
case 0x3df:
idx = oti->index;
if (!oti->chip_id)
idx &= 0x1f;
@@ -441,6 +446,13 @@ oti_init(const device_t *info)
#endif
break;
case OTI_037_PBL300SX:
romfn = NULL;
oti->chip_id = 0;
oti->vram_size = 256;
oti->regs[0] = 0x08; /* FIXME: The BIOS wants to read this at index 0? This index is undocumented. */
break;
case OTI_067_AMA932J:
romfn = BIOS_067_AMA932J_PATH;
oti->chip_id = 2;
@@ -478,26 +490,25 @@ oti_init(const device_t *info)
break;
}
if (romfn != NULL) {
if (romfn != NULL)
rom_init(&oti->bios_rom, romfn,
0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
}
oti->vram_mask = (oti->vram_size << 10) - 1;
if (oti->chip_id == OTI_077_ACER100T){
/* josephillips: Required to show all BIOS
information on Acer 100T only
if (oti->chip_id == OTI_077_ACER100T) {
/*
josephillips: Required to show all BIOS
information on Acer 100T only
*/
video_inform(0x1,&timing_oti);
}else{
video_inform(0x1, &timing_oti);
} else
video_inform(VIDEO_FLAG_TYPE_SPECIAL, &timing_oti);
}
svga_init(info, &oti->svga, oti, oti->vram_size << 10,
oti_recalctimings, oti_in, oti_out, NULL, NULL);
if (oti->chip_id == OTI_077 || oti->chip_id == OTI_077_ACER100T)
if ((oti->chip_id == OTI_077) || (oti->chip_id == OTI_077_ACER100T))
oti->svga.ramdac = device_add(&sc11487_ramdac_device); /*Actually a 82c487, probably a clone.*/
io_sethandler(0x03c0, 32,
@@ -662,6 +673,20 @@ const device_t oti037c_device = {
.config = NULL
};
const device_t oti037_pbl300sx_device = {
.name = "Oak OTI-037 (Packard Bell Legend 300SX)",
.internal_name = "oti037_pbl300sx",
.flags = DEVICE_ISA,
.local = 1,
.init = oti_init,
.close = oti_close,
.reset = NULL,
.available = NULL,
.speed_changed = oti_speed_changed,
.force_redraw = oti_force_redraw,
.config = NULL
};
const device_t oti067_device = {
.name = "Oak OTI-067",
.internal_name = "oti067",
@@ -676,20 +701,6 @@ const device_t oti067_device = {
.config = oti067_config
};
const device_t oti067_m300_device = {
.name = "Oak OTI-067 (Olivetti M300-08/15)",
.internal_name = "oti067_m300",
.flags = DEVICE_ISA,
.local = 4,
.init = oti_init,
.close = oti_close,
.reset = NULL,
.available = oti067_m300_available,
.speed_changed = oti_speed_changed,
.force_redraw = oti_force_redraw,
.config = oti067_config
};
const device_t oti067_ama932j_device = {
.name = "Oak OTI-067 (AMA-932J)",
.internal_name = "oti067_ama932j",
@@ -704,21 +715,20 @@ const device_t oti067_ama932j_device = {
.config = oti067_ama932j_config
};
const device_t oti077_acer100t_device = {
.name = "Oak OTI-077 (Acer 100T)",
.internal_name = "oti077_acer100t",
const device_t oti067_m300_device = {
.name = "Oak OTI-067 (Olivetti M300-08/15)",
.internal_name = "oti067_m300",
.flags = DEVICE_ISA,
.local = 6,
.local = 4,
.init = oti_init,
.close = oti_close,
.reset = NULL,
.available = oti077_acer100t_available,
.available = oti067_m300_available,
.speed_changed = oti_speed_changed,
.force_redraw = oti_force_redraw,
.config = oti077_acer100t_config
.config = oti067_config
};
const device_t oti077_device = {
.name = "Oak OTI-077",
.internal_name = "oti077",
@@ -732,3 +742,17 @@ const device_t oti077_device = {
.force_redraw = oti_force_redraw,
.config = oti077_config
};
const device_t oti077_acer100t_device = {
.name = "Oak OTI-077 (Acer 100T)",
.internal_name = "oti077_acer100t",
.flags = DEVICE_ISA,
.local = 6,
.init = oti_init,
.close = oti_close,
.reset = NULL,
.available = oti077_acer100t_available,
.speed_changed = oti_speed_changed,
.force_redraw = oti_force_redraw,
.config = oti077_acer100t_config
};