Skip to content

Commit

Permalink
Added $SIMPLE_CHAR to disable the output rewriting
Browse files Browse the repository at this point in the history
  • Loading branch information
skx committed Apr 28, 2024
1 parent f82a13a commit ea3983d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,11 @@ The console-I/O is blocking by default, but that can be changed by setting the e

Here is the complete list of environmental variables which influence behaviour:

| Variable | Purpose |
|-----------|---------------------------------------------------------------|
| DEBUG | Send a log of CP/M syscalls to STDERR |
| NON_BLOCK | Avoid blocking for console input, instead poll in a busy-loop |
| Variable | Purpose |
|-------------|---------------------------------------------------------------|
| DEBUG | Send a log of CP/M syscalls to STDERR |
| NON_BLOCK | Avoid blocking for console input, instead poll in a busy-loop |
| SIMPLE_CHAR | Avoid the attempted VT52 output conversion. |



Expand Down
8 changes: 7 additions & 1 deletion cpm/cpm_syscalls.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ func SysCallAuxWrite(cpm *CPM) error {
//
// This is all a bit sleazy.
func (cpm *CPM) outC(c uint8) {

if os.Getenv("SIMPLE_CHAR") != "" {
fmt.Printf("%c", c)
return
}

switch cpm.auxStatus {
case 0:
switch c {
Expand Down Expand Up @@ -281,7 +287,7 @@ func SysCallRawIO(cpm *CPM) error {
}
return nil
default:
fmt.Printf("%c", 0x7f&cpm.CPU.States.DE.Lo)
cpm.outC(cpm.CPU.States.DE.Lo)
}
return nil
}
Expand Down

0 comments on commit ea3983d

Please sign in to comment.