some definition changes
This commit is contained in:
@@ -8,14 +8,14 @@
|
|||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#ifndef NRJWORD
|
#ifndef NRJWORD /* we emulate NRJ16 by default */
|
||||||
#define NRJWORD unsigned short
|
#define NRJWORD unsigned short
|
||||||
#endif
|
#endif
|
||||||
#define NRJWSIZE (sizeof(NRJWORD) << 3)
|
#define NRJWSIZE (sizeof(NRJWORD) << 3)
|
||||||
#define NRJSIZE (1 << NRJWSIZE)
|
#define NRJSIZE (1 << NRJWSIZE)
|
||||||
#define MAXADDR ((NRJWORD) (NRJSIZE - 1))
|
#define MAXADDR ((NRJWORD) (NRJSIZE - 1))
|
||||||
|
|
||||||
int kbhit() {
|
int kbhit() { /* our best attempt to detect a keypress on a POSIX system */
|
||||||
struct timeval tv = { 0L, 0L };
|
struct timeval tv = { 0L, 0L };
|
||||||
fd_set fds;
|
fd_set fds;
|
||||||
FD_ZERO(&fds);
|
FD_ZERO(&fds);
|
||||||
@@ -66,7 +66,7 @@ int main(int argc, char* argv[]) {
|
|||||||
fseek(prog, 0, SEEK_END);
|
fseek(prog, 0, SEEK_END);
|
||||||
int flen = ftell(prog);
|
int flen = ftell(prog);
|
||||||
fseek(prog, 0, SEEK_SET);
|
fseek(prog, 0, SEEK_SET);
|
||||||
fread(mem, NRJWSIZE, (flen/NRJWSIZE) & MAXADDR, prog);
|
fread(mem, sizeof(NRJWORD), (flen/sizeof(NRJWORD)) & MAXADDR, prog);
|
||||||
fclose(prog);
|
fclose(prog);
|
||||||
/* prepare the terminal */
|
/* prepare the terminal */
|
||||||
tcgetattr(STDIN_FILENO, &tty_opts_backup);
|
tcgetattr(STDIN_FILENO, &tty_opts_backup);
|
||||||
|
|||||||
Reference in New Issue
Block a user