aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README8
-rw-r--r--built/old-builds/prog-z80-1.65.binbin0 -> 5120 bytes
-rw-r--r--built/prog-z80.binbin5120 -> 5120 bytes
-rw-r--r--c/echo.c44
-rw-r--r--c/echoblob.h376
-rw-r--r--src-68k/echo.68k87
-rw-r--r--src-z80/core/direct.z806
-rw-r--r--src-z80/core/vars.z801
8 files changed, 305 insertions, 217 deletions
diff --git a/README b/README
index d16b16c..f479d01 100644
--- a/README
+++ b/README
@@ -8,11 +8,11 @@
| |_______ |_ |___| _| | | | | |_ |_____| _|
|___________| |________| |___| |___| |_________|
___ ___ _ _ ___ __ ___ ___ ___ _ ___ ___ _ ___ ___
- | _| | | | | \ | _| | _| | | _| | | | _| _|
- | |_| | | | | | | | | | |_| | | |_| | | | |_ _ _ ___ ___ | | | |_| |_
- |_ | | | | | | | | | | _| | | | | | | | _| | | | __| _ \ | | | | |
+ | _| | | | | \ | _| | _| | | _| | | | _|_ |
+ | |_| | | | | | | | | | |_| | | |_| | | | |_ _ _ ___ ___ | | | |_ | |
+ |_ | | | | | | | | | | _| | | | | | | | _| | | | __| _ \ | | | | | |
_| | | | | | | | | | | |_| | | | | | | | |_ | | | __| /_ | |_| | | | |
- |___|___|___|_|_|__/ |___|_|_|___|_|_|_|___| \_/|___|_|_\_| |_|_|___|___|
+ |___|___|___|_|_|__/ |___|_|_|___|_|_|_|___| \_/|___|_|_\_| |_|_|___| |_|
=============================================================================
diff --git a/built/old-builds/prog-z80-1.65.bin b/built/old-builds/prog-z80-1.65.bin
new file mode 100644
index 0000000..7785dc1
--- /dev/null
+++ b/built/old-builds/prog-z80-1.65.bin
Binary files differ
diff --git a/built/prog-z80.bin b/built/prog-z80.bin
index 7785dc1..c2c4e0b 100644
--- a/built/prog-z80.bin
+++ b/built/prog-z80.bin
Binary files differ
diff --git a/c/echo.c b/c/echo.c
index 61acf68..5eef324 100644
--- a/c/echo.c
+++ b/c/echo.c
@@ -15,14 +15,14 @@ static volatile uint16_t* const z80_reset = (uint16_t *) 0xA11200;
{ *z80_busreq = 0; }
#define Z80_RESET() \
{ *z80_reset = 0; \
- volatile int16_t i; for (i = 4; i >= 0; i--); \
+ volatile int16_t i; for (i = 30; i >= 0; i--); \
*z80_reset = 0x100; }
// Macro to add delays
// Using volatile is needlessly ugly but at least portable
// GCC is already awful at optimizing, so this isn't that bad...
#define DELAY() \
- { volatile int16_t i; for (i = 0xFF; i >= 0; i--); }
+ { volatile int16_t i; for (i = 0x1FF; i >= 0; i--); }
// Look-up tables for echo_set_volume
const uint8_t echo_fm_vol_table[0x40] = {
@@ -46,6 +46,27 @@ const uint8_t echo_psg_vol_table[0x40] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
+// Look-up table used by echo_play_direct to know how many argument bytes
+// each event has so it knows where the source stream actually ends
+static const uint8_t arg_table[] = {
+ 1,1,1,0, 1,1,1,0, 1,1,1,1, 1,0,0,0, // 00-0F (key on)
+ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 10-1F (key off)
+ 1,1,1,0, 1,1,1,0, 1,1,1,1, 0,0,0,0, // 20-2F (set volume)
+ 2,2,2,0, 2,2,2,0, 2,2,2,1, 0,0,0,0, // 30-3F (set frequency)
+ 1,1,1,0, 1,1,1,0, 1,1,1,1, 0,0,0,0, // 40-4F (set instrument)
+ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 50-5F
+ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 60-6F
+ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 70-7F
+ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 80-8F
+ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // 90-9F
+ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // A0-AF
+ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // B0-BF
+ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // C0-CF
+ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // D0-DF (quick delay)
+ 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // E0-EF (lock channel)
+ 1,1,1,0, 1,1,1,0, 2,2,1,1, 0,0,1,0, // F0-FF (miscellaneous)
+};
+
//***************************************************************************
// echo_init
// Initializes Echo and gets it running.
@@ -66,6 +87,7 @@ void echo_init(const void* const* list) {
// Direct stream is empty yet
z80_ram[0x1F00] = 0xFF;
+ z80_ram[0x1F80] = 0x00;
// Load the instrument list manually, since thanks to linker shenanigans
// we can't implement the list properly in ROM :/
@@ -280,17 +302,31 @@ void echo_play_direct(const void *ptr) {
Z80_REQUEST();
// Check where we can start writing events
- volatile uint8_t *dest = &z80_ram[0x1F00];
- while (*dest != 0xFF) dest++;
+ // If it's a bogus value we need to wait
+ uint8_t len = z80_ram[0x1F80];
+ while (len >= 0x80) {
+ Z80_RELEASE();
+ DELAY();
+ Z80_REQUEST();
+ len = z80_ram[0x1F80];
+ }
// Write the events
const uint8_t *src = (uint8_t*)(ptr);
+ volatile uint8_t *dest = &z80_ram[0x1F00 + len];
for (;;) {
uint8_t byte = *src++;
*dest++ = byte;
if (byte == 0xFF) break;
+ for (unsigned i = arg_table[byte]; i > 0; i--) {
+ *dest++ = *src++;
+ len++;
+ }
}
+ // Store new length
+ z80_ram[0x1F80] = len;
+
// Done with the Z80
Z80_RELEASE();
}
diff --git a/c/echoblob.h b/c/echoblob.h
index 148a832..cfeb4f5 100644
--- a/c/echoblob.h
+++ b/c/echoblob.h
@@ -36,14 +36,14 @@ static uint8_t echo_blob[] = {
54, 0, 37,221, 54, 1, 3,221, 54, 0, 38,221, 54, 1,201,221,
54, 0, 39,221, 54, 1, 63,195,120, 2, 61,202,212, 2, 61,202,
179, 5, 61,202,206, 6, 61,202, 41, 3, 61,202,242, 4, 61,202,
- 210, 3, 61,202, 77, 1, 61,202,122, 3, 61,202, 49, 13, 58, 0,
+ 210, 3, 61,202, 77, 1, 61,202,122, 3, 61,202, 58, 13, 58, 0,
64, 15,207, 42,248, 31, 34,252, 31, 42,250, 31, 34,254, 31,175,
50,251, 31, 58, 0, 64, 15,207, 58,255, 31,183, 32,188, 58, 0,
64, 15,207, 58, 0, 64,203, 79, 32, 8,203, 71,196, 8, 0,195,
120, 2, 58, 0, 64, 15,207,221, 54, 0, 39,221, 54, 1, 47, 58,
- 0, 64, 15,207, 58,241, 31,183,196,122, 17,195,174, 2, 58, 0,
+ 0, 64, 15,207, 58,241, 31,183,196,131, 17,195,174, 2, 58, 0,
64, 15,207,205,140, 7, 58, 0, 64, 15,207, 58,169, 19,183, 32,
- 3,195,196, 2, 58, 0, 64, 15,207,195, 58, 13, 58, 0, 64, 15,
+ 3,195,196, 2, 58, 0, 64, 15,207,195, 67, 13, 58, 0, 64, 15,
207,195,120, 2, 42,253, 31, 58,252, 31, 79, 17, 0, 28,205,252,
2,120,183,202,249, 2, 18, 20,205,252, 2,120, 18, 20,205,252,
2,120, 18, 21, 21, 28,195,222, 2,195, 99, 2, 58,152, 19,185,
@@ -56,25 +56,25 @@ static uint8_t echo_blob[] = {
114, 58, 0, 64, 15,207, 33, 7, 4, 34,194, 2, 6, 8, 14,127,
33, 72, 19,113, 44, 16,252,195, 99, 2, 58,153, 19,183,202, 99,
2, 62, 1, 50,169, 19, 6,127, 14, 7, 33,143, 19, 58, 0, 64,
- 15,207,126,183, 32, 4,121,205,111, 10, 58, 0, 64, 15,207, 45,
+ 15,207,126,183, 32, 4,121,205,120, 10, 58, 0, 64, 15,207, 45,
13,242,141, 3, 6, 4, 14, 15, 17,144, 19, 33, 0, 19, 58, 0,
64, 15,207, 26,183, 32, 5,126,230,128,177,119, 58, 0, 64, 15,
207,125,198, 16,111, 28, 16,230, 58,142, 19,183,204, 52, 1,195,
99, 2, 58,153, 19,183,202, 99, 2,175, 50,169, 19, 6, 4, 17,
147, 19, 33, 63, 19, 58, 0, 64, 15,207, 78,125,214, 15,111, 26,
183, 32, 5,126,230,128,177,119, 58, 0, 64, 15,207, 45, 29, 16,
- 228,205,122, 17,195, 99, 2, 58, 0, 64, 15,207, 33,154, 19,126,
+ 228,205,131, 17,195, 99, 2, 58, 0, 64, 15,207, 33,154, 19,126,
61,202, 24, 4,119,195,196, 2, 58, 0, 64, 15,207, 44, 78, 44,
94, 44, 86,235, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,
- 207,120,254, 8,218,184, 7,254, 11,218, 52, 14,202,162, 14,254,
- 12,202,175, 0, 58, 0, 64, 15,207,120,254, 24,218, 73, 8,254,
- 28,218,244, 14,202, 34, 1, 58, 0, 64, 15,207,120,254,254,202,
- 3, 17,254,255,202,236, 4,254,252,202,149, 5,254,253,202,164,
- 5, 58, 0, 64, 15,207,120,254, 40,218, 30, 10,254, 44,218, 85,
- 15, 58, 0, 64, 15,207,120,254, 56,218,117, 8,254, 59,218, 76,
- 16,202,204, 16, 58, 0, 64, 15,207,120,254, 72,218,239, 8,254,
- 76,218,218, 15, 58, 0, 64, 15,207,120,254,224,218, 19, 17,254,
- 248,218,119, 11,254,250,218,215, 11,202, 62, 17,254,251,202, 95,
+ 207,120,254, 8,218,193, 7,254, 11,218, 61, 14,202,171, 14,254,
+ 12,202,175, 0, 58, 0, 64, 15,207,120,254, 24,218, 82, 8,254,
+ 28,218,253, 14,202, 34, 1, 58, 0, 64, 15,207,120,254,254,202,
+ 12, 17,254,255,202,236, 4,254,252,202,149, 5,254,253,202,164,
+ 5, 58, 0, 64, 15,207,120,254, 40,218, 39, 10,254, 44,218, 94,
+ 15, 58, 0, 64, 15,207,120,254, 56,218,126, 8,254, 59,218, 85,
+ 16,202,213, 16, 58, 0, 64, 15,207,120,254, 72,218,248, 8,254,
+ 76,218,227, 15, 58, 0, 64, 15,207,120,254,224,218, 28, 17,254,
+ 248,218,128, 11,254,250,218,224, 11,202, 71, 17,254,251,202,104,
17, 58, 0, 64, 15,207,195,236, 4, 58, 0, 64, 15,207, 44,194,
217, 4, 36,194,217, 4, 38,128, 12, 58, 0, 64, 15,207, 44,194,
233, 4, 36,194,233, 4, 38,128, 12,195, 36, 4,205,248, 4,195,
@@ -85,7 +85,7 @@ static uint8_t echo_blob[] = {
147, 19, 58, 0, 64, 15,207, 62, 15, 18,123,214, 15, 95,126,183,
32, 2,175, 18, 58, 0, 64, 15,207, 29, 45, 16,229, 6, 8, 17,
79, 19, 58, 0, 64, 15,207, 62,127, 18, 29, 58, 0, 64, 15,207,
- 126,183,194,130, 5, 5,120,205,111, 12, 58, 0, 64, 15,207,120,
+ 126,183,194,130, 5, 5,120,205,120, 12, 58, 0, 64, 15,207,120,
230, 4, 15,253,111,120,230, 3,198,180,253,119, 0,253, 54, 1,
192, 4, 45, 16,205, 33, 80, 19, 62,192, 6, 8,119, 44, 16,252,
175, 50,242, 31,201, 58, 0, 64, 15,207, 42,159, 19, 58,158, 19,
@@ -97,16 +97,16 @@ static uint8_t echo_blob[] = {
34,172, 2, 58, 0, 64, 15,207,195, 99, 2, 58, 0, 64, 15,207,
33,162, 19,126, 61,202, 12, 6,119,195,174, 2, 58, 0, 64, 15,
207, 44, 78, 44, 94, 44, 86,235, 58, 0, 64, 15,207,205,252, 2,
- 58, 0, 64, 15,207,120,254, 8,218,178, 7,254, 11,218, 46, 14,
- 202,156, 14,254, 12,202,169, 0, 58, 0, 64, 15,207,120,254, 24,
- 218, 67, 8,254, 28,218,238, 14,202, 28, 1, 58, 0, 64, 15,207,
- 120,254,254,202,253, 16,254,255,202,200, 6, 58, 0, 64, 15,207,
- 120,254, 40,218, 9, 10,254, 44,218, 51, 15, 58, 0, 64, 15,207,
- 120,254, 56,218,111, 8,254, 59,218, 70, 16,202,198, 16, 58, 0,
- 64, 15,207,120,254, 72,218,233, 8,254, 76,218,156, 15, 58, 0,
- 64, 15,207,120,254,224,218, 9, 17,254,232,218, 65, 12,254,236,
- 218,217, 16,202, 66, 1, 58, 0, 64, 15,207,120,254,248,218, 63,
- 11,254,250,218,209, 11,202, 56, 17,254,251,202, 89, 17,254,252,
+ 58, 0, 64, 15,207,120,254, 8,218,187, 7,254, 11,218, 55, 14,
+ 202,165, 14,254, 12,202,169, 0, 58, 0, 64, 15,207,120,254, 24,
+ 218, 76, 8,254, 28,218,247, 14,202, 28, 1, 58, 0, 64, 15,207,
+ 120,254,254,202, 6, 17,254,255,202,200, 6, 58, 0, 64, 15,207,
+ 120,254, 40,218, 18, 10,254, 44,218, 60, 15, 58, 0, 64, 15,207,
+ 120,254, 56,218,120, 8,254, 59,218, 79, 16,202,207, 16, 58, 0,
+ 64, 15,207,120,254, 72,218,242, 8,254, 76,218,165, 15, 58, 0,
+ 64, 15,207,120,254,224,218, 18, 17,254,232,218, 74, 12,254,236,
+ 218,226, 16,202, 66, 1, 58, 0, 64, 15,207,120,254,248,218, 72,
+ 11,254,250,218,218, 11,202, 65, 17,254,251,202, 98, 17,254,252,
202,110, 7,254,253,202,125, 7,205,212, 6,195,174, 2,205,212,
6,195, 99, 2, 58, 0, 64, 15,207, 58,240, 31,230,254, 50,240,
31, 58, 0, 64, 15,207,175, 50,161, 19, 33,174, 2, 34,172, 2,
@@ -117,172 +117,172 @@ static uint8_t echo_blob[] = {
8,111,198, 4, 95, 84, 58, 0, 64, 15,207, 26,119, 44, 28, 26,
119, 44, 28, 26,119,209, 58, 0, 64, 15,207, 29, 16,188, 6, 8,
58, 0, 64, 15,207, 26,183,202,106, 7,175, 18, 58, 0, 64, 15,
- 207, 5,120,205,111, 12,205,254, 12, 4, 29, 16,227,201, 58, 0,
+ 207, 5,120,205,120, 12,205, 7, 13, 4, 29, 16,227,201, 58, 0,
64, 15,207, 42,167, 19, 58,166, 19, 79,195, 24, 6, 58, 0, 64,
15,207,121, 50,166, 19, 34,167, 19,195, 24, 6, 58, 0, 31, 60,
- 200, 58, 0, 64, 15,207, 33,166, 7, 34,101, 4, 33, 0, 31, 58,
- 152, 19, 79,195, 36, 4, 33,236, 4, 34,101, 4, 62,255, 50, 0,
- 31,201,205,212, 7,195, 24, 6, 71, 58, 0, 64, 15,207,229,120,
- 230, 7, 33,136, 19,133,111,126,225,183,194,217, 4,120,205,212,
- 7,195, 36, 4,230, 7,221, 54, 0, 40,221,119, 1, 71, 8, 58,
- 0, 64, 15,207,120,230, 4, 15,253,111, 58, 0, 64, 15,207,205,
- 252, 2, 58, 0, 64, 15,207, 8,213,229, 87,230, 3,198,164, 95,
- 58, 0, 64, 15,207, 38, 18,120,230, 31,198,144,111, 58, 0, 64,
- 15,207,120,230,224, 15, 15, 71,126,176,253,115, 0,253,119, 1,
- 58, 0, 64, 15,207,123,214, 4, 95, 45,126,253,115, 0,253,119,
- 1, 58, 0, 64, 15,207,122,246,240,221, 54, 0, 40,221,119, 1,
- 225,209,201,205,101, 8,195, 24, 6, 71, 58, 0, 64, 15,207,120,
- 229,230, 7, 33,136, 19,133,111,126,225,183,194, 36, 4,120,205,
- 101, 8,195, 36, 4,230, 7,221, 54, 0, 40,221,119, 1,201,205,
- 145, 8,195, 24, 6, 71, 58, 0, 64, 15,207,120,229,230, 7, 33,
- 136, 19,133,111,126,225,183,194,201, 4,120,205,145, 8,195, 36,
- 4, 71, 8, 58, 0, 64, 15,207,120,230, 4, 15,253,111, 58, 0,
- 64, 15,207,205,252, 2, 58, 0, 64, 15,207,120,135,218,227, 8,
- 8,213,230, 7, 87,230, 3,198,164, 95, 58, 0, 64, 15,207,253,
- 115, 0,253,112, 1, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64,
- 15,207,123,214, 4, 95,253,115, 0,253,112, 1, 58, 0, 64, 15,
- 207,209,201, 60, 71, 8,195,248, 7,205, 69, 9,195, 24, 6,230,
- 7, 71, 58, 0, 64, 15,207,213,197,120, 17, 64, 19,131, 95, 58,
- 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207,120, 18,123,198,
- 8, 95,175, 18, 89,193, 75,209, 58, 0, 64, 15,207,229,120, 38,
- 19,198,136,111,126,225,183,194, 36, 4, 58, 0, 64, 15,207,120,
- 229, 33, 64, 19,133,111, 70,225, 8, 58, 0, 64, 15,207, 8,205,
- 86, 9,195, 36, 4,230, 7, 8, 58, 0, 64, 15,207,205,252, 2,
- 58, 0, 64, 15,207, 8,245,230, 4, 15,253,111, 58, 0, 64, 15,
- 207,241,197,213,229, 38, 28,104, 86, 36, 94, 36, 78,235,245, 58,
- 0, 64, 15,207, 6, 7, 17,177, 19,120, 8,205,252, 2,235,112,
+ 200, 62,255, 50,128, 31, 58, 0, 64, 15,207, 33,171, 7, 34,101,
+ 4, 33, 0, 31, 58,152, 19, 79,195, 36, 4, 33,236, 4, 34,101,
+ 4, 62,255, 50, 0, 31, 60, 50,128, 31,201,205,221, 7,195, 24,
+ 6, 71, 58, 0, 64, 15,207,229,120,230, 7, 33,136, 19,133,111,
+ 126,225,183,194,217, 4,120,205,221, 7,195, 36, 4,230, 7,221,
+ 54, 0, 40,221,119, 1, 71, 8, 58, 0, 64, 15,207,120,230, 4,
+ 15,253,111, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207,
+ 8,213,229, 87,230, 3,198,164, 95, 58, 0, 64, 15,207, 38, 18,
+ 120,230, 31,198,144,111, 58, 0, 64, 15,207,120,230,224, 15, 15,
+ 71,126,176,253,115, 0,253,119, 1, 58, 0, 64, 15,207,123,214,
+ 4, 95, 45,126,253,115, 0,253,119, 1, 58, 0, 64, 15,207,122,
+ 246,240,221, 54, 0, 40,221,119, 1,225,209,201,205,110, 8,195,
+ 24, 6, 71, 58, 0, 64, 15,207,120,229,230, 7, 33,136, 19,133,
+ 111,126,225,183,194, 36, 4,120,205,110, 8,195, 36, 4,230, 7,
+ 221, 54, 0, 40,221,119, 1,201,205,154, 8,195, 24, 6, 71, 58,
+ 0, 64, 15,207,120,229,230, 7, 33,136, 19,133,111,126,225,183,
+ 194,201, 4,120,205,154, 8,195, 36, 4, 71, 8, 58, 0, 64, 15,
+ 207,120,230, 4, 15,253,111, 58, 0, 64, 15,207,205,252, 2, 58,
+ 0, 64, 15,207,120,135,218,236, 8, 8,213,230, 7, 87,230, 3,
+ 198,164, 95, 58, 0, 64, 15,207,253,115, 0,253,112, 1, 58, 0,
+ 64, 15,207,205,252, 2, 58, 0, 64, 15,207,123,214, 4, 95,253,
+ 115, 0,253,112, 1, 58, 0, 64, 15,207,209,201, 60, 71, 8,195,
+ 1, 8,205, 78, 9,195, 24, 6,230, 7, 71, 58, 0, 64, 15,207,
+ 213,197,120, 17, 64, 19,131, 95, 58, 0, 64, 15,207,205,252, 2,
+ 58, 0, 64, 15,207,120, 18,123,198, 8, 95,175, 18, 89,193, 75,
+ 209, 58, 0, 64, 15,207,229,120, 38, 19,198,136,111,126,225,183,
+ 194, 36, 4, 58, 0, 64, 15,207,120,229, 33, 64, 19,133,111, 70,
+ 225, 8, 58, 0, 64, 15,207, 8,205, 95, 9,195, 36, 4,230, 7,
+ 8, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207, 8,245,
+ 230, 4, 15,253,111, 58, 0, 64, 15,207,241,197,213,229, 38, 28,
+ 104, 86, 36, 94, 36, 78,235,245, 58, 0, 64, 15,207, 6, 7, 17,
+ 177, 19,120, 8,205,252, 2,235,112,235, 28,205,252, 2,235,112,
235, 28,205,252, 2,235,112,235, 28,205,252, 2,235,112,235, 28,
- 205,252, 2,235,112,235, 28, 8, 71, 16,222,205,252, 2,235,112,
- 235, 58, 0, 64, 15,207,241, 71,205,111, 12,120, 17, 96, 19,230,
- 7,131, 95,245,230, 3,198,176, 33,177, 19, 8, 58, 0, 64, 15,
- 207, 8,253,119, 0, 70, 44,253,112, 1, 8,120, 18,123,198, 8,
- 95, 58, 0, 64, 15,207, 8,214,128, 6, 28,253,119, 0, 78,253,
- 113, 1,198, 4, 44, 16,244, 58, 0, 64, 15,207,125,214, 24,111,
- 6, 4,126, 18,123,198, 8, 95, 44, 16,247, 58, 0, 64, 15,207,
- 241,225,209,193, 6, 0,195,117, 10,245, 58, 0, 64, 15,207,205,
- 252, 2, 58, 0, 64, 15,207,241,205,117, 10,195, 24, 6,230, 7,
- 71, 58, 0, 64, 15,207,213,197,120, 22, 19,198, 72, 95, 58, 0,
- 64, 15,207,205,252, 2, 58, 0, 64, 15,207,235,112,235, 89,193,
- 75,209, 58, 0, 64, 15,207,229,120, 33,136, 19,133,111,126,225,
- 183,194, 36, 4, 58, 0, 64, 15,207,120,229, 33, 72, 19,133,111,
- 70,225,245, 58, 0, 64, 15,207,241,205,117, 10,195, 36, 4,197,
- 213,229,195,130, 10,197,213,229,230, 7,245, 38, 19,198, 88,111,
- 112,241,245, 38, 19,198, 96,111, 8, 58, 0, 64, 15,207, 8,230,
- 7,246,224, 22, 31, 95, 8, 26, 87, 58, 0, 64, 15,207, 8,230,
- 4, 15,253,111, 58, 0, 64, 15,207,241,230, 3,198, 64, 79,126,
- 230, 7, 95, 58, 0, 64, 15,207,125,198, 8,111,123,254, 7, 56,
- 17,253,113, 0,126,130,250,205, 10,128,242,207, 10, 62,127,253,
- 119, 1,121,198, 4, 79, 58, 0, 64, 15,207,125,198, 8,111,123,
- 254, 5, 56, 17,253,113, 0,126,130,250,240, 10,128,242,242, 10,
- 62,127,253,119, 1,121,198, 4, 79, 58, 0, 64, 15,207,125,198,
- 8,111,123,254, 4, 56, 17,253,113, 0,126,130,250, 19, 11,128,
- 242, 21, 11, 62,127,253,119, 1,121,198, 4, 79, 58, 0, 64, 15,
- 207,125,198, 8,111,253,113, 0,126,130,250, 49, 11,128,242, 51,
- 11, 62,127,253,119, 1, 58, 0, 64, 15,207,225,209,193,201, 71,
- 58, 0, 64, 15,207,120,230, 4, 15,253,111,120, 8, 58, 0, 64,
- 15,207,205,252, 2, 58, 0, 64, 15,207, 58,170, 19,183, 40, 9,
- 120,246,192, 71, 58, 0, 64, 15,207, 8,230, 3,198,180,253,119,
- 0,253,112, 1,195, 24, 6, 71, 58, 0, 64, 15,207,120,230, 4,
- 15,253,111,120, 8, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64,
- 15,207, 58,170, 19,183, 40, 9,120,246,192, 71, 58, 0, 64, 15,
- 207, 8,229,230, 7, 38, 19,198, 80,111,112, 8, 58, 0, 64, 15,
- 207, 8,230, 7,198,136,111, 8,126,183,225,194, 36, 4, 58, 0,
- 64, 15,207, 8,230, 3,198,180,253,119, 0,253,112, 1,195, 36,
- 4,205,221, 11,195, 24, 6,205,221, 11,195, 36, 4,230, 1,135,
- 253,111, 58, 0, 64, 15,207,205,252, 2,120,254, 39, 40, 23,197,
- 58, 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207,120,193,253,
- 112, 0,253,119, 1,201, 58, 0, 64, 15,207,205,252, 2, 58, 0,
- 64, 15,207,120,230,192,246, 15, 71, 62, 39,253,119, 0,253,112,
- 0, 58, 0, 64, 15,207,120,230,192, 58, 17, 0,230, 63,183, 50,
- 17, 0, 58,158, 2,230, 63,183, 50,158, 2, 58, 0, 64, 15,207,
- 201,230, 7, 71, 58, 0, 64, 15,207,229, 38, 19,120,198,136,111,
- 54, 1,225, 58, 0, 64, 15,207,120,230, 4, 15,253,111,120,230,
- 3,135,135,198,180,253,119, 0,253, 54, 1,192,195, 24, 6,230,
- 7,245,213,229, 79,230, 4, 15,253,111,121,230, 3,198, 64, 14,
- 6, 33,183, 18, 8, 58, 0, 64, 15,207, 8, 94,253,119, 0,253,
- 115, 1,198, 4, 8, 58, 0, 64, 15,207, 8,253,119, 0,253,115,
- 1,198, 4, 8, 58, 0, 64, 15,207, 8,253,119, 0,253,115, 1,
- 198, 4, 8, 58, 0, 64, 15,207, 8,253,119, 0,253,115, 1,198,
- 4, 44, 13,194,132, 12, 30, 0,198, 4,253,119, 0,253,115, 1,
- 214, 4,253,119, 0,253,115, 1,225,209, 58, 0, 64, 15,207,241,
- 79,246,240,221, 54, 0, 40,221,113, 1,221, 54, 0, 40,221,119,
- 1,221, 54, 0, 40,221,113, 1, 58, 0, 64, 15,207,201,120, 38,
- 19,198, 64,111,197,120, 70,205, 86, 9,193, 58, 0, 64, 15,207,
- 197,125,198, 8,111,120, 70,205,117, 10,193,125,198, 8,111,120,
- 230, 3,198,180,253,119, 0,126,253,119, 1, 58, 0, 64, 15,207,
- 201, 58,252, 31, 50,170, 19,195, 99, 2, 33, 48, 19, 6, 3,197,
- 175,253,111,126,183,250, 78, 13, 6, 15, 44,195,154, 13,230,127,
- 71, 44,126,128, 71, 58, 0, 64, 15,207,197, 44, 78, 44, 94, 44,
- 86,235, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207,120,
- 254,254,202, 8, 14,254,255,202, 27, 14,253,104, 58, 0, 64, 15,
- 207,235,114, 45,115, 45,113, 45,193, 58, 0, 64, 15,207,253,125,
- 230, 15,128, 71,254, 16, 56, 2, 6, 15, 58, 0, 64, 15,207,120,
- 7, 7, 7,193,176, 15, 15, 15,246,144, 50, 17,127, 58, 0, 64,
- 15,207,197,125,198, 10,111, 70,214, 10,111,120, 60, 40, 56, 58,
- 0, 64, 15,207,253,125,230,240, 15, 15, 15, 15,235, 38, 18,198,
- 168,111, 78,235, 58, 0, 64, 15,207,120,129,235, 38, 18,111, 78,
- 44, 70, 58, 0, 64, 15,207,123,230, 48,135,177, 33, 17,127,119,
- 112,235, 58, 0, 64, 15,207,193,125,214, 17,111, 58, 0, 64, 15,
- 207, 5,242, 63, 13,195,204, 2, 58, 0, 64, 15,207, 28,235,113,
- 44,115, 44,114,235, 29, 29, 29,195, 98, 13, 58, 0, 64, 15,207,
- 28,235, 78, 44, 94, 44, 86,235, 29, 29, 29,195, 98, 13,205, 80,
- 14,195, 24, 6, 71, 58, 0, 64, 15,207,120,229,230, 3, 33,144,
- 19,133,111,126,225,183,194,217, 4,120,205, 80, 14,195, 36, 4,
- 230, 3, 71, 8, 58, 0, 64, 15,207,229, 38, 19,120, 15, 15, 15,
- 15,111,126,246,128,119, 58, 0, 64, 15,207,213, 44, 44, 84,125,
- 198, 6, 95, 58, 0, 64, 15,207, 26,119, 44, 28, 26,119, 44, 28,
- 26,119,123,209,225, 8, 58, 0, 64, 15,207,205,252, 2, 58, 0,
- 64, 15,207, 8,229, 60, 38, 19,111,112,225,201,205,175, 14,195,
- 24, 6, 58,147, 19,183,194,217, 4,205,175, 14,195, 36, 4, 58,
- 0, 64, 15,207,229, 33, 48, 19,126,246,128,119, 58, 0, 64, 15,
- 207,213, 44, 44, 84,125,198, 6, 95, 58, 0, 64, 15,207, 26,119,
- 44, 28, 26,119, 44, 28, 26,119,209,225, 58, 0, 64, 15,207,205,
- 252, 2, 58, 0, 64, 15,207, 62,224,176, 50, 17,127,201,205, 16,
- 15,195, 24, 6, 71, 58, 0, 64, 15,207,120,229,230, 3, 33,144,
- 19,133,111,126,225,183,194, 36, 4,120,205, 16, 15,195, 36, 4,
- 230, 3, 71, 58, 0, 64, 15,207,229, 38, 19,120, 15, 15, 15, 15,
- 111,126,230,127,119, 58, 0, 64, 15,207,125,198, 11,111, 62,255,
- 119,225,201,230, 3, 8, 58, 0, 64, 15,207,205,252, 2, 58, 0,
- 64, 15,207, 8,229, 38, 19, 15, 15, 15, 15,111,126,230,128,176,
- 119,225,195, 24, 6,230, 3, 8, 58, 0, 64, 15,207,205,252, 2,
- 58, 0, 64, 15,207, 8,213,229,245, 17,144, 19,131, 95, 26, 95,
- 58, 0, 64, 15,207,241, 38, 19, 15, 15, 15, 15,198, 15,111,112,
- 58, 0, 64, 15,207,123,183, 32, 14,125,214, 15,111,126,230,128,
- 176,119, 58, 0, 64, 15,207,225,209,195, 36, 4,230, 3, 8, 58,
- 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207, 8,213,229, 22,
- 28, 88, 38, 19, 15, 15, 15, 15,198, 10,111, 58, 0, 64, 15,207,
- 26,119, 20, 45, 26,119, 20, 45, 26,119, 58, 0, 64, 15,207,125,
- 214, 8,111, 54, 0,225,209,195, 24, 6,230, 3, 8, 58, 0, 64,
- 15,207,205,252, 2, 58, 0, 64, 15,207, 8,213,229, 22, 28, 88,
- 33,144, 19,245,133,111,241, 70, 38, 19, 15, 15, 15, 15,198, 15,
- 111, 58, 0, 64, 15,207,175,119, 45, 26,119, 20, 45, 26,119, 20,
- 45, 26,119, 58, 0, 64, 15,207,120,183,202, 34, 16,225,209,195,
- 36, 4, 58, 0, 64, 15,207, 84,125,214, 4, 95,126, 18, 44, 28,
- 126, 18, 44, 28,126, 18, 58, 0, 64, 15,207,125,214, 8,111, 54,
- 0,225,209,195, 36, 4,205,104, 16,195, 24, 6, 71, 58, 0, 64,
- 15,207,120,229,230, 15, 38, 19,198,136,111,126,225,183,194,201,
- 4,120,205,104, 16,195, 36, 4,230, 3, 8, 58, 0, 64, 15,207,
- 205,252, 2, 58, 0, 64, 15,207,120,135,218,182, 16, 8,229,111,
- 8, 58, 0, 64, 15,207,125, 15, 15, 15, 15,198, 11,111, 38, 19,
- 54,255,225, 58, 0, 64, 15,207, 8,213, 17, 17,127, 15, 15, 15,
- 176,246,128, 18, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,
- 207,235,112,235,209,201, 71, 58, 0, 64, 15,207, 8, 15, 15, 15,
- 15,198, 10,195,148, 14,205,218, 14,195, 24, 6, 58,147, 19,183,
- 194,217, 4,205,218, 14,195, 36, 4,230, 3, 71, 58, 0, 64, 15,
- 207,229, 38, 19,120,198,144,111, 54, 1, 58, 0, 64, 15,207,120,
- 15, 15, 15, 15,111, 38, 19, 54, 0,225,195, 24, 6,205, 29, 17,
- 195,174, 2,205, 29, 17,195,196, 2,230, 15, 60, 71,205, 42, 17,
- 195,174, 2,230, 15, 60, 71,205, 42, 17,195,196, 2, 58, 0, 64,
- 15,207,205,252, 2, 58, 0, 64, 15,207,235,114, 45,115, 45,113,
- 58, 0, 64, 15,207, 45,112,201,205, 68, 17,195, 24, 6,205, 68,
- 17,195, 36, 4, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,
- 207, 58,242, 31,176, 50,242, 31,201,205,101, 17,195, 24, 6,205,
- 101, 17,195, 36, 4, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64,
- 15,207, 58,242, 31,160, 50,242, 31,201, 33,240, 31, 17, 88, 19,
- 14, 8, 26, 70,128,242,138, 17, 62,127, 71,125,230, 7,205,111,
- 10, 44, 28, 13, 58, 0, 64, 15,207, 32,231, 33,232, 31, 17, 1,
- 19, 1, 16, 4,126, 18, 44,123,129, 95, 58, 0, 64, 15,207, 16,
- 243,175, 50,241, 31,201,255,255,255,255,255,255,255,255,255,255,
+ 8, 71, 16,222,205,252, 2,235,112,235, 58, 0, 64, 15,207,241,
+ 71,205,120, 12,120, 17, 96, 19,230, 7,131, 95,245,230, 3,198,
+ 176, 33,177, 19, 8, 58, 0, 64, 15,207, 8,253,119, 0, 70, 44,
+ 253,112, 1, 8,120, 18,123,198, 8, 95, 58, 0, 64, 15,207, 8,
+ 214,128, 6, 28,253,119, 0, 78,253,113, 1,198, 4, 44, 16,244,
+ 58, 0, 64, 15,207,125,214, 24,111, 6, 4,126, 18,123,198, 8,
+ 95, 44, 16,247, 58, 0, 64, 15,207,241,225,209,193, 6, 0,195,
+ 126, 10,245, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207,
+ 241,205,126, 10,195, 24, 6,230, 7, 71, 58, 0, 64, 15,207,213,
+ 197,120, 22, 19,198, 72, 95, 58, 0, 64, 15,207,205,252, 2, 58,
+ 0, 64, 15,207,235,112,235, 89,193, 75,209, 58, 0, 64, 15,207,
+ 229,120, 33,136, 19,133,111,126,225,183,194, 36, 4, 58, 0, 64,
+ 15,207,120,229, 33, 72, 19,133,111, 70,225,245, 58, 0, 64, 15,
+ 207,241,205,126, 10,195, 36, 4,197,213,229,195,139, 10,197,213,
+ 229,230, 7,245, 38, 19,198, 88,111,112,241,245, 38, 19,198, 96,
+ 111, 8, 58, 0, 64, 15,207, 8,230, 7,246,224, 22, 31, 95, 8,
+ 26, 87, 58, 0, 64, 15,207, 8,230, 4, 15,253,111, 58, 0, 64,
+ 15,207,241,230, 3,198, 64, 79,126,230, 7, 95, 58, 0, 64, 15,
+ 207,125,198, 8,111,123,254, 7, 56, 17,253,113, 0,126,130,250,
+ 214, 10,128,242,216, 10, 62,127,253,119, 1,121,198, 4, 79, 58,
+ 0, 64, 15,207,125,198, 8,111,123,254, 5, 56, 17,253,113, 0,
+ 126,130,250,249, 10,128,242,251, 10, 62,127,253,119, 1,121,198,
+ 4, 79, 58, 0, 64, 15,207,125,198, 8,111,123,254, 4, 56, 17,
+ 253,113, 0,126,130,250, 28, 11,128,242, 30, 11, 62,127,253,119,
+ 1,121,198, 4, 79, 58, 0, 64, 15,207,125,198, 8,111,253,113,
+ 0,126,130,250, 58, 11,128,242, 60, 11, 62,127,253,119, 1, 58,
+ 0, 64, 15,207,225,209,193,201, 71, 58, 0, 64, 15,207,120,230,
+ 4, 15,253,111,120, 8, 58, 0, 64, 15,207,205,252, 2, 58, 0,
+ 64, 15,207, 58,170, 19,183, 40, 9,120,246,192, 71, 58, 0, 64,
+ 15,207, 8,230, 3,198,180,253,119, 0,253,112, 1,195, 24, 6,
+ 71, 58, 0, 64, 15,207,120,230, 4, 15,253,111,120, 8, 58, 0,
+ 64, 15,207,205,252, 2, 58, 0, 64, 15,207, 58,170, 19,183, 40,
+ 9,120,246,192, 71, 58, 0, 64, 15,207, 8,229,230, 7, 38, 19,
+ 198, 80,111,112, 8, 58, 0, 64, 15,207, 8,230, 7,198,136,111,
+ 8,126,183,225,194, 36, 4, 58, 0, 64, 15,207, 8,230, 3,198,
+ 180,253,119, 0,253,112, 1,195, 36, 4,205,230, 11,195, 24, 6,
+ 205,230, 11,195, 36, 4,230, 1,135,253,111, 58, 0, 64, 15,207,
+ 205,252, 2,120,254, 39, 40, 23,197, 58, 0, 64, 15,207,205,252,
+ 2, 58, 0, 64, 15,207,120,193,253,112, 0,253,119, 1,201, 58,
+ 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207,120,230,192,246,
+ 15, 71, 62, 39,253,119, 0,253,112, 0, 58, 0, 64, 15,207,120,
+ 230,192, 58, 17, 0,230, 63,183, 50, 17, 0, 58,158, 2,230, 63,
+ 183, 50,158, 2, 58, 0, 64, 15,207,201,230, 7, 71, 58, 0, 64,
+ 15,207,229, 38, 19,120,198,136,111, 54, 1,225, 58, 0, 64, 15,
+ 207,120,230, 4, 15,253,111,120,230, 3,135,135,198,180,253,119,
+ 0,253, 54, 1,192,195, 24, 6,230, 7,245,213,229, 79,230, 4,
+ 15,253,111,121,230, 3,198, 64, 14, 6, 33,183, 18, 8, 58, 0,
+ 64, 15,207, 8, 94,253,119, 0,253,115, 1,198, 4, 8, 58, 0,
+ 64, 15,207, 8,253,119, 0,253,115, 1,198, 4, 8, 58, 0, 64,
+ 15,207, 8,253,119, 0,253,115, 1,198, 4, 8, 58, 0, 64, 15,
+ 207, 8,253,119, 0,253,115, 1,198, 4, 44, 13,194,141, 12, 30,
+ 0,198, 4,253,119, 0,253,115, 1,214, 4,253,119, 0,253,115,
+ 1,225,209, 58, 0, 64, 15,207,241, 79,246,240,221, 54, 0, 40,
+ 221,113, 1,221, 54, 0, 40,221,119, 1,221, 54, 0, 40,221,113,
+ 1, 58, 0, 64, 15,207,201,120, 38, 19,198, 64,111,197,120, 70,
+ 205, 95, 9,193, 58, 0, 64, 15,207,197,125,198, 8,111,120, 70,
+ 205,126, 10,193,125,198, 8,111,120,230, 3,198,180,253,119, 0,
+ 126,253,119, 1, 58, 0, 64, 15,207,201, 58,252, 31, 50,170, 19,
+ 195, 99, 2, 33, 48, 19, 6, 3,197,175,253,111,126,183,250, 87,
+ 13, 6, 15, 44,195,163, 13,230,127, 71, 44,126,128, 71, 58, 0,
+ 64, 15,207,197, 44, 78, 44, 94, 44, 86,235, 58, 0, 64, 15,207,
+ 205,252, 2, 58, 0, 64, 15,207,120,254,254,202, 17, 14,254,255,
+ 202, 36, 14,253,104, 58, 0, 64, 15,207,235,114, 45,115, 45,113,
+ 45,193, 58, 0, 64, 15,207,253,125,230, 15,128, 71,254, 16, 56,
+ 2, 6, 15, 58, 0, 64, 15,207,120, 7, 7, 7,193,176, 15, 15,
+ 15,246,144, 50, 17,127, 58, 0, 64, 15,207,197,125,198, 10,111,
+ 70,214, 10,111,120, 60, 40, 56, 58, 0, 64, 15,207,253,125,230,
+ 240, 15, 15, 15, 15,235, 38, 18,198,168,111, 78,235, 58, 0, 64,
+ 15,207,120,129,235, 38, 18,111, 78, 44, 70, 58, 0, 64, 15,207,
+ 123,230, 48,135,177, 33, 17,127,119,112,235, 58, 0, 64, 15,207,
+ 193,125,214, 17,111, 58, 0, 64, 15,207, 5,242, 72, 13,195,204,
+ 2, 58, 0, 64, 15,207, 28,235,113, 44,115, 44,114,235, 29, 29,
+ 29,195,107, 13, 58, 0, 64, 15,207, 28,235, 78, 44, 94, 44, 86,
+ 235, 29, 29, 29,195,107, 13,205, 89, 14,195, 24, 6, 71, 58, 0,
+ 64, 15,207,120,229,230, 3, 33,144, 19,133,111,126,225,183,194,
+ 217, 4,120,205, 89, 14,195, 36, 4,230, 3, 71, 8, 58, 0, 64,
+ 15,207,229, 38, 19,120, 15, 15, 15, 15,111,126,246,128,119, 58,
+ 0, 64, 15,207,213, 44, 44, 84,125,198, 6, 95, 58, 0, 64, 15,
+ 207, 26,119, 44, 28, 26,119, 44, 28, 26,119,123,209,225, 8, 58,
+ 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207, 8,229, 60, 38,
+ 19,111,112,225,201,205,184, 14,195, 24, 6, 58,147, 19,183,194,
+ 217, 4,205,184, 14,195, 36, 4, 58, 0, 64, 15,207,229, 33, 48,
+ 19,126,246,128,119, 58, 0, 64, 15,207,213, 44, 44, 84,125,198,
+ 6, 95, 58, 0, 64, 15,207, 26,119, 44, 28, 26,119, 44, 28, 26,
+ 119,209,225, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207,
+ 62,224,176, 50, 17,127,201,205, 25, 15,195, 24, 6, 71, 58, 0,
+ 64, 15,207,120,229,230, 3, 33,144, 19,133,111,126,225,183,194,
+ 36, 4,120,205, 25, 15,195, 36, 4,230, 3, 71, 58, 0, 64, 15,
+ 207,229, 38, 19,120, 15, 15, 15, 15,111,126,230,127,119, 58, 0,
+ 64, 15,207,125,198, 11,111, 62,255,119,225,201,230, 3, 8, 58,
+ 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207, 8,229, 38, 19,
+ 15, 15, 15, 15,111,126,230,128,176,119,225,195, 24, 6,230, 3,
+ 8, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,207, 8,213,
+ 229,245, 17,144, 19,131, 95, 26, 95, 58, 0, 64, 15,207,241, 38,
+ 19, 15, 15, 15, 15,198, 15,111,112, 58, 0, 64, 15,207,123,183,
+ 32, 14,125,214, 15,111,126,230,128,176,119, 58, 0, 64, 15,207,
+ 225,209,195, 36, 4,230, 3, 8, 58, 0, 64, 15,207,205,252, 2,
+ 58, 0, 64, 15,207, 8,213,229, 22, 28, 88, 38, 19, 15, 15, 15,
+ 15,198, 10,111, 58, 0, 64, 15,207, 26,119, 20, 45, 26,119, 20,
+ 45, 26,119, 58, 0, 64, 15,207,125,214, 8,111, 54, 0,225,209,
+ 195, 24, 6,230, 3, 8, 58, 0, 64, 15,207,205,252, 2, 58, 0,
+ 64, 15,207, 8,213,229, 22, 28, 88, 33,144, 19,245,133,111,241,
+ 70, 38, 19, 15, 15, 15, 15,198, 15,111, 58, 0, 64, 15,207,175,
+ 119, 45, 26,119, 20, 45, 26,119, 20, 45, 26,119, 58, 0, 64, 15,
+ 207,120,183,202, 43, 16,225,209,195, 36, 4, 58, 0, 64, 15,207,
+ 84,125,214, 4, 95,126, 18, 44, 28,126, 18, 44, 28,126, 18, 58,
+ 0, 64, 15,207,125,214, 8,111, 54, 0,225,209,195, 36, 4,205,
+ 113, 16,195, 24, 6, 71, 58, 0, 64, 15,207,120,229,230, 15, 38,
+ 19,198,136,111,126,225,183,194,201, 4,120,205,113, 16,195, 36,
+ 4,230, 3, 8, 58, 0, 64, 15,207,205,252, 2, 58, 0, 64, 15,
+ 207,120,135,218,191, 16, 8,229,111, 8, 58, 0, 64, 15,207,125,
+ 15, 15, 15, 15,198, 11,111, 38, 19, 54,255,225, 58, 0, 64, 15,
+ 207, 8,213, 17, 17,127, 15, 15, 15,176,246,128, 18, 58, 0, 64,
+ 15,207,205,252, 2, 58, 0, 64, 15,207,235,112,235,209,201, 71,
+ 58, 0, 64, 15,207, 8, 15, 15, 15, 15,198, 10,195,157, 14,205,
+ 227, 14,195, 24, 6, 58,147, 19,183,194,217, 4,205,227, 14,195,
+ 36, 4,230, 3, 71, 58, 0, 64, 15,207,229, 38, 19,120,198,144,
+ 111, 54, 1, 58, 0, 64, 15,207,120, 15, 15, 15, 15,111, 38, 19,
+ 54, 0,225,195, 24, 6,205, 38, 17,195,174, 2,205, 38, 17,195,
+ 196, 2,230, 15, 60, 71,205, 51, 17,195,174, 2,230, 15, 60, 71,
+ 205, 51, 17,195,196, 2, 58, 0, 64, 15,207,205,252, 2, 58, 0,
+ 64, 15,207,235,114, 45,115, 45,113, 58, 0, 64, 15,207, 45,112,
+ 201,205, 77, 17,195, 24, 6,205, 77, 17,195, 36, 4, 58, 0, 64,
+ 15,207,205,252, 2, 58, 0, 64, 15,207, 58,242, 31,176, 50,242,
+ 31,201,205,110, 17,195, 24, 6,205,110, 17,195, 36, 4, 58, 0,
+ 64, 15,207,205,252, 2, 58, 0, 64, 15,207, 58,242, 31,160, 50,
+ 242, 31,201, 33,240, 31, 17, 88, 19, 14, 8, 26, 70,128,242,147,
+ 17, 62,127, 71,125,230, 7,205,120, 10, 44, 28, 13, 58, 0, 64,
+ 15,207, 32,231, 33,232, 31, 17, 1, 19, 1, 16, 4,126, 18, 44,
+ 123,129, 95, 58, 0, 64, 15,207, 16,243,175, 50,241, 31,201,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
diff --git a/src-68k/echo.68k b/src-68k/echo.68k
index 46fb361..530db5f 100644
--- a/src-68k/echo.68k
+++ b/src-68k/echo.68k
@@ -52,7 +52,7 @@ Echo_SendCommand:
tst.b (a1) ; Check if 2nd slot is ready
beq.s @Ready ; Too busy?
Echo_Z80Release ; Let Echo continue
- move.w #$FF, d1 ; Give it some time
+ move.w #$1FF, d1 ; Give it some time
dbf d1, * ; ...
bra.s @Try ; Try again
@@ -85,7 +85,7 @@ Echo_SendCommandEx:
tst.b (a1) ; Check if 2nd slot is ready
beq.s @Ready ; Too busy?
Echo_Z80Release ; Let Echo continue
- move.w #$FF, d1 ; Give it some time
+ move.w #$1FF, d1 ; Give it some time
dbf d1, * ; ...
bra.s @Try ; Try again
@@ -122,9 +122,10 @@ Echo_SendCommandEx:
Echo_SendCommandByte:
movem.l d1-d2/a1, -(sp) ; Save registers
- Echo_Z80Request ; We need the Z80 bus
@Try:
+ Echo_Z80Request ; We need the Z80 bus
+
lea ($A01FFF), a1 ; First try the 1st slot
tst.b (a1) ; Is 1st slot available?
beq.s @Ready ; If so, move on
@@ -133,7 +134,7 @@ Echo_SendCommandByte:
tst.b (a1) ; Check if 2nd slot is ready
beq.s @Ready ; Too busy?
Echo_Z80Release ; Let Echo continue
- move.w #$FF, d2 ; Give it some time
+ move.w #$1FF, d2 ; Give it some time
dbf d2, * ; ...
bra.s @Try ; Try again
@@ -234,26 +235,69 @@ Echo_ResumeBGM:
Echo_PlayDirect:
Echo_Z80Request ; We need the Z80 bus
- movem.l d0-d1/a0-a1, -(sp) ; Save registers
-
- lea ($A01F00), a1 ; Skip any pending events
- moveq #-1, d1
-@Skip:
- cmp.b (a1), d1
- beq.s @Load
- addq.w #1, a1
- bra.s @Skip
-
-@Load: ; Copy stream into the direct buffer
- move.b (a0)+, d0
- move.b d0, (a1)+
- cmp.b d1, d0
- bne.s @Load
-
- movem.l (sp)+, d0-d1/a0-a1 ; Restore registers
+ movem.l d0-d1/a0-a2, -(sp) ; Save registers
+
+@Check:
+ moveq #0, d0 ; Retrieve direct stream length
+ move.b ($A01F80), d0
+ bpl.s @StreamOk ; Is it valid?
+@Wait:
+ Echo_Z80Release ; If not, let the Z80 run until it's
+ move.w #$1FF, d0 ; done processing the direct stream
+ dbf d0, * ; ...
+ Echo_Z80Request ; Take over Z80 bus again
+ bra.s @Check ; Retry
+
+@StreamOk:
+ lea ($A01F00), a1 ; Get pointer to last event in the
+ lea (a1,d0.w), a1 ; direct stream
+
+ lea @ArgTable(pc), a2 ; Copy stream into the direct buffer
+@LoadLoop:
+ move.b (a0)+, d0 ; Get byte from source stream...
+ move.b d0, (a1)+ ; ...and store it into direct stream
+ cmp.b #$FF, d0 ; Was it the STOP event?
+ beq.s @LoadEnd ; If so, we're done
+ moveq #0, d0 ; Check how many argument bytes it has
+ move.b (a2,d0.w), d0
+ subq.w #1, d0 ; Adjust for DBF
+ bmi.s @LoadLoop ; No arguments?
+@LoadArgLoop:
+ move.b (a0)+, (a1)+ ; Copy the arguments
+ dbf d0, @LoadArgLoop
+ bra.s @LoadLoop ; Keep copying
+@LoadEnd:
+
+ move.w a1, d0 ; Update stream length
+ subq.b #1, d0
+ move.b d0, ($A01F80)
+
+ movem.l (sp)+, d0-d1/a0-a2 ; Restore registers
Echo_Z80Release ; We're done with the Z80 bus
rts ; End of subroutine
+;----------------------------------------------------------------------------
+; Look-up table used to know how many bytes each event has as argument
+;----------------------------------------------------------------------------
+
+@ArgTable:
+ dc.b 1,1,1,0, 1,1,1,0, 1,1,1,1, 1,0,0,0 ; $00-$0F (key on)
+ dc.b 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ; $10-$1F (key off)
+ dc.b 1,1,1,0, 1,1,1,0, 1,1,1,1, 0,0,0,0 ; $20-$2F (set volume)
+ dc.b 2,2,2,0, 2,2,2,0, 2,2,2,1, 0,0,0,0 ; $30-$3F (set frequency)
+ dc.b 1,1,1,0, 1,1,1,0, 1,1,1,1, 0,0,0,0 ; $40-$4F (set instrument)
+ dc.b 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ; $50-$5F
+ dc.b 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ; $60-$6F
+ dc.b 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ; $70-$7F
+ dc.b 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ; $80-$8F
+ dc.b 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ; $90-$9F
+ dc.b 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ; $A0-$AF
+ dc.b 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ; $B0-$BF
+ dc.b 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ; $C0-$CF
+ dc.b 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ; $D0-$DF (quick delay)
+ dc.b 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0 ; $E0-$EF (lock channel)
+ dc.b 1,1,1,0, 1,1,1,0, 2,2,1,1, 0,0,1,0 ; $F0-$FF (miscellaneous)
+
;****************************************************************************
; Echo_SetPCMRate
; Sets the playback rate of PCM
@@ -591,6 +635,7 @@ Echo_Init:
move.b d0, ($A01FF1)
move.b #$FF, ($A01F00) ; No direct events to execute
+ move.b #$00, ($A01F80)
Echo_Z80Reset ; Now reset for real
Echo_Z80Release ; Let the Z80 go!
diff --git a/src-z80/core/direct.z80 b/src-z80/core/direct.z80
index d796ddf..570175f 100644
--- a/src-z80/core/direct.z80
+++ b/src-z80/core/direct.z80
@@ -10,6 +10,9 @@ ProcessDirect:
inc a
ret z
+ ld a, $FF ; Put bogus length for direct stream
+ ld (RAM_DirectLen), a ; so 68000 knows to wait
+
PollPCM
ld hl, ProcessDirectEnd ; Override $FF event
@@ -24,7 +27,10 @@ ProcessDirect:
ProcessDirectEnd:
ld hl, StopBGMEvent ; Restore $FF event
ld (ProcessBGMEventFF+1), hl
+
ld a, $FF ; Reset the stream
ld ($1F00), a
+ inc a
+ ld (RAM_DirectLen), a
ret ; Return to the main loop
diff --git a/src-z80/core/vars.z80 b/src-z80/core/vars.z80
index 23b15b5..054106b 100644
--- a/src-z80/core/vars.z80
+++ b/src-z80/core/vars.z80
@@ -77,6 +77,7 @@ RAM_PointerList: equ $1C00
; 68000 communication variables
;****************************************************************************
+RAM_DirectLen: equ $1F80 ; Length of direct event stream
RAM_Stack: equ $1FE0 ; Where stack starts
RAM_GlobalVol: equ $1FE0 ; Global volume for all channels