aboutsummaryrefslogtreecommitdiff
path: root/c/echo.c
diff options
context:
space:
mode:
authorSik2020-04-16 01:03:03 -0300
committerSik2020-04-16 01:03:03 -0300
commit16bedcd72b8b300440a2b1fa3a39290aa79a7940 (patch)
tree0915240526aeb442a39295b9788e175e8afd4d25 /c/echo.c
parent8e96c87f2d2bac7207718fd211f29fc085d31bc3 (diff)
Hopefully fixing some issues with the C API
Diffstat (limited to 'c/echo.c')
-rw-r--r--c/echo.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/c/echo.c b/c/echo.c
index 5eef324..cd27cb0 100644
--- a/c/echo.c
+++ b/c/echo.c
@@ -316,7 +316,7 @@ void echo_play_direct(const void *ptr) {
volatile uint8_t *dest = &z80_ram[0x1F00 + len];
for (;;) {
uint8_t byte = *src++;
- *dest++ = byte;
+ *dest++ = byte; len++;
if (byte == 0xFF) break;
for (unsigned i = arg_table[byte]; i > 0; i--) {
*dest++ = *src++;
@@ -426,11 +426,11 @@ uint16_t echo_get_status(void) {
// Look-up tables used to work around the fact that playing/stopping
// won't set the status immediately (only when Echo processes the command)
// and this can catch programmers off guard
- static const uint8_t and_flags[] = {
- 0xFF,0xFF, 0xFF,0xFE,0xFF,0xFD, 0xFF,0xFF,0xFF
+ static const uint16_t and_flags[] = {
+ 0xFFFF,0xFFFF, 0xFFFF,0xFFFE,0xFFFF,0xFFFD, 0xFFFF,0xFFFF,0xFFFF
};
- static const uint8_t or_flags[] = {
- 0x00,0x00, 0x01,0x00,0x02,0x00, 0x00,0x00,0x00
+ static const uint16_t or_flags[] = {
+ 0x0000,0x0000, 0x0001,0x0000,0x0002,0x0000, 0x0000,0x0000,0x0000
};
// We need access to the Z80