OSDN Git Service

* public snapshot of sid simulator
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / lcd / testsuite / t6963c-tester.h
1 // t6963-tester.h - description.  -*- C++ -*-
2
3 // Copyright (C) 1999, 2000 Red Hat.
4 // This file is part of SID and is licensed under the GPL.
5 // See the file COPYING.SID for conditions for redistribution.
6
7 #ifndef T6963C_TESTER_DEF_H
8 #define T6963C_TESTER_DEF_H     1
9
10 #include <sidcomp.h>
11 #include <sidpinutil.h>
12 #include <sidbusutil.h>
13 #include <sidattrutil.h>
14 #include <sidcomputil.h>
15
16 using namespace sid;
17 using namespace sidutil;
18 using namespace std;
19
20 typedef unsigned char uchar;
21
22 class T6963C_tester : public virtual component,
23                       public fixed_attribute_map_component,
24                       public fixed_accessor_map_component,
25                       public fixed_pin_map_component,
26                       public no_bus_component,
27                       public fixed_relation_map_component
28 {
29 private:
30   sid::bus* bus;
31
32   callback_pin<T6963C_tester> run_ipin;
33   output_pin run_opin;
34
35   int fail_count;
36
37   bool check_status( uchar what );
38   bool send_cmd( uchar cmd );
39
40   bool send_data( uchar data );
41   bool get_data( uchar& data );
42
43   bool auto_write( uchar data );
44   bool auto_read( uchar& data );
45   bool reset_auto( uchar mode );
46
47   bool write_mem( uchar cmd, uchar data );
48   bool read_mem( uchar cmd, uchar& data );
49
50   bool set_word_reg( uchar cmd, uchar lo, uchar hi );
51
52   void mem_set( uchar val, unsigned addr, int len );
53
54   enum {
55     DONE,
56     WAITING,
57     BASE_TESTS,
58     DRAW_LOGO,
59     ENABLE_GX,
60     TST_OR_MODE,
61     TST_XOR_MODE,
62     DUMP_ROM,
63     TST_ATTR_MODE
64   };
65
66   int state, next_state;
67   unsigned long curr_count, wait_count;
68
69   char* test_str;
70
71   void yield( int to_state, unsigned long count );
72
73   void base_tests();
74   void draw_string();
75   void draw_logo();
76   void enable_gx();
77   void test_or_mode();
78   void test_xor_mode();
79   void dump_rom();
80   void test_attr_mode();
81
82 public:
83
84   T6963C_tester();
85
86   void run( host_int_4 );
87
88   ~T6963C_tester() {}
89 };
90
91 #endif // T6963C_TESTER_DEF_H
92
93