mirror of
https://github.com/RyuKojiro/apple1.git
synced 2025-01-15 23:30:46 +00:00
use \r for carriage return, since that is what it is intended to be (unmasked 0D, CR). Also added an encoding relationship for the escape/reset key
git-svn-id: svn+ssh://svn.phoenixbox.net/svn/apple1/trunk@22 64f78de7-aa59-e511-a0e8-0002a5492df0
This commit is contained in:
parent
5a5718c311
commit
b9de338cbf
@ -35,8 +35,9 @@ void saveFreeze(v6502_memory *mem, const char *fname) {
|
|||||||
char asciiCharFromA1Char(uint8_t c) {
|
char asciiCharFromA1Char(uint8_t c) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 0xDC: return '\\';
|
case 0xDC: return '\\';
|
||||||
case 0x8D: return '\n';
|
case 0x8D: return '\r';
|
||||||
case 0xDF: return 0x7F; // Backspace
|
case 0xDF: return 0x7F; // Backspace
|
||||||
|
case 0x9B: return '\e'; // Escape
|
||||||
}
|
}
|
||||||
|
|
||||||
return (char)c;
|
return (char)c;
|
||||||
@ -47,6 +48,8 @@ uint8_t a1CharFromAsciiChar(char c) {
|
|||||||
case '\\': return 0xDC;
|
case '\\': return 0xDC;
|
||||||
case '\r': return 0x8D;
|
case '\r': return 0x8D;
|
||||||
case 0x7F: return 0xDF; // Backspace
|
case 0x7F: return 0xDF; // Backspace
|
||||||
|
case '\e': return 0x9B; // Escape
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c >= 'a' && c <= 'z') {
|
if (c >= 'a' && c <= 'z') {
|
||||||
@ -59,8 +62,8 @@ uint8_t a1CharFromAsciiChar(char c) {
|
|||||||
void videoWriteCharCallback(struct _v6502_memory *memory, uint16_t offset, uint8_t value, a1pia *context) {
|
void videoWriteCharCallback(struct _v6502_memory *memory, uint16_t offset, uint8_t value, a1pia *context) {
|
||||||
if (value) {
|
if (value) {
|
||||||
char c = asciiCharFromA1Char(value);
|
char c = asciiCharFromA1Char(value);
|
||||||
if (c == '\n') {
|
if (c == '\r') {
|
||||||
fprintf(stdout, "\r");
|
fprintf(stdout, "\n");
|
||||||
}
|
}
|
||||||
if (c == 0x7f) {
|
if (c == 0x7f) {
|
||||||
int y, x;
|
int y, x;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user