projects
/
dosdemo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed djgpp version of memset16, missing input clobbers
[dosdemo]
/
src
/
dos
/
main.c
diff --git
a/src/dos/main.c
b/src/dos/main.c
index
7535681
..
ee28dc9
100644
(file)
--- a/
src/dos/main.c
+++ b/
src/dos/main.c
@@
-8,6
+8,10
@@
#include "logger.h"
#include "cdpmi.h"
#include "audio.h"
#include "logger.h"
#include "cdpmi.h"
#include "audio.h"
+#include "mouse.h"
+#include "sball.h"
+#include "vmath.h"
+#include "cpuid.h"
static int handle_sball_event(sball_event *ev);
static void recalc_sball_matrix(float *xform);
static int handle_sball_event(sball_event *ev);
static void recalc_sball_matrix(float *xform);
@@
-38,6
+42,16
@@
int main(int argc, char **argv)
init_logger("demo.log");
init_logger("demo.log");
+#ifdef __WATCOMC__
+ printf("watcom build\n");
+#elif defined(__DJGPP__)
+ printf("djgpp build\n");
+#endif
+
+ if(read_cpuid(&cpuid) == 0) {
+ print_cpuid(&cpuid);
+ }
+
/* au_init needs to be called early, before init_timer, and also before
* we enter graphics mode, to use the midas configuration tool if necessary
*/
/* au_init needs to be called early, before init_timer, and also before
* we enter graphics mode, to use the midas configuration tool if necessary
*/
@@
-52,7
+66,7
@@
int main(int argc, char **argv)
return 1;
}
return 1;
}
- if((vmidx = match_video_mode(640, 480, 16)) == -1) {
+ if((vmidx = match_video_mode(FB_WIDTH, FB_HEIGHT, FB_BPP)) == -1) {
return 1;
}
if(!(vmem = set_video_mode(vmidx, 1))) {
return 1;
}
if(!(vmem = set_video_mode(vmidx, 1))) {
@@
-67,7
+81,7
@@
int main(int argc, char **argv)
}
}
}
}
- if(init(argc, argv) == -1) {
+ if(demo_init(argc, argv) == -1) {
status = -1;
goto break_evloop;
}
status = -1;
goto break_evloop;
}
@@
-81,7
+95,7
@@
int main(int argc, char **argv)
for(;;) {
int key;
while((key = kb_getkey()) != -1) {
for(;;) {
int key;
while((key = kb_getkey()) != -1) {
- demo_key(key, 1);
+ demo_keyboard(key, 1);
if(quit) goto break_evloop;
}
if(quit) goto break_evloop;
}
@@
-97,11
+111,11
@@
int main(int argc, char **argv)
}
time_msec = get_msec();
}
time_msec = get_msec();
- draw();
+ demo_draw();
}
break_evloop:
}
break_evloop:
- cleanup();
+ demo_cleanup();
set_text_mode();
cleanup_video();
kb_shutdown();
set_text_mode();
cleanup_video();
kb_shutdown();
@@
-117,6
+131,15
@@
void demo_quit(void)
quit = 1;
}
quit = 1;
}
+void demo_abort(void)
+{
+ set_text_mode();
+ stop_logger();
+ printf("demo_abort called. see demo.log for details. Last lines:\n\n");
+ print_tail("demo.log");
+ abort();
+}
+
#define TX(ev) ((ev)->motion.motion[0])
#define TY(ev) ((ev)->motion.motion[1])
#define TZ(ev) ((ev)->motion.motion[2])
#define TX(ev) ((ev)->motion.motion[0])
#define TY(ev) ((ev)->motion.motion[1])
#define TZ(ev) ((ev)->motion.motion[2])