Skip to content

Commit e59228e

Browse files
committed
[rs232] fujiCommandID_t
1 parent 3d0393a commit e59228e

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

lib/device/rs232/network.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ void rs232Network::rs232_set_password()
606606
*/
607607
void rs232Network::rs232_special()
608608
{
609-
do_inquiry(cmdFrame.comnd);
609+
do_inquiry((fujiCommandID_t) cmdFrame.comnd);
610610

611611
switch (inq_dstats)
612612
{
@@ -641,23 +641,23 @@ void rs232Network::rs232_special_inquiry()
641641

642642
Debug_printf("rs232Network::rs232_special_inquiry(%02x)\n", cmdFrame.aux1);
643643

644-
do_inquiry(cmdFrame.aux1);
644+
do_inquiry((fujiCommandID_t) cmdFrame.aux1);
645645

646646
// Finally, return the completed inq_dstats value back to Atari
647-
bus_to_computer(&inq_dstats, sizeof(inq_dstats), false); // never errors.
647+
bus_to_computer((uint8_t *) &inq_dstats, sizeof(inq_dstats), false); // never errors.
648648
}
649649

650-
void rs232Network::do_inquiry(unsigned char inq_cmd)
650+
void rs232Network::do_inquiry(fujiCommandID_t inq_cmd)
651651
{
652652
// Reset inq_dstats
653-
inq_dstats = 0xff;
653+
inq_dstats = SIO_DIRECTION_INVALID;
654654

655655
// Ask protocol for dstats, otherwise get it locally.
656656
if (protocol != nullptr)
657657
inq_dstats = protocol->special_inquiry(inq_cmd);
658658

659659
// If we didn't get one from protocol, or unsupported, see if supported globally.
660-
if (inq_dstats == 0xFF)
660+
if (inq_dstats == SIO_DIRECTION_INVALID)
661661
{
662662
switch (inq_cmd)
663663
{
@@ -670,30 +670,30 @@ void rs232Network::do_inquiry(unsigned char inq_cmd)
670670
case FUJICMD_CHDIR:
671671
case FUJICMD_USERNAME:
672672
case FUJICMD_PASSWORD:
673-
inq_dstats = 0x80;
673+
inq_dstats = SIO_DIRECTION_WRITE;
674674
break;
675675
case FUJICMD_JSON:
676-
inq_dstats = 0x00;
676+
inq_dstats = SIO_DIRECTION_NONE;
677677
break;
678678
case FUJICMD_GETCWD:
679-
inq_dstats = 0x40;
679+
inq_dstats = SIO_DIRECTION_READ;
680680
break;
681681
case FUJICMD_TIMER: // Set interrupt rate
682-
inq_dstats = 0x00;
682+
inq_dstats = SIO_DIRECTION_NONE;
683683
break;
684684
case FUJICMD_TRANSLATION: // Set Translation
685-
inq_dstats = 0x00;
685+
inq_dstats = SIO_DIRECTION_NONE;
686686
break;
687687
case FUJICMD_PARSE: // JSON Parse
688688
if (channelMode == JSON)
689-
inq_dstats = 0x00;
689+
inq_dstats = SIO_DIRECTION_NONE;
690690
break;
691691
case FUJICMD_QUERY: // JSON Query
692692
if (channelMode == JSON)
693-
inq_dstats = 0x80;
693+
inq_dstats = SIO_DIRECTION_WRITE;
694694
break;
695695
default:
696-
inq_dstats = 0xFF; // not supported
696+
inq_dstats = SIO_DIRECTION_INVALID; // not supported
697697
break;
698698
}
699699
}

lib/device/rs232/network.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class rs232Network : public virtualDevice
210210
/**
211211
* Return value for DSTATS inquiry
212212
*/
213-
uint8_t inq_dstats=0xFF;
213+
AtariSIODirection inq_dstats=SIO_DIRECTION_INVALID;
214214

215215
/**
216216
* The login to use for a protocol action
@@ -371,7 +371,7 @@ class rs232Network : public virtualDevice
371371
* @brief Perform the inquiry, handle both local and protocol commands.
372372
* @param inq_cmd the command to check against.
373373
*/
374-
void do_inquiry(unsigned char inq_cmd);
374+
void do_inquiry(fujiCommandID_t inq_cmd);
375375

376376
/**
377377
* @brief set translation specified by aux1 to aux2_translation mode.

0 commit comments

Comments
 (0)