Fixed come crashes (AHA1542, general with SB tips) etc.

This commit is contained in:
waltje
2017-10-09 03:18:50 -04:00
parent fa880c2865
commit efc129eb22
5 changed files with 41 additions and 36 deletions

View File

@@ -9,7 +9,7 @@
* Implementation of the CD-ROM drive with SCSI(-like) * Implementation of the CD-ROM drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage. * commands, for both ATAPI and SCSI usage.
* *
* Version: @(#)cdrom.c 1.0.12 2017/10/07 * Version: @(#)cdrom.c 1.0.13 2017/10/08
* *
* Author: Miran Grca, <mgrca8@gmail.com> * Author: Miran Grca, <mgrca8@gmail.com>
* *
@@ -4018,7 +4018,9 @@ void cdrom_general_init(void)
{ {
int c = 0; int c = 0;
#if 0
cdrom_init_host_drives(); cdrom_init_host_drives();
#endif
for (c=0; c<CDROM_NUM; c++) { for (c=0; c<CDROM_NUM; c++) {
if (cdrom_drives[c].bus_type) { if (cdrom_drives[c].bus_type) {

View File

@@ -8,7 +8,7 @@
* *
* Emulation core dispatcher. * Emulation core dispatcher.
* *
* Version: @(#)pc.c 1.0.18 2017/10/08 * Version: @(#)pc.c 1.0.19 2017/10/08
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -27,31 +27,46 @@
#include "86box.h" #include "86box.h"
#include "config.h" #include "config.h"
#include "ibm.h" #include "ibm.h"
#include "cpu/cpu.h"
#include "cpu/codegen.h"
#include "cpu/x86_ops.h"
#include "io.h" #include "io.h"
#include "mem.h" #include "mem.h"
#include "rom.h" #include "rom.h"
#include "cpu/codegen.h"
#include "cpu/cpu.h"
#include "dma.h" #include "dma.h"
#include "pic.h"
#include "pit.h"
#include "random.h" #include "random.h"
#include "timer.h"
#include "mouse.h"
#include "device.h" #include "device.h"
#include "nvr.h"
#include "machine/machine.h"
#include "game/gameport.h"
#include "keyboard.h"
#include "keyboard_at.h"
#include "lpt.h"
#include "serial.h"
#include "cdrom/cdrom.h" #include "cdrom/cdrom.h"
#include "disk/hdd.h" #include "disk/hdd.h"
#include "disk/hdc.h" #include "disk/hdc.h"
#include "disk/hdc_ide.h" #include "disk/hdc_ide.h"
#include "floppy/floppy.h" #include "floppy/floppy.h"
#include "floppy/fdc.h" #include "floppy/fdc.h"
#include "game/gameport.h" #include "scsi/scsi.h"
#include "keyboard.h"
#include "keyboard_at.h"
#include "lpt.h"
#include "machine/machine.h"
#include "sound/midi.h"
#include "mouse.h"
#include "network/network.h" #include "network/network.h"
#include "nvr.h" #include "sound/sound.h"
#include "pic.h" #include "sound/midi.h"
#include "pit.h" #include "sound/snd_cms.h"
#include "sound/snd_dbopl.h"
#include "sound/snd_mpu401.h"
#include "sound/snd_opl.h"
#include "sound/snd_gus.h"
#include "sound/snd_sb.h"
#include "sound/snd_speaker.h"
#include "sound/snd_ssi2001.h"
#include "video/video.h"
#include "video/vid_voodoo.h"
#ifdef WALTJE #ifdef WALTJE
# define UNICODE # define UNICODE
# include <direct.h> # include <direct.h>
@@ -62,23 +77,9 @@
#include "win/plat_keyboard.h" #include "win/plat_keyboard.h"
#include "win/plat_midi.h" #include "win/plat_midi.h"
#include "win/plat_mouse.h" #include "win/plat_mouse.h"
#include "win/plat_iodev.h"
#include "win/plat_ui.h" #include "win/plat_ui.h"
#include "win/win.h" #include "win/win.h"
#include "scsi/scsi.h"
#include "serial.h"
#include "sound/sound.h"
#include "sound/snd_cms.h"
#include "sound/snd_dbopl.h"
#include "sound/snd_mpu401.h"
#include "sound/snd_opl.h"
#include "sound/snd_gus.h"
#include "sound/snd_sb.h"
#include "sound/snd_speaker.h"
#include "sound/snd_ssi2001.h"
#include "timer.h"
#include "video/video.h"
#include "video/vid_voodoo.h"
#include "cpu/x86_ops.h"
int window_w, window_h, window_x, window_y, window_remember; int window_w, window_h, window_x, window_y, window_remember;
@@ -307,6 +308,7 @@ usage:
*/ */
hdd_init(); hdd_init();
network_init(); network_init();
cdrom_init_host_drives();
/* Load the configuration file. */ /* Load the configuration file. */
config_load(cfg); config_load(cfg);

View File

@@ -12,7 +12,7 @@
* *
* NOTE: THIS IS CURRENTLY A MESS, but will be cleaned up as I go. * NOTE: THIS IS CURRENTLY A MESS, but will be cleaned up as I go.
* *
* Version: @(#)scsi_aha154x.c 1.0.22 2017/10/08 * Version: @(#)scsi_aha154x.c 1.0.23 2017/10/08
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Original Buslogic version by SA1988 and Miran Grca. * Original Buslogic version by SA1988 and Miran Grca.
@@ -1249,6 +1249,7 @@ aha_mbo(aha_t *dev, Mailbox32_t *Mailbox32)
static void static void
aha_mbo_adv(aha_t *dev) aha_mbo_adv(aha_t *dev)
{ {
if (dev->MailboxCount > 0)
dev->MailboxOutPosCur = (dev->MailboxOutPosCur + 1) % dev->MailboxCount; dev->MailboxOutPosCur = (dev->MailboxOutPosCur + 1) % dev->MailboxCount;
} }

View File

@@ -8,7 +8,7 @@
* *
* The Emulator's Windows core. * The Emulator's Windows core.
* *
* Version: @(#)win.c 1.0.17 2017/10/08 * Version: @(#)win.c 1.0.18 2017/10/08
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -1263,9 +1263,6 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nFunsterStil)
/* Fire up the machine. */ /* Fire up the machine. */
pc_reset_hard(); pc_reset_hard();
/* Make sure the status bar is up-to-date. */
StatusBarUpdatePanes();
/* /*
* Everything has been configured, and all seems to work, * Everything has been configured, and all seems to work,
* so now it is time to start the main thread to do some * so now it is time to start the main thread to do some

View File

@@ -766,7 +766,7 @@ StatusBarUpdatePanes(void)
break; break;
case SB_TEXT: /* Status text */ case SB_TEXT: /* Status text */
SendMessage(hwndSBAR, SB_SETTEXT, i | SBT_NOBORDERS, (LPARAM) L""); SendMessage(hwndSBAR, SB_SETTEXT, i | SBT_NOBORDERS, (LPARAM)L"");
sb_part_icons[i] = -1; sb_part_icons[i] = -1;
break; break;
} }
@@ -1116,6 +1116,7 @@ StatusBarSetTextW(wchar_t *wstr)
int part = -1; int part = -1;
int i; int i;
pclog("SB_settext(%ws)", wstr);
if (!sb_ready || (sb_parts == 0) || (sb_part_meanings == NULL)) return; if (!sb_ready || (sb_parts == 0) || (sb_part_meanings == NULL)) return;
for (i=0; i<sb_parts; i++) { for (i=0; i<sb_parts; i++) {
@@ -1123,9 +1124,11 @@ StatusBarSetTextW(wchar_t *wstr)
part = i; part = i;
} }
} }
pclog(" part=%d", part);
if (part != -1) if (part != -1)
SendMessage(hwndSBAR, SB_SETTEXT, part | SBT_NOBORDERS, (LPARAM)wstr); SendMessage(hwndSBAR, SB_SETTEXT, part | SBT_NOBORDERS, (LPARAM)wstr);
pclog(" done\n");
} }