Skip to content

Commit

Permalink
Merge branch 'pcmcia' of ssh://github.com/Cacodemon345/86box into pcmcia
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed May 30, 2024
2 parents 5381d64 + c6d5462 commit 83e5bd3
Show file tree
Hide file tree
Showing 15 changed files with 797 additions and 827 deletions.
3 changes: 2 additions & 1 deletion src/include/86box/vid_8514a.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ typedef union {

typedef struct ibm8514_t {
rom_t bios_rom;
rom_t bios_rom2;
hwcursor8514_t hwcursor;
hwcursor8514_t hwcursor_latch;
uint8_t pos_regs[8];
char *rom_path;

int force_old_addr;
int type;
Expand All @@ -56,6 +56,7 @@ typedef struct ibm8514_t {
uint32_t vram_size;
uint32_t vram_mask;
uint32_t pallook[512];
uint32_t bios_addr;

PALETTE vgapal;
uint8_t hwcursor_oddeven;
Expand Down
1 change: 1 addition & 0 deletions src/include/86box/vid_ati_mach8.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ typedef struct mach_t {
uint16_t shadow_set;
uint16_t shadow_cntl;
int ext_on[2];
int extended_mode;
int compat_mode;

struct {
Expand Down
38 changes: 23 additions & 15 deletions src/include/86box/vid_svga.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ typedef struct svga_t {
uint8_t overlay_oddeven;
uint8_t fcr;
uint8_t hblank_overscan;
uint8_t vidsys_ena;

int dac_addr;
int dac_pos;
Expand Down Expand Up @@ -199,6 +200,7 @@ typedef struct svga_t {

void (*ven_write)(struct svga_t *svga, uint8_t val, uint32_t addr);
float (*getclock)(int clock, void *priv);
float (*getclock8514)(int clock, void *priv);

/* Called when VC=R18 and friends. If this returns zero then MA resetting
is skipped. Matrox Mystique in Power mode reuses this counter for
Expand Down Expand Up @@ -288,26 +290,32 @@ typedef struct svga_t {

void * dev8514;
void * ext8514;
void * clock_gen8514;
void * xga;
} svga_t;

extern int vga_on;

extern void ibm8514_poll(void *priv);
extern void ibm8514_recalctimings(svga_t *svga);
extern uint8_t ibm8514_ramdac_in(uint16_t port, void *priv);
extern void ibm8514_ramdac_out(uint16_t port, uint8_t val, void *priv);
extern int ibm8514_cpu_src(svga_t *svga);
extern int ibm8514_cpu_dest(svga_t *svga);
extern void ibm8514_accel_out_pixtrans(svga_t *svga, uint16_t port, uint32_t val, int len);
extern void ibm8514_short_stroke_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, uint8_t ssv, int len);
extern void ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, int len);
extern int vga_on;

extern void ibm8514_poll(void *priv);
extern void ibm8514_recalctimings(svga_t *svga);
extern uint8_t ibm8514_ramdac_in(uint16_t port, void *priv);
extern void ibm8514_ramdac_out(uint16_t port, uint8_t val, void *priv);
extern void ibm8514_accel_out_fifo(svga_t *svga, uint16_t port, uint32_t val, int len);
extern void ibm8514_accel_out(uint16_t port, uint32_t val, svga_t *svga, int len);
extern uint16_t ibm8514_accel_in_fifo(svga_t *svga, uint16_t port, int len);
extern uint8_t ibm8514_accel_in(uint16_t port, svga_t *svga);
extern int ibm8514_cpu_src(svga_t *svga);
extern int ibm8514_cpu_dest(svga_t *svga);
extern void ibm8514_accel_out_pixtrans(svga_t *svga, uint16_t port, uint32_t val, int len);
extern void ibm8514_short_stroke_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, uint8_t ssv, int len);
extern void ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, int len);

#ifdef ATI_8514_ULTRA
extern void ati8514_recalctimings(svga_t *svga);
extern uint8_t ati8514_mca_read(int port, void *priv);
extern void ati8514_mca_write(int port, uint8_t val, void *priv);
extern void ati8514_init(svga_t *svga, void *ext8514, void *dev8514);
extern void ati8514_recalctimings(svga_t *svga);
extern uint8_t ati8514_mca_read(int port, void *priv);
extern void ati8514_mca_write(int port, uint8_t val, void *priv);
extern void ati8514_pos_write(uint16_t port, uint8_t val, void *priv);
extern void ati8514_init(svga_t *svga, void *ext8514, void *dev8514);
#endif

extern void xga_poll(void *priv, svga_t *svga);
Expand Down
5 changes: 3 additions & 2 deletions src/include/86box/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,15 +507,15 @@ extern const device_t s3_phoenix_vision864_pci_device;
extern const device_t s3_phoenix_vision864_vlb_device;
extern const device_t s3_9fx_531_pci_device;
extern const device_t s3_phoenix_vision868_pci_device;
extern const device_t s3_phoenix_vision868_vlb_device;
extern const device_t s3_diamond_stealth64_pci_device;
extern const device_t s3_diamond_stealth64_vlb_device;
extern const device_t s3_diamond_stealth64_964_pci_device;
extern const device_t s3_diamond_stealth64_964_vlb_device;
extern const device_t s3_diamond_stealth64_968_pci_device;
extern const device_t s3_diamond_stealth64_968_vlb_device;
extern const device_t s3_mirovideo_40sv_ergo_968_pci_device;
extern const device_t s3_9fx_771_pci_device;
extern const device_t s3_phoenix_vision968_pci_device;
extern const device_t s3_phoenix_vision968_vlb_device;
extern const device_t s3_spea_mercury_p64v_pci_device;
extern const device_t s3_elsa_winner2000_pro_x_964_pci_device;
extern const device_t s3_elsa_winner2000_pro_x_pci_device;
Expand All @@ -528,6 +528,7 @@ extern const device_t s3_diamond_stealth_2000_pci_device;
extern const device_t s3_diamond_stealth_3000_pci_device;
extern const device_t s3_stb_velocity_3d_pci_device;
extern const device_t s3_virge_375_pci_device;
extern const device_t s3_virge_375_onboard_pci_device;
extern const device_t s3_diamond_stealth_2000pro_pci_device;
extern const device_t s3_virge_385_pci_device;
extern const device_t s3_virge_357_pci_device;
Expand Down
7 changes: 7 additions & 0 deletions src/machine/m_at_socket8.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <86box/timer.h>
#include <86box/nvr.h>
#include <86box/sio.h>
#include <86box/sound.h>
#include <86box/hwm.h>
#include <86box/spd.h>
#include <86box/video.h>
Expand Down Expand Up @@ -322,6 +323,12 @@ machine_at_ap440fx_init(const machine_t *model)
device_add(&pc87307_device);
device_add(&intel_flash_bxt_ami_device);

if (sound_card_current[0] == SOUND_INTERNAL)
device_add(&cs4236b_device);

if (gfxcard[0] == VID_INTERNAL)
device_add(&s3_virge_375_onboard_pci_device);

return ret;
}

Expand Down
14 changes: 7 additions & 7 deletions src/machine/machine_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -5182,7 +5182,7 @@ const machine_t machines[] = {
.snd_device = NULL,
.net_device = NULL
},
/* The board has a "ASII KB-100" which I was not able to find any information about,
/* The board has a "ASII KB-100" which I was not able to find any information about,
but the BIOS sends commands C9 without a parameter and D5, both of which are
Phoenix MultiKey commands. */
{
Expand Down Expand Up @@ -10606,7 +10606,7 @@ const machine_t machines[] = {
.snd_device = NULL,
.net_device = NULL
},
/* [TEST] The board doesn't seem to have a KBC at all, which probably means it's an on-chip one on the PC87306 SIO.
/* [TEST] The board doesn't seem to have a KBC at all, which probably means it's an on-chip one on the PC87306 SIO.
A list on a Danish site shows the BIOS as having a -0 string, indicating non-AMI KBC firmware. */
{
.name = "[i430HX] Supermicro P55T2S",
Expand Down Expand Up @@ -12658,7 +12658,7 @@ const machine_t machines[] = {
.snd_device = NULL,
.net_device = NULL
},

/* ALi ALADDiN IV+ */
/* Has the ALi M1543 southbridge with on-chip KBC. */
{
Expand Down Expand Up @@ -13051,7 +13051,7 @@ const machine_t machines[] = {
.max_multi = 5.5
},
.bus_flags = MACHINE_PS2_A97 | MACHINE_BUS_USB,
.flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI | MACHINE_GAMEPORT | MACHINE_USB,
.flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI | MACHINE_GAMEPORT | MACHINE_USB,
.ram = {
.min = 8192,
.max = 786432,
Expand Down Expand Up @@ -13462,7 +13462,7 @@ const machine_t machines[] = {
.max_multi = 3.5
},
.bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB,
.flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_USB, /* Machine has internal video: S3 ViRGE/DX and sound: Crystal CS4236B */
.flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_SOUND | MACHINE_VIDEO | MACHINE_USB, /* Machine has internal video: S3 ViRGE/DX and sound: Crystal CS4236B */
.ram = {
.min = 8192,
.max = 131072,
Expand All @@ -13476,8 +13476,8 @@ const machine_t machines[] = {
.device = NULL,
.fdc_device = NULL,
.sio_device = NULL,
.vid_device = NULL,
.snd_device = NULL,
.vid_device = &s3_virge_375_onboard_pci_device,
.snd_device = &cs4236b_device,
.net_device = NULL
},
/* According to tests from real hardware: This has AMI MegaKey KBC firmware on the
Expand Down
15 changes: 9 additions & 6 deletions src/scsi/scsi_ncr53c400.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ ncr53c400_write(uint32_t addr, uint8_t val, void *priv)
if (ncr400->buffer_host_pos == MIN(128, dev->buffer_length)) {
ncr400->status_ctrl |= STATUS_BUFFER_NOT_READY;
ncr400->busy = 1;
if (!(ncr->mode & MODE_MONITOR_BUSY))
timer_on_auto(&ncr400->timer, ncr->period / 280.0);
if (!(ncr->mode & MODE_MONITOR_BUSY) && ((scsi_device_get_callback(dev) > 0.0)))
timer_on_auto(&ncr400->timer, ncr->period / 250.0);
}
}
break;
Expand Down Expand Up @@ -182,9 +182,12 @@ ncr53c400_write(uint32_t addr, uint8_t val, void *priv)
memset(ncr400->buffer, 0, MIN(128, dev->buffer_length));
if (ncr->mode & MODE_MONITOR_BUSY)
timer_on_auto(&ncr400->timer, ncr->period);
else
else if (scsi_device_get_callback(dev) > 0.0)
timer_on_auto(&ncr400->timer, 40.0);
ncr53c400_log("DMA timer on, callback=%lf, scsi buflen=%d, waitdata=%d, waitcomplete=%d, clearreq=%d, datawait=%d, enabled=%d.\n", scsi_device_get_callback(dev), dev->buffer_length, ncr->wait_complete, ncr->wait_data, ncr->wait_complete, ncr->clear_req, ncr->data_wait, timer_is_enabled(&ncr400->timer));
else
timer_on_auto(&ncr400->timer, ncr->period);

ncr53c400_log("DMA timer on=%02x, callback=%lf, scsi buflen=%d, waitdata=%d, waitcomplete=%d, clearreq=%d, datawait=%d, enabled=%d.\n", ncr->mode & MODE_MONITOR_BUSY, scsi_device_get_callback(dev), dev->buffer_length, ncr->wait_complete, ncr->wait_data, ncr->wait_complete, ncr->clear_req, ncr->data_wait, timer_is_enabled(&ncr400->timer));
}
break;

Expand Down Expand Up @@ -239,8 +242,8 @@ ncr53c400_read(uint32_t addr, void *priv)
if (ncr400->buffer_host_pos == MIN(128, dev->buffer_length)) {
ncr400->status_ctrl |= STATUS_BUFFER_NOT_READY;
ncr53c400_log("Transfer busy read, status = %02x.\n", ncr400->status_ctrl);
if (!(ncr->mode & MODE_MONITOR_BUSY))
timer_on_auto(&ncr400->timer, ncr->period / 280.0);
if (!(ncr->mode & MODE_MONITOR_BUSY) && (scsi_device_get_callback(dev) > 0.0))
timer_on_auto(&ncr400->timer, ncr->period / 250.0);
}
}
break;
Expand Down
2 changes: 1 addition & 1 deletion src/sound/snd_pas16.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ pas16_in(uint16_t port, void *priv)
- 2 = FM (1 = stereo, 0 = mono);
- 3 = Code (1 = 16-bit, 0 = 8-bit).
*/
ret = pas16->type ? pas16->type : 0x06;
ret = pas16->type ? pas16->type : 0x07;
break;

case 0xf000:
Expand Down
Loading

0 comments on commit 83e5bd3

Please sign in to comment.