Serial library for Diablo4D. Tested with uLCD220RD
Diablo_Serial_4DLib.cpp@2:7cff98af2c68, 2017-05-09 (annotated)
- Committer:
- martin13
- Date:
- Tue May 09 14:29:22 2017 +0000
- Revision:
- 2:7cff98af2c68
- Parent:
- 1:9a2c573adad6
Remove old func
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
martin13 | 0:81cd913c5e43 | 1 | /* |
martin13 | 0:81cd913c5e43 | 2 | Diablo_Serial_4DLib.cpp - Library for 4D Systems Serial Environment. |
martin13 | 0:81cd913c5e43 | 3 | */ |
martin13 | 0:81cd913c5e43 | 4 | |
martin13 | 0:81cd913c5e43 | 5 | #include "Diablo_Serial_4DLib.h" |
martin13 | 0:81cd913c5e43 | 6 | |
martin13 | 0:81cd913c5e43 | 7 | Diablo_Serial_4DLib::Diablo_Serial_4DLib(Serial *virtualPort, int timeout4D) { |
martin13 | 0:81cd913c5e43 | 8 | _virtualPort = virtualPort; |
martin13 | 0:81cd913c5e43 | 9 | TimeLimit4D = timeout4D; |
martin13 | 0:81cd913c5e43 | 10 | } |
martin13 | 1:9a2c573adad6 | 11 | |
martin13 | 0:81cd913c5e43 | 12 | //*********************************************************************************************// |
martin13 | 0:81cd913c5e43 | 13 | //**********************************Intrinsic 4D Routines**************************************// |
martin13 | 0:81cd913c5e43 | 14 | //*********************************************************************************************// |
martin13 | 0:81cd913c5e43 | 15 | |
martin13 | 0:81cd913c5e43 | 16 | void Diablo_Serial_4DLib::WriteChars(char * charsout) |
martin13 | 0:81cd913c5e43 | 17 | { |
martin13 | 0:81cd913c5e43 | 18 | char wk ; |
martin13 | 0:81cd913c5e43 | 19 | do |
martin13 | 0:81cd913c5e43 | 20 | { |
martin13 | 0:81cd913c5e43 | 21 | wk = *charsout++ ; |
martin13 | 0:81cd913c5e43 | 22 | _virtualPort->putc(wk) ; |
martin13 | 0:81cd913c5e43 | 23 | } while (wk) ; |
martin13 | 0:81cd913c5e43 | 24 | } |
martin13 | 0:81cd913c5e43 | 25 | |
martin13 | 0:81cd913c5e43 | 26 | void Diablo_Serial_4DLib::WriteBytes(char * Source, int Size) |
martin13 | 0:81cd913c5e43 | 27 | { |
martin13 | 0:81cd913c5e43 | 28 | char wk ; |
martin13 | 0:81cd913c5e43 | 29 | int i ; |
martin13 | 0:81cd913c5e43 | 30 | for (i = 0; i < Size; i++) |
martin13 | 0:81cd913c5e43 | 31 | { |
martin13 | 0:81cd913c5e43 | 32 | wk = *Source++ ; |
martin13 | 0:81cd913c5e43 | 33 | _virtualPort->putc(wk) ; |
martin13 | 0:81cd913c5e43 | 34 | } |
martin13 | 0:81cd913c5e43 | 35 | } |
martin13 | 0:81cd913c5e43 | 36 | |
martin13 | 0:81cd913c5e43 | 37 | void Diablo_Serial_4DLib::WriteWords(word * Source, int Size) |
martin13 | 0:81cd913c5e43 | 38 | { |
martin13 | 0:81cd913c5e43 | 39 | word wk ; |
martin13 | 0:81cd913c5e43 | 40 | int i ; |
martin13 | 0:81cd913c5e43 | 41 | for (i = 0; i < Size; i++) |
martin13 | 0:81cd913c5e43 | 42 | { |
martin13 | 0:81cd913c5e43 | 43 | wk = *Source++ ; |
martin13 | 0:81cd913c5e43 | 44 | _virtualPort->putc(wk >> 8) ; |
martin13 | 0:81cd913c5e43 | 45 | _virtualPort->putc(wk) ; |
martin13 | 0:81cd913c5e43 | 46 | } |
martin13 | 0:81cd913c5e43 | 47 | } |
martin13 | 0:81cd913c5e43 | 48 | |
martin13 | 0:81cd913c5e43 | 49 | void Diablo_Serial_4DLib::getbytes(char * data, int size) |
martin13 | 0:81cd913c5e43 | 50 | { |
martin13 | 0:81cd913c5e43 | 51 | //int read ; |
martin13 | 0:81cd913c5e43 | 52 | Timer timer; |
martin13 | 0:81cd913c5e43 | 53 | int sttime ; |
martin13 | 0:81cd913c5e43 | 54 | int readc ; |
martin13 | 0:81cd913c5e43 | 55 | readc = 0 ; |
martin13 | 0:81cd913c5e43 | 56 | timer.reset(); |
martin13 | 0:81cd913c5e43 | 57 | timer.start(); |
martin13 | 0:81cd913c5e43 | 58 | sttime = timer.read_ms(); |
martin13 | 0:81cd913c5e43 | 59 | while ((readc != size) && (timer.read_ms() - sttime < TimeLimit4D)) |
martin13 | 0:81cd913c5e43 | 60 | { |
martin13 | 0:81cd913c5e43 | 61 | if(_virtualPort->readable()) |
martin13 | 0:81cd913c5e43 | 62 | { |
martin13 | 0:81cd913c5e43 | 63 | data[readc++] = _virtualPort->getc() ; |
martin13 | 0:81cd913c5e43 | 64 | } |
martin13 | 0:81cd913c5e43 | 65 | } |
martin13 | 0:81cd913c5e43 | 66 | if (readc != size) |
martin13 | 0:81cd913c5e43 | 67 | { |
martin13 | 0:81cd913c5e43 | 68 | Error4D = GFX_Err4D_Timeout ; |
martin13 | 0:81cd913c5e43 | 69 | if (Callback4D != NULL) |
martin13 | 0:81cd913c5e43 | 70 | Callback4D(Error4D, Error4D_Inv) ; |
martin13 | 0:81cd913c5e43 | 71 | } |
martin13 | 0:81cd913c5e43 | 72 | } |
martin13 | 0:81cd913c5e43 | 73 | |
martin13 | 0:81cd913c5e43 | 74 | void Diablo_Serial_4DLib::GetAck(void) |
martin13 | 0:81cd913c5e43 | 75 | { |
martin13 | 0:81cd913c5e43 | 76 | Timer timer; |
martin13 | 0:81cd913c5e43 | 77 | int read ; |
martin13 | 0:81cd913c5e43 | 78 | unsigned char readx ; |
martin13 | 0:81cd913c5e43 | 79 | int sttime ; |
martin13 | 0:81cd913c5e43 | 80 | Error4D = GFX_Err4D_OK ; |
martin13 | 0:81cd913c5e43 | 81 | timer.reset(); |
martin13 | 0:81cd913c5e43 | 82 | timer.start(); |
martin13 | 0:81cd913c5e43 | 83 | sttime = timer.read_ms(); |
martin13 | 0:81cd913c5e43 | 84 | read = 0 ; |
martin13 | 0:81cd913c5e43 | 85 | while ((read != 1) && (timer.read_ms() - sttime < TimeLimit4D)) |
martin13 | 0:81cd913c5e43 | 86 | { |
martin13 | 0:81cd913c5e43 | 87 | if(_virtualPort->readable() != 0) |
martin13 | 0:81cd913c5e43 | 88 | { |
martin13 | 0:81cd913c5e43 | 89 | readx = (unsigned char)_virtualPort->getc() ; |
martin13 | 0:81cd913c5e43 | 90 | read = 1 ; |
martin13 | 0:81cd913c5e43 | 91 | } |
martin13 | 0:81cd913c5e43 | 92 | } |
martin13 | 0:81cd913c5e43 | 93 | if (read == 0) |
martin13 | 0:81cd913c5e43 | 94 | { |
martin13 | 0:81cd913c5e43 | 95 | Error4D = GFX_Err4D_Timeout ; |
martin13 | 0:81cd913c5e43 | 96 | if (Callback4D != NULL) |
martin13 | 0:81cd913c5e43 | 97 | Callback4D(Error4D, Error4D_Inv) ; |
martin13 | 0:81cd913c5e43 | 98 | } |
martin13 | 0:81cd913c5e43 | 99 | else if (readx != 6) |
martin13 | 0:81cd913c5e43 | 100 | { |
martin13 | 0:81cd913c5e43 | 101 | Error4D = GFX_Err4D_NAK ; |
martin13 | 0:81cd913c5e43 | 102 | Error4D_Inv = readx ; |
martin13 | 0:81cd913c5e43 | 103 | if (Callback4D != NULL) |
martin13 | 0:81cd913c5e43 | 104 | Callback4D(Error4D, Error4D_Inv) ; |
martin13 | 0:81cd913c5e43 | 105 | } |
martin13 | 0:81cd913c5e43 | 106 | } |
martin13 | 0:81cd913c5e43 | 107 | |
martin13 | 0:81cd913c5e43 | 108 | word Diablo_Serial_4DLib::GetWord(void) |
martin13 | 0:81cd913c5e43 | 109 | { |
martin13 | 0:81cd913c5e43 | 110 | Timer timer; |
martin13 | 0:81cd913c5e43 | 111 | unsigned char readx[2] ; |
martin13 | 0:81cd913c5e43 | 112 | int readc ; |
martin13 | 0:81cd913c5e43 | 113 | int sttime ; |
martin13 | 0:81cd913c5e43 | 114 | |
martin13 | 0:81cd913c5e43 | 115 | if (Error4D != GFX_Err4D_OK) |
martin13 | 0:81cd913c5e43 | 116 | return 0 ; |
martin13 | 0:81cd913c5e43 | 117 | timer.reset(); |
martin13 | 0:81cd913c5e43 | 118 | timer.start(); |
martin13 | 0:81cd913c5e43 | 119 | sttime = timer.read_ms(); |
martin13 | 0:81cd913c5e43 | 120 | readc = 0 ; |
martin13 | 0:81cd913c5e43 | 121 | while ((readc != 2) && (timer.read_ms() - sttime < TimeLimit4D)) |
martin13 | 0:81cd913c5e43 | 122 | { |
martin13 | 0:81cd913c5e43 | 123 | if(_virtualPort->readable()) |
martin13 | 0:81cd913c5e43 | 124 | { |
martin13 | 0:81cd913c5e43 | 125 | readx[readc++] = (unsigned char)_virtualPort->getc(); |
martin13 | 0:81cd913c5e43 | 126 | } |
martin13 | 0:81cd913c5e43 | 127 | } |
martin13 | 0:81cd913c5e43 | 128 | |
martin13 | 0:81cd913c5e43 | 129 | if (readc != 2) |
martin13 | 0:81cd913c5e43 | 130 | { |
martin13 | 0:81cd913c5e43 | 131 | Error4D = GFX_Err4D_Timeout ; |
martin13 | 0:81cd913c5e43 | 132 | if (Callback4D != NULL) |
martin13 | 0:81cd913c5e43 | 133 | Callback4D(Error4D, Error4D_Inv) ; |
martin13 | 0:81cd913c5e43 | 134 | return 0 ; |
martin13 | 0:81cd913c5e43 | 135 | } |
martin13 | 0:81cd913c5e43 | 136 | else |
martin13 | 0:81cd913c5e43 | 137 | return readx[0] << 8 | readx[1] ; |
martin13 | 0:81cd913c5e43 | 138 | } |
martin13 | 0:81cd913c5e43 | 139 | |
martin13 | 0:81cd913c5e43 | 140 | void Diablo_Serial_4DLib::getString(char * outStr, int strLen) |
martin13 | 0:81cd913c5e43 | 141 | { |
martin13 | 0:81cd913c5e43 | 142 | //unsigned char readx[2] ; |
martin13 | 0:81cd913c5e43 | 143 | Timer timer; |
martin13 | 0:81cd913c5e43 | 144 | int readc ; |
martin13 | 0:81cd913c5e43 | 145 | int sttime ; |
martin13 | 0:81cd913c5e43 | 146 | |
martin13 | 0:81cd913c5e43 | 147 | if (Error4D != GFX_Err4D_OK) |
martin13 | 0:81cd913c5e43 | 148 | { |
martin13 | 0:81cd913c5e43 | 149 | outStr[0] = 0 ; |
martin13 | 0:81cd913c5e43 | 150 | return ; |
martin13 | 0:81cd913c5e43 | 151 | } |
martin13 | 0:81cd913c5e43 | 152 | timer.reset(); |
martin13 | 0:81cd913c5e43 | 153 | timer.start(); |
martin13 | 0:81cd913c5e43 | 154 | sttime = timer.read_ms(); |
martin13 | 0:81cd913c5e43 | 155 | readc = 0 ; |
martin13 | 0:81cd913c5e43 | 156 | while ((readc != strLen) && (timer.read_ms() - sttime < TimeLimit4D)) |
martin13 | 0:81cd913c5e43 | 157 | { |
martin13 | 0:81cd913c5e43 | 158 | if(_virtualPort->readable()) |
martin13 | 0:81cd913c5e43 | 159 | { |
martin13 | 0:81cd913c5e43 | 160 | outStr[readc++] = _virtualPort->getc() ; |
martin13 | 0:81cd913c5e43 | 161 | } |
martin13 | 0:81cd913c5e43 | 162 | } |
martin13 | 0:81cd913c5e43 | 163 | |
martin13 | 0:81cd913c5e43 | 164 | if (readc != strLen) |
martin13 | 0:81cd913c5e43 | 165 | { |
martin13 | 0:81cd913c5e43 | 166 | Error4D = GFX_Err4D_Timeout ; |
martin13 | 0:81cd913c5e43 | 167 | if (Callback4D != NULL) |
martin13 | 0:81cd913c5e43 | 168 | Callback4D(Error4D, Error4D_Inv) ; |
martin13 | 0:81cd913c5e43 | 169 | } |
martin13 | 0:81cd913c5e43 | 170 | outStr[readc] = 0 ; |
martin13 | 0:81cd913c5e43 | 171 | } |
martin13 | 0:81cd913c5e43 | 172 | |
martin13 | 0:81cd913c5e43 | 173 | word Diablo_Serial_4DLib::GetAckResp(void) |
martin13 | 0:81cd913c5e43 | 174 | { |
martin13 | 0:81cd913c5e43 | 175 | GetAck(); |
martin13 | 0:81cd913c5e43 | 176 | return GetWord() ; |
martin13 | 0:81cd913c5e43 | 177 | } |
martin13 | 0:81cd913c5e43 | 178 | |
martin13 | 0:81cd913c5e43 | 179 | word Diablo_Serial_4DLib::GetAckRes2Words(word * word1, word * word2) |
martin13 | 0:81cd913c5e43 | 180 | { |
martin13 | 0:81cd913c5e43 | 181 | int Result ; |
martin13 | 0:81cd913c5e43 | 182 | GetAck() ; |
martin13 | 0:81cd913c5e43 | 183 | Result = GetWord() ; |
martin13 | 0:81cd913c5e43 | 184 | *word1 = GetWord() ; |
martin13 | 0:81cd913c5e43 | 185 | *word2 = GetWord() ; |
martin13 | 0:81cd913c5e43 | 186 | return Result ; |
martin13 | 0:81cd913c5e43 | 187 | } |
martin13 | 0:81cd913c5e43 | 188 | |
martin13 | 0:81cd913c5e43 | 189 | void Diablo_Serial_4DLib::GetAck2Words(word * word1, word * word2) |
martin13 | 0:81cd913c5e43 | 190 | { |
martin13 | 0:81cd913c5e43 | 191 | GetAck() ; |
martin13 | 0:81cd913c5e43 | 192 | *word1 = GetWord() ; |
martin13 | 0:81cd913c5e43 | 193 | *word2 = GetWord() ; |
martin13 | 0:81cd913c5e43 | 194 | } |
martin13 | 0:81cd913c5e43 | 195 | |
martin13 | 0:81cd913c5e43 | 196 | word Diablo_Serial_4DLib::GetAckResSector(GFX_t4DSector Sector) |
martin13 | 0:81cd913c5e43 | 197 | { |
martin13 | 0:81cd913c5e43 | 198 | int Result ; |
martin13 | 0:81cd913c5e43 | 199 | GetAck() ; |
martin13 | 0:81cd913c5e43 | 200 | Result = GetWord() ; |
martin13 | 0:81cd913c5e43 | 201 | getbytes(Sector, 512) ; |
martin13 | 0:81cd913c5e43 | 202 | return Result ; |
martin13 | 0:81cd913c5e43 | 203 | } |
martin13 | 0:81cd913c5e43 | 204 | |
martin13 | 0:81cd913c5e43 | 205 | word Diablo_Serial_4DLib::GetAckResStr(char * OutStr) |
martin13 | 0:81cd913c5e43 | 206 | { |
martin13 | 0:81cd913c5e43 | 207 | int Result ; |
martin13 | 0:81cd913c5e43 | 208 | GetAck() ; |
martin13 | 0:81cd913c5e43 | 209 | Result = GetWord() ; |
martin13 | 0:81cd913c5e43 | 210 | getString(OutStr, Result) ; |
martin13 | 0:81cd913c5e43 | 211 | return Result ; |
martin13 | 0:81cd913c5e43 | 212 | } |
martin13 | 0:81cd913c5e43 | 213 | |
martin13 | 0:81cd913c5e43 | 214 | word Diablo_Serial_4DLib::GetAckResData(GFX_t4DByteArray OutData, word size) |
martin13 | 0:81cd913c5e43 | 215 | { |
martin13 | 0:81cd913c5e43 | 216 | int Result ; |
martin13 | 0:81cd913c5e43 | 217 | GetAck() ; |
martin13 | 0:81cd913c5e43 | 218 | Result = GetWord() ; |
martin13 | 0:81cd913c5e43 | 219 | getbytes(OutData, size) ; |
martin13 | 0:81cd913c5e43 | 220 | return Result ; |
martin13 | 0:81cd913c5e43 | 221 | } |
martin13 | 0:81cd913c5e43 | 222 | |
martin13 | 0:81cd913c5e43 | 223 | void Diablo_Serial_4DLib::SetThisBaudrate(int Newrate) |
martin13 | 0:81cd913c5e43 | 224 | { |
martin13 | 0:81cd913c5e43 | 225 | int br ; |
martin13 | 0:81cd913c5e43 | 226 | // _virtualPort->flush() ; |
martin13 | 0:81cd913c5e43 | 227 | // _virtualPort->end() ; |
martin13 | 0:81cd913c5e43 | 228 | switch(Newrate) |
martin13 | 0:81cd913c5e43 | 229 | { |
martin13 | 0:81cd913c5e43 | 230 | /* case BAUD_110 : br = 110 ; |
martin13 | 0:81cd913c5e43 | 231 | break ; |
martin13 | 0:81cd913c5e43 | 232 | case BAUD_300 : br = 300 ; |
martin13 | 0:81cd913c5e43 | 233 | break ; |
martin13 | 0:81cd913c5e43 | 234 | case BAUD_600 : br = 600 ; |
martin13 | 0:81cd913c5e43 | 235 | break ; |
martin13 | 0:81cd913c5e43 | 236 | case BAUD_1200 : br = 1200 ; |
martin13 | 0:81cd913c5e43 | 237 | break ; |
martin13 | 0:81cd913c5e43 | 238 | case BAUD_2400 : br = 2400 ; |
martin13 | 0:81cd913c5e43 | 239 | break ; |
martin13 | 0:81cd913c5e43 | 240 | case BAUD_4800 : br = 4800 ; |
martin13 | 0:81cd913c5e43 | 241 | break ;*/ |
martin13 | 0:81cd913c5e43 | 242 | case GFX_BAUD_9600 : br = 9600 ; |
martin13 | 0:81cd913c5e43 | 243 | break ; |
martin13 | 0:81cd913c5e43 | 244 | // case BAUD_14400 : br = 14400 ; |
martin13 | 0:81cd913c5e43 | 245 | // break ; |
martin13 | 0:81cd913c5e43 | 246 | case GFX_BAUD_19200 : br = 19200 ; |
martin13 | 0:81cd913c5e43 | 247 | break ; |
martin13 | 0:81cd913c5e43 | 248 | /* case BAUD_31250 : br = 31250 ; |
martin13 | 0:81cd913c5e43 | 249 | break ; |
martin13 | 0:81cd913c5e43 | 250 | case BAUD_38400 : br = 38400 ; |
martin13 | 0:81cd913c5e43 | 251 | break ; |
martin13 | 0:81cd913c5e43 | 252 | case BAUD_56000 : br = 56000 ; |
martin13 | 0:81cd913c5e43 | 253 | break ; |
martin13 | 0:81cd913c5e43 | 254 | case BAUD_57600 : br = 57600 ; |
martin13 | 0:81cd913c5e43 | 255 | break ; |
martin13 | 0:81cd913c5e43 | 256 | case BAUD_115200 : br = 115200 ; |
martin13 | 0:81cd913c5e43 | 257 | break ; |
martin13 | 0:81cd913c5e43 | 258 | case BAUD_128000 : br = 133928 ; // actual rate is not 128000 ; |
martin13 | 0:81cd913c5e43 | 259 | break ; |
martin13 | 0:81cd913c5e43 | 260 | case BAUD_256000 : br = 281250 ; // actual rate is not 256000 ; |
martin13 | 0:81cd913c5e43 | 261 | break ; |
martin13 | 0:81cd913c5e43 | 262 | case BAUD_300000 : br = 312500 ; // actual rate is not 300000 ; |
martin13 | 0:81cd913c5e43 | 263 | break ; |
martin13 | 0:81cd913c5e43 | 264 | case BAUD_375000 : br = 401785 ; // actual rate is not 375000 ; |
martin13 | 0:81cd913c5e43 | 265 | break ; |
martin13 | 0:81cd913c5e43 | 266 | case BAUD_500000 : br = 562500 ; // actual rate is not 500000 ; |
martin13 | 0:81cd913c5e43 | 267 | break ; |
martin13 | 0:81cd913c5e43 | 268 | case BAUD_600000 : br = 703125 ; // actual rate is not 600000 ; |
martin13 | 0:81cd913c5e43 | 269 | break ;*/ |
martin13 | 0:81cd913c5e43 | 270 | } |
martin13 | 0:81cd913c5e43 | 271 | // _virtualPort->begin(br) ; |
martin13 | 0:81cd913c5e43 | 272 | wait(0.05) ; // Display sleeps for 100 |
martin13 | 0:81cd913c5e43 | 273 | _virtualPort->baud(br) ; |
martin13 | 0:81cd913c5e43 | 274 | } |
martin13 | 0:81cd913c5e43 | 275 | |
martin13 | 0:81cd913c5e43 | 276 | //*********************************************************************************************// |
martin13 | 0:81cd913c5e43 | 277 | //**********************************Compound 4D Routines***************************************// |
martin13 | 0:81cd913c5e43 | 278 | //*********************************************************************************************// |
martin13 | 0:81cd913c5e43 | 279 | |
martin13 | 0:81cd913c5e43 | 280 | word Diablo_Serial_4DLib::bus_Read8() |
martin13 | 0:81cd913c5e43 | 281 | { |
martin13 | 0:81cd913c5e43 | 282 | _virtualPort->putc(GFX_F_bus_Read8 >> 8) ; |
martin13 | 0:81cd913c5e43 | 283 | _virtualPort->putc(GFX_F_bus_Read8) ; |
martin13 | 0:81cd913c5e43 | 284 | return GetAckResp() ; |
martin13 | 0:81cd913c5e43 | 285 | } |
martin13 | 0:81cd913c5e43 | 286 | |
martin13 | 0:81cd913c5e43 | 287 | void Diablo_Serial_4DLib::bus_Write8(word Bits) |
martin13 | 0:81cd913c5e43 | 288 | { |
martin13 | 0:81cd913c5e43 | 289 | _virtualPort->putc(GFX_F_bus_Write8 >> 8) ; |
martin13 | 0:81cd913c5e43 | 290 | _virtualPort->putc(GFX_F_bus_Write8) ; |
martin13 | 0:81cd913c5e43 | 291 | _virtualPort->putc(Bits >> 8); |
martin13 | 0:81cd913c5e43 | 292 | _virtualPort->putc(Bits) ; |
martin13 | 0:81cd913c5e43 | 293 | GetAck() ; |
martin13 | 0:81cd913c5e43 | 294 | } |
martin13 | 0:81cd913c5e43 | 295 | |
martin13 | 0:81cd913c5e43 | 296 | word Diablo_Serial_4DLib::charheight(char TestChar) |
martin13 | 0:81cd913c5e43 | 297 | { |
martin13 | 0:81cd913c5e43 | 298 | _virtualPort->putc(GFX_F_charheight >> 8); |
martin13 | 0:81cd913c5e43 | 299 | _virtualPort->putc(GFX_F_charheight); |
martin13 | 0:81cd913c5e43 | 300 | _virtualPort->putc(TestChar); |
martin13 | 0:81cd913c5e43 | 301 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 302 | } |
martin13 | 0:81cd913c5e43 | 303 | |
martin13 | 0:81cd913c5e43 | 304 | word Diablo_Serial_4DLib::charwidth(char TestChar) |
martin13 | 0:81cd913c5e43 | 305 | { |
martin13 | 0:81cd913c5e43 | 306 | _virtualPort->putc(GFX_F_charwidth >> 8); |
martin13 | 0:81cd913c5e43 | 307 | _virtualPort->putc(GFX_F_charwidth); |
martin13 | 0:81cd913c5e43 | 308 | _virtualPort->putc(TestChar); |
martin13 | 0:81cd913c5e43 | 309 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 310 | } |
martin13 | 0:81cd913c5e43 | 311 | |
martin13 | 0:81cd913c5e43 | 312 | word Diablo_Serial_4DLib::file_Close(word Handle) |
martin13 | 0:81cd913c5e43 | 313 | { |
martin13 | 0:81cd913c5e43 | 314 | _virtualPort->putc(GFX_F_file_Close >> 8); |
martin13 | 0:81cd913c5e43 | 315 | _virtualPort->putc(GFX_F_file_Close); |
martin13 | 0:81cd913c5e43 | 316 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 317 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 318 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 319 | } |
martin13 | 0:81cd913c5e43 | 320 | |
martin13 | 0:81cd913c5e43 | 321 | word Diablo_Serial_4DLib::file_Count(char * Filename) |
martin13 | 0:81cd913c5e43 | 322 | { |
martin13 | 0:81cd913c5e43 | 323 | _virtualPort->putc(GFX_F_file_Count >> 8); |
martin13 | 0:81cd913c5e43 | 324 | _virtualPort->putc(GFX_F_file_Count); |
martin13 | 0:81cd913c5e43 | 325 | WriteChars(Filename); |
martin13 | 0:81cd913c5e43 | 326 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 327 | } |
martin13 | 0:81cd913c5e43 | 328 | |
martin13 | 0:81cd913c5e43 | 329 | word Diablo_Serial_4DLib::file_Dir(char * Filename) |
martin13 | 0:81cd913c5e43 | 330 | { |
martin13 | 0:81cd913c5e43 | 331 | _virtualPort->putc(GFX_F_file_Dir >> 8); |
martin13 | 0:81cd913c5e43 | 332 | _virtualPort->putc(GFX_F_file_Dir); |
martin13 | 0:81cd913c5e43 | 333 | WriteChars(Filename); |
martin13 | 0:81cd913c5e43 | 334 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 335 | } |
martin13 | 0:81cd913c5e43 | 336 | |
martin13 | 0:81cd913c5e43 | 337 | word Diablo_Serial_4DLib::file_Erase(char * Filename) |
martin13 | 0:81cd913c5e43 | 338 | { |
martin13 | 0:81cd913c5e43 | 339 | _virtualPort->putc(GFX_F_file_Erase >> 8); |
martin13 | 0:81cd913c5e43 | 340 | _virtualPort->putc(GFX_F_file_Erase); |
martin13 | 0:81cd913c5e43 | 341 | WriteChars(Filename); |
martin13 | 0:81cd913c5e43 | 342 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 343 | } |
martin13 | 0:81cd913c5e43 | 344 | |
martin13 | 0:81cd913c5e43 | 345 | word Diablo_Serial_4DLib::file_Error() |
martin13 | 0:81cd913c5e43 | 346 | { |
martin13 | 0:81cd913c5e43 | 347 | _virtualPort->putc(GFX_F_file_Error >> 8); |
martin13 | 0:81cd913c5e43 | 348 | _virtualPort->putc(GFX_F_file_Error); |
martin13 | 0:81cd913c5e43 | 349 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 350 | } |
martin13 | 0:81cd913c5e43 | 351 | |
martin13 | 0:81cd913c5e43 | 352 | word Diablo_Serial_4DLib::file_Exec(char * Filename, word ArgCount, GFX_t4DWordArray Args) |
martin13 | 0:81cd913c5e43 | 353 | { |
martin13 | 0:81cd913c5e43 | 354 | _virtualPort->putc(GFX_F_file_Exec >> 8); |
martin13 | 0:81cd913c5e43 | 355 | _virtualPort->putc(GFX_F_file_Exec); |
martin13 | 0:81cd913c5e43 | 356 | WriteChars(Filename); |
martin13 | 0:81cd913c5e43 | 357 | _virtualPort->putc(ArgCount >> 8); |
martin13 | 0:81cd913c5e43 | 358 | _virtualPort->putc(ArgCount); |
martin13 | 0:81cd913c5e43 | 359 | WriteWords(Args, ArgCount); |
martin13 | 0:81cd913c5e43 | 360 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 361 | } |
martin13 | 0:81cd913c5e43 | 362 | |
martin13 | 0:81cd913c5e43 | 363 | word Diablo_Serial_4DLib::file_Exists(char * Filename) |
martin13 | 0:81cd913c5e43 | 364 | { |
martin13 | 0:81cd913c5e43 | 365 | _virtualPort->putc(GFX_F_file_Exists >> 8); |
martin13 | 0:81cd913c5e43 | 366 | _virtualPort->putc(GFX_F_file_Exists); |
martin13 | 0:81cd913c5e43 | 367 | WriteChars(Filename); |
martin13 | 0:81cd913c5e43 | 368 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 369 | } |
martin13 | 0:81cd913c5e43 | 370 | |
martin13 | 0:81cd913c5e43 | 371 | word Diablo_Serial_4DLib::file_FindFirst(char * Filename) |
martin13 | 0:81cd913c5e43 | 372 | { |
martin13 | 0:81cd913c5e43 | 373 | _virtualPort->putc(GFX_F_file_FindFirst >> 8); |
martin13 | 0:81cd913c5e43 | 374 | _virtualPort->putc(GFX_F_file_FindFirst); |
martin13 | 0:81cd913c5e43 | 375 | WriteChars(Filename); |
martin13 | 0:81cd913c5e43 | 376 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 377 | } |
martin13 | 0:81cd913c5e43 | 378 | |
martin13 | 0:81cd913c5e43 | 379 | word Diablo_Serial_4DLib::file_FindNext() |
martin13 | 0:81cd913c5e43 | 380 | { |
martin13 | 0:81cd913c5e43 | 381 | _virtualPort->putc(GFX_F_file_FindNext >> 8); |
martin13 | 0:81cd913c5e43 | 382 | _virtualPort->putc(GFX_F_file_FindNext); |
martin13 | 0:81cd913c5e43 | 383 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 384 | } |
martin13 | 0:81cd913c5e43 | 385 | |
martin13 | 0:81cd913c5e43 | 386 | char Diablo_Serial_4DLib::file_GetC(word Handle) |
martin13 | 0:81cd913c5e43 | 387 | { |
martin13 | 0:81cd913c5e43 | 388 | _virtualPort->putc(GFX_F_file_GetC >> 8); |
martin13 | 0:81cd913c5e43 | 389 | _virtualPort->putc(GFX_F_file_GetC); |
martin13 | 0:81cd913c5e43 | 390 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 391 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 392 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 393 | } |
martin13 | 0:81cd913c5e43 | 394 | |
martin13 | 0:81cd913c5e43 | 395 | word Diablo_Serial_4DLib::file_GetS(char * StringIn, word Size, word Handle) |
martin13 | 0:81cd913c5e43 | 396 | { |
martin13 | 0:81cd913c5e43 | 397 | _virtualPort->putc(GFX_F_file_GetS >> 8); |
martin13 | 0:81cd913c5e43 | 398 | _virtualPort->putc(GFX_F_file_GetS); |
martin13 | 0:81cd913c5e43 | 399 | _virtualPort->putc(Size >> 8); |
martin13 | 0:81cd913c5e43 | 400 | _virtualPort->putc(Size); |
martin13 | 0:81cd913c5e43 | 401 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 402 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 403 | return GetAckResStr(StringIn); |
martin13 | 0:81cd913c5e43 | 404 | } |
martin13 | 0:81cd913c5e43 | 405 | |
martin13 | 0:81cd913c5e43 | 406 | word Diablo_Serial_4DLib::file_GetW(word Handle) |
martin13 | 0:81cd913c5e43 | 407 | { |
martin13 | 0:81cd913c5e43 | 408 | _virtualPort->putc(GFX_F_file_GetW >> 8); |
martin13 | 0:81cd913c5e43 | 409 | _virtualPort->putc(GFX_F_file_GetW); |
martin13 | 0:81cd913c5e43 | 410 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 411 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 412 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 413 | } |
martin13 | 0:81cd913c5e43 | 414 | |
martin13 | 0:81cd913c5e43 | 415 | word Diablo_Serial_4DLib::file_Image(word X, word Y, word Handle) |
martin13 | 0:81cd913c5e43 | 416 | { |
martin13 | 0:81cd913c5e43 | 417 | _virtualPort->putc(GFX_F_file_Image >> 8); |
martin13 | 0:81cd913c5e43 | 418 | _virtualPort->putc(GFX_F_file_Image); |
martin13 | 0:81cd913c5e43 | 419 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 420 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 421 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 422 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 423 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 424 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 425 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 426 | } |
martin13 | 0:81cd913c5e43 | 427 | |
martin13 | 0:81cd913c5e43 | 428 | word Diablo_Serial_4DLib::file_Index(word Handle, word HiSize, word LoSize, word Recordnum) |
martin13 | 0:81cd913c5e43 | 429 | { |
martin13 | 0:81cd913c5e43 | 430 | _virtualPort->putc(GFX_F_file_Index >> 8); |
martin13 | 0:81cd913c5e43 | 431 | _virtualPort->putc(GFX_F_file_Index); |
martin13 | 0:81cd913c5e43 | 432 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 433 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 434 | _virtualPort->putc(HiSize >> 8); |
martin13 | 0:81cd913c5e43 | 435 | _virtualPort->putc(HiSize); |
martin13 | 0:81cd913c5e43 | 436 | _virtualPort->putc(LoSize >> 8); |
martin13 | 0:81cd913c5e43 | 437 | _virtualPort->putc(LoSize); |
martin13 | 0:81cd913c5e43 | 438 | _virtualPort->putc(Recordnum >> 8); |
martin13 | 0:81cd913c5e43 | 439 | _virtualPort->putc(Recordnum); |
martin13 | 0:81cd913c5e43 | 440 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 441 | } |
martin13 | 0:81cd913c5e43 | 442 | |
martin13 | 0:81cd913c5e43 | 443 | word Diablo_Serial_4DLib::file_LoadFunction(char * Filename) |
martin13 | 0:81cd913c5e43 | 444 | { |
martin13 | 0:81cd913c5e43 | 445 | _virtualPort->putc(GFX_F_file_LoadFunction >> 8); |
martin13 | 0:81cd913c5e43 | 446 | _virtualPort->putc(GFX_F_file_LoadFunction); |
martin13 | 0:81cd913c5e43 | 447 | WriteChars(Filename); |
martin13 | 0:81cd913c5e43 | 448 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 449 | } |
martin13 | 0:81cd913c5e43 | 450 | |
martin13 | 0:81cd913c5e43 | 451 | word Diablo_Serial_4DLib::file_LoadImageControl(char * Datname, char * GCIName, word Mode) |
martin13 | 0:81cd913c5e43 | 452 | { |
martin13 | 0:81cd913c5e43 | 453 | _virtualPort->putc(GFX_F_file_LoadImageControl >> 8); |
martin13 | 0:81cd913c5e43 | 454 | _virtualPort->putc(GFX_F_file_LoadImageControl); |
martin13 | 0:81cd913c5e43 | 455 | WriteChars(Datname); |
martin13 | 0:81cd913c5e43 | 456 | WriteChars(GCIName); |
martin13 | 0:81cd913c5e43 | 457 | _virtualPort->putc(Mode >> 8); |
martin13 | 0:81cd913c5e43 | 458 | _virtualPort->putc(Mode); |
martin13 | 0:81cd913c5e43 | 459 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 460 | } |
martin13 | 0:81cd913c5e43 | 461 | |
martin13 | 0:81cd913c5e43 | 462 | word Diablo_Serial_4DLib::file_Mount() |
martin13 | 0:81cd913c5e43 | 463 | { |
martin13 | 0:81cd913c5e43 | 464 | _virtualPort->putc(GFX_F_file_Mount >> 8); |
martin13 | 0:81cd913c5e43 | 465 | _virtualPort->putc(GFX_F_file_Mount); |
martin13 | 0:81cd913c5e43 | 466 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 467 | } |
martin13 | 0:81cd913c5e43 | 468 | |
martin13 | 0:81cd913c5e43 | 469 | word Diablo_Serial_4DLib::file_Open(char * Filename, char Mode) |
martin13 | 0:81cd913c5e43 | 470 | { |
martin13 | 0:81cd913c5e43 | 471 | _virtualPort->putc(GFX_F_file_Open >> 8); |
martin13 | 0:81cd913c5e43 | 472 | _virtualPort->putc(GFX_F_file_Open); |
martin13 | 0:81cd913c5e43 | 473 | WriteChars(Filename); |
martin13 | 0:81cd913c5e43 | 474 | _virtualPort->putc(Mode); |
martin13 | 0:81cd913c5e43 | 475 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 476 | } |
martin13 | 0:81cd913c5e43 | 477 | |
martin13 | 0:81cd913c5e43 | 478 | word Diablo_Serial_4DLib::file_PlayWAV(char * Filename) |
martin13 | 0:81cd913c5e43 | 479 | { |
martin13 | 0:81cd913c5e43 | 480 | _virtualPort->putc(GFX_F_file_PlayWAV >> 8); |
martin13 | 0:81cd913c5e43 | 481 | _virtualPort->putc(GFX_F_file_PlayWAV); |
martin13 | 0:81cd913c5e43 | 482 | WriteChars(Filename); |
martin13 | 0:81cd913c5e43 | 483 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 484 | } |
martin13 | 0:81cd913c5e43 | 485 | |
martin13 | 0:81cd913c5e43 | 486 | word Diablo_Serial_4DLib::file_PutC(char Character, word Handle) |
martin13 | 0:81cd913c5e43 | 487 | { |
martin13 | 0:81cd913c5e43 | 488 | _virtualPort->putc(GFX_F_file_PutC >> 8); |
martin13 | 0:81cd913c5e43 | 489 | _virtualPort->putc(GFX_F_file_PutC); |
martin13 | 0:81cd913c5e43 | 490 | _virtualPort->putc(Character); |
martin13 | 0:81cd913c5e43 | 491 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 492 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 493 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 494 | } |
martin13 | 0:81cd913c5e43 | 495 | |
martin13 | 0:81cd913c5e43 | 496 | word Diablo_Serial_4DLib::file_PutS(char * StringOut, word Handle) |
martin13 | 0:81cd913c5e43 | 497 | { |
martin13 | 0:81cd913c5e43 | 498 | _virtualPort->putc(GFX_F_file_PutS >> 8); |
martin13 | 0:81cd913c5e43 | 499 | _virtualPort->putc(GFX_F_file_PutS); |
martin13 | 0:81cd913c5e43 | 500 | WriteChars(StringOut); |
martin13 | 0:81cd913c5e43 | 501 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 502 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 503 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 504 | } |
martin13 | 0:81cd913c5e43 | 505 | |
martin13 | 0:81cd913c5e43 | 506 | word Diablo_Serial_4DLib::file_PutW(word Word, word Handle) |
martin13 | 0:81cd913c5e43 | 507 | { |
martin13 | 0:81cd913c5e43 | 508 | _virtualPort->putc(GFX_F_file_PutW >> 8); |
martin13 | 0:81cd913c5e43 | 509 | _virtualPort->putc(GFX_F_file_PutW); |
martin13 | 0:81cd913c5e43 | 510 | _virtualPort->putc(Word >> 8); |
martin13 | 0:81cd913c5e43 | 511 | _virtualPort->putc(Word); |
martin13 | 0:81cd913c5e43 | 512 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 513 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 514 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 515 | } |
martin13 | 0:81cd913c5e43 | 516 | |
martin13 | 0:81cd913c5e43 | 517 | word Diablo_Serial_4DLib::file_Read(GFX_t4DByteArray Data, word Size, word Handle) |
martin13 | 0:81cd913c5e43 | 518 | { |
martin13 | 0:81cd913c5e43 | 519 | _virtualPort->putc(GFX_F_file_Read >> 8); |
martin13 | 0:81cd913c5e43 | 520 | _virtualPort->putc(GFX_F_file_Read); |
martin13 | 0:81cd913c5e43 | 521 | _virtualPort->putc(Size >> 8); |
martin13 | 0:81cd913c5e43 | 522 | _virtualPort->putc(Size); |
martin13 | 0:81cd913c5e43 | 523 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 524 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 525 | return GetAckResData(Data,Size); |
martin13 | 0:81cd913c5e43 | 526 | } |
martin13 | 0:81cd913c5e43 | 527 | |
martin13 | 0:81cd913c5e43 | 528 | word Diablo_Serial_4DLib::file_Rewind(word Handle) |
martin13 | 0:81cd913c5e43 | 529 | { |
martin13 | 0:81cd913c5e43 | 530 | _virtualPort->putc(GFX_F_file_Rewind >> 8); |
martin13 | 0:81cd913c5e43 | 531 | _virtualPort->putc(GFX_F_file_Rewind); |
martin13 | 0:81cd913c5e43 | 532 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 533 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 534 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 535 | } |
martin13 | 0:81cd913c5e43 | 536 | |
martin13 | 0:81cd913c5e43 | 537 | word Diablo_Serial_4DLib::file_Run(char * Filename, word ArgCount, GFX_t4DWordArray Args) |
martin13 | 0:81cd913c5e43 | 538 | { |
martin13 | 0:81cd913c5e43 | 539 | _virtualPort->putc(GFX_F_file_Run >> 8); |
martin13 | 0:81cd913c5e43 | 540 | _virtualPort->putc(GFX_F_file_Run); |
martin13 | 0:81cd913c5e43 | 541 | WriteChars(Filename); |
martin13 | 0:81cd913c5e43 | 542 | _virtualPort->putc(ArgCount >> 8); |
martin13 | 0:81cd913c5e43 | 543 | _virtualPort->putc(ArgCount); |
martin13 | 0:81cd913c5e43 | 544 | WriteWords(Args, ArgCount); |
martin13 | 0:81cd913c5e43 | 545 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 546 | } |
martin13 | 0:81cd913c5e43 | 547 | |
martin13 | 0:81cd913c5e43 | 548 | word Diablo_Serial_4DLib::file_ScreenCapture(word X, word Y, word Width, word Height, word Handle) |
martin13 | 0:81cd913c5e43 | 549 | { |
martin13 | 0:81cd913c5e43 | 550 | _virtualPort->putc(GFX_F_file_ScreenCapture >> 8); |
martin13 | 0:81cd913c5e43 | 551 | _virtualPort->putc(GFX_F_file_ScreenCapture); |
martin13 | 0:81cd913c5e43 | 552 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 553 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 554 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 555 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 556 | _virtualPort->putc(Width >> 8); |
martin13 | 0:81cd913c5e43 | 557 | _virtualPort->putc(Width); |
martin13 | 0:81cd913c5e43 | 558 | _virtualPort->putc(Height >> 8); |
martin13 | 0:81cd913c5e43 | 559 | _virtualPort->putc(Height); |
martin13 | 0:81cd913c5e43 | 560 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 561 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 562 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 563 | } |
martin13 | 0:81cd913c5e43 | 564 | |
martin13 | 0:81cd913c5e43 | 565 | word Diablo_Serial_4DLib::file_Seek(word Handle, word HiWord, word LoWord) |
martin13 | 0:81cd913c5e43 | 566 | { |
martin13 | 0:81cd913c5e43 | 567 | _virtualPort->putc(GFX_F_file_Seek >> 8); |
martin13 | 0:81cd913c5e43 | 568 | _virtualPort->putc(GFX_F_file_Seek); |
martin13 | 0:81cd913c5e43 | 569 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 570 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 571 | _virtualPort->putc(HiWord >> 8); |
martin13 | 0:81cd913c5e43 | 572 | _virtualPort->putc(HiWord); |
martin13 | 0:81cd913c5e43 | 573 | _virtualPort->putc(LoWord >> 8); |
martin13 | 0:81cd913c5e43 | 574 | _virtualPort->putc(LoWord); |
martin13 | 0:81cd913c5e43 | 575 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 576 | } |
martin13 | 0:81cd913c5e43 | 577 | |
martin13 | 0:81cd913c5e43 | 578 | word Diablo_Serial_4DLib::file_Size(word Handle, word * HiWord, word * LoWord) |
martin13 | 0:81cd913c5e43 | 579 | { |
martin13 | 0:81cd913c5e43 | 580 | _virtualPort->putc(GFX_F_file_Size >> 8); |
martin13 | 0:81cd913c5e43 | 581 | _virtualPort->putc(GFX_F_file_Size); |
martin13 | 0:81cd913c5e43 | 582 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 583 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 584 | return GetAckRes2Words(HiWord,LoWord); |
martin13 | 0:81cd913c5e43 | 585 | } |
martin13 | 0:81cd913c5e43 | 586 | |
martin13 | 0:81cd913c5e43 | 587 | word Diablo_Serial_4DLib::file_Tell(word Handle, word * HiWord, word * LoWord) |
martin13 | 0:81cd913c5e43 | 588 | { |
martin13 | 0:81cd913c5e43 | 589 | _virtualPort->putc(GFX_F_file_Tell >> 8); |
martin13 | 0:81cd913c5e43 | 590 | _virtualPort->putc(GFX_F_file_Tell); |
martin13 | 0:81cd913c5e43 | 591 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 592 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 593 | return GetAckRes2Words(HiWord,LoWord); |
martin13 | 0:81cd913c5e43 | 594 | } |
martin13 | 0:81cd913c5e43 | 595 | |
martin13 | 0:81cd913c5e43 | 596 | void Diablo_Serial_4DLib::file_Unmount() |
martin13 | 0:81cd913c5e43 | 597 | { |
martin13 | 0:81cd913c5e43 | 598 | _virtualPort->putc(GFX_F_file_Unmount >> 8); |
martin13 | 0:81cd913c5e43 | 599 | _virtualPort->putc(GFX_F_file_Unmount); |
martin13 | 0:81cd913c5e43 | 600 | GetAck(); |
martin13 | 0:81cd913c5e43 | 601 | } |
martin13 | 0:81cd913c5e43 | 602 | |
martin13 | 0:81cd913c5e43 | 603 | word Diablo_Serial_4DLib::file_Write(word Size, GFX_t4DByteArray Source, word Handle) |
martin13 | 0:81cd913c5e43 | 604 | { |
martin13 | 0:81cd913c5e43 | 605 | _virtualPort->putc(GFX_F_file_Write >> 8); |
martin13 | 0:81cd913c5e43 | 606 | _virtualPort->putc(GFX_F_file_Write); |
martin13 | 0:81cd913c5e43 | 607 | _virtualPort->putc(Size >> 8); |
martin13 | 0:81cd913c5e43 | 608 | _virtualPort->putc(Size); |
martin13 | 0:81cd913c5e43 | 609 | WriteBytes(Source, Size); |
martin13 | 0:81cd913c5e43 | 610 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 611 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 612 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 613 | } |
martin13 | 0:81cd913c5e43 | 614 | |
martin13 | 0:81cd913c5e43 | 615 | word Diablo_Serial_4DLib::gfx_BevelShadow(word Value) |
martin13 | 0:81cd913c5e43 | 616 | { |
martin13 | 0:81cd913c5e43 | 617 | _virtualPort->putc(GFX_F_gfx_BevelShadow >> 8); |
martin13 | 0:81cd913c5e43 | 618 | _virtualPort->putc(GFX_F_gfx_BevelShadow); |
martin13 | 0:81cd913c5e43 | 619 | _virtualPort->putc(Value >> 8); |
martin13 | 0:81cd913c5e43 | 620 | _virtualPort->putc(Value); |
martin13 | 0:81cd913c5e43 | 621 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 622 | } |
martin13 | 0:81cd913c5e43 | 623 | |
martin13 | 0:81cd913c5e43 | 624 | word Diablo_Serial_4DLib::gfx_BevelWidth(word Value) |
martin13 | 0:81cd913c5e43 | 625 | { |
martin13 | 0:81cd913c5e43 | 626 | _virtualPort->putc(GFX_F_gfx_BevelWidth >> 8); |
martin13 | 0:81cd913c5e43 | 627 | _virtualPort->putc(GFX_F_gfx_BevelWidth); |
martin13 | 0:81cd913c5e43 | 628 | _virtualPort->putc(Value >> 8); |
martin13 | 0:81cd913c5e43 | 629 | _virtualPort->putc(Value); |
martin13 | 0:81cd913c5e43 | 630 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 631 | } |
martin13 | 0:81cd913c5e43 | 632 | |
martin13 | 0:81cd913c5e43 | 633 | word Diablo_Serial_4DLib::gfx_BGcolour(word Color) |
martin13 | 0:81cd913c5e43 | 634 | { |
martin13 | 0:81cd913c5e43 | 635 | _virtualPort->putc(GFX_F_gfx_BGcolour >> 8); |
martin13 | 0:81cd913c5e43 | 636 | _virtualPort->putc(GFX_F_gfx_BGcolour); |
martin13 | 0:81cd913c5e43 | 637 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 638 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 639 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 640 | } |
martin13 | 0:81cd913c5e43 | 641 | |
martin13 | 0:81cd913c5e43 | 642 | void Diablo_Serial_4DLib::gfx_Button(word Up, word x, word y, word buttonColour, word txtColour, word font, word txtWidth, word txtHeight, char * text) |
martin13 | 0:81cd913c5e43 | 643 | { |
martin13 | 0:81cd913c5e43 | 644 | _virtualPort->putc(GFX_F_gfx_Button >> 8); |
martin13 | 0:81cd913c5e43 | 645 | _virtualPort->putc(GFX_F_gfx_Button); |
martin13 | 0:81cd913c5e43 | 646 | _virtualPort->putc(Up >> 8); |
martin13 | 0:81cd913c5e43 | 647 | _virtualPort->putc(Up); |
martin13 | 0:81cd913c5e43 | 648 | _virtualPort->putc(x >> 8); |
martin13 | 0:81cd913c5e43 | 649 | _virtualPort->putc(x); |
martin13 | 0:81cd913c5e43 | 650 | _virtualPort->putc(y >> 8); |
martin13 | 0:81cd913c5e43 | 651 | _virtualPort->putc(y); |
martin13 | 0:81cd913c5e43 | 652 | _virtualPort->putc(buttonColour >> 8); |
martin13 | 0:81cd913c5e43 | 653 | _virtualPort->putc(buttonColour); |
martin13 | 0:81cd913c5e43 | 654 | _virtualPort->putc(txtColour >> 8); |
martin13 | 0:81cd913c5e43 | 655 | _virtualPort->putc(txtColour); |
martin13 | 0:81cd913c5e43 | 656 | _virtualPort->putc(font >> 8); |
martin13 | 0:81cd913c5e43 | 657 | _virtualPort->putc(font); |
martin13 | 0:81cd913c5e43 | 658 | _virtualPort->putc(txtWidth >> 8); |
martin13 | 0:81cd913c5e43 | 659 | _virtualPort->putc(txtWidth); |
martin13 | 0:81cd913c5e43 | 660 | _virtualPort->putc(txtHeight >> 8); |
martin13 | 0:81cd913c5e43 | 661 | _virtualPort->putc(txtHeight); |
martin13 | 0:81cd913c5e43 | 662 | WriteChars(text); |
martin13 | 0:81cd913c5e43 | 663 | GetAck(); |
martin13 | 0:81cd913c5e43 | 664 | } |
martin13 | 0:81cd913c5e43 | 665 | |
martin13 | 0:81cd913c5e43 | 666 | void Diablo_Serial_4DLib::gfx_ChangeColour(word OldColor, word NewColor) |
martin13 | 0:81cd913c5e43 | 667 | { |
martin13 | 0:81cd913c5e43 | 668 | _virtualPort->putc(GFX_F_gfx_ChangeColour >> 8); |
martin13 | 0:81cd913c5e43 | 669 | _virtualPort->putc(GFX_F_gfx_ChangeColour); |
martin13 | 0:81cd913c5e43 | 670 | _virtualPort->putc(OldColor >> 8); |
martin13 | 0:81cd913c5e43 | 671 | _virtualPort->putc(OldColor); |
martin13 | 0:81cd913c5e43 | 672 | _virtualPort->putc(NewColor >> 8); |
martin13 | 0:81cd913c5e43 | 673 | _virtualPort->putc(NewColor); |
martin13 | 0:81cd913c5e43 | 674 | GetAck(); |
martin13 | 0:81cd913c5e43 | 675 | } |
martin13 | 0:81cd913c5e43 | 676 | |
martin13 | 0:81cd913c5e43 | 677 | void Diablo_Serial_4DLib::gfx_Circle(word X, word Y, word Radius, word Color) |
martin13 | 0:81cd913c5e43 | 678 | { |
martin13 | 0:81cd913c5e43 | 679 | _virtualPort->putc(GFX_F_gfx_Circle >> 8); |
martin13 | 0:81cd913c5e43 | 680 | _virtualPort->putc(GFX_F_gfx_Circle); |
martin13 | 0:81cd913c5e43 | 681 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 682 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 683 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 684 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 685 | _virtualPort->putc(Radius >> 8); |
martin13 | 0:81cd913c5e43 | 686 | _virtualPort->putc(Radius); |
martin13 | 0:81cd913c5e43 | 687 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 688 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 689 | GetAck(); |
martin13 | 0:81cd913c5e43 | 690 | } |
martin13 | 0:81cd913c5e43 | 691 | |
martin13 | 0:81cd913c5e43 | 692 | void Diablo_Serial_4DLib::gfx_CircleFilled(word X, word Y, word Radius, word Color) |
martin13 | 0:81cd913c5e43 | 693 | { |
martin13 | 0:81cd913c5e43 | 694 | _virtualPort->putc(GFX_F_gfx_CircleFilled >> 8); |
martin13 | 0:81cd913c5e43 | 695 | _virtualPort->putc(GFX_F_gfx_CircleFilled); |
martin13 | 0:81cd913c5e43 | 696 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 697 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 698 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 699 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 700 | _virtualPort->putc(Radius >> 8); |
martin13 | 0:81cd913c5e43 | 701 | _virtualPort->putc(Radius); |
martin13 | 0:81cd913c5e43 | 702 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 703 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 704 | GetAck(); |
martin13 | 0:81cd913c5e43 | 705 | } |
martin13 | 0:81cd913c5e43 | 706 | |
martin13 | 0:81cd913c5e43 | 707 | void Diablo_Serial_4DLib::gfx_Clipping(word OnOff) |
martin13 | 0:81cd913c5e43 | 708 | { |
martin13 | 0:81cd913c5e43 | 709 | _virtualPort->putc(GFX_F_gfx_Clipping >> 8); |
martin13 | 0:81cd913c5e43 | 710 | _virtualPort->putc(GFX_F_gfx_Clipping); |
martin13 | 0:81cd913c5e43 | 711 | _virtualPort->putc(OnOff >> 8); |
martin13 | 0:81cd913c5e43 | 712 | _virtualPort->putc(OnOff); |
martin13 | 0:81cd913c5e43 | 713 | GetAck(); |
martin13 | 0:81cd913c5e43 | 714 | } |
martin13 | 0:81cd913c5e43 | 715 | |
martin13 | 0:81cd913c5e43 | 716 | void Diablo_Serial_4DLib::gfx_ClipWindow(word X1, word Y1, word X2, word Y2) |
martin13 | 0:81cd913c5e43 | 717 | { |
martin13 | 0:81cd913c5e43 | 718 | _virtualPort->putc(GFX_F_gfx_ClipWindow >> 8); |
martin13 | 0:81cd913c5e43 | 719 | _virtualPort->putc(GFX_F_gfx_ClipWindow); |
martin13 | 0:81cd913c5e43 | 720 | _virtualPort->putc(X1 >> 8); |
martin13 | 0:81cd913c5e43 | 721 | _virtualPort->putc(X1); |
martin13 | 0:81cd913c5e43 | 722 | _virtualPort->putc(Y1 >> 8); |
martin13 | 0:81cd913c5e43 | 723 | _virtualPort->putc(Y1); |
martin13 | 0:81cd913c5e43 | 724 | _virtualPort->putc(X2 >> 8); |
martin13 | 0:81cd913c5e43 | 725 | _virtualPort->putc(X2); |
martin13 | 0:81cd913c5e43 | 726 | _virtualPort->putc(Y2 >> 8); |
martin13 | 0:81cd913c5e43 | 727 | _virtualPort->putc(Y2); |
martin13 | 0:81cd913c5e43 | 728 | GetAck(); |
martin13 | 0:81cd913c5e43 | 729 | } |
martin13 | 0:81cd913c5e43 | 730 | |
martin13 | 0:81cd913c5e43 | 731 | void Diablo_Serial_4DLib::gfx_Cls() |
martin13 | 0:81cd913c5e43 | 732 | { |
martin13 | 0:81cd913c5e43 | 733 | _virtualPort->putc(GFX_F_gfx_Cls >> 8); |
martin13 | 0:81cd913c5e43 | 734 | _virtualPort->putc(GFX_F_gfx_Cls); |
martin13 | 0:81cd913c5e43 | 735 | GetAck(); |
martin13 | 0:81cd913c5e43 | 736 | } |
martin13 | 0:81cd913c5e43 | 737 | |
martin13 | 0:81cd913c5e43 | 738 | word Diablo_Serial_4DLib::gfx_Contrast(word Contrast) |
martin13 | 0:81cd913c5e43 | 739 | { |
martin13 | 0:81cd913c5e43 | 740 | _virtualPort->putc(GFX_F_gfx_Contrast >> 8); |
martin13 | 0:81cd913c5e43 | 741 | _virtualPort->putc(GFX_F_gfx_Contrast); |
martin13 | 0:81cd913c5e43 | 742 | _virtualPort->putc(Contrast >> 8); |
martin13 | 0:81cd913c5e43 | 743 | _virtualPort->putc(Contrast); |
martin13 | 0:81cd913c5e43 | 744 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 745 | } |
martin13 | 0:81cd913c5e43 | 746 | |
martin13 | 0:81cd913c5e43 | 747 | void Diablo_Serial_4DLib::gfx_Ellipse(word X, word Y, word Xrad, word Yrad, word Color) |
martin13 | 0:81cd913c5e43 | 748 | { |
martin13 | 0:81cd913c5e43 | 749 | _virtualPort->putc(GFX_F_gfx_Ellipse >> 8); |
martin13 | 0:81cd913c5e43 | 750 | _virtualPort->putc(GFX_F_gfx_Ellipse); |
martin13 | 0:81cd913c5e43 | 751 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 752 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 753 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 754 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 755 | _virtualPort->putc(Xrad >> 8); |
martin13 | 0:81cd913c5e43 | 756 | _virtualPort->putc(Xrad); |
martin13 | 0:81cd913c5e43 | 757 | _virtualPort->putc(Yrad >> 8); |
martin13 | 0:81cd913c5e43 | 758 | _virtualPort->putc(Yrad); |
martin13 | 0:81cd913c5e43 | 759 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 760 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 761 | GetAck(); |
martin13 | 0:81cd913c5e43 | 762 | } |
martin13 | 0:81cd913c5e43 | 763 | |
martin13 | 0:81cd913c5e43 | 764 | void Diablo_Serial_4DLib::gfx_EllipseFilled(word X, word Y, word Xrad, word Yrad, word Color) |
martin13 | 0:81cd913c5e43 | 765 | { |
martin13 | 0:81cd913c5e43 | 766 | _virtualPort->putc(GFX_F_gfx_EllipseFilled >> 8); |
martin13 | 0:81cd913c5e43 | 767 | _virtualPort->putc(GFX_F_gfx_EllipseFilled); |
martin13 | 0:81cd913c5e43 | 768 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 769 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 770 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 771 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 772 | _virtualPort->putc(Xrad >> 8); |
martin13 | 0:81cd913c5e43 | 773 | _virtualPort->putc(Xrad); |
martin13 | 0:81cd913c5e43 | 774 | _virtualPort->putc(Yrad >> 8); |
martin13 | 0:81cd913c5e43 | 775 | _virtualPort->putc(Yrad); |
martin13 | 0:81cd913c5e43 | 776 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 777 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 778 | GetAck(); |
martin13 | 0:81cd913c5e43 | 779 | } |
martin13 | 0:81cd913c5e43 | 780 | |
martin13 | 0:81cd913c5e43 | 781 | word Diablo_Serial_4DLib::gfx_FrameDelay(word Msec) |
martin13 | 0:81cd913c5e43 | 782 | { |
martin13 | 0:81cd913c5e43 | 783 | _virtualPort->putc(GFX_F_gfx_FrameDelay >> 8); |
martin13 | 0:81cd913c5e43 | 784 | _virtualPort->putc(GFX_F_gfx_FrameDelay); |
martin13 | 0:81cd913c5e43 | 785 | _virtualPort->putc(Msec >> 8); |
martin13 | 0:81cd913c5e43 | 786 | _virtualPort->putc(Msec); |
martin13 | 0:81cd913c5e43 | 787 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 788 | } |
martin13 | 0:81cd913c5e43 | 789 | |
martin13 | 0:81cd913c5e43 | 790 | word Diablo_Serial_4DLib::gfx_Get(word Mode) |
martin13 | 0:81cd913c5e43 | 791 | { |
martin13 | 0:81cd913c5e43 | 792 | _virtualPort->putc(GFX_F_gfx_Get >> 8); |
martin13 | 0:81cd913c5e43 | 793 | _virtualPort->putc(GFX_F_gfx_Get); |
martin13 | 0:81cd913c5e43 | 794 | _virtualPort->putc(Mode >> 8); |
martin13 | 0:81cd913c5e43 | 795 | _virtualPort->putc(Mode); |
martin13 | 0:81cd913c5e43 | 796 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 797 | } |
martin13 | 0:81cd913c5e43 | 798 | |
martin13 | 0:81cd913c5e43 | 799 | word Diablo_Serial_4DLib::gfx_GetPixel(word X, word Y) |
martin13 | 0:81cd913c5e43 | 800 | { |
martin13 | 0:81cd913c5e43 | 801 | _virtualPort->putc(GFX_F_gfx_GetPixel >> 8); |
martin13 | 0:81cd913c5e43 | 802 | _virtualPort->putc(GFX_F_gfx_GetPixel); |
martin13 | 0:81cd913c5e43 | 803 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 804 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 805 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 806 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 807 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 808 | } |
martin13 | 0:81cd913c5e43 | 809 | |
martin13 | 0:81cd913c5e43 | 810 | void Diablo_Serial_4DLib::gfx_Line(word X1, word Y1, word X2, word Y2, word Color) |
martin13 | 0:81cd913c5e43 | 811 | { |
martin13 | 0:81cd913c5e43 | 812 | _virtualPort->putc(GFX_F_gfx_Line >> 8); |
martin13 | 0:81cd913c5e43 | 813 | _virtualPort->putc(GFX_F_gfx_Line); |
martin13 | 0:81cd913c5e43 | 814 | _virtualPort->putc(X1 >> 8); |
martin13 | 0:81cd913c5e43 | 815 | _virtualPort->putc(X1); |
martin13 | 0:81cd913c5e43 | 816 | _virtualPort->putc(Y1 >> 8); |
martin13 | 0:81cd913c5e43 | 817 | _virtualPort->putc(Y1); |
martin13 | 0:81cd913c5e43 | 818 | _virtualPort->putc(X2 >> 8); |
martin13 | 0:81cd913c5e43 | 819 | _virtualPort->putc(X2); |
martin13 | 0:81cd913c5e43 | 820 | _virtualPort->putc(Y2 >> 8); |
martin13 | 0:81cd913c5e43 | 821 | _virtualPort->putc(Y2); |
martin13 | 0:81cd913c5e43 | 822 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 823 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 824 | GetAck(); |
martin13 | 0:81cd913c5e43 | 825 | } |
martin13 | 0:81cd913c5e43 | 826 | |
martin13 | 0:81cd913c5e43 | 827 | word Diablo_Serial_4DLib::gfx_LinePattern(word Pattern) |
martin13 | 0:81cd913c5e43 | 828 | { |
martin13 | 0:81cd913c5e43 | 829 | _virtualPort->putc(GFX_F_gfx_LinePattern >> 8); |
martin13 | 0:81cd913c5e43 | 830 | _virtualPort->putc(GFX_F_gfx_LinePattern); |
martin13 | 0:81cd913c5e43 | 831 | _virtualPort->putc(Pattern >> 8); |
martin13 | 0:81cd913c5e43 | 832 | _virtualPort->putc(Pattern); |
martin13 | 0:81cd913c5e43 | 833 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 834 | } |
martin13 | 0:81cd913c5e43 | 835 | |
martin13 | 0:81cd913c5e43 | 836 | void Diablo_Serial_4DLib::gfx_LineTo(word X, word Y) |
martin13 | 0:81cd913c5e43 | 837 | { |
martin13 | 0:81cd913c5e43 | 838 | _virtualPort->putc(GFX_F_gfx_LineTo >> 8); |
martin13 | 0:81cd913c5e43 | 839 | _virtualPort->putc(GFX_F_gfx_LineTo); |
martin13 | 0:81cd913c5e43 | 840 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 841 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 842 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 843 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 844 | GetAck(); |
martin13 | 0:81cd913c5e43 | 845 | } |
martin13 | 0:81cd913c5e43 | 846 | |
martin13 | 0:81cd913c5e43 | 847 | void Diablo_Serial_4DLib::gfx_MoveTo(word X, word Y) |
martin13 | 0:81cd913c5e43 | 848 | { |
martin13 | 0:81cd913c5e43 | 849 | _virtualPort->putc(GFX_F_gfx_MoveTo >> 8); |
martin13 | 0:81cd913c5e43 | 850 | _virtualPort->putc(GFX_F_gfx_MoveTo); |
martin13 | 0:81cd913c5e43 | 851 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 852 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 853 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 854 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 855 | GetAck(); |
martin13 | 0:81cd913c5e43 | 856 | } |
martin13 | 0:81cd913c5e43 | 857 | |
martin13 | 0:81cd913c5e43 | 858 | word Diablo_Serial_4DLib::gfx_Orbit(word Angle, word Distance, word * Xdest, word * Ydest) |
martin13 | 0:81cd913c5e43 | 859 | { |
martin13 | 0:81cd913c5e43 | 860 | _virtualPort->putc(GFX_F_gfx_Orbit >> 8); |
martin13 | 0:81cd913c5e43 | 861 | _virtualPort->putc(GFX_F_gfx_Orbit); |
martin13 | 0:81cd913c5e43 | 862 | _virtualPort->putc(Angle >> 8); |
martin13 | 0:81cd913c5e43 | 863 | _virtualPort->putc(Angle); |
martin13 | 0:81cd913c5e43 | 864 | _virtualPort->putc(Distance >> 8); |
martin13 | 0:81cd913c5e43 | 865 | _virtualPort->putc(Distance); |
martin13 | 0:81cd913c5e43 | 866 | GetAck2Words(Xdest,Ydest); |
martin13 | 0:81cd913c5e43 | 867 | return 0 ; |
martin13 | 0:81cd913c5e43 | 868 | } |
martin13 | 0:81cd913c5e43 | 869 | |
martin13 | 0:81cd913c5e43 | 870 | word Diablo_Serial_4DLib::gfx_OutlineColour(word Color) |
martin13 | 0:81cd913c5e43 | 871 | { |
martin13 | 0:81cd913c5e43 | 872 | _virtualPort->putc(GFX_F_gfx_OutlineColour >> 8); |
martin13 | 0:81cd913c5e43 | 873 | _virtualPort->putc(GFX_F_gfx_OutlineColour); |
martin13 | 0:81cd913c5e43 | 874 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 875 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 876 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 877 | } |
martin13 | 0:81cd913c5e43 | 878 | |
martin13 | 0:81cd913c5e43 | 879 | void Diablo_Serial_4DLib::gfx_Panel(word Raised, word X, word Y, word Width, word Height, word Color) |
martin13 | 0:81cd913c5e43 | 880 | { |
martin13 | 0:81cd913c5e43 | 881 | _virtualPort->putc(GFX_F_gfx_Panel >> 8); |
martin13 | 0:81cd913c5e43 | 882 | _virtualPort->putc(GFX_F_gfx_Panel); |
martin13 | 0:81cd913c5e43 | 883 | _virtualPort->putc(Raised >> 8); |
martin13 | 0:81cd913c5e43 | 884 | _virtualPort->putc(Raised); |
martin13 | 0:81cd913c5e43 | 885 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 886 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 887 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 888 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 889 | _virtualPort->putc(Width >> 8); |
martin13 | 0:81cd913c5e43 | 890 | _virtualPort->putc(Width); |
martin13 | 0:81cd913c5e43 | 891 | _virtualPort->putc(Height >> 8); |
martin13 | 0:81cd913c5e43 | 892 | _virtualPort->putc(Height); |
martin13 | 0:81cd913c5e43 | 893 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 894 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 895 | GetAck(); |
martin13 | 0:81cd913c5e43 | 896 | } |
martin13 | 0:81cd913c5e43 | 897 | |
martin13 | 0:81cd913c5e43 | 898 | void Diablo_Serial_4DLib::gfx_Polygon(word n, GFX_t4DWordArray Xvalues, GFX_t4DWordArray Yvalues, word Color) |
martin13 | 0:81cd913c5e43 | 899 | { |
martin13 | 0:81cd913c5e43 | 900 | _virtualPort->putc(GFX_F_gfx_Polygon >> 8); |
martin13 | 0:81cd913c5e43 | 901 | _virtualPort->putc(GFX_F_gfx_Polygon); |
martin13 | 0:81cd913c5e43 | 902 | _virtualPort->putc(n >> 8); |
martin13 | 0:81cd913c5e43 | 903 | _virtualPort->putc(n); |
martin13 | 0:81cd913c5e43 | 904 | WriteWords(Xvalues, n); |
martin13 | 0:81cd913c5e43 | 905 | WriteWords(Yvalues, n); |
martin13 | 0:81cd913c5e43 | 906 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 907 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 908 | GetAck(); |
martin13 | 0:81cd913c5e43 | 909 | } |
martin13 | 0:81cd913c5e43 | 910 | |
martin13 | 0:81cd913c5e43 | 911 | void Diablo_Serial_4DLib::gfx_PolygonFilled(word n, GFX_t4DWordArray Xvalues, GFX_t4DWordArray Yvalues, word Color) |
martin13 | 0:81cd913c5e43 | 912 | { |
martin13 | 0:81cd913c5e43 | 913 | _virtualPort->putc(GFX_F_gfx_PolygonFilled >> 8); |
martin13 | 0:81cd913c5e43 | 914 | _virtualPort->putc(GFX_F_gfx_PolygonFilled); |
martin13 | 0:81cd913c5e43 | 915 | _virtualPort->putc(n >> 8); |
martin13 | 0:81cd913c5e43 | 916 | _virtualPort->putc(n); |
martin13 | 0:81cd913c5e43 | 917 | WriteWords(Xvalues, n); |
martin13 | 0:81cd913c5e43 | 918 | WriteWords(Yvalues, n); |
martin13 | 0:81cd913c5e43 | 919 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 920 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 921 | GetAck(); |
martin13 | 0:81cd913c5e43 | 922 | } |
martin13 | 0:81cd913c5e43 | 923 | |
martin13 | 0:81cd913c5e43 | 924 | void Diablo_Serial_4DLib::gfx_Polyline(word n, GFX_t4DWordArray Xvalues, GFX_t4DWordArray Yvalues, word Color) |
martin13 | 0:81cd913c5e43 | 925 | { |
martin13 | 0:81cd913c5e43 | 926 | _virtualPort->putc(GFX_F_gfx_Polyline >> 8); |
martin13 | 0:81cd913c5e43 | 927 | _virtualPort->putc(GFX_F_gfx_Polyline); |
martin13 | 0:81cd913c5e43 | 928 | _virtualPort->putc(n >> 8); |
martin13 | 0:81cd913c5e43 | 929 | _virtualPort->putc(n); |
martin13 | 0:81cd913c5e43 | 930 | WriteWords(Xvalues, n); |
martin13 | 0:81cd913c5e43 | 931 | WriteWords(Yvalues, n); |
martin13 | 0:81cd913c5e43 | 932 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 933 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 934 | GetAck(); |
martin13 | 0:81cd913c5e43 | 935 | } |
martin13 | 0:81cd913c5e43 | 936 | |
martin13 | 0:81cd913c5e43 | 937 | void Diablo_Serial_4DLib::gfx_PutPixel(word X, word Y, word Color) |
martin13 | 0:81cd913c5e43 | 938 | { |
martin13 | 0:81cd913c5e43 | 939 | _virtualPort->putc(GFX_F_gfx_PutPixel >> 8); |
martin13 | 0:81cd913c5e43 | 940 | _virtualPort->putc(GFX_F_gfx_PutPixel); |
martin13 | 0:81cd913c5e43 | 941 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 942 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 943 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 944 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 945 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 946 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 947 | GetAck(); |
martin13 | 0:81cd913c5e43 | 948 | } |
martin13 | 0:81cd913c5e43 | 949 | |
martin13 | 0:81cd913c5e43 | 950 | void Diablo_Serial_4DLib::gfx_Rectangle(word X1, word Y1, word X2, word Y2, word Color) |
martin13 | 0:81cd913c5e43 | 951 | { |
martin13 | 0:81cd913c5e43 | 952 | _virtualPort->putc(GFX_F_gfx_Rectangle >> 8); |
martin13 | 0:81cd913c5e43 | 953 | _virtualPort->putc(GFX_F_gfx_Rectangle); |
martin13 | 0:81cd913c5e43 | 954 | _virtualPort->putc(X1 >> 8); |
martin13 | 0:81cd913c5e43 | 955 | _virtualPort->putc(X1); |
martin13 | 0:81cd913c5e43 | 956 | _virtualPort->putc(Y1 >> 8); |
martin13 | 0:81cd913c5e43 | 957 | _virtualPort->putc(Y1); |
martin13 | 0:81cd913c5e43 | 958 | _virtualPort->putc(X2 >> 8); |
martin13 | 0:81cd913c5e43 | 959 | _virtualPort->putc(X2); |
martin13 | 0:81cd913c5e43 | 960 | _virtualPort->putc(Y2 >> 8); |
martin13 | 0:81cd913c5e43 | 961 | _virtualPort->putc(Y2); |
martin13 | 0:81cd913c5e43 | 962 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 963 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 964 | GetAck(); |
martin13 | 0:81cd913c5e43 | 965 | } |
martin13 | 0:81cd913c5e43 | 966 | |
martin13 | 0:81cd913c5e43 | 967 | void Diablo_Serial_4DLib::gfx_RectangleFilled(word X1, word Y1, word X2, word Y2, word Color) |
martin13 | 0:81cd913c5e43 | 968 | { |
martin13 | 0:81cd913c5e43 | 969 | _virtualPort->putc(GFX_F_gfx_RectangleFilled >> 8); |
martin13 | 0:81cd913c5e43 | 970 | _virtualPort->putc(GFX_F_gfx_RectangleFilled); |
martin13 | 0:81cd913c5e43 | 971 | _virtualPort->putc(X1 >> 8); |
martin13 | 0:81cd913c5e43 | 972 | _virtualPort->putc(X1); |
martin13 | 0:81cd913c5e43 | 973 | _virtualPort->putc(Y1 >> 8); |
martin13 | 0:81cd913c5e43 | 974 | _virtualPort->putc(Y1); |
martin13 | 0:81cd913c5e43 | 975 | _virtualPort->putc(X2 >> 8); |
martin13 | 0:81cd913c5e43 | 976 | _virtualPort->putc(X2); |
martin13 | 0:81cd913c5e43 | 977 | _virtualPort->putc(Y2 >> 8); |
martin13 | 0:81cd913c5e43 | 978 | _virtualPort->putc(Y2); |
martin13 | 0:81cd913c5e43 | 979 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 980 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 981 | GetAck(); |
martin13 | 0:81cd913c5e43 | 982 | } |
martin13 | 0:81cd913c5e43 | 983 | |
martin13 | 0:81cd913c5e43 | 984 | void Diablo_Serial_4DLib::gfx_ScreenCopyPaste(word Xs, word Ys, word Xd, word Yd, word Width, word Height) |
martin13 | 0:81cd913c5e43 | 985 | { |
martin13 | 0:81cd913c5e43 | 986 | _virtualPort->putc(GFX_F_gfx_ScreenCopyPaste >> 8); |
martin13 | 0:81cd913c5e43 | 987 | _virtualPort->putc(GFX_F_gfx_ScreenCopyPaste); |
martin13 | 0:81cd913c5e43 | 988 | _virtualPort->putc(Xs >> 8); |
martin13 | 0:81cd913c5e43 | 989 | _virtualPort->putc(Xs); |
martin13 | 0:81cd913c5e43 | 990 | _virtualPort->putc(Ys >> 8); |
martin13 | 0:81cd913c5e43 | 991 | _virtualPort->putc(Ys); |
martin13 | 0:81cd913c5e43 | 992 | _virtualPort->putc(Xd >> 8); |
martin13 | 0:81cd913c5e43 | 993 | _virtualPort->putc(Xd); |
martin13 | 0:81cd913c5e43 | 994 | _virtualPort->putc(Yd >> 8); |
martin13 | 0:81cd913c5e43 | 995 | _virtualPort->putc(Yd); |
martin13 | 0:81cd913c5e43 | 996 | _virtualPort->putc(Width >> 8); |
martin13 | 0:81cd913c5e43 | 997 | _virtualPort->putc(Width); |
martin13 | 0:81cd913c5e43 | 998 | _virtualPort->putc(Height >> 8); |
martin13 | 0:81cd913c5e43 | 999 | _virtualPort->putc(Height); |
martin13 | 0:81cd913c5e43 | 1000 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1001 | } |
martin13 | 0:81cd913c5e43 | 1002 | |
martin13 | 0:81cd913c5e43 | 1003 | word Diablo_Serial_4DLib::gfx_ScreenMode(word ScreenMode) |
martin13 | 0:81cd913c5e43 | 1004 | { |
martin13 | 0:81cd913c5e43 | 1005 | _virtualPort->putc(GFX_F_gfx_ScreenMode >> 8); |
martin13 | 0:81cd913c5e43 | 1006 | _virtualPort->putc(GFX_F_gfx_ScreenMode); |
martin13 | 0:81cd913c5e43 | 1007 | _virtualPort->putc(ScreenMode >> 8); |
martin13 | 0:81cd913c5e43 | 1008 | _virtualPort->putc(ScreenMode); |
martin13 | 0:81cd913c5e43 | 1009 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1010 | } |
martin13 | 0:81cd913c5e43 | 1011 | |
martin13 | 0:81cd913c5e43 | 1012 | void Diablo_Serial_4DLib::gfx_Set(word Func, word Value) |
martin13 | 0:81cd913c5e43 | 1013 | { |
martin13 | 0:81cd913c5e43 | 1014 | _virtualPort->putc(GFX_F_gfx_Set >> 8); |
martin13 | 0:81cd913c5e43 | 1015 | _virtualPort->putc(GFX_F_gfx_Set); |
martin13 | 0:81cd913c5e43 | 1016 | _virtualPort->putc(Func >> 8); |
martin13 | 0:81cd913c5e43 | 1017 | _virtualPort->putc(Func); |
martin13 | 0:81cd913c5e43 | 1018 | _virtualPort->putc(Value >> 8); |
martin13 | 0:81cd913c5e43 | 1019 | _virtualPort->putc(Value); |
martin13 | 0:81cd913c5e43 | 1020 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1021 | } |
martin13 | 0:81cd913c5e43 | 1022 | |
martin13 | 0:81cd913c5e43 | 1023 | void Diablo_Serial_4DLib::gfx_SetClipRegion() |
martin13 | 0:81cd913c5e43 | 1024 | { |
martin13 | 0:81cd913c5e43 | 1025 | _virtualPort->putc(GFX_F_gfx_SetClipRegion >> 8); |
martin13 | 0:81cd913c5e43 | 1026 | _virtualPort->putc(GFX_F_gfx_SetClipRegion); |
martin13 | 0:81cd913c5e43 | 1027 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1028 | } |
martin13 | 0:81cd913c5e43 | 1029 | |
martin13 | 0:81cd913c5e43 | 1030 | word Diablo_Serial_4DLib::gfx_Slider(word Mode, word X1, word Y1, word X2, word Y2, word Color, word Scale, word Value) |
martin13 | 0:81cd913c5e43 | 1031 | { |
martin13 | 0:81cd913c5e43 | 1032 | _virtualPort->putc(GFX_F_gfx_Slider >> 8); |
martin13 | 0:81cd913c5e43 | 1033 | _virtualPort->putc(GFX_F_gfx_Slider); |
martin13 | 0:81cd913c5e43 | 1034 | _virtualPort->putc(Mode >> 8); |
martin13 | 0:81cd913c5e43 | 1035 | _virtualPort->putc(Mode); |
martin13 | 0:81cd913c5e43 | 1036 | _virtualPort->putc(X1 >> 8); |
martin13 | 0:81cd913c5e43 | 1037 | _virtualPort->putc(X1); |
martin13 | 0:81cd913c5e43 | 1038 | _virtualPort->putc(Y1 >> 8); |
martin13 | 0:81cd913c5e43 | 1039 | _virtualPort->putc(Y1); |
martin13 | 0:81cd913c5e43 | 1040 | _virtualPort->putc(X2 >> 8); |
martin13 | 0:81cd913c5e43 | 1041 | _virtualPort->putc(X2); |
martin13 | 0:81cd913c5e43 | 1042 | _virtualPort->putc(Y2 >> 8); |
martin13 | 0:81cd913c5e43 | 1043 | _virtualPort->putc(Y2); |
martin13 | 0:81cd913c5e43 | 1044 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 1045 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 1046 | _virtualPort->putc(Scale >> 8); |
martin13 | 0:81cd913c5e43 | 1047 | _virtualPort->putc(Scale); |
martin13 | 0:81cd913c5e43 | 1048 | _virtualPort->putc(Value >> 8); |
martin13 | 0:81cd913c5e43 | 1049 | _virtualPort->putc(Value); |
martin13 | 0:81cd913c5e43 | 1050 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1051 | } |
martin13 | 0:81cd913c5e43 | 1052 | |
martin13 | 0:81cd913c5e43 | 1053 | word Diablo_Serial_4DLib::gfx_Transparency(word OnOff) |
martin13 | 0:81cd913c5e43 | 1054 | { |
martin13 | 0:81cd913c5e43 | 1055 | _virtualPort->putc(GFX_F_gfx_Transparency >> 8); |
martin13 | 0:81cd913c5e43 | 1056 | _virtualPort->putc(GFX_F_gfx_Transparency); |
martin13 | 0:81cd913c5e43 | 1057 | _virtualPort->putc(OnOff >> 8); |
martin13 | 0:81cd913c5e43 | 1058 | _virtualPort->putc(OnOff); |
martin13 | 0:81cd913c5e43 | 1059 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1060 | } |
martin13 | 0:81cd913c5e43 | 1061 | |
martin13 | 0:81cd913c5e43 | 1062 | word Diablo_Serial_4DLib::gfx_TransparentColour(word Color) |
martin13 | 0:81cd913c5e43 | 1063 | { |
martin13 | 0:81cd913c5e43 | 1064 | _virtualPort->putc(GFX_F_gfx_TransparentColour >> 8); |
martin13 | 0:81cd913c5e43 | 1065 | _virtualPort->putc(GFX_F_gfx_TransparentColour); |
martin13 | 0:81cd913c5e43 | 1066 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 1067 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 1068 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1069 | } |
martin13 | 0:81cd913c5e43 | 1070 | |
martin13 | 0:81cd913c5e43 | 1071 | void Diablo_Serial_4DLib::gfx_Triangle(word X1, word Y1, word X2, word Y2, word X3, word Y3, word Color) |
martin13 | 0:81cd913c5e43 | 1072 | { |
martin13 | 0:81cd913c5e43 | 1073 | _virtualPort->putc(GFX_F_gfx_Triangle >> 8); |
martin13 | 0:81cd913c5e43 | 1074 | _virtualPort->putc(GFX_F_gfx_Triangle); |
martin13 | 0:81cd913c5e43 | 1075 | _virtualPort->putc(X1 >> 8); |
martin13 | 0:81cd913c5e43 | 1076 | _virtualPort->putc(X1); |
martin13 | 0:81cd913c5e43 | 1077 | _virtualPort->putc(Y1 >> 8); |
martin13 | 0:81cd913c5e43 | 1078 | _virtualPort->putc(Y1); |
martin13 | 0:81cd913c5e43 | 1079 | _virtualPort->putc(X2 >> 8); |
martin13 | 0:81cd913c5e43 | 1080 | _virtualPort->putc(X2); |
martin13 | 0:81cd913c5e43 | 1081 | _virtualPort->putc(Y2 >> 8); |
martin13 | 0:81cd913c5e43 | 1082 | _virtualPort->putc(Y2); |
martin13 | 0:81cd913c5e43 | 1083 | _virtualPort->putc(X3 >> 8); |
martin13 | 0:81cd913c5e43 | 1084 | _virtualPort->putc(X3); |
martin13 | 0:81cd913c5e43 | 1085 | _virtualPort->putc(Y3 >> 8); |
martin13 | 0:81cd913c5e43 | 1086 | _virtualPort->putc(Y3); |
martin13 | 0:81cd913c5e43 | 1087 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 1088 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 1089 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1090 | } |
martin13 | 0:81cd913c5e43 | 1091 | |
martin13 | 0:81cd913c5e43 | 1092 | void Diablo_Serial_4DLib::gfx_TriangleFilled(word X1, word Y1, word X2, word Y2, word X3, word Y3, word Color) |
martin13 | 0:81cd913c5e43 | 1093 | { |
martin13 | 0:81cd913c5e43 | 1094 | _virtualPort->putc(GFX_F_gfx_TriangleFilled >> 8); |
martin13 | 0:81cd913c5e43 | 1095 | _virtualPort->putc(GFX_F_gfx_TriangleFilled); |
martin13 | 0:81cd913c5e43 | 1096 | _virtualPort->putc(X1 >> 8); |
martin13 | 0:81cd913c5e43 | 1097 | _virtualPort->putc(X1); |
martin13 | 0:81cd913c5e43 | 1098 | _virtualPort->putc(Y1 >> 8); |
martin13 | 0:81cd913c5e43 | 1099 | _virtualPort->putc(Y1); |
martin13 | 0:81cd913c5e43 | 1100 | _virtualPort->putc(X2 >> 8); |
martin13 | 0:81cd913c5e43 | 1101 | _virtualPort->putc(X2); |
martin13 | 0:81cd913c5e43 | 1102 | _virtualPort->putc(Y2 >> 8); |
martin13 | 0:81cd913c5e43 | 1103 | _virtualPort->putc(Y2); |
martin13 | 0:81cd913c5e43 | 1104 | _virtualPort->putc(X3 >> 8); |
martin13 | 0:81cd913c5e43 | 1105 | _virtualPort->putc(X3); |
martin13 | 0:81cd913c5e43 | 1106 | _virtualPort->putc(Y3 >> 8); |
martin13 | 0:81cd913c5e43 | 1107 | _virtualPort->putc(Y3); |
martin13 | 0:81cd913c5e43 | 1108 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 1109 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 1110 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1111 | } |
martin13 | 0:81cd913c5e43 | 1112 | |
martin13 | 0:81cd913c5e43 | 1113 | word Diablo_Serial_4DLib::img_ClearAttributes(word Handle, word Index, word Value) |
martin13 | 0:81cd913c5e43 | 1114 | { |
martin13 | 0:81cd913c5e43 | 1115 | _virtualPort->putc(GFX_F_img_ClearAttributes >> 8); |
martin13 | 0:81cd913c5e43 | 1116 | _virtualPort->putc(GFX_F_img_ClearAttributes); |
martin13 | 0:81cd913c5e43 | 1117 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1118 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1119 | _virtualPort->putc(Index >> 8); |
martin13 | 0:81cd913c5e43 | 1120 | _virtualPort->putc(Index); |
martin13 | 0:81cd913c5e43 | 1121 | _virtualPort->putc(Value >> 8); |
martin13 | 0:81cd913c5e43 | 1122 | _virtualPort->putc(Value); |
martin13 | 0:81cd913c5e43 | 1123 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1124 | } |
martin13 | 0:81cd913c5e43 | 1125 | |
martin13 | 0:81cd913c5e43 | 1126 | word Diablo_Serial_4DLib::img_Darken(word Handle, word Index) |
martin13 | 0:81cd913c5e43 | 1127 | { |
martin13 | 0:81cd913c5e43 | 1128 | _virtualPort->putc(GFX_F_img_Darken >> 8); |
martin13 | 0:81cd913c5e43 | 1129 | _virtualPort->putc(GFX_F_img_Darken); |
martin13 | 0:81cd913c5e43 | 1130 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1131 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1132 | _virtualPort->putc(Index >> 8); |
martin13 | 0:81cd913c5e43 | 1133 | _virtualPort->putc(Index); |
martin13 | 0:81cd913c5e43 | 1134 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1135 | } |
martin13 | 0:81cd913c5e43 | 1136 | |
martin13 | 0:81cd913c5e43 | 1137 | word Diablo_Serial_4DLib::img_Disable(word Handle, word Index) |
martin13 | 0:81cd913c5e43 | 1138 | { |
martin13 | 0:81cd913c5e43 | 1139 | _virtualPort->putc(GFX_F_img_Disable >> 8); |
martin13 | 0:81cd913c5e43 | 1140 | _virtualPort->putc(GFX_F_img_Disable); |
martin13 | 0:81cd913c5e43 | 1141 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1142 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1143 | _virtualPort->putc(Index >> 8); |
martin13 | 0:81cd913c5e43 | 1144 | _virtualPort->putc(Index); |
martin13 | 0:81cd913c5e43 | 1145 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1146 | } |
martin13 | 0:81cd913c5e43 | 1147 | |
martin13 | 0:81cd913c5e43 | 1148 | word Diablo_Serial_4DLib::img_Enable(word Handle, word Index) |
martin13 | 0:81cd913c5e43 | 1149 | { |
martin13 | 0:81cd913c5e43 | 1150 | _virtualPort->putc(GFX_F_img_Enable >> 8); |
martin13 | 0:81cd913c5e43 | 1151 | _virtualPort->putc(GFX_F_img_Enable); |
martin13 | 0:81cd913c5e43 | 1152 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1153 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1154 | _virtualPort->putc(Index >> 8); |
martin13 | 0:81cd913c5e43 | 1155 | _virtualPort->putc(Index); |
martin13 | 0:81cd913c5e43 | 1156 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1157 | } |
martin13 | 0:81cd913c5e43 | 1158 | |
martin13 | 0:81cd913c5e43 | 1159 | word Diablo_Serial_4DLib::img_GetWord(word Handle, word Index, word Offset ) |
martin13 | 0:81cd913c5e43 | 1160 | { |
martin13 | 0:81cd913c5e43 | 1161 | _virtualPort->putc(GFX_F_img_GetWord >> 8); |
martin13 | 0:81cd913c5e43 | 1162 | _virtualPort->putc(GFX_F_img_GetWord); |
martin13 | 0:81cd913c5e43 | 1163 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1164 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1165 | _virtualPort->putc(Index >> 8); |
martin13 | 0:81cd913c5e43 | 1166 | _virtualPort->putc(Index); |
martin13 | 0:81cd913c5e43 | 1167 | _virtualPort->putc(Offset >> 8); |
martin13 | 0:81cd913c5e43 | 1168 | _virtualPort->putc(Offset ); |
martin13 | 0:81cd913c5e43 | 1169 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1170 | } |
martin13 | 0:81cd913c5e43 | 1171 | |
martin13 | 0:81cd913c5e43 | 1172 | word Diablo_Serial_4DLib::img_Lighten(word Handle, word Index) |
martin13 | 0:81cd913c5e43 | 1173 | { |
martin13 | 0:81cd913c5e43 | 1174 | _virtualPort->putc(GFX_F_img_Lighten >> 8); |
martin13 | 0:81cd913c5e43 | 1175 | _virtualPort->putc(GFX_F_img_Lighten); |
martin13 | 0:81cd913c5e43 | 1176 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1177 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1178 | _virtualPort->putc(Index >> 8); |
martin13 | 0:81cd913c5e43 | 1179 | _virtualPort->putc(Index); |
martin13 | 0:81cd913c5e43 | 1180 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1181 | } |
martin13 | 0:81cd913c5e43 | 1182 | |
martin13 | 0:81cd913c5e43 | 1183 | word Diablo_Serial_4DLib::img_SetAttributes(word Handle, word Index, word Value) |
martin13 | 0:81cd913c5e43 | 1184 | { |
martin13 | 0:81cd913c5e43 | 1185 | _virtualPort->putc(GFX_F_img_SetAttributes >> 8); |
martin13 | 0:81cd913c5e43 | 1186 | _virtualPort->putc(GFX_F_img_SetAttributes); |
martin13 | 0:81cd913c5e43 | 1187 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1188 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1189 | _virtualPort->putc(Index >> 8); |
martin13 | 0:81cd913c5e43 | 1190 | _virtualPort->putc(Index); |
martin13 | 0:81cd913c5e43 | 1191 | _virtualPort->putc(Value >> 8); |
martin13 | 0:81cd913c5e43 | 1192 | _virtualPort->putc(Value); |
martin13 | 0:81cd913c5e43 | 1193 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1194 | } |
martin13 | 0:81cd913c5e43 | 1195 | |
martin13 | 0:81cd913c5e43 | 1196 | word Diablo_Serial_4DLib::img_SetPosition(word Handle, word Index, word Xpos, word Ypos) |
martin13 | 0:81cd913c5e43 | 1197 | { |
martin13 | 0:81cd913c5e43 | 1198 | _virtualPort->putc(GFX_F_img_SetPosition >> 8); |
martin13 | 0:81cd913c5e43 | 1199 | _virtualPort->putc(GFX_F_img_SetPosition); |
martin13 | 0:81cd913c5e43 | 1200 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1201 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1202 | _virtualPort->putc(Index >> 8); |
martin13 | 0:81cd913c5e43 | 1203 | _virtualPort->putc(Index); |
martin13 | 0:81cd913c5e43 | 1204 | _virtualPort->putc(Xpos >> 8); |
martin13 | 0:81cd913c5e43 | 1205 | _virtualPort->putc(Xpos); |
martin13 | 0:81cd913c5e43 | 1206 | _virtualPort->putc(Ypos >> 8); |
martin13 | 0:81cd913c5e43 | 1207 | _virtualPort->putc(Ypos); |
martin13 | 0:81cd913c5e43 | 1208 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1209 | } |
martin13 | 0:81cd913c5e43 | 1210 | |
martin13 | 0:81cd913c5e43 | 1211 | word Diablo_Serial_4DLib::img_SetWord(word Handle, word Index, word Offset , word Word) |
martin13 | 0:81cd913c5e43 | 1212 | { |
martin13 | 0:81cd913c5e43 | 1213 | _virtualPort->putc(GFX_F_img_SetWord >> 8); |
martin13 | 0:81cd913c5e43 | 1214 | _virtualPort->putc(GFX_F_img_SetWord); |
martin13 | 0:81cd913c5e43 | 1215 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1216 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1217 | _virtualPort->putc(Index >> 8); |
martin13 | 0:81cd913c5e43 | 1218 | _virtualPort->putc(Index); |
martin13 | 0:81cd913c5e43 | 1219 | _virtualPort->putc(Offset >> 8); |
martin13 | 0:81cd913c5e43 | 1220 | _virtualPort->putc(Offset ); |
martin13 | 0:81cd913c5e43 | 1221 | _virtualPort->putc(Word >> 8); |
martin13 | 0:81cd913c5e43 | 1222 | _virtualPort->putc(Word); |
martin13 | 0:81cd913c5e43 | 1223 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1224 | } |
martin13 | 0:81cd913c5e43 | 1225 | |
martin13 | 0:81cd913c5e43 | 1226 | word Diablo_Serial_4DLib::img_Show(word Handle, word Index) |
martin13 | 0:81cd913c5e43 | 1227 | { |
martin13 | 0:81cd913c5e43 | 1228 | _virtualPort->putc(GFX_F_img_Show >> 8); |
martin13 | 0:81cd913c5e43 | 1229 | _virtualPort->putc(GFX_F_img_Show); |
martin13 | 0:81cd913c5e43 | 1230 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1231 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1232 | _virtualPort->putc(Index >> 8); |
martin13 | 0:81cd913c5e43 | 1233 | _virtualPort->putc(Index); |
martin13 | 0:81cd913c5e43 | 1234 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1235 | } |
martin13 | 0:81cd913c5e43 | 1236 | |
martin13 | 0:81cd913c5e43 | 1237 | word Diablo_Serial_4DLib::img_Touched(word Handle, word Index) |
martin13 | 0:81cd913c5e43 | 1238 | { |
martin13 | 0:81cd913c5e43 | 1239 | _virtualPort->putc(GFX_F_img_Touched >> 8); |
martin13 | 0:81cd913c5e43 | 1240 | _virtualPort->putc(GFX_F_img_Touched); |
martin13 | 0:81cd913c5e43 | 1241 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1242 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1243 | _virtualPort->putc(Index >> 8); |
martin13 | 0:81cd913c5e43 | 1244 | _virtualPort->putc(Index); |
martin13 | 0:81cd913c5e43 | 1245 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1246 | } |
martin13 | 0:81cd913c5e43 | 1247 | |
martin13 | 0:81cd913c5e43 | 1248 | word Diablo_Serial_4DLib::media_Flush() |
martin13 | 0:81cd913c5e43 | 1249 | { |
martin13 | 0:81cd913c5e43 | 1250 | _virtualPort->putc(GFX_F_media_Flush >> 8); |
martin13 | 0:81cd913c5e43 | 1251 | _virtualPort->putc(GFX_F_media_Flush); |
martin13 | 0:81cd913c5e43 | 1252 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1253 | } |
martin13 | 0:81cd913c5e43 | 1254 | |
martin13 | 0:81cd913c5e43 | 1255 | void Diablo_Serial_4DLib::media_Image(word X, word Y) |
martin13 | 0:81cd913c5e43 | 1256 | { |
martin13 | 0:81cd913c5e43 | 1257 | _virtualPort->putc(GFX_F_media_Image >> 8); |
martin13 | 0:81cd913c5e43 | 1258 | _virtualPort->putc(GFX_F_media_Image); |
martin13 | 0:81cd913c5e43 | 1259 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 1260 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 1261 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 1262 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 1263 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1264 | } |
martin13 | 0:81cd913c5e43 | 1265 | |
martin13 | 0:81cd913c5e43 | 1266 | word Diablo_Serial_4DLib::media_Init() |
martin13 | 0:81cd913c5e43 | 1267 | { |
martin13 | 0:81cd913c5e43 | 1268 | _virtualPort->putc(GFX_F_media_Init >> 8); |
martin13 | 0:81cd913c5e43 | 1269 | _virtualPort->putc(GFX_F_media_Init); |
martin13 | 0:81cd913c5e43 | 1270 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1271 | } |
martin13 | 0:81cd913c5e43 | 1272 | |
martin13 | 0:81cd913c5e43 | 1273 | word Diablo_Serial_4DLib::media_RdSector(GFX_t4DSector SectorIn) |
martin13 | 0:81cd913c5e43 | 1274 | { |
martin13 | 0:81cd913c5e43 | 1275 | _virtualPort->putc(GFX_F_media_RdSector >> 8); |
martin13 | 0:81cd913c5e43 | 1276 | _virtualPort->putc(GFX_F_media_RdSector); |
martin13 | 0:81cd913c5e43 | 1277 | return GetAckResSector(SectorIn); |
martin13 | 0:81cd913c5e43 | 1278 | } |
martin13 | 0:81cd913c5e43 | 1279 | |
martin13 | 0:81cd913c5e43 | 1280 | word Diablo_Serial_4DLib::media_ReadByte() |
martin13 | 0:81cd913c5e43 | 1281 | { |
martin13 | 0:81cd913c5e43 | 1282 | _virtualPort->putc(GFX_F_media_ReadByte >> 8); |
martin13 | 0:81cd913c5e43 | 1283 | _virtualPort->putc(GFX_F_media_ReadByte); |
martin13 | 0:81cd913c5e43 | 1284 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1285 | } |
martin13 | 0:81cd913c5e43 | 1286 | |
martin13 | 0:81cd913c5e43 | 1287 | word Diablo_Serial_4DLib::media_ReadWord() |
martin13 | 0:81cd913c5e43 | 1288 | { |
martin13 | 0:81cd913c5e43 | 1289 | _virtualPort->putc(GFX_F_media_ReadWord >> 8); |
martin13 | 0:81cd913c5e43 | 1290 | _virtualPort->putc(GFX_F_media_ReadWord); |
martin13 | 0:81cd913c5e43 | 1291 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1292 | } |
martin13 | 0:81cd913c5e43 | 1293 | |
martin13 | 0:81cd913c5e43 | 1294 | void Diablo_Serial_4DLib::media_SetAdd(word HiWord, word LoWord) |
martin13 | 0:81cd913c5e43 | 1295 | { |
martin13 | 0:81cd913c5e43 | 1296 | _virtualPort->putc(GFX_F_media_SetAdd >> 8); |
martin13 | 0:81cd913c5e43 | 1297 | _virtualPort->putc(GFX_F_media_SetAdd); |
martin13 | 0:81cd913c5e43 | 1298 | _virtualPort->putc(HiWord >> 8); |
martin13 | 0:81cd913c5e43 | 1299 | _virtualPort->putc(HiWord); |
martin13 | 0:81cd913c5e43 | 1300 | _virtualPort->putc(LoWord >> 8); |
martin13 | 0:81cd913c5e43 | 1301 | _virtualPort->putc(LoWord); |
martin13 | 0:81cd913c5e43 | 1302 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1303 | } |
martin13 | 0:81cd913c5e43 | 1304 | |
martin13 | 0:81cd913c5e43 | 1305 | void Diablo_Serial_4DLib::media_SetSector(word HiWord, word LoWord) |
martin13 | 0:81cd913c5e43 | 1306 | { |
martin13 | 0:81cd913c5e43 | 1307 | _virtualPort->putc(GFX_F_media_SetSector >> 8); |
martin13 | 0:81cd913c5e43 | 1308 | _virtualPort->putc(GFX_F_media_SetSector); |
martin13 | 0:81cd913c5e43 | 1309 | _virtualPort->putc(HiWord >> 8); |
martin13 | 0:81cd913c5e43 | 1310 | _virtualPort->putc(HiWord); |
martin13 | 0:81cd913c5e43 | 1311 | _virtualPort->putc(LoWord >> 8); |
martin13 | 0:81cd913c5e43 | 1312 | _virtualPort->putc(LoWord); |
martin13 | 0:81cd913c5e43 | 1313 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1314 | } |
martin13 | 0:81cd913c5e43 | 1315 | |
martin13 | 0:81cd913c5e43 | 1316 | void Diablo_Serial_4DLib::media_Video(word X, word Y) |
martin13 | 0:81cd913c5e43 | 1317 | { |
martin13 | 0:81cd913c5e43 | 1318 | _virtualPort->putc(GFX_F_media_Video >> 8); |
martin13 | 0:81cd913c5e43 | 1319 | _virtualPort->putc(GFX_F_media_Video); |
martin13 | 0:81cd913c5e43 | 1320 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 1321 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 1322 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 1323 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 1324 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1325 | } |
martin13 | 0:81cd913c5e43 | 1326 | |
martin13 | 0:81cd913c5e43 | 1327 | void Diablo_Serial_4DLib::media_VideoFrame(word X, word Y, word Framenumber) |
martin13 | 0:81cd913c5e43 | 1328 | { |
martin13 | 0:81cd913c5e43 | 1329 | _virtualPort->putc(GFX_F_media_VideoFrame >> 8); |
martin13 | 0:81cd913c5e43 | 1330 | _virtualPort->putc(GFX_F_media_VideoFrame); |
martin13 | 0:81cd913c5e43 | 1331 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 1332 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 1333 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 1334 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 1335 | _virtualPort->putc(Framenumber >> 8); |
martin13 | 0:81cd913c5e43 | 1336 | _virtualPort->putc(Framenumber); |
martin13 | 0:81cd913c5e43 | 1337 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1338 | } |
martin13 | 0:81cd913c5e43 | 1339 | |
martin13 | 0:81cd913c5e43 | 1340 | word Diablo_Serial_4DLib::media_WriteByte(word Byte) |
martin13 | 0:81cd913c5e43 | 1341 | { |
martin13 | 0:81cd913c5e43 | 1342 | _virtualPort->putc(GFX_F_media_WriteByte >> 8); |
martin13 | 0:81cd913c5e43 | 1343 | _virtualPort->putc(GFX_F_media_WriteByte); |
martin13 | 0:81cd913c5e43 | 1344 | _virtualPort->putc(Byte >> 8); |
martin13 | 0:81cd913c5e43 | 1345 | _virtualPort->putc(Byte); |
martin13 | 0:81cd913c5e43 | 1346 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1347 | } |
martin13 | 0:81cd913c5e43 | 1348 | |
martin13 | 0:81cd913c5e43 | 1349 | word Diablo_Serial_4DLib::media_WriteWord(word Word) |
martin13 | 0:81cd913c5e43 | 1350 | { |
martin13 | 0:81cd913c5e43 | 1351 | _virtualPort->putc(GFX_F_media_WriteWord >> 8); |
martin13 | 0:81cd913c5e43 | 1352 | _virtualPort->putc(GFX_F_media_WriteWord); |
martin13 | 0:81cd913c5e43 | 1353 | _virtualPort->putc(Word >> 8); |
martin13 | 0:81cd913c5e43 | 1354 | _virtualPort->putc(Word); |
martin13 | 0:81cd913c5e43 | 1355 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1356 | } |
martin13 | 0:81cd913c5e43 | 1357 | |
martin13 | 0:81cd913c5e43 | 1358 | word Diablo_Serial_4DLib::media_WrSector(GFX_t4DSector SectorOut) |
martin13 | 0:81cd913c5e43 | 1359 | { |
martin13 | 0:81cd913c5e43 | 1360 | _virtualPort->putc(GFX_F_media_WrSector >> 8); |
martin13 | 0:81cd913c5e43 | 1361 | _virtualPort->putc(GFX_F_media_WrSector); |
martin13 | 0:81cd913c5e43 | 1362 | WriteBytes(SectorOut, 512); |
martin13 | 0:81cd913c5e43 | 1363 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1364 | } |
martin13 | 0:81cd913c5e43 | 1365 | |
martin13 | 0:81cd913c5e43 | 1366 | word Diablo_Serial_4DLib::mem_Free(word Handle) |
martin13 | 0:81cd913c5e43 | 1367 | { |
martin13 | 0:81cd913c5e43 | 1368 | _virtualPort->putc(GFX_F_mem_Free >> 8); |
martin13 | 0:81cd913c5e43 | 1369 | _virtualPort->putc(GFX_F_mem_Free); |
martin13 | 0:81cd913c5e43 | 1370 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1371 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1372 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1373 | } |
martin13 | 0:81cd913c5e43 | 1374 | |
martin13 | 0:81cd913c5e43 | 1375 | word Diablo_Serial_4DLib::mem_Heap() |
martin13 | 0:81cd913c5e43 | 1376 | { |
martin13 | 0:81cd913c5e43 | 1377 | _virtualPort->putc(GFX_F_mem_Heap >> 8); |
martin13 | 0:81cd913c5e43 | 1378 | _virtualPort->putc(GFX_F_mem_Heap); |
martin13 | 0:81cd913c5e43 | 1379 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1380 | } |
martin13 | 0:81cd913c5e43 | 1381 | |
martin13 | 0:81cd913c5e43 | 1382 | word Diablo_Serial_4DLib::peekM(word Address) |
martin13 | 0:81cd913c5e43 | 1383 | { |
martin13 | 0:81cd913c5e43 | 1384 | _virtualPort->putc(GFX_F_peekM >> 8); |
martin13 | 0:81cd913c5e43 | 1385 | _virtualPort->putc(GFX_F_peekM); |
martin13 | 0:81cd913c5e43 | 1386 | _virtualPort->putc(Address >> 8); |
martin13 | 0:81cd913c5e43 | 1387 | _virtualPort->putc(Address); |
martin13 | 0:81cd913c5e43 | 1388 | return GetAckResp() ; |
martin13 | 0:81cd913c5e43 | 1389 | } |
martin13 | 0:81cd913c5e43 | 1390 | |
martin13 | 0:81cd913c5e43 | 1391 | word Diablo_Serial_4DLib::pin_HI(word Pin) |
martin13 | 0:81cd913c5e43 | 1392 | { |
martin13 | 0:81cd913c5e43 | 1393 | _virtualPort->putc(GFX_F_pin_HI >> 8); |
martin13 | 0:81cd913c5e43 | 1394 | _virtualPort->putc(GFX_F_pin_HI); |
martin13 | 0:81cd913c5e43 | 1395 | _virtualPort->putc(Pin >> 8); |
martin13 | 0:81cd913c5e43 | 1396 | _virtualPort->putc(Pin); |
martin13 | 0:81cd913c5e43 | 1397 | return GetAckResp() ; |
martin13 | 0:81cd913c5e43 | 1398 | } |
martin13 | 0:81cd913c5e43 | 1399 | |
martin13 | 0:81cd913c5e43 | 1400 | word Diablo_Serial_4DLib::pin_LO(word Pin) |
martin13 | 0:81cd913c5e43 | 1401 | { |
martin13 | 0:81cd913c5e43 | 1402 | _virtualPort->putc(GFX_F_pin_LO >> 8); |
martin13 | 0:81cd913c5e43 | 1403 | _virtualPort->putc(GFX_F_pin_LO); |
martin13 | 0:81cd913c5e43 | 1404 | _virtualPort->putc(Pin >> 8); |
martin13 | 0:81cd913c5e43 | 1405 | _virtualPort->putc(Pin); |
martin13 | 0:81cd913c5e43 | 1406 | return GetAckResp() ; |
martin13 | 0:81cd913c5e43 | 1407 | } |
martin13 | 0:81cd913c5e43 | 1408 | |
martin13 | 0:81cd913c5e43 | 1409 | word Diablo_Serial_4DLib::pin_Read(word Pin) |
martin13 | 0:81cd913c5e43 | 1410 | { |
martin13 | 0:81cd913c5e43 | 1411 | _virtualPort->putc(GFX_F_pin_Read >> 8); |
martin13 | 0:81cd913c5e43 | 1412 | _virtualPort->putc(GFX_F_pin_Read); |
martin13 | 0:81cd913c5e43 | 1413 | _virtualPort->putc(Pin >> 8); |
martin13 | 0:81cd913c5e43 | 1414 | _virtualPort->putc(Pin); |
martin13 | 0:81cd913c5e43 | 1415 | return GetAckResp() ; |
martin13 | 0:81cd913c5e43 | 1416 | } |
martin13 | 0:81cd913c5e43 | 1417 | |
martin13 | 0:81cd913c5e43 | 1418 | word Diablo_Serial_4DLib::pin_Set(word Mode, word Pin) |
martin13 | 0:81cd913c5e43 | 1419 | { |
martin13 | 0:81cd913c5e43 | 1420 | _virtualPort->putc(GFX_F_pin_Set >> 8); |
martin13 | 0:81cd913c5e43 | 1421 | _virtualPort->putc(GFX_F_pin_Set); |
martin13 | 0:81cd913c5e43 | 1422 | _virtualPort->putc(Mode >> 8); |
martin13 | 0:81cd913c5e43 | 1423 | _virtualPort->putc(Mode); |
martin13 | 0:81cd913c5e43 | 1424 | _virtualPort->putc(Pin >> 8); |
martin13 | 0:81cd913c5e43 | 1425 | _virtualPort->putc(Pin); |
martin13 | 0:81cd913c5e43 | 1426 | return GetAckResp() ; |
martin13 | 0:81cd913c5e43 | 1427 | } |
martin13 | 0:81cd913c5e43 | 1428 | |
martin13 | 0:81cd913c5e43 | 1429 | void Diablo_Serial_4DLib::pokeM(word Address, word WordValue) |
martin13 | 0:81cd913c5e43 | 1430 | { |
martin13 | 0:81cd913c5e43 | 1431 | _virtualPort->putc(GFX_F_pokeM >> 8); |
martin13 | 0:81cd913c5e43 | 1432 | _virtualPort->putc(GFX_F_pokeM); |
martin13 | 0:81cd913c5e43 | 1433 | _virtualPort->putc(Address >> 8); |
martin13 | 0:81cd913c5e43 | 1434 | _virtualPort->putc(Address); |
martin13 | 0:81cd913c5e43 | 1435 | _virtualPort->putc(WordValue >> 8); |
martin13 | 0:81cd913c5e43 | 1436 | _virtualPort->putc(WordValue); |
martin13 | 0:81cd913c5e43 | 1437 | GetAck() ; |
martin13 | 0:81cd913c5e43 | 1438 | } |
martin13 | 0:81cd913c5e43 | 1439 | |
martin13 | 0:81cd913c5e43 | 1440 | void Diablo_Serial_4DLib::putCH(word WordChar) |
martin13 | 0:81cd913c5e43 | 1441 | { |
martin13 | 0:81cd913c5e43 | 1442 | _virtualPort->putc(GFX_F_putCH >> 8); |
martin13 | 0:81cd913c5e43 | 1443 | _virtualPort->putc(GFX_F_putCH); |
martin13 | 0:81cd913c5e43 | 1444 | _virtualPort->putc(WordChar >> 8); |
martin13 | 0:81cd913c5e43 | 1445 | _virtualPort->putc(WordChar); |
martin13 | 0:81cd913c5e43 | 1446 | GetAck() ; |
martin13 | 0:81cd913c5e43 | 1447 | } |
martin13 | 0:81cd913c5e43 | 1448 | |
martin13 | 0:81cd913c5e43 | 1449 | word Diablo_Serial_4DLib::putstr(char * InString) |
martin13 | 0:81cd913c5e43 | 1450 | { |
martin13 | 0:81cd913c5e43 | 1451 | _virtualPort->putc(GFX_F_putstr >> 8); |
martin13 | 0:81cd913c5e43 | 1452 | _virtualPort->putc(GFX_F_putstr); |
martin13 | 0:81cd913c5e43 | 1453 | WriteChars(InString); |
martin13 | 0:81cd913c5e43 | 1454 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1455 | } |
martin13 | 0:81cd913c5e43 | 1456 | |
martin13 | 0:81cd913c5e43 | 1457 | //-----------------print---------------------------------- |
martin13 | 0:81cd913c5e43 | 1458 | |
martin13 | 0:81cd913c5e43 | 1459 | void Diablo_Serial_4DLib::print(const string &s) |
martin13 | 0:81cd913c5e43 | 1460 | { |
martin13 | 0:81cd913c5e43 | 1461 | int len = s.length(); |
martin13 | 0:81cd913c5e43 | 1462 | //char arr[len + 1]; |
martin13 | 0:81cd913c5e43 | 1463 | //s.toCharArray(arr,len + 1); |
martin13 | 0:81cd913c5e43 | 1464 | //putstr(arr); |
martin13 | 0:81cd913c5e43 | 1465 | for(int x=0; x<len; x++) |
martin13 | 0:81cd913c5e43 | 1466 | { |
martin13 | 0:81cd913c5e43 | 1467 | putCH(s[x]); |
martin13 | 0:81cd913c5e43 | 1468 | } |
martin13 | 0:81cd913c5e43 | 1469 | } |
martin13 | 0:81cd913c5e43 | 1470 | |
martin13 | 0:81cd913c5e43 | 1471 | void Diablo_Serial_4DLib::print(const char str[]) |
martin13 | 0:81cd913c5e43 | 1472 | { |
martin13 | 0:81cd913c5e43 | 1473 | int len = strlen(str); |
martin13 | 0:81cd913c5e43 | 1474 | for(int x = 0; x<len; x++) |
martin13 | 0:81cd913c5e43 | 1475 | { |
martin13 | 0:81cd913c5e43 | 1476 | putCH(str[x]); |
martin13 | 0:81cd913c5e43 | 1477 | } |
martin13 | 0:81cd913c5e43 | 1478 | } |
martin13 | 0:81cd913c5e43 | 1479 | |
martin13 | 0:81cd913c5e43 | 1480 | void Diablo_Serial_4DLib::print(char c) |
martin13 | 0:81cd913c5e43 | 1481 | { |
martin13 | 0:81cd913c5e43 | 1482 | putCH(c); |
martin13 | 0:81cd913c5e43 | 1483 | } |
martin13 | 0:81cd913c5e43 | 1484 | |
martin13 | 0:81cd913c5e43 | 1485 | void Diablo_Serial_4DLib::print(unsigned char b, int base) |
martin13 | 0:81cd913c5e43 | 1486 | { |
martin13 | 0:81cd913c5e43 | 1487 | print((unsigned long) b, base); |
martin13 | 0:81cd913c5e43 | 1488 | } |
martin13 | 0:81cd913c5e43 | 1489 | |
martin13 | 0:81cd913c5e43 | 1490 | void Diablo_Serial_4DLib::print(int n, int base) |
martin13 | 0:81cd913c5e43 | 1491 | { |
martin13 | 0:81cd913c5e43 | 1492 | print((long) n, base); |
martin13 | 0:81cd913c5e43 | 1493 | } |
martin13 | 0:81cd913c5e43 | 1494 | |
martin13 | 0:81cd913c5e43 | 1495 | void Diablo_Serial_4DLib::print(unsigned int n, int base) |
martin13 | 0:81cd913c5e43 | 1496 | { |
martin13 | 0:81cd913c5e43 | 1497 | print((unsigned long) n, base); |
martin13 | 0:81cd913c5e43 | 1498 | } |
martin13 | 0:81cd913c5e43 | 1499 | |
martin13 | 0:81cd913c5e43 | 1500 | void Diablo_Serial_4DLib::print(long n, int base) |
martin13 | 0:81cd913c5e43 | 1501 | { |
martin13 | 0:81cd913c5e43 | 1502 | |
martin13 | 0:81cd913c5e43 | 1503 | if (base == 10) |
martin13 | 0:81cd913c5e43 | 1504 | { |
martin13 | 0:81cd913c5e43 | 1505 | if (n < 0) |
martin13 | 0:81cd913c5e43 | 1506 | { |
martin13 | 0:81cd913c5e43 | 1507 | //int t = print('-'); |
martin13 | 0:81cd913c5e43 | 1508 | putCH('-'); |
martin13 | 0:81cd913c5e43 | 1509 | n = -n; |
martin13 | 0:81cd913c5e43 | 1510 | printNumber(n, 10); |
martin13 | 0:81cd913c5e43 | 1511 | } |
martin13 | 0:81cd913c5e43 | 1512 | else |
martin13 | 0:81cd913c5e43 | 1513 | { |
martin13 | 0:81cd913c5e43 | 1514 | printNumber(n, 10); |
martin13 | 0:81cd913c5e43 | 1515 | } |
martin13 | 0:81cd913c5e43 | 1516 | } |
martin13 | 0:81cd913c5e43 | 1517 | else |
martin13 | 0:81cd913c5e43 | 1518 | { |
martin13 | 0:81cd913c5e43 | 1519 | printNumber(n, base); |
martin13 | 0:81cd913c5e43 | 1520 | } |
martin13 | 0:81cd913c5e43 | 1521 | |
martin13 | 0:81cd913c5e43 | 1522 | } |
martin13 | 0:81cd913c5e43 | 1523 | |
martin13 | 0:81cd913c5e43 | 1524 | void Diablo_Serial_4DLib::print(unsigned long n, int base) |
martin13 | 0:81cd913c5e43 | 1525 | { |
martin13 | 0:81cd913c5e43 | 1526 | printNumber(n, base); |
martin13 | 0:81cd913c5e43 | 1527 | } |
martin13 | 0:81cd913c5e43 | 1528 | |
martin13 | 0:81cd913c5e43 | 1529 | void Diablo_Serial_4DLib::print(double n, int digits) |
martin13 | 0:81cd913c5e43 | 1530 | { |
martin13 | 0:81cd913c5e43 | 1531 | printFloat(n, digits); |
martin13 | 0:81cd913c5e43 | 1532 | } |
martin13 | 0:81cd913c5e43 | 1533 | |
martin13 | 0:81cd913c5e43 | 1534 | |
martin13 | 0:81cd913c5e43 | 1535 | //println |
martin13 | 0:81cd913c5e43 | 1536 | /* |
martin13 | 0:81cd913c5e43 | 1537 | void Diablo_Serial_4DLib::println(const __FlashStringHelper *ifsh) |
martin13 | 0:81cd913c5e43 | 1538 | { |
martin13 | 0:81cd913c5e43 | 1539 | print(ifsh); |
martin13 | 0:81cd913c5e43 | 1540 | putCH('\n'); |
martin13 | 0:81cd913c5e43 | 1541 | putCH('\r'); |
martin13 | 0:81cd913c5e43 | 1542 | } |
martin13 | 0:81cd913c5e43 | 1543 | */ |
martin13 | 0:81cd913c5e43 | 1544 | void Diablo_Serial_4DLib::println(const string &s) |
martin13 | 0:81cd913c5e43 | 1545 | { |
martin13 | 0:81cd913c5e43 | 1546 | print(s); |
martin13 | 0:81cd913c5e43 | 1547 | putCH('\n'); |
martin13 | 0:81cd913c5e43 | 1548 | putCH('\r'); |
martin13 | 0:81cd913c5e43 | 1549 | } |
martin13 | 0:81cd913c5e43 | 1550 | |
martin13 | 0:81cd913c5e43 | 1551 | void Diablo_Serial_4DLib::println(const char c[]) |
martin13 | 0:81cd913c5e43 | 1552 | { |
martin13 | 0:81cd913c5e43 | 1553 | print(c); |
martin13 | 0:81cd913c5e43 | 1554 | putCH('\n'); |
martin13 | 0:81cd913c5e43 | 1555 | putCH('\r'); |
martin13 | 0:81cd913c5e43 | 1556 | } |
martin13 | 0:81cd913c5e43 | 1557 | |
martin13 | 0:81cd913c5e43 | 1558 | void Diablo_Serial_4DLib::println(char c) |
martin13 | 0:81cd913c5e43 | 1559 | { |
martin13 | 0:81cd913c5e43 | 1560 | // print(string(c); |
martin13 | 0:81cd913c5e43 | 1561 | putCH('\n'); |
martin13 | 0:81cd913c5e43 | 1562 | putCH('\r'); |
martin13 | 0:81cd913c5e43 | 1563 | } |
martin13 | 0:81cd913c5e43 | 1564 | |
martin13 | 0:81cd913c5e43 | 1565 | void Diablo_Serial_4DLib::println(unsigned char b, int base) |
martin13 | 0:81cd913c5e43 | 1566 | { |
martin13 | 0:81cd913c5e43 | 1567 | print((unsigned char)b, base); |
martin13 | 0:81cd913c5e43 | 1568 | putCH('\n'); |
martin13 | 0:81cd913c5e43 | 1569 | putCH('\r'); |
martin13 | 0:81cd913c5e43 | 1570 | } |
martin13 | 0:81cd913c5e43 | 1571 | |
martin13 | 0:81cd913c5e43 | 1572 | void Diablo_Serial_4DLib::println(int num, int base) |
martin13 | 0:81cd913c5e43 | 1573 | { |
martin13 | 0:81cd913c5e43 | 1574 | print((int)num, base); |
martin13 | 0:81cd913c5e43 | 1575 | putCH('\n'); |
martin13 | 0:81cd913c5e43 | 1576 | putCH('\r'); |
martin13 | 0:81cd913c5e43 | 1577 | } |
martin13 | 0:81cd913c5e43 | 1578 | |
martin13 | 0:81cd913c5e43 | 1579 | void Diablo_Serial_4DLib::println(unsigned int num, int base) |
martin13 | 0:81cd913c5e43 | 1580 | { |
martin13 | 0:81cd913c5e43 | 1581 | print((unsigned int)num, base); |
martin13 | 0:81cd913c5e43 | 1582 | putCH('\n'); |
martin13 | 0:81cd913c5e43 | 1583 | putCH('\r'); |
martin13 | 0:81cd913c5e43 | 1584 | } |
martin13 | 0:81cd913c5e43 | 1585 | |
martin13 | 0:81cd913c5e43 | 1586 | void Diablo_Serial_4DLib::println(long num, int base) |
martin13 | 0:81cd913c5e43 | 1587 | { |
martin13 | 0:81cd913c5e43 | 1588 | print((long)num, base); |
martin13 | 0:81cd913c5e43 | 1589 | putCH('\n'); |
martin13 | 0:81cd913c5e43 | 1590 | putCH('\r'); |
martin13 | 0:81cd913c5e43 | 1591 | } |
martin13 | 0:81cd913c5e43 | 1592 | |
martin13 | 0:81cd913c5e43 | 1593 | void Diablo_Serial_4DLib::println(unsigned long num, int base) |
martin13 | 0:81cd913c5e43 | 1594 | { |
martin13 | 0:81cd913c5e43 | 1595 | print((unsigned long)num, base); |
martin13 | 0:81cd913c5e43 | 1596 | putCH('\n'); |
martin13 | 0:81cd913c5e43 | 1597 | putCH('\r'); |
martin13 | 0:81cd913c5e43 | 1598 | } |
martin13 | 0:81cd913c5e43 | 1599 | |
martin13 | 0:81cd913c5e43 | 1600 | void Diablo_Serial_4DLib::println(double num, int digits) |
martin13 | 0:81cd913c5e43 | 1601 | { |
martin13 | 0:81cd913c5e43 | 1602 | print((double)num, digits); |
martin13 | 0:81cd913c5e43 | 1603 | putCH('\n'); |
martin13 | 0:81cd913c5e43 | 1604 | putCH('\r'); |
martin13 | 0:81cd913c5e43 | 1605 | } |
martin13 | 0:81cd913c5e43 | 1606 | |
martin13 | 0:81cd913c5e43 | 1607 | |
martin13 | 0:81cd913c5e43 | 1608 | //-Private: |
martin13 | 0:81cd913c5e43 | 1609 | |
martin13 | 0:81cd913c5e43 | 1610 | void Diablo_Serial_4DLib::printNumber(unsigned long n, uint8_t base) { |
martin13 | 0:81cd913c5e43 | 1611 | char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte. |
martin13 | 0:81cd913c5e43 | 1612 | int count = 0; |
martin13 | 0:81cd913c5e43 | 1613 | do { |
martin13 | 0:81cd913c5e43 | 1614 | unsigned long m = n; |
martin13 | 0:81cd913c5e43 | 1615 | n /= base; |
martin13 | 0:81cd913c5e43 | 1616 | char c = m - base * n; |
martin13 | 0:81cd913c5e43 | 1617 | buf[count] = c < 10 ? c + '0' : c + 'A' - 10; |
martin13 | 0:81cd913c5e43 | 1618 | count++; |
martin13 | 0:81cd913c5e43 | 1619 | } while(n); |
martin13 | 0:81cd913c5e43 | 1620 | |
martin13 | 0:81cd913c5e43 | 1621 | for(int x = count - 1; x>=0; x--) |
martin13 | 0:81cd913c5e43 | 1622 | { |
martin13 | 0:81cd913c5e43 | 1623 | putCH(buf[x]); |
martin13 | 0:81cd913c5e43 | 1624 | } |
martin13 | 0:81cd913c5e43 | 1625 | } |
martin13 | 0:81cd913c5e43 | 1626 | |
martin13 | 0:81cd913c5e43 | 1627 | void Diablo_Serial_4DLib::printFloat(double number, uint8_t digits) |
martin13 | 0:81cd913c5e43 | 1628 | { |
martin13 | 0:81cd913c5e43 | 1629 | //size_t n = 0; |
martin13 | 0:81cd913c5e43 | 1630 | if (isnan(number)) print("nan"); |
martin13 | 0:81cd913c5e43 | 1631 | else if (isinf(number)) print("inf"); |
martin13 | 0:81cd913c5e43 | 1632 | else if (number > 4294967040.0) print ("ovf"); // constant determined empirically |
martin13 | 0:81cd913c5e43 | 1633 | else if (number <-4294967040.0) print ("ovf"); // constant determined empirically |
martin13 | 0:81cd913c5e43 | 1634 | else{ |
martin13 | 0:81cd913c5e43 | 1635 | // Handle negative numbers |
martin13 | 0:81cd913c5e43 | 1636 | if (number < 0.0) |
martin13 | 0:81cd913c5e43 | 1637 | { |
martin13 | 0:81cd913c5e43 | 1638 | putCH('-'); |
martin13 | 0:81cd913c5e43 | 1639 | number = -number; |
martin13 | 0:81cd913c5e43 | 1640 | } |
martin13 | 0:81cd913c5e43 | 1641 | |
martin13 | 0:81cd913c5e43 | 1642 | // Round correctly so that print(1.999, 2) prints as "2.00" |
martin13 | 0:81cd913c5e43 | 1643 | double rounding = 0.5; |
martin13 | 0:81cd913c5e43 | 1644 | for (uint8_t i=0; i<digits; ++i) |
martin13 | 0:81cd913c5e43 | 1645 | rounding /= 10.0; |
martin13 | 0:81cd913c5e43 | 1646 | |
martin13 | 0:81cd913c5e43 | 1647 | number += rounding; |
martin13 | 0:81cd913c5e43 | 1648 | |
martin13 | 0:81cd913c5e43 | 1649 | // Extract the integer part of the number and print it |
martin13 | 0:81cd913c5e43 | 1650 | unsigned long int_part = (unsigned long)number; |
martin13 | 0:81cd913c5e43 | 1651 | double remainder = number - (double)int_part; |
martin13 | 0:81cd913c5e43 | 1652 | //print((unsigned long)int_part); |
martin13 | 0:81cd913c5e43 | 1653 | printNumber(int_part, 10); |
martin13 | 0:81cd913c5e43 | 1654 | |
martin13 | 0:81cd913c5e43 | 1655 | // Print the decimal point, but only if there are digits beyond |
martin13 | 0:81cd913c5e43 | 1656 | if (digits > 0) { |
martin13 | 0:81cd913c5e43 | 1657 | putCH('.'); |
martin13 | 0:81cd913c5e43 | 1658 | } |
martin13 | 0:81cd913c5e43 | 1659 | |
martin13 | 0:81cd913c5e43 | 1660 | // Extract digits from the remainder one at a time |
martin13 | 0:81cd913c5e43 | 1661 | while (digits-- > 0) |
martin13 | 0:81cd913c5e43 | 1662 | { |
martin13 | 0:81cd913c5e43 | 1663 | remainder *= 10.0; |
martin13 | 0:81cd913c5e43 | 1664 | int toPrint = int(remainder); |
martin13 | 0:81cd913c5e43 | 1665 | printNumber((unsigned long)toPrint, 10); |
martin13 | 0:81cd913c5e43 | 1666 | remainder -= toPrint; |
martin13 | 0:81cd913c5e43 | 1667 | } |
martin13 | 0:81cd913c5e43 | 1668 | } |
martin13 | 0:81cd913c5e43 | 1669 | } |
martin13 | 0:81cd913c5e43 | 1670 | |
martin13 | 0:81cd913c5e43 | 1671 | |
martin13 | 0:81cd913c5e43 | 1672 | //-------------------------------------------------------- |
martin13 | 0:81cd913c5e43 | 1673 | |
martin13 | 0:81cd913c5e43 | 1674 | void Diablo_Serial_4DLib::snd_BufSize(word Bufsize) |
martin13 | 0:81cd913c5e43 | 1675 | { |
martin13 | 0:81cd913c5e43 | 1676 | _virtualPort->putc(GFX_F_snd_BufSize >> 8); |
martin13 | 0:81cd913c5e43 | 1677 | _virtualPort->putc(GFX_F_snd_BufSize); |
martin13 | 0:81cd913c5e43 | 1678 | _virtualPort->putc(Bufsize >> 8); |
martin13 | 0:81cd913c5e43 | 1679 | _virtualPort->putc(Bufsize); |
martin13 | 0:81cd913c5e43 | 1680 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1681 | } |
martin13 | 0:81cd913c5e43 | 1682 | |
martin13 | 0:81cd913c5e43 | 1683 | void Diablo_Serial_4DLib::snd_Continue() |
martin13 | 0:81cd913c5e43 | 1684 | { |
martin13 | 0:81cd913c5e43 | 1685 | _virtualPort->putc(GFX_F_snd_Continue >> 8); |
martin13 | 0:81cd913c5e43 | 1686 | _virtualPort->putc(GFX_F_snd_Continue); |
martin13 | 0:81cd913c5e43 | 1687 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1688 | } |
martin13 | 0:81cd913c5e43 | 1689 | |
martin13 | 0:81cd913c5e43 | 1690 | void Diablo_Serial_4DLib::snd_Pause() |
martin13 | 0:81cd913c5e43 | 1691 | { |
martin13 | 0:81cd913c5e43 | 1692 | _virtualPort->putc(GFX_F_snd_Pause >> 8); |
martin13 | 0:81cd913c5e43 | 1693 | _virtualPort->putc(GFX_F_snd_Pause); |
martin13 | 0:81cd913c5e43 | 1694 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1695 | } |
martin13 | 0:81cd913c5e43 | 1696 | |
martin13 | 0:81cd913c5e43 | 1697 | word Diablo_Serial_4DLib::snd_Pitch(word Pitch) |
martin13 | 0:81cd913c5e43 | 1698 | { |
martin13 | 0:81cd913c5e43 | 1699 | _virtualPort->putc(GFX_F_snd_Pitch >> 8); |
martin13 | 0:81cd913c5e43 | 1700 | _virtualPort->putc(GFX_F_snd_Pitch); |
martin13 | 0:81cd913c5e43 | 1701 | _virtualPort->putc(Pitch >> 8); |
martin13 | 0:81cd913c5e43 | 1702 | _virtualPort->putc(Pitch); |
martin13 | 0:81cd913c5e43 | 1703 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1704 | } |
martin13 | 0:81cd913c5e43 | 1705 | |
martin13 | 0:81cd913c5e43 | 1706 | word Diablo_Serial_4DLib::snd_Playing() |
martin13 | 0:81cd913c5e43 | 1707 | { |
martin13 | 0:81cd913c5e43 | 1708 | _virtualPort->putc(GFX_F_snd_Playing >> 8); |
martin13 | 0:81cd913c5e43 | 1709 | _virtualPort->putc(GFX_F_snd_Playing); |
martin13 | 0:81cd913c5e43 | 1710 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1711 | } |
martin13 | 0:81cd913c5e43 | 1712 | |
martin13 | 0:81cd913c5e43 | 1713 | void Diablo_Serial_4DLib::snd_Stop() |
martin13 | 0:81cd913c5e43 | 1714 | { |
martin13 | 0:81cd913c5e43 | 1715 | _virtualPort->putc(GFX_F_snd_Stop >> 8); |
martin13 | 0:81cd913c5e43 | 1716 | _virtualPort->putc(GFX_F_snd_Stop); |
martin13 | 0:81cd913c5e43 | 1717 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1718 | } |
martin13 | 0:81cd913c5e43 | 1719 | |
martin13 | 0:81cd913c5e43 | 1720 | void Diablo_Serial_4DLib::snd_Volume(word Volume) |
martin13 | 0:81cd913c5e43 | 1721 | { |
martin13 | 0:81cd913c5e43 | 1722 | _virtualPort->putc(GFX_F_snd_Volume >> 8); |
martin13 | 0:81cd913c5e43 | 1723 | _virtualPort->putc(GFX_F_snd_Volume); |
martin13 | 0:81cd913c5e43 | 1724 | _virtualPort->putc(Volume >> 8); |
martin13 | 0:81cd913c5e43 | 1725 | _virtualPort->putc(Volume); |
martin13 | 0:81cd913c5e43 | 1726 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1727 | } |
martin13 | 0:81cd913c5e43 | 1728 | |
martin13 | 0:81cd913c5e43 | 1729 | word Diablo_Serial_4DLib::sys_Sleep(word Units) |
martin13 | 0:81cd913c5e43 | 1730 | { |
martin13 | 0:81cd913c5e43 | 1731 | _virtualPort->putc(GFX_F_sys_Sleep >> 8); |
martin13 | 0:81cd913c5e43 | 1732 | _virtualPort->putc(GFX_F_sys_Sleep); |
martin13 | 0:81cd913c5e43 | 1733 | _virtualPort->putc(Units >> 8); |
martin13 | 0:81cd913c5e43 | 1734 | _virtualPort->putc(Units); |
martin13 | 0:81cd913c5e43 | 1735 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1736 | } |
martin13 | 0:81cd913c5e43 | 1737 | |
martin13 | 0:81cd913c5e43 | 1738 | void Diablo_Serial_4DLib::touch_DetectRegion(word X1, word Y1, word X2, word Y2) |
martin13 | 0:81cd913c5e43 | 1739 | { |
martin13 | 0:81cd913c5e43 | 1740 | _virtualPort->putc(GFX_F_touch_DetectRegion >> 8); |
martin13 | 0:81cd913c5e43 | 1741 | _virtualPort->putc(GFX_F_touch_DetectRegion); |
martin13 | 0:81cd913c5e43 | 1742 | _virtualPort->putc(X1 >> 8); |
martin13 | 0:81cd913c5e43 | 1743 | _virtualPort->putc(X1); |
martin13 | 0:81cd913c5e43 | 1744 | _virtualPort->putc(Y1 >> 8); |
martin13 | 0:81cd913c5e43 | 1745 | _virtualPort->putc(Y1); |
martin13 | 0:81cd913c5e43 | 1746 | _virtualPort->putc(X2 >> 8); |
martin13 | 0:81cd913c5e43 | 1747 | _virtualPort->putc(X2); |
martin13 | 0:81cd913c5e43 | 1748 | _virtualPort->putc(Y2 >> 8); |
martin13 | 0:81cd913c5e43 | 1749 | _virtualPort->putc(Y2); |
martin13 | 0:81cd913c5e43 | 1750 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1751 | } |
martin13 | 0:81cd913c5e43 | 1752 | |
martin13 | 0:81cd913c5e43 | 1753 | word Diablo_Serial_4DLib::touch_Get(word Mode) |
martin13 | 0:81cd913c5e43 | 1754 | { |
martin13 | 0:81cd913c5e43 | 1755 | _virtualPort->putc(GFX_F_touch_Get >> 8); |
martin13 | 0:81cd913c5e43 | 1756 | _virtualPort->putc(GFX_F_touch_Get); |
martin13 | 0:81cd913c5e43 | 1757 | _virtualPort->putc(Mode >> 8); |
martin13 | 0:81cd913c5e43 | 1758 | _virtualPort->putc(Mode); |
martin13 | 0:81cd913c5e43 | 1759 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1760 | } |
martin13 | 0:81cd913c5e43 | 1761 | |
martin13 | 0:81cd913c5e43 | 1762 | void Diablo_Serial_4DLib::touch_Set(word Mode) |
martin13 | 0:81cd913c5e43 | 1763 | { |
martin13 | 0:81cd913c5e43 | 1764 | _virtualPort->putc(GFX_F_touch_Set >> 8); |
martin13 | 0:81cd913c5e43 | 1765 | _virtualPort->putc(GFX_F_touch_Set); |
martin13 | 0:81cd913c5e43 | 1766 | _virtualPort->putc(Mode >> 8); |
martin13 | 0:81cd913c5e43 | 1767 | _virtualPort->putc(Mode); |
martin13 | 0:81cd913c5e43 | 1768 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1769 | } |
martin13 | 0:81cd913c5e43 | 1770 | |
martin13 | 0:81cd913c5e43 | 1771 | word Diablo_Serial_4DLib::txt_Attributes(word Attribs) |
martin13 | 0:81cd913c5e43 | 1772 | { |
martin13 | 0:81cd913c5e43 | 1773 | _virtualPort->putc(GFX_F_txt_Attributes >> 8); |
martin13 | 0:81cd913c5e43 | 1774 | _virtualPort->putc(GFX_F_txt_Attributes); |
martin13 | 0:81cd913c5e43 | 1775 | _virtualPort->putc(Attribs >> 8); |
martin13 | 0:81cd913c5e43 | 1776 | _virtualPort->putc(Attribs); |
martin13 | 0:81cd913c5e43 | 1777 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1778 | } |
martin13 | 0:81cd913c5e43 | 1779 | |
martin13 | 0:81cd913c5e43 | 1780 | word Diablo_Serial_4DLib::txt_BGcolour(word Color) |
martin13 | 0:81cd913c5e43 | 1781 | { |
martin13 | 0:81cd913c5e43 | 1782 | _virtualPort->putc(GFX_F_txt_BGcolour >> 8); |
martin13 | 0:81cd913c5e43 | 1783 | _virtualPort->putc(GFX_F_txt_BGcolour); |
martin13 | 0:81cd913c5e43 | 1784 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 1785 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 1786 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1787 | } |
martin13 | 0:81cd913c5e43 | 1788 | |
martin13 | 0:81cd913c5e43 | 1789 | word Diablo_Serial_4DLib::txt_Bold(word Bold) |
martin13 | 0:81cd913c5e43 | 1790 | { |
martin13 | 0:81cd913c5e43 | 1791 | _virtualPort->putc(GFX_F_txt_Bold >> 8); |
martin13 | 0:81cd913c5e43 | 1792 | _virtualPort->putc(GFX_F_txt_Bold); |
martin13 | 0:81cd913c5e43 | 1793 | _virtualPort->putc(Bold >> 8); |
martin13 | 0:81cd913c5e43 | 1794 | _virtualPort->putc(Bold); |
martin13 | 0:81cd913c5e43 | 1795 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1796 | } |
martin13 | 0:81cd913c5e43 | 1797 | |
martin13 | 0:81cd913c5e43 | 1798 | word Diablo_Serial_4DLib::txt_FGcolour(word Color) |
martin13 | 0:81cd913c5e43 | 1799 | { |
martin13 | 0:81cd913c5e43 | 1800 | _virtualPort->putc(GFX_F_txt_FGcolour >> 8); |
martin13 | 0:81cd913c5e43 | 1801 | _virtualPort->putc(GFX_F_txt_FGcolour); |
martin13 | 0:81cd913c5e43 | 1802 | _virtualPort->putc(Color >> 8); |
martin13 | 0:81cd913c5e43 | 1803 | _virtualPort->putc(Color); |
martin13 | 0:81cd913c5e43 | 1804 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1805 | } |
martin13 | 0:81cd913c5e43 | 1806 | |
martin13 | 0:81cd913c5e43 | 1807 | word Diablo_Serial_4DLib::txt_FontID(word FontNumber) |
martin13 | 0:81cd913c5e43 | 1808 | { |
martin13 | 0:81cd913c5e43 | 1809 | _virtualPort->putc(GFX_F_txt_FontID >> 8); |
martin13 | 0:81cd913c5e43 | 1810 | _virtualPort->putc(GFX_F_txt_FontID); |
martin13 | 0:81cd913c5e43 | 1811 | _virtualPort->putc(FontNumber >> 8); |
martin13 | 0:81cd913c5e43 | 1812 | _virtualPort->putc(FontNumber); |
martin13 | 0:81cd913c5e43 | 1813 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1814 | } |
martin13 | 0:81cd913c5e43 | 1815 | |
martin13 | 0:81cd913c5e43 | 1816 | word Diablo_Serial_4DLib::txt_Height(word Multiplier) |
martin13 | 0:81cd913c5e43 | 1817 | { |
martin13 | 0:81cd913c5e43 | 1818 | _virtualPort->putc(GFX_F_txt_Height >> 8); |
martin13 | 0:81cd913c5e43 | 1819 | _virtualPort->putc(GFX_F_txt_Height); |
martin13 | 0:81cd913c5e43 | 1820 | _virtualPort->putc(Multiplier >> 8); |
martin13 | 0:81cd913c5e43 | 1821 | _virtualPort->putc(Multiplier); |
martin13 | 0:81cd913c5e43 | 1822 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1823 | } |
martin13 | 0:81cd913c5e43 | 1824 | |
martin13 | 0:81cd913c5e43 | 1825 | word Diablo_Serial_4DLib::txt_Inverse(word Inverse) |
martin13 | 0:81cd913c5e43 | 1826 | { |
martin13 | 0:81cd913c5e43 | 1827 | _virtualPort->putc(GFX_F_txt_Inverse >> 8); |
martin13 | 0:81cd913c5e43 | 1828 | _virtualPort->putc(GFX_F_txt_Inverse); |
martin13 | 0:81cd913c5e43 | 1829 | _virtualPort->putc(Inverse >> 8); |
martin13 | 0:81cd913c5e43 | 1830 | _virtualPort->putc(Inverse); |
martin13 | 0:81cd913c5e43 | 1831 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1832 | } |
martin13 | 0:81cd913c5e43 | 1833 | |
martin13 | 0:81cd913c5e43 | 1834 | word Diablo_Serial_4DLib::txt_Italic(word Italic) |
martin13 | 0:81cd913c5e43 | 1835 | { |
martin13 | 0:81cd913c5e43 | 1836 | _virtualPort->putc(GFX_F_txt_Italic >> 8); |
martin13 | 0:81cd913c5e43 | 1837 | _virtualPort->putc(GFX_F_txt_Italic); |
martin13 | 0:81cd913c5e43 | 1838 | _virtualPort->putc(Italic >> 8); |
martin13 | 0:81cd913c5e43 | 1839 | _virtualPort->putc(Italic); |
martin13 | 0:81cd913c5e43 | 1840 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1841 | } |
martin13 | 0:81cd913c5e43 | 1842 | |
martin13 | 0:81cd913c5e43 | 1843 | void Diablo_Serial_4DLib::txt_MoveCursor(word Line, word Column) |
martin13 | 0:81cd913c5e43 | 1844 | { |
martin13 | 0:81cd913c5e43 | 1845 | _virtualPort->putc(GFX_F_txt_MoveCursor >> 8); |
martin13 | 0:81cd913c5e43 | 1846 | _virtualPort->putc(GFX_F_txt_MoveCursor); |
martin13 | 0:81cd913c5e43 | 1847 | _virtualPort->putc(Line >> 8); |
martin13 | 0:81cd913c5e43 | 1848 | _virtualPort->putc(Line); |
martin13 | 0:81cd913c5e43 | 1849 | _virtualPort->putc(Column >> 8); |
martin13 | 0:81cd913c5e43 | 1850 | _virtualPort->putc(Column); |
martin13 | 0:81cd913c5e43 | 1851 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1852 | } |
martin13 | 0:81cd913c5e43 | 1853 | |
martin13 | 0:81cd913c5e43 | 1854 | word Diablo_Serial_4DLib::txt_Opacity(word TransparentOpaque) |
martin13 | 0:81cd913c5e43 | 1855 | { |
martin13 | 0:81cd913c5e43 | 1856 | _virtualPort->putc(GFX_F_txt_Opacity >> 8); |
martin13 | 0:81cd913c5e43 | 1857 | _virtualPort->putc(GFX_F_txt_Opacity); |
martin13 | 0:81cd913c5e43 | 1858 | _virtualPort->putc(TransparentOpaque >> 8); |
martin13 | 0:81cd913c5e43 | 1859 | _virtualPort->putc(TransparentOpaque); |
martin13 | 0:81cd913c5e43 | 1860 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1861 | } |
martin13 | 0:81cd913c5e43 | 1862 | |
martin13 | 0:81cd913c5e43 | 1863 | void Diablo_Serial_4DLib::txt_Set(word Func, word Value) |
martin13 | 0:81cd913c5e43 | 1864 | { |
martin13 | 0:81cd913c5e43 | 1865 | _virtualPort->putc(GFX_F_txt_Set >> 8); |
martin13 | 0:81cd913c5e43 | 1866 | _virtualPort->putc(GFX_F_txt_Set); |
martin13 | 0:81cd913c5e43 | 1867 | _virtualPort->putc(Func >> 8); |
martin13 | 0:81cd913c5e43 | 1868 | _virtualPort->putc(Func); |
martin13 | 0:81cd913c5e43 | 1869 | _virtualPort->putc(Value >> 8); |
martin13 | 0:81cd913c5e43 | 1870 | _virtualPort->putc(Value); |
martin13 | 0:81cd913c5e43 | 1871 | GetAck(); |
martin13 | 0:81cd913c5e43 | 1872 | } |
martin13 | 0:81cd913c5e43 | 1873 | |
martin13 | 0:81cd913c5e43 | 1874 | word Diablo_Serial_4DLib::txt_Underline(word Underline) |
martin13 | 0:81cd913c5e43 | 1875 | { |
martin13 | 0:81cd913c5e43 | 1876 | _virtualPort->putc(GFX_F_txt_Underline >> 8); |
martin13 | 0:81cd913c5e43 | 1877 | _virtualPort->putc(GFX_F_txt_Underline); |
martin13 | 0:81cd913c5e43 | 1878 | _virtualPort->putc(Underline >> 8); |
martin13 | 0:81cd913c5e43 | 1879 | _virtualPort->putc(Underline); |
martin13 | 0:81cd913c5e43 | 1880 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1881 | } |
martin13 | 0:81cd913c5e43 | 1882 | |
martin13 | 0:81cd913c5e43 | 1883 | word Diablo_Serial_4DLib::txt_Width(word Multiplier) |
martin13 | 0:81cd913c5e43 | 1884 | { |
martin13 | 0:81cd913c5e43 | 1885 | _virtualPort->putc(GFX_F_txt_Width >> 8); |
martin13 | 0:81cd913c5e43 | 1886 | _virtualPort->putc(GFX_F_txt_Width); |
martin13 | 0:81cd913c5e43 | 1887 | _virtualPort->putc(Multiplier >> 8); |
martin13 | 0:81cd913c5e43 | 1888 | _virtualPort->putc(Multiplier); |
martin13 | 0:81cd913c5e43 | 1889 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1890 | } |
martin13 | 0:81cd913c5e43 | 1891 | |
martin13 | 0:81cd913c5e43 | 1892 | word Diablo_Serial_4DLib::txt_Wrap(word Position) |
martin13 | 0:81cd913c5e43 | 1893 | { |
martin13 | 0:81cd913c5e43 | 1894 | _virtualPort->putc(GFX_F_txt_Wrap >> 8); |
martin13 | 0:81cd913c5e43 | 1895 | _virtualPort->putc(GFX_F_txt_Wrap); |
martin13 | 0:81cd913c5e43 | 1896 | _virtualPort->putc(Position >> 8); |
martin13 | 0:81cd913c5e43 | 1897 | _virtualPort->putc(Position); |
martin13 | 0:81cd913c5e43 | 1898 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1899 | } |
martin13 | 0:81cd913c5e43 | 1900 | |
martin13 | 0:81cd913c5e43 | 1901 | word Diablo_Serial_4DLib::txt_Xgap(word Pixels) |
martin13 | 0:81cd913c5e43 | 1902 | { |
martin13 | 0:81cd913c5e43 | 1903 | _virtualPort->putc(GFX_F_txt_Xgap >> 8); |
martin13 | 0:81cd913c5e43 | 1904 | _virtualPort->putc(GFX_F_txt_Xgap); |
martin13 | 0:81cd913c5e43 | 1905 | _virtualPort->putc(Pixels >> 8); |
martin13 | 0:81cd913c5e43 | 1906 | _virtualPort->putc(Pixels); |
martin13 | 0:81cd913c5e43 | 1907 | return GetAckResp() ; |
martin13 | 0:81cd913c5e43 | 1908 | } |
martin13 | 0:81cd913c5e43 | 1909 | |
martin13 | 0:81cd913c5e43 | 1910 | word Diablo_Serial_4DLib::txt_Ygap(word Pixels) |
martin13 | 0:81cd913c5e43 | 1911 | { |
martin13 | 0:81cd913c5e43 | 1912 | _virtualPort->putc(GFX_F_txt_Ygap >> 8); |
martin13 | 0:81cd913c5e43 | 1913 | _virtualPort->putc(GFX_F_txt_Ygap); |
martin13 | 0:81cd913c5e43 | 1914 | _virtualPort->putc(Pixels >> 8); |
martin13 | 0:81cd913c5e43 | 1915 | _virtualPort->putc(Pixels); |
martin13 | 0:81cd913c5e43 | 1916 | return GetAckResp() ; |
martin13 | 0:81cd913c5e43 | 1917 | } |
martin13 | 0:81cd913c5e43 | 1918 | |
martin13 | 0:81cd913c5e43 | 1919 | word Diablo_Serial_4DLib::file_CallFunction(word Handle, word ArgCount, GFX_t4DWordArray Args) |
martin13 | 0:81cd913c5e43 | 1920 | { |
martin13 | 0:81cd913c5e43 | 1921 | _virtualPort->putc(GFX_F_file_CallFunction >> 8); |
martin13 | 0:81cd913c5e43 | 1922 | _virtualPort->putc(GFX_F_file_CallFunction); |
martin13 | 0:81cd913c5e43 | 1923 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1924 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1925 | _virtualPort->putc(ArgCount >> 8); |
martin13 | 0:81cd913c5e43 | 1926 | _virtualPort->putc(ArgCount); |
martin13 | 0:81cd913c5e43 | 1927 | WriteWords(Args, ArgCount); |
martin13 | 0:81cd913c5e43 | 1928 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1929 | } |
martin13 | 0:81cd913c5e43 | 1930 | |
martin13 | 0:81cd913c5e43 | 1931 | word Diablo_Serial_4DLib::sys_GetModel(char * ModelStr) |
martin13 | 0:81cd913c5e43 | 1932 | { |
martin13 | 0:81cd913c5e43 | 1933 | _virtualPort->putc(GFX_F_sys_GetModel >> 8); |
martin13 | 0:81cd913c5e43 | 1934 | _virtualPort->putc(GFX_F_sys_GetModel); |
martin13 | 0:81cd913c5e43 | 1935 | return GetAckResStr(ModelStr); |
martin13 | 0:81cd913c5e43 | 1936 | } |
martin13 | 0:81cd913c5e43 | 1937 | |
martin13 | 0:81cd913c5e43 | 1938 | word Diablo_Serial_4DLib::sys_GetVersion() |
martin13 | 0:81cd913c5e43 | 1939 | { |
martin13 | 0:81cd913c5e43 | 1940 | _virtualPort->putc(GFX_F_sys_GetVersion >> 8); |
martin13 | 0:81cd913c5e43 | 1941 | _virtualPort->putc(GFX_F_sys_GetVersion); |
martin13 | 0:81cd913c5e43 | 1942 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1943 | } |
martin13 | 0:81cd913c5e43 | 1944 | |
martin13 | 0:81cd913c5e43 | 1945 | word Diablo_Serial_4DLib::sys_GetPmmC() |
martin13 | 0:81cd913c5e43 | 1946 | { |
martin13 | 0:81cd913c5e43 | 1947 | _virtualPort->putc(GFX_F_sys_GetPmmC >> 8); |
martin13 | 0:81cd913c5e43 | 1948 | _virtualPort->putc(GFX_F_sys_GetPmmC); |
martin13 | 0:81cd913c5e43 | 1949 | return GetAckResp(); |
martin13 | 0:81cd913c5e43 | 1950 | } |
martin13 | 0:81cd913c5e43 | 1951 | |
martin13 | 0:81cd913c5e43 | 1952 | word Diablo_Serial_4DLib::writeString(word Handle, char * StringOut) |
martin13 | 0:81cd913c5e43 | 1953 | { |
martin13 | 0:81cd913c5e43 | 1954 | _virtualPort->putc(GFX_F_writeString >> 8); |
martin13 | 0:81cd913c5e43 | 1955 | _virtualPort->putc(GFX_F_writeString); |
martin13 | 0:81cd913c5e43 | 1956 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1957 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1958 | WriteChars(StringOut) ; |
martin13 | 0:81cd913c5e43 | 1959 | return GetAckResp() ; |
martin13 | 0:81cd913c5e43 | 1960 | } |
martin13 | 0:81cd913c5e43 | 1961 | |
martin13 | 0:81cd913c5e43 | 1962 | word Diablo_Serial_4DLib::readString(word Handle, char * StringIn) |
martin13 | 0:81cd913c5e43 | 1963 | { |
martin13 | 0:81cd913c5e43 | 1964 | _virtualPort->putc(GFX_F_readString >> 8); |
martin13 | 0:81cd913c5e43 | 1965 | _virtualPort->putc(GFX_F_readString); |
martin13 | 0:81cd913c5e43 | 1966 | _virtualPort->putc(Handle >> 8); |
martin13 | 0:81cd913c5e43 | 1967 | _virtualPort->putc(Handle); |
martin13 | 0:81cd913c5e43 | 1968 | return GetAckResStr(StringIn); |
martin13 | 0:81cd913c5e43 | 1969 | } |
martin13 | 0:81cd913c5e43 | 1970 | |
martin13 | 0:81cd913c5e43 | 1971 | void Diablo_Serial_4DLib::blitComtoDisplay(word X, word Y, word Width, word Height, GFX_t4DByteArray Pixels) |
martin13 | 0:81cd913c5e43 | 1972 | { |
martin13 | 0:81cd913c5e43 | 1973 | _virtualPort->putc(GFX_F_blitComtoDisplay >> 8); |
martin13 | 0:81cd913c5e43 | 1974 | _virtualPort->putc(GFX_F_blitComtoDisplay); |
martin13 | 0:81cd913c5e43 | 1975 | _virtualPort->putc(X >> 8); |
martin13 | 0:81cd913c5e43 | 1976 | _virtualPort->putc(X); |
martin13 | 0:81cd913c5e43 | 1977 | _virtualPort->putc(Y >> 8); |
martin13 | 0:81cd913c5e43 | 1978 | _virtualPort->putc(Y); |
martin13 | 0:81cd913c5e43 | 1979 | _virtualPort->putc(Width >> 8); |
martin13 | 0:81cd913c5e43 | 1980 | _virtualPort->putc(Width); |
martin13 | 0:81cd913c5e43 | 1981 | _virtualPort->putc(Height >> 8); |
martin13 | 0:81cd913c5e43 | 1982 | _virtualPort->putc(Height); |
martin13 | 0:81cd913c5e43 | 1983 | WriteBytes(Pixels, Width*Height*2); |
martin13 | 0:81cd913c5e43 | 1984 | GetAck() ; |
martin13 | 0:81cd913c5e43 | 1985 | } |
martin13 | 0:81cd913c5e43 | 1986 | |
martin13 | 0:81cd913c5e43 | 1987 | word Diablo_Serial_4DLib::file_FindFirstRet(char * Filename, char * StringIn) |
martin13 | 0:81cd913c5e43 | 1988 | { |
martin13 | 0:81cd913c5e43 | 1989 | _virtualPort->putc(GFX_F_file_FindFirstRet >> 8) ; |
martin13 | 0:81cd913c5e43 | 1990 | _virtualPort->putc(GFX_F_file_FindFirstRet) ; |
martin13 | 0:81cd913c5e43 | 1991 | WriteChars(Filename) ; |
martin13 | 0:81cd913c5e43 | 1992 | return GetAckResStr(StringIn) ; |
martin13 | 0:81cd913c5e43 | 1993 | } |
martin13 | 0:81cd913c5e43 | 1994 | |
martin13 | 0:81cd913c5e43 | 1995 | word Diablo_Serial_4DLib::file_FindNextRet(char * StringIn) |
martin13 | 0:81cd913c5e43 | 1996 | { |
martin13 | 0:81cd913c5e43 | 1997 | _virtualPort->putc(GFX_F_file_FindNextRet >> 8) ; |
martin13 | 0:81cd913c5e43 | 1998 | _virtualPort->putc(GFX_F_file_FindNextRet) ; |
martin13 | 0:81cd913c5e43 | 1999 | return GetAckResStr(StringIn) ; |
martin13 | 0:81cd913c5e43 | 2000 | } |
martin13 | 0:81cd913c5e43 | 2001 | |
martin13 | 0:81cd913c5e43 | 2002 | void Diablo_Serial_4DLib::setbaudWait(word Newrate) |
martin13 | 0:81cd913c5e43 | 2003 | { |
martin13 | 0:81cd913c5e43 | 2004 | _virtualPort->putc(GFX_F_setbaudWait >> 8); |
martin13 | 0:81cd913c5e43 | 2005 | _virtualPort->putc(GFX_F_setbaudWait); |
martin13 | 0:81cd913c5e43 | 2006 | _virtualPort->putc(Newrate >> 8); |
martin13 | 0:81cd913c5e43 | 2007 | _virtualPort->putc(Newrate); |
martin13 | 0:81cd913c5e43 | 2008 | SetThisBaudrate(Newrate); // change this systems baud rate to match new display rate, ACK is 100ms away |
martin13 | 0:81cd913c5e43 | 2009 | GetAck() ; |
martin13 | 0:81cd913c5e43 | 2010 | } |