aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-02-05 19:35:07 +0100
committerJavier <dev.git@javispedro.com>2022-02-05 19:35:07 +0100
commitc6228d95afe04aab8ca9b947030679778e228f52 (patch)
treeae36abeb6b7cb60516e20fb781fef06c1a02c775
parent774984e2f00b4ea81060adf7a0625706ddaa42a5 (diff)
downloadvmusic-c6228d95afe04aab8ca9b947030679778e228f52.tar.gz
vmusic-c6228d95afe04aab8ca9b947030679778e228f52.zip
fix accidental truncation of sample_count register
-rw-r--r--Emu8000.cpp2
-rw-r--r--emu8k.c7
-rw-r--r--emu8k.h2
-rwxr-xr-xscripts/enable.sh7
4 files changed, 15 insertions, 3 deletions
diff --git a/Emu8000.cpp b/Emu8000.cpp
index 4e3fd01..8cf471b 100644
--- a/Emu8000.cpp
+++ b/Emu8000.cpp
@@ -84,7 +84,7 @@ typedef PCMOutWin PCMOutBackend;
#define EMU_DEFAULT_SAMPLE_RATE 44100 /* Hz */
#define EMU_NUM_CHANNELS 2
-#define EMU_DEFAULT_ONBOARD_RAM 0x7000U /* KiB */
+#define EMU_DEFAULT_ONBOARD_RAM (8 * 1024) /* KiB */
enum {
EMU_PORT_DATA0 = 0,
diff --git a/emu8k.c b/emu8k.c
index 6737616..194ff58 100644
--- a/emu8k.c
+++ b/emu8k.c
@@ -2432,7 +2432,12 @@ void emu8k_render(emu8k_t *emu8k, int16_t *buf, size_t frames)
emu8k->pos = 0;
}
-void emu8k_update_virtual_sample_count(emu8k_t *emu8k, uint8_t sample_count)
+void emu8k_update_virtual_sample_count(emu8k_t *emu8k, uint16_t sample_count)
{
+#if 0
+ if (sample_count > emu8k->sample_count_virtual + 1) {
+ Log5Func(("big vsc increment: %u : %u -> %u\n", sample_count - emu8k->sample_count_virtual, emu8k->sample_count_virtual, sample_count));
+ }
+#endif
emu8k->sample_count_virtual = sample_count;
}
diff --git a/emu8k.h b/emu8k.h
index 01782a9..f5f77fb 100644
--- a/emu8k.h
+++ b/emu8k.h
@@ -62,7 +62,7 @@ void emu8k_outb(emu8k_t *emu8k, uint16_t addr, uint8_t val);
void emu8k_render(emu8k_t *emu8k, int16_t *buf, size_t frames);
/** Between calls to emu8k_render, the virtual sample count is used to keep the "sample count" register ticking at a reasonable pace. */
-void emu8k_update_virtual_sample_count(emu8k_t *emu8k, uint8_t sample_count);
+void emu8k_update_virtual_sample_count(emu8k_t *emu8k, uint16_t sample_count);
/* Many programs seem to rely in this counter incrementing frequently, and may hang/error out if it doesn't.
* It is reset to 0 whenever we render and therefore increment the real sample count.
* This means that effectively the sample count register may readjust itself (go back or jump ahead) on _render :(. */
diff --git a/scripts/enable.sh b/scripts/enable.sh
index 24763bb..315f0ac 100755
--- a/scripts/enable.sh
+++ b/scripts/enable.sh
@@ -4,6 +4,13 @@ set -ex
vm="$1"
+# Adlib
VBoxManage setextradata "$vm" VBoxInternal/Devices/adlib/0/Trusted 1
VBoxManage setextradata "$vm" VBoxInternal/Devices/adlib/0/Config/MirrorPort "0x220"
+
+# MPU-401
VBoxManage setextradata "$vm" VBoxInternal/Devices/mpu401/0/Trusted 1
+
+# EMU8000
+awe32_romfile=~/.pcem/roms/awe32.raw # Mandatory!
+VBoxManage setextradata "$vm" VBoxInternal/Devices/emu8000/0/Config/ROMFile "$awe32_romfile"