512 |
|
* Read from channel |
513 |
|
*/ |
514 |
|
|
515 |
< |
uint8 FSDrive::Read(int channel, uint8 *byte) |
515 |
> |
uint8 FSDrive::Read(int channel, uint8 &byte) |
516 |
|
{ |
517 |
|
int c; |
518 |
|
|
519 |
|
// Channel 15: Error channel |
520 |
|
if (channel == 15) { |
521 |
< |
*byte = *error_ptr++; |
521 |
> |
byte = *error_ptr++; |
522 |
|
|
523 |
< |
if (*byte != '\r') |
523 |
> |
if (byte != '\r') |
524 |
|
return ST_OK; |
525 |
|
else { // End of message |
526 |
|
set_error(ERR_OK); |
531 |
|
if (!file[channel]) return ST_READ_TIMEOUT; |
532 |
|
|
533 |
|
// Read one byte |
534 |
< |
*byte = read_char[channel]; |
534 |
> |
byte = read_char[channel]; |
535 |
|
c = fgetc(file[channel]); |
536 |
|
if (c == EOF) |
537 |
|
return ST_EOF; |