home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.7z / ftp.whtech.com / emulators / v9t9 / linux / sources / V9t9 / source / svgaloop.c < prev    next >
Encoding:
C/C++ Source or Header  |  2006-10-19  |  817 b   |  51 lines

  1. #include <signal.h>
  2. #include <fcntl.h>
  3. #include <unistd.h>
  4. #include <sys/time.h>
  5.  
  6. #include "v9t9_common.h"
  7. #include "system.h"
  8. #include "timer.h"
  9. #include "v9t9.h"
  10.  
  11. #include "command_rl.h"
  12. #include "moduleconfig.h"
  13. #include "v9t9_module.h"
  14.  
  15. #include "unixmain.h"
  16.  
  17. #define _L     LOG_INTERNAL | LOG_INFO
  18.  
  19. #if defined(LINUX_SVGA_VIDEO) && defined(LINUX_SVGA_KEYBOARD)
  20.  
  21. extern    int    console_fd;
  22.  
  23. int
  24. svga_system_init(void)
  25. {
  26.     return vga_init() == 0;
  27. }
  28.  
  29. int
  30. svga_system_loop(void)
  31. {
  32.     int ret;
  33.  
  34.     while (1) {
  35.         while (TM_Ticked) {
  36.             TM_TickHandler(0);
  37. //            TM_Ticked--;
  38.             TM_Ticked = 0;
  39.         }
  40.         ret = v9t9_execute();
  41.         if (ret == em_TooFast)
  42.             unix_system_pause();
  43.         else if (ret == em_Quitting || ret == em_Dying)
  44.             break;
  45.     }
  46.     return ret == em_Dying;
  47.         
  48. }
  49.  
  50. #endif // defined(LINUX_SVGA_VIDEO) && defined(LINUX_SVGA_KEYBOARD)
  51.