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

  1. #ifndef __DEMO_H__
  2. #define __DEMO_H__
  3.  
  4. #define DEMO_MAGIC_HEADER    "V910"
  5.  
  6. typedef enum
  7. {
  8.     demo_type_tick = 0,    /* wait for emulator tick */
  9.     demo_type_video = 1,    /* video addresses and data */
  10.     demo_type_sound = 2,    /* sound bytes */
  11.     demo_type_speech = 3    /* speech commands */
  12. }    demo_type;
  13.  
  14. typedef enum
  15. {
  16.     demo_speech_starting = 0,        /* new phrase */
  17.     demo_speech_adding_byte = 1,    /* an LPC encoded byte (following) */
  18.     demo_speech_terminating = 2,    /* terminating speech */
  19.     demo_speech_stopping = 3,        /* finished */
  20.     demo_speech_interrupt = 4        /* interrupt to perform work */
  21. }    demo_speech_event;
  22.  
  23. /*
  24.  *    The demo file format is very rudimentary.
  25.  *
  26.  *    Header:        'V910' bytes
  27.  *
  28.  *    Followed by a list of sections for various demo_types.
  29.  *    Each section starts with one byte (demo_type) and is
  30.  *    followed by nothing (for the timer) or by a buffer length
  31.  *    (little-endian, 16 bits) which is passed to the event handler.
  32.  *
  33.  *    Video has 16-bit little-endian addresses followed (if the
  34.  *    address does not have the 0x8000 bit set, which is a register
  35.  *    write) by a 16-bit little-endian length and data bytes.
  36.  *
  37.  *    Sound has a series of data bytes.
  38.  *
  39.  *    Speech has a series of demo_speech_event bytes, and the
  40.  *    demo_speech_adding_byte event is followed by that byte.
  41.  */
  42.  
  43. void demo_init(void);
  44. void demo_term(void);
  45. int demo_start_record(OSSpec *spec);
  46. void demo_pause_record(bool pausing);
  47. void demo_stop_record(void);
  48. int demo_record_event(demo_type type, ...);
  49.  
  50. #endif
  51.