home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------VBENCH.H---------------------------------
-
- const int desc_maxlen = 30; // Maximum description string length!
-
- // Enumeration for video mode selection
-
- enum vmode {
- mode_13h = 0,
- tweaked_mode = 1
- };
-
- //------------------------------------------------------------------------\\
- // struct SharedBenchData
- //
- // Simple structure used to hold info on a 'shared' benchmark, i.e. a
- // benchmark which can (and is) performed in both mode 13h and Tweaked
- // mode. The structure holds an array of 2 function pointers, and a
- // description of the benchmark. The 1st function pointer element is
- // for the mode 13h version, the 2nd for the Tweaked mode version.
- //------------------------------------------------------------------------\\
-
- class SharedBenchData
- {
- void (* funcs[2]) (); // array of 2 function pointers
- char * fnc_desc; // Description of benchmark (up to 30 char's)
- public:
- void do_bench(enum vmode v) // Execute one of the 2 functions
- { (*funcs[v]) (); }
- char * desc() // Return benchmark description
- { return fnc_desc; }
- };
-
- //------------------------------------------------------------------------\\
- // struct BenchData
- //
- // Simple structure to hold info on mode-specific benchmarks, i.e. a
- // benchmark which works with one video mode (13h or tweaked mode here)
- // The structure holds a pointer to the mode-specific function, and
- // a description of the benchmark.
- //------------------------------------------------------------------------\\
-
- class BenchData
- {
- void (* func) (); // Mode-specific function
- char * fnc_desc; // Description of benchmark (up to 30 char's)
- public:
- void do_bench() // Execute mode-specific benchmark
- { func(); }
- char * desc() // Return benchmark description
- { return fnc_desc; }
- };
-
-
- // Mode 13h function prototypes (used below)
- extern "C" {
- void M13WriteB(); // straight write-byte
- void M13WriteW1(); // straight write-word
- void M13ReadW1(); // straight read
-
- void M13VTransW1(); // video-to-video transfer,word-aligned
- }
-
- // Tweaked mode function prototypes (used below)
- extern "C" {
- void TwWriteB(); // planar write-byte
- void TwWriteW1(); // planar write-word
- void TwReadW1(); // planar read-word
-
- void TwVTrans(); // video-to-video hardware transfer
- }
-
- // Shared benchmark array
- SharedBenchData shared_benches [] =
- {
- M13WriteB , TwWriteB , "Byte Blit",
- M13WriteW1, TwWriteW1, "Word Blit,Aligned",
- M13ReadW1 , TwReadW1 , "Word Read,Aligned",
- };
-
- // Mode 13h-specific benchmark array
- BenchData m13_benches [] =
- {
- M13VTransW1, "Word Video Transfer,Aligned",
- };
-
- // Tweaked mode-specific benchmark array
- BenchData tw_benches [] =
- {
- TwVTrans, "Hardware Video Transfer",
- };
-