Skip to content

Commit cabf46d

Browse files
committed
2.
1 parent 06de809 commit cabf46d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

software/io/acia/modem.cc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,9 +705,17 @@ int Modem :: ExecuteCommand(ModemCommand_t *cmd)
705705
}
706706

707707
//ATA command does not return a response (except for CONNECT response)
708-
if(doesResponse)
709-
acia.SendToRx((uint8_t *)response, strlen(response));
710-
708+
if(doesResponse) {
709+
char hex_buf[128]; // Buffer for HEX string
710+
int pos = 0;
711+
size_t resp_len = strlen(response);
712+
for(size_t i = 0; i < resp_len && pos < 120; i++) {
713+
pos += sprintf(hex_buf + pos, "%02X", (uint8_t)response[i]);
714+
}
715+
// Calculating what C64 fetched from the buffer based on status transitions
716+
printf("PUSH_HEX:%s\n", hex_buf);
717+
acia.SendToRx((uint8_t *)response, resp_len);
718+
}
711719
return connectionStateChange;
712720
}
713721

0 commit comments

Comments
 (0)