projects
/
eradicate
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MMX
[eradicate]
/
src
/
dos
/
main.c
diff --git
a/src/dos/main.c
b/src/dos/main.c
index
911781c
..
4a3dc1a
100644
(file)
--- a/
src/dos/main.c
+++ b/
src/dos/main.c
@@
-44,16
+44,26
@@
int main(int argc, char **argv)
status = -1;
goto break_evloop;
}
status = -1;
goto break_evloop;
}
- fb_pixels = (char*)fb_buf + vmode->pitch;
+ fb_pixels = (uint16_t*)((char*)fb_buf + vmode->pitch);
+
+ if(init(argc, argv) == -1) {
+ status = -1;
+ goto break_evloop;
+ }
reset_timer();
for(;;) {
int key;
reset_timer();
for(;;) {
int key;
- while((key = kb_getkey()) != -1) {
- if(key == 27) goto break_evloop;
+ if(key_event) {
+ while((key = kb_getkey()) != -1) {
+ key_event(key, 1);
+ }
+ } else {
+ while((key = kb_getkey()) != -1) {
+ if(key == 27) goto break_evloop;
+ }
}
}
-
if(quit) goto break_evloop;
time_msec = get_msec();
if(quit) goto break_evloop;
time_msec = get_msec();
@@
-62,6
+72,7
@@
int main(int argc, char **argv)
break_evloop:
free(fb_buf);
break_evloop:
free(fb_buf);
+ cleanup();
set_text_mode();
cleanup_video();
kb_shutdown();
set_text_mode();
cleanup_video();
kb_shutdown();