|
21 | 21 | ((long)(((unsigned)(l)) | (((long)((unsigned)(h))) << 16))) |
22 | 22 | #endif |
23 | 23 |
|
24 | | -class THardwareInfo { |
25 | | -public: |
26 | | - THardwareInfo() noexcept; |
27 | | - ~THardwareInfo(); |
| 24 | +namespace tvision { |
| 25 | + class THardwareInfo { |
| 26 | + public: |
| 27 | + THardwareInfo(); |
| 28 | + ~THardwareInfo(); |
28 | 29 |
|
29 | | -// screen functions |
30 | | - static uint16_t getScreenRows(void) noexcept; |
31 | | - static uint16_t getScreenCols(void) noexcept; |
| 30 | + // screen functions |
| 31 | + static uint16_t getScreenRows(void); |
| 32 | + static uint16_t getScreenCols(void); |
32 | 33 |
|
33 | | - static uint16_t* getColorAddr(void) noexcept; |
34 | | - static uint16_t* getMonoAddr (void) noexcept; |
35 | | - |
36 | | - void cursorOn (void) noexcept; |
37 | | - void cursorOff(void) noexcept; |
38 | | - |
39 | | - static uint32_t getTickCount(void) noexcept; |
40 | | - static uint32_t getTickCountMs(void) noexcept; |
41 | | -private: |
42 | | - static uint16_t colorSel; |
43 | | - static uint16_t monoSel ; |
44 | | - static uint16_t biosSel ; |
45 | | -}; |
| 34 | + static uint16_t* getColorAddr(uint16_t); |
| 35 | + static uint16_t* getMonoAddr (uint16_t); |
| 36 | + |
| 37 | + void cursorOn (void); |
| 38 | + void cursorOff(void); |
| 39 | + |
| 40 | + static uint32_t getTickCount (void); |
| 41 | + static uint32_t getTickCountMs(void); |
| 42 | + private: |
| 43 | + static uint16_t colorSel; |
| 44 | + static uint16_t monoSel ; |
| 45 | + static uint16_t biosSel ; |
| 46 | + }; |
46 | 47 |
|
47 | | -inline uint32_t THardwareInfo::getTickCount() noexcept { |
48 | | - return *(uint32_t *) MAKELONG( biosSel, 0x6C ); |
49 | | -} |
50 | | -inline uint32_t THardwareInfo::getTickCountMs() noexcept { |
51 | | - return getTickCount() * 55; |
52 | | -} |
| 48 | + inline uint32_t THardwareInfo::getTickCount() { |
| 49 | + return *(uint32_t *) MAKELONG( biosSel, 0x6C ); |
| 50 | + } |
| 51 | + inline uint32_t THardwareInfo::getTickCountMs() { |
| 52 | + return getTickCount() * 55; |
| 53 | + } |
53 | 54 |
|
54 | | -inline uint16_t THardwareInfo::getScreenRows(void) noexcept |
55 | | -{ |
56 | | - return 25; |
57 | | -} |
58 | | -inline uint16_t THardwareInfo::getScreenCols(void) noexcept |
59 | | -{ |
60 | | - return 80; |
61 | | -} |
| 55 | + inline uint16_t THardwareInfo::getScreenRows(void) { |
| 56 | + return 25; |
| 57 | + } |
| 58 | + inline uint16_t THardwareInfo::getScreenCols(void) { |
| 59 | + return 80; |
| 60 | + } |
62 | 61 |
|
63 | | -inline void THardwareInfo::cursorOn(void) noexcept { |
64 | | - |
65 | | -} |
66 | | -inline void THardwareInfo::cursorOff(void) noexcept { |
67 | | - |
68 | | -} |
69 | | - |
70 | | -inline uint16_t* THardwareInfo::getColorAddr(void) { |
71 | | - return (uint16_t*)colorSel; |
72 | | -} |
73 | | -inline uint16_t* THardwareInfo::getMonoAddr(void) { |
74 | | - return (uint16_t*)monoSel; |
75 | | -} |
| 62 | + inline void THardwareInfo::cursorOn(void) { |
| 63 | + |
| 64 | + } |
| 65 | + inline void THardwareInfo::cursorOff(void) { |
| 66 | + |
| 67 | + } |
76 | 68 |
|
| 69 | + inline uint16_t* THardwareInfo::getColorAddr(uint16_t offset) { |
| 70 | + return (uint16_t *) MAKELONG( colorSel, offset ); |
| 71 | + } |
| 72 | + inline uint16_t* THardwareInfo::getMonoAddr(uint16_t offset) { |
| 73 | + return (uint16_t *) MAKELONG( monoSel, offset ); |
| 74 | + } |
| 75 | +} // namespace: tvision |
77 | 76 | #endif // __HARDWARE_H__ |
78 | 77 |
|
0 commit comments