mirror of
https://github.com/RyuKojiro/apple1.git
synced 2025-01-15 23:30:46 +00:00
Added some character set conversion code
git-svn-id: svn+ssh://svn.phoenixbox.net/svn/apple1/trunk@8 64f78de7-aa59-e511-a0e8-0002a5492df0
This commit is contained in:
parent
76d6da7302
commit
d5b4f0a83b
16
apple1/pia.c
16
apple1/pia.c
@ -12,9 +12,21 @@
|
||||
|
||||
#define FIXME_I_SHOULDNT_BE_NULL NULL
|
||||
|
||||
char asciiCharFromA1Char(uint8_t c) {
|
||||
switch (c) {
|
||||
case 0xDC: return '\\';
|
||||
case 0x8D: return '\n';
|
||||
}
|
||||
return (char)c;
|
||||
}
|
||||
|
||||
void videoWriteCharCallback(struct _v6502_memory *memory, uint16_t offset, uint8_t value, void *context) {
|
||||
fprintf(stdout, ANSI_COLOR_BRIGHT_GREEN "%c" ANSI_COLOR_RESET, value);
|
||||
fflush(stdout);
|
||||
if (value) {
|
||||
fprintf(stdout, ANSI_COLOR_BRIGHT_GREEN "%c" ANSI_COLOR_RESET, asciiCharFromA1Char(value));
|
||||
//fprintf(stderr, "I was asked to print (0x%02x)\n", value);
|
||||
//memory->bytes[offset] = value;
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void videoWriteNewlineCallback(struct _v6502_memory *memory, uint16_t offset, uint8_t value, void *context) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user