SimpleCon V2 window

SimpleCon V2 window

SimpleCon V2 is a lightweight console interface that lets Sinclair BASIC programs running in the emulator send text directly to a native Windows log window. It bridges Spectrum code to the host UI using a small memory buffer and a two-port I/O protocol.

SimpleCon V2 window

Why it exists

The Spectrum has no standard text console device for structured debug output. SimpleCon solves this by exposing a 255-byte character buffer, a single index register, and two ports so BASIC or assembly code can stream text to a Windows log without touching screen memory.

Memory model and ports

User interface elements

Typical workflow

Example: BASIC output to SimpleCon

10 LET m$="Hello from Sinclair BASIC!"
20 REM Set index to start of buffer
30 OUT 1259,1
40 FOR i=1 TO LEN m$
50   OUT 1515, CODE m$(i)
60 NEXT i
70 REM Commit line (line feed)
80 OUT 1259,0

Result: the message appears in the SimpleCon log; the input field mirrors the text; the index wraps back to 1.

Example 2: BASIC input from SimpleCon

1 REM SimpleCon V2 Read Input  Demo
10 CLS 
20 PRINT INK 1;"Clear First and Write Something into Simplecon window."''"Press a key when ready."''
30 PAUSE 0
40 OUT 1259,1
50 REM read every byte
60 FOR x=0 TO 254
70 INK 2: PRINT CHR$ IN 1515;
80 NEXT x
      

Run the program, and open simpleCon window and type something into InputBox. Go back to basinC display window and press any key, your basic program will read the contents of the input box.

Notes and best practices

Summary

SimpleCon V2 keeps the Spectrum programming model intact while providing a modern, explicit console path for debugging and logging. It is intentionally simple, predictable, and easy to integrate into both BASIC and assembly code.