Canola  0.8.D001
lib/display.h
Go to the documentation of this file.
00001 //
00002 // canola - canon canola 1614p emulator
00003 // Copyright (C) 2011 Peter Miller
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License, version 3, as
00007 // published by the Free Software Foundation.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License along
00015 // with this program. If not, see <http://www.gnu.org/licenses/>.
00016 //
00017 
00018 #ifndef LIB_DISPLAY_H
00019 #define LIB_DISPLAY_H
00020 
00021 #include <lib/opcode.h>
00022 
00027 class display
00028 {
00029 public:
00030     struct tube_t
00031     {
00032         ~tube_t();
00033         tube_t();
00034         tube_t(const tube_t &rhs);
00035         tube_t &operator=(const tube_t &rhs);
00036         int digit: 6;
00037         bool dot: 1;
00038         bool tick: 1;
00039     };
00040 
00041     ~display();
00042     display();
00043     display(const display &rhs);
00044     display &operator=(const display &rhs);
00045 
00046     bool overflow;
00047     tube_t tubes[16];
00048     bool negative;
00049     bool m1;
00050     bool m2;
00051     bool entry;
00052 
00061     void set_opcode(opcode_t op);
00062 
00063     enum column18_t
00064     {
00065         column18_blank,
00066         column18_minus,
00067         column18_ce,
00068         column18_cm,
00069         column18_e,
00070         column18_fj,
00071         column18_ej,
00072         column18_uj,
00073         column18_mj,
00074         column18_sj,
00075         column18_rv, // uncertain
00076         column18_sfj, // uncertain
00077         column18_suj, // uncertain
00078         column18_srj, // uncertain
00079         column18_right, // uncertain
00080         column18_cs, // uncertain
00081     };
00082 
00083     column18_t column18;
00084 
00085     enum column19_t
00086     {
00087         column19_blank,
00088         column19_plus_equals,
00089         column19_minus_equals,
00090         column19_times,
00091         column19_divide,
00092         column19_sqrt,
00093         column19_m_plus,
00094         column19_m_minus,
00095         column19_rm,
00096         column19_sm,
00097         column19_print,
00098     };
00099 
00100     column19_t column19;
00101 
00102     enum column20_t
00103     {
00104         column20_blank,
00105         column20_n1,
00106         column20_fd,
00107         column20_round_up,
00108         column20_round_off,
00109         column20_round_down,
00110         column20_dot,
00111     };
00112 
00113     column20_t column20;
00114 
00115     enum column21_t
00116     {
00117         column21_blank,
00118         column21_n0,
00119         column21_n1,
00120         column21_n2,
00121         column21_n3,
00122         column21_n4,
00123         column21_n5,
00124         column21_n6,
00125         column21_n7,
00126         column21_n8,
00127         column21_n9,
00128     };
00129 
00130     column21_t column21;
00131 };
00132 
00133 #endif // LIB_DISPLAY_H