mirror of
https://github.com/thiagoauler/apple1.git
synced 2024-11-22 15:32:29 +00:00
ajusting i/o
This commit is contained in:
parent
7003d3f63b
commit
dd4a315e93
@ -8,12 +8,15 @@ void io_init()
|
|||||||
noecho();
|
noecho();
|
||||||
cbreak();
|
cbreak();
|
||||||
nodelay(stdscr, TRUE);
|
nodelay(stdscr, TRUE);
|
||||||
|
|
||||||
|
keyboard_control = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
void input()
|
void input()
|
||||||
{
|
{
|
||||||
int ch = getch();
|
int ch = getch();
|
||||||
if (ch != ERR)
|
if (ch == '\n') { ch = '\r'; }
|
||||||
|
if (ch == '\r' || (ch >= '0' && ch <= '9'))
|
||||||
{
|
{
|
||||||
keyboard_buffer = ch | 0x80;
|
keyboard_buffer = ch | 0x80;
|
||||||
keyboard_control = 0xFF;
|
keyboard_control = 0xFF;
|
||||||
@ -27,9 +30,10 @@ void output()
|
|||||||
{
|
{
|
||||||
// outputs the buffer character
|
// outputs the buffer character
|
||||||
display_buffer = display_buffer & 0x7F;
|
display_buffer = display_buffer & 0x7F;
|
||||||
|
if (display_buffer == '\r')
|
||||||
|
{
|
||||||
|
display_buffer = '\n';
|
||||||
|
}
|
||||||
addch(display_buffer);
|
addch(display_buffer);
|
||||||
//refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//refresh();
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user