Re-applied 808x CPU patch, now works.

More changes for cassette operation.
This commit is contained in:
waltje
2019-02-15 17:31:26 -05:00
parent 031cc9f4cf
commit 8f064727fb
3 changed files with 991 additions and 815 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -8,7 +8,7 @@
* *
* Implementation of the XT-style keyboard. * Implementation of the XT-style keyboard.
* *
* Version: @(#)keyboard_xt.c 1.0.13 2019/02/12 * Version: @(#)keyboard_xt.c 1.0.14 2019/02/14
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -54,6 +54,7 @@
#include "../sound/sound.h" #include "../sound/sound.h"
#include "../sound/snd_speaker.h" #include "../sound/snd_speaker.h"
#include "../video/video.h" #include "../video/video.h"
#include <cassette.h>
#include "keyboard.h" #include "keyboard.h"
@@ -482,21 +483,10 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
speaker_enable = val & 2; speaker_enable = val & 2;
if (kbd->type <= KBC_PC82) { if (kbd->type <= KBC_PC82) {
/* #ifdef USE_CASSETTE
* Cassette Port present. if (cassette_enabled)
* cassette_motor(! (val & 0x08));
* Normally, the PC BIOS will disable the #endif
* PC Speaker when doing cassette I/O, as
* they share the same hardware.
*
* For us, it is more fun to actually have
* that audio, so we do some tricks here.
*/
if (! (val & 0x08)) {
/* PB3, MotorOn - enable audio */
speaker_gated = 1;
speaker_enable = 1;
}
} }
if (speaker_enable) if (speaker_enable)

View File

@@ -13,7 +13,7 @@
* B4 to 40, two writes to 43, then two reads * B4 to 40, two writes to 43, then two reads
* - value _does_ change! * - value _does_ change!
* *
* Version: @(#)pit.c 1.0.9 2019/02/12 * Version: @(#)pit.c 1.0.10 2019/02/14
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -54,6 +54,9 @@
#include "../../timer.h" #include "../../timer.h"
#include "../sound/sound.h" #include "../sound/sound.h"
#include "../sound/snd_speaker.h" #include "../sound/snd_speaker.h"
#ifdef USE_CASSETTE
# include <cassette.h>
#endif
#include "../video/video.h" #include "../video/video.h"
#include "nmi.h" #include "nmi.h"
#include "dma.h" #include "dma.h"
@@ -403,6 +406,13 @@ pit_write(uint16_t addr, uint8_t val, void *priv)
case 2: case 2:
t = addr & 3; t = addr & 3;
switch (dev->wm[t]) { switch (dev->wm[t]) {
case 0:
dev->l[t] &= 0xff;
dev->l[t] |= (val << 8);
pit_load(dev, t);
dev->wm[t] = 3;
break;
case 1: case 1:
dev->l[t] = val; dev->l[t] = val;
pit_load(dev, t); pit_load(dev, t);
@@ -413,17 +423,15 @@ pit_write(uint16_t addr, uint8_t val, void *priv)
pit_load(dev, t); pit_load(dev, t);
break; break;
case 0:
dev->l[t] &= 0xff;
dev->l[t] |= (val << 8);
pit_load(dev, t);
dev->wm[t] = 3;
break;
case 3: case 3:
dev->l[t] &= 0xff00; dev->l[t] &= 0xff00;
dev->l[t] |= val; dev->l[t] |= val;
dev->wm[t] = 0; dev->wm[t] = 0;
#ifdef USE_CASSETTE
if (t == 2) {
cassette_write(dev->l[t]);
}
#endif
break; break;
} }