Skip to content

Commit

Permalink
Alternative serial method
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Robson committed Jan 26, 2024
1 parent 5f4498f commit c41fdad
Show file tree
Hide file tree
Showing 21 changed files with 119 additions and 82 deletions.
Binary file modified basic/memory.dump
Binary file not shown.
13 changes: 13 additions & 0 deletions basic/sources/editing/editing/warmstart.asm
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,15 @@ WarmStart:
ldx #inputBuffer & $FF

jsr ReadLine ; read using screen editor

; jsr InputLine ; input string to buffer direct typing (ignores YX)

lda inputBuffer ; entered something ?
beq _WSNotSerialLink
lda inputBuffer+1 ; if first character is / start the serial link.
cmp #'/'
beq _WSSerialLink
_WSNotSerialLink:
stz ControlStatus ; clear break flag.
jsr TOKTokenise ; tokenise it.
lda tokLineNumber ; any line number ? if not, execute it.
Expand All @@ -49,6 +56,12 @@ _WSExecute:

jmp RUNNewLine ; go to run it.

_WSSerialLink:
.DoSendMessage ; and reset it.
.byte 1,5
.DoWaitMessage
jmp WarmStart

.send code
; ************************************************************************************************
Expand Down
8 changes: 6 additions & 2 deletions documents/release/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ Changes
*** Release 10 ***
IMP: Added 'waiting for USB Key' notice.
CHG: Removed serial echo of console
CHG: Function 2,0 should now use function 2,6 (consistency, but 2,0 will be supported permanently so non-breaking)

26/01/24: CHG: Function 2,0 should now use function 2,6 (consistency, but 2,0 will be supported permanently so non-breaking)
BUG: Reported issues with r10 not booting whereas r9 did. Need to check differences r9/r10 but removed serial code entirely.
*** Release 11 ***

IMP: Added turtle graphics code (not complete yet)
BUG: Made serial operate independently, rather than in the keyboard handler.
CHG: Boots straight into BASIC, WozMon temporarily disabled.
CHG: Modifier warm start so can use the keyboard to start serial handler.
2 changes: 1 addition & 1 deletion emulator/include/kernel_binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file is automatically created
//
const uint8_t kernel_bin[] = {
216,120,162,255,154,32,16,252,8,3,32,129,252,76,168,252,32,129,252,141,48,252,104,141,61,252,104,141,62,252,32,52,252,72,32,52,252,141,1,255,104,141,0,255,32,52,252,169,255,108,61,252,238,61,252,208,3,238,62,252,173,255,255,96,141,48,252,104,141,61,252,104,141,62,252,32,52,252,32,83,252,128,217,72,141,4,255,169,6,141,1,255,169,2,141,0,255,104,96,32,64,252,24,32,16,252,1,5,32,129,252,32,16,252,2,1,32,129,252,173,4,255,240,235,32,64,252,24,96,72,173,0,255,208,251,104,96,218,90,32,99,252,201,13,240,5,32,83,252,128,244,122,250,142,4,255,140,5,255,32,16,252,2,3,32,129,252,96,32,64,252,92,169,13,162,255,232,32,83,252,32,99,252,41,127,201,97,144,2,73,32,157,0,2,201,32,176,234,201,8,208,7,169,95,202,48,223,128,224,32,83,252,162,255,169,128,105,8,141,61,253,232,189,0,2,201,33,144,199,201,46,240,239,144,242,201,58,240,233,32,142,253,156,140,253,156,141,253,160,0,201,58,240,37,144,2,233,7,56,233,48,201,16,176,26,72,169,4,14,140,253,46,141,253,58,208,247,104,13,140,253,141,140,253,200,232,189,0,2,128,215,192,0,240,129,44,61,253,80,16,173,140,253,141,0,0,238,48,253,208,167,238,49,253,128,162,169,255,16,47,160,2,185,139,253,153,105,253,153,47,253,136,208,244,208,20,32,64,252,13,173,107,253,32,165,253,173,106,253,32,165,253,32,64,252,58,169,32,32,83,252,173,0,0,32,165,253,173,106,253,205,140,253,173,107,253,237,141,253,176,189,238,106,253,208,3,238,107,253,173,106,253,41,7,128,194,0,0,201,82,240,5,201,78,240,4,96,108,106,253,32,16,252,1,3,32,129,252,108,0,0,72,74,74,74,74,32,174,253,104,41,15,201,10,144,2,105,6,105,48,32,83,252,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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120,162,255,154,32,24,252,8,3,32,129,252,32,24,252,1,3,32,129,252,108,0,0,32,129,252,141,56,252,104,141,69,252,104,141,70,252,32,60,252,72,32,60,252,141,1,255,104,141,0,255,32,60,252,169,255,108,69,252,238,69,252,208,3,238,70,252,173,255,255,96,141,56,252,104,141,69,252,104,141,70,252,32,60,252,32,91,252,128,217,72,141,4,255,169,6,141,1,255,169,2,141,0,255,104,96,32,72,252,24,32,24,252,2,1,32,129,252,173,4,255,240,243,32,72,252,24,96,72,173,0,255,208,251,104,96,218,90,32,107,252,201,13,240,5,32,91,252,128,244,122,250,142,4,255,140,5,255,32,24,252,2,3,32,129,252,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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#define KERNEL_LOAD (0xfc00)
#define KERNEL_SIZE (0x0400)
Expand Down
3 changes: 2 additions & 1 deletion emulator/src/core/hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ void STOSynchronise(void) {
//
// ***************************************************************************************

void SERInitialise(void) {
bool SERInitialise(void) {
return false;
}

bool SERIsByteAvailable(void) {
Expand Down
2 changes: 1 addition & 1 deletion firmware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ add_subdirectory(libraries/fatfs/source)
add_subdirectory(sources)

pico_enable_stdio_usb(firmware 0)
pico_enable_stdio_uart(firmware 1)
pico_enable_stdio_uart(firmware 0)
4 changes: 2 additions & 2 deletions firmware/common/include/data/basic_binary.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion firmware/common/include/data/kernel_binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This file is automatically created
//
const uint8_t kernel_bin[] = {
216,120,162,255,154,32,16,252,8,3,32,129,252,76,168,252,32,129,252,141,48,252,104,141,61,252,104,141,62,252,32,52,252,72,32,52,252,141,1,255,104,141,0,255,32,52,252,169,255,108,61,252,238,61,252,208,3,238,62,252,173,255,255,96,141,48,252,104,141,61,252,104,141,62,252,32,52,252,32,83,252,128,217,72,141,4,255,169,6,141,1,255,169,2,141,0,255,104,96,32,64,252,24,32,16,252,1,5,32,129,252,32,16,252,2,1,32,129,252,173,4,255,240,235,32,64,252,24,96,72,173,0,255,208,251,104,96,218,90,32,99,252,201,13,240,5,32,83,252,128,244,122,250,142,4,255,140,5,255,32,16,252,2,3,32,129,252,96,32,64,252,92,169,13,162,255,232,32,83,252,32,99,252,41,127,201,97,144,2,73,32,157,0,2,201,32,176,234,201,8,208,7,169,95,202,48,223,128,224,32,83,252,162,255,169,128,105,8,141,61,253,232,189,0,2,201,33,144,199,201,46,240,239,144,242,201,58,240,233,32,142,253,156,140,253,156,141,253,160,0,201,58,240,37,144,2,233,7,56,233,48,201,16,176,26,72,169,4,14,140,253,46,141,253,58,208,247,104,13,140,253,141,140,253,200,232,189,0,2,128,215,192,0,240,129,44,61,253,80,16,173,140,253,141,0,0,238,48,253,208,167,238,49,253,128,162,169,255,16,47,160,2,185,139,253,153,105,253,153,47,253,136,208,244,208,20,32,64,252,13,173,107,253,32,165,253,173,106,253,32,165,253,32,64,252,58,169,32,32,83,252,173,0,0,32,165,253,173,106,253,205,140,253,173,107,253,237,141,253,176,189,238,106,253,208,3,238,107,253,173,106,253,41,7,128,194,0,0,201,82,240,5,201,78,240,4,96,108,106,253,32,16,252,1,3,32,129,252,108,0,0,72,74,74,74,74,32,174,253,104,41,15,201,10,144,2,105,6,105,48,32,83,252,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76,137,252,76,99,252,76,83,252,76,129,252,76,16,252,0,252,0,252,0,252
216,120,162,255,154,32,24,252,8,3,32,129,252,32,24,252,1,3,32,129,252,108,0,0,32,129,252,141,56,252,104,141,69,252,104,141,70,252,32,60,252,72,32,60,252,141,1,255,104,141,0,255,32,60,252,169,255,108,69,252,238,69,252,208,3,238,70,252,173,255,255,96,141,56,252,104,141,69,252,104,141,70,252,32,60,252,32,91,252,128,217,72,141,4,255,169,6,141,1,255,169,2,141,0,255,104,96,32,72,252,24,32,24,252,2,1,32,129,252,173,4,255,240,243,32,72,252,24,96,72,173,0,255,208,251,104,96,218,90,32,107,252,201,13,240,5,32,91,252,128,244,122,250,142,4,255,140,5,255,32,24,252,2,3,32,129,252,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,76,137,252,76,107,252,76,91,252,76,129,252,76,24,252,0,252,0,252,0,252
};
#define KERNEL_LOAD (0xfc00)
#define KERNEL_SIZE (0x0400)
Expand Down
2 changes: 1 addition & 1 deletion firmware/common/include/data/prompt.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
// This file is automatically generated
//
#define PROMPT "(Build 2447 26-Jan-24)\r"
#define PROMPT "(Build 2469 26-Jan-24)\r"
6 changes: 3 additions & 3 deletions firmware/common/include/data/sfxdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ static const uint16_t sfxData18[] = {
740,75,0,50,740,75,0,50,740,75,0,50,740,75,0,50,65535 };
// 19 expl100
static const uint16_t sfxData19[] = {
213,1,446,1,520,1,227,1,305,1,337,1,206,1,408,1,674,1,226,1,692,1,587,1,545,1,253,1,206,1,475,1,467,1,288,1,505,1,581,1,445,1,590,1,548,1,290,1,429,1,288,1,500,1,531,1,374,1,493,1,562,1,227,1,579,1,372,1,590,1,599,1,216,1,206,1,273,1,623,1,589,1,245,1,386,1,661,1,527,1,547,1,357,1,419,1,677,1,342,1,65535 };
256,1,674,1,314,1,547,1,679,1,416,1,206,1,651,1,484,1,484,1,673,1,285,1,430,1,533,1,399,1,610,1,352,1,680,1,271,1,263,1,677,1,637,1,679,1,596,1,327,1,544,1,487,1,459,1,547,1,539,1,336,1,643,1,229,1,421,1,632,1,438,1,435,1,575,1,367,1,597,1,381,1,329,1,560,1,612,1,648,1,588,1,335,1,514,1,279,1,598,1,65535 };
// 20 expl50
static const uint16_t sfxData20[] = {
612,1,305,1,359,1,501,1,297,1,484,1,506,1,305,1,499,1,545,1,205,1,372,1,605,1,377,1,263,1,430,1,327,1,323,1,280,1,364,1,696,1,346,1,374,1,697,1,212,1,65535 };
358,1,283,1,645,1,507,1,204,1,632,1,227,1,293,1,287,1,381,1,561,1,393,1,355,1,406,1,252,1,403,1,468,1,678,1,665,1,316,1,431,1,535,1,652,1,287,1,484,1,65535 };
// 21 expl20
static const uint16_t sfxData21[] = {
527,1,478,1,400,1,584,1,490,1,420,1,682,1,285,1,211,1,559,1,65535 };
674,1,517,1,273,1,642,1,460,1,688,1,215,1,609,1,582,1,415,1,65535 };
// 22 las30
static const uint16_t sfxData22[] = {
600,1,574,1,547,1,520,1,494,1,467,1,440,1,414,1,387,1,360,1,334,1,307,1,280,1,254,1,227,1,65535 };
Expand Down
2 changes: 1 addition & 1 deletion firmware/common/include/interface/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#ifndef _SERIALHARDWARE_H
#define _SERIALHARDWARE_H

void SERInitialise(void);
bool SERInitialise(void);
bool SERIsByteAvailable(void);
uint8_t SERReadByte(void);
void SERCheckDataAvailable(void);
Expand Down
1 change: 0 additions & 1 deletion firmware/common/sources/interface/dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void DSPReset(void) {
CONWrite(0x80+6);
STOSynchronise(); // Synchronise storage
CONWrite(0x80+2);
SERInitialise(); // Initialise serial port.
CFGProcess(); // Process configuration file.
}

Expand Down
Binary file modified firmware/common/sources/interface/dispatch.o
Binary file not shown.
Binary file modified firmware/common/sources/interface/memory.o
Binary file not shown.
110 changes: 63 additions & 47 deletions firmware/common/sources/interface/serialmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,47 @@

#include "common.h"

//static void SERCommand(uint8_t command,uint8_t *data,uint8_t size);
static bool SERCommand(uint8_t command,uint8_t *data,uint8_t size);

// ***************************************************************************************
//
// Input and process buffer.
//
// ***************************************************************************************

//static uint8_t sBuffer[256]; // Input buffer.
static uint8_t sBuffer[256]; // Input buffer.
static bool isInitialised = false;

void SERCheckDataAvailable(void) {
// if (SERIsByteAvailable()) { // Something waiting.
// sBuffer[0] = SERReadByte(); // Read length of data
// sBuffer[1] = SERReadByte(); // Read checksum
// uint8_t checksum = 0;
// for (int16_t i = 0;i < sBuffer[0];i++) { // Read in data and calculate checksum
// sBuffer[i+2] = SERReadByte();
// checksum += sBuffer[i+2];
// }
// if (sBuffer[1] == checksum) { // Checksum okay.
// SERCommand(sBuffer[2],sBuffer+3,sBuffer[0]-1); // Do command.
// } else {
// CONWriteString("Serial checksum error.\r");
// }
// }
if (!isInitialised) { // Try to initialise it.
isInitialised = SERInitialise(); // Initialise serial port.
if (!isInitialised) {
CONWriteString("Serial not functioning.\r"); // Failed to initialise.
return;
}
while (SERIsByteAvailable()) SERReadByte(); // Clear anything already incoming.
}

bool completed = false;
CONWriteString("Serial link enabled.\r");
while (!completed) {
if (SERIsByteAvailable()) { // Something waiting.
sBuffer[0] = SERReadByte(); // Read length of data
sBuffer[1] = SERReadByte(); // Read checksum
uint8_t checksum = 0;
for (int16_t i = 0;i < sBuffer[0];i++) { // Read in data and calculate checksum
sBuffer[i+2] = SERReadByte();
checksum += sBuffer[i+2];
}
if (sBuffer[1] == checksum) { // Checksum okay.
completed = SERCommand(sBuffer[2],sBuffer+3,sBuffer[0]-1); // Do command.
} else {
CONWriteString("Serial checksum error.\r");
completed = true;
}
}
}
CONWriteString("Serial link disabled.\r");
}

// ***************************************************************************************
Expand All @@ -45,38 +61,38 @@ void SERCheckDataAvailable(void) {
//
// ***************************************************************************************

// static uint8_t *dataPtr = NULL; // Where we write stuff
// static uint16_t startAddress,currentAddress; // Start and current address accessing.

// static void SERCommand(uint8_t command,uint8_t *data,uint8_t size) {
// uint16_t a;
static uint8_t *dataPtr = NULL; // Where we write stuff
static uint16_t startAddress,currentAddress; // Start and current address accessing.

// switch (command) {
// case 0: // 0 detach
// break;
// case 1: // 1 data transmit
// if (dataPtr != NULL) { // Address assigned ?
// for (uint8_t i = 0;i < size;i++) { // Copy data if so
// *dataPtr++ = data[i];
// currentAddress++;
// }
// }
// break;
// case 2: // 2 set 6502 memory address
// case 3: // 3 set gfxmemory address
// currentAddress = startAddress = data[0] + (data[1] << 8);
// dataPtr = (command == 2) ? cpuMemory+currentAddress:gfxMemory+currentAddress;
// break;
// case 4: // 4 set 6502 memory address indirect
// a = data[0] + (data[1] << 8); // Get address from here.
// currentAddress = startAddress = cpuMemory[a] + (cpuMemory[a+1]<<8); // Get the actual address
// dataPtr = cpuMemory + currentAddress; // Initialise the pointer
// break;
// case 5:
// KBDInsertQueue(data[0]); // 5 Insert key in keyboard queue
// break;
// }
// }
static bool SERCommand(uint8_t command,uint8_t *data,uint8_t size) {
uint16_t a;
switch (command) {
case 0: // 0 detach
break;
case 1: // 1 data transmit
if (dataPtr != NULL) { // Address assigned ?
for (uint8_t i = 0;i < size;i++) { // Copy data if so
*dataPtr++ = data[i];
currentAddress++;
}
}
break;
case 2: // 2 set 6502 memory address
case 3: // 3 set gfxmemory address
currentAddress = startAddress = data[0] + (data[1] << 8);
dataPtr = (command == 2) ? cpuMemory+currentAddress:gfxMemory+currentAddress;
break;
case 4: // 4 set 6502 memory address indirect
a = data[0] + (data[1] << 8); // Get address from here.
currentAddress = startAddress = cpuMemory[a] + (cpuMemory[a+1]<<8); // Get the actual address
dataPtr = cpuMemory + currentAddress; // Initialise the pointer
break;
case 5:
KBDInsertQueue(data[0]); // 5 Insert key in keyboard queue
break;
}
return (command == 0);
}

// ***************************************************************************************
//
Expand Down
Binary file modified firmware/common/sources/interface/serialmanager.o
Binary file not shown.
Binary file modified firmware/common/sources/interface/sfxmanager.o
Binary file not shown.
Loading

0 comments on commit c41fdad

Please sign in to comment.