-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot download specific variables from TI-92 II #65
Comments
I fixed a bug related to 92 support after TILP II 1.18, but the commit message mentions dirlist being fixed, not recv. Could you clean up your distro libti*+gfm+tilp packages if any, use the standard user build script from this repo ( https://github.com/debrouxl/tilp_and_gfm/raw/master/tilp/trunk/build/scripts/install_tilp.sh ) to build libti*+gfm+tilp after installing the build dependencies listed by the script, and try again ? Thanks in advance :) |
I have run into the same issue, and debrouxl/tilibs@7659920 seems to fix the directory listing for me. However, even with it I still cannot download variables, but that might be related to my cable - will debug further. |
I've now added some debug output to My calculator is a regular TI-92, with Firmware 1.12, by the way. |
Okay, I am far from knowledgable enough with the codebase (or TI calculators other than the one I own) to know if this is a proper fix, or if it breaks any other calculator models, so I won't open a Pull Request for this. However, this patch (in addition to the mentioned dirlist patch) allows me to receive variables from my calculator: (Edit: This patch is against libticalcs2-1.1.9, not against the latest repo state.) --- libticalcs2-1.1.9/src/calc_9x.c 2016-09-10 21:45:22.000000000 +0200
+++ libticalcs2-1.1.9-patched/src/calc_9x.c 2025-01-03 10:32:13.433454866 +0100
@@ -62,6 +62,7 @@
#define SEND_EOT(handle) (handle->model != CALC_TI92 ? ti89_send_EOT(handle) : ti92_send_EOT(handle))
#define RECV_ACK(handle, status) (handle->model != CALC_TI92 ? ti89_recv_ACK(handle, status) : ti92_recv_ACK(handle, status))
+#define RECV_ACK_NO_SIZE(handle, status) (handle->model != CALC_TI92 ? ti89_recv_ACK(handle, status) : ti92_recv_ACK_NO_SIZE(handle))
#define RECV_VAR(handle, varsize, vartype, varname) (handle->model != CALC_TI92 ? ti89_recv_VAR(handle, varsize, vartype, varname) : ti92_recv_VAR(handle, varsize, vartype, varname))
#define RECV_XDP(handle, length, data) (handle->model != CALC_TI92 ? ti89_recv_XDP(handle, length, data) : ti92_recv_XDP(handle, length, data))
#define RECV_CTS(handle) (handle->model != CALC_TI92 ? ti89_recv_CTS(handle) : ti92_recv_CTS(handle))
@@ -851,7 +852,7 @@
static int recv_var (CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr)
{
int ret = 0;
- uint16_t status;
+ uint16_t status = 0;
VarEntry *ve;
uint16_t unused;
char varname[20];
@@ -867,7 +868,7 @@
ret = SEND_REQ(handle, 0, vr->type, varname);
if (!ret)
{
- ret = RECV_ACK(handle, &status);
+ ret = RECV_ACK_NO_SIZE(handle, &status);
if (!ret)
{
if (status != 0)
diff '--color=auto' -ur libticalcs2-1.1.9/src/cmd68k.c libticalcs2-1.1.9-patched/src/cmd68k.c
--- libticalcs2-1.1.9/src/cmd68k.c 2016-10-02 21:58:25.000000000 +0200
+++ libticalcs2-1.1.9-patched/src/cmd68k.c 2025-01-03 10:31:42.285229070 +0100
@@ -632,6 +632,29 @@
return ti68k_recv_ACK(handle, status, 1);
}
+TIEXPORT3 int TICALL ti92_recv_ACK_NO_SIZE(CalcHandle* handle)
+{
+ uint8_t host, cmd;
+ int ret;
+
+ VALIDATE_HANDLE(handle);
+ ret = dbus_recv_ack_no_len(handle, &host, &cmd);
+ if (ret)
+ {
+ return ret;
+ }
+
+ if (cmd != DBUS_CMD_ACK)
+ {
+ return ERR_INVALID_CMD;
+ }
+
+ ticalcs_info(" TI92->PC: ACK");
+
+ return 0;
+
+}
+
TIEXPORT3 int TICALL ti68k_recv_CNT(CalcHandle* handle)
{
uint8_t host, cmd;
diff '--color=auto' -ur libticalcs2-1.1.9/src/cmd68k.h libticalcs2-1.1.9-patched/src/cmd68k.h
--- libticalcs2-1.1.9/src/cmd68k.h 2016-10-02 21:58:25.000000000 +0200
+++ libticalcs2-1.1.9-patched/src/cmd68k.h 2025-01-03 10:35:23.185877305 +0100
@@ -103,6 +103,7 @@
#define ti92_recv_SKP(handle, rej_code) ti68k_recv_SKP(handle, rej_code)
#define ti92_recv_XDP(handle, length, data) ti68k_recv_XDP(handle, length, data)
TIEXPORT3 int TICALL ti92_recv_ACK(CalcHandle *handle, uint16_t * status);
+TIEXPORT3 int TICALL ti92_recv_ACK_NO_SIZE(CalcHandle *handle);
#define ti92_recv_CNT(handle) ti68k_recv_CNT(handle)
#define ti92_recv_EOT(handle) ti68k_recv_EOT(handle)
TIEXPORT3 int TICALL ti92_recv_RTS(CalcHandle *handle, uint32_t * varsize, uint8_t * vartype, char *varname);
diff '--color=auto' -ur libticalcs2-1.1.9/src/dbus_pkt.c libticalcs2-1.1.9-patched/src/dbus_pkt.c
--- libticalcs2-1.1.9/src/dbus_pkt.c 2016-10-02 21:58:25.000000000 +0200
+++ libticalcs2-1.1.9-patched/src/dbus_pkt.c 2025-01-03 10:12:20.487058776 +0100
@@ -341,3 +341,22 @@
return ret;
}
+
+TIEXPORT3 int TICALL dbus_recv_ack_no_len(CalcHandle *handle, uint8_t* host, uint8_t* cmd)
+{
+ int ret = 0;
+ uint8_t buf[4] = {0};
+
+ VALIDATE_HANDLE(handle);
+ VALIDATE_NONNULL(host);
+ VALIDATE_NONNULL(cmd);
+
+ // Any packet has always at least 2 bytes (MID, CID)
+ ret = ticables_cable_recv(handle->cable, buf, 2);
+ if (!ret)
+ {
+ *host = buf[0];
+ *cmd = buf[1];
+ }
+ return ret;
+}
diff '--color=auto' -ur libticalcs2-1.1.9/src/ticalcs.h libticalcs2-1.1.9-patched/src/ticalcs.h
--- libticalcs2-1.1.9/src/ticalcs.h 2016-10-02 21:58:25.000000000 +0200
+++ libticalcs2-1.1.9-patched/src/ticalcs.h 2025-01-03 10:10:10.286115863 +0100
@@ -931,6 +931,8 @@
TIEXPORT3 int TICALL dbus_recv(CalcHandle *handle, uint8_t* host, uint8_t* cmd, uint16_t* length, uint8_t* data);
TIEXPORT3 int TICALL dbus_recv_header(CalcHandle *handle, uint8_t* host, uint8_t* cmd, uint16_t* length);
TIEXPORT3 int TICALL dbus_recv_data(CalcHandle *handle, uint16_t* length, uint8_t* data);
+ // special handling of a TI-92 quirk when receiving variables - unlike all other situations does not read length
+ TIEXPORT3 int TICALL dbus_recv_ack_no_len(CalcHandle *handle, uint8_t* host, uint8_t* cmd);
// dusb_rpkt.c
TIEXPORT3 int TICALL dusb_send(CalcHandle *handle, DUSBRawPacket* pkt);
|
Interesting, thanks for the investigation and patch :) Since And you probably don't have multiple 92 calculators with different OS versions for testing fixes, but that should be OK: TILP on top of patched libticalcs communicating with 92 ROM dumps running on TIEmu through virtual linking ought to do the job. |
I'm trying to figure out how to set TILP into non-silent receive mode, but I'm only seeing a call to Am I missing something, or is this functionality not exposed for TI92? |
On the lower levels, the 92 supports non-silent linking: By default, in TILP, it's a "Receive variables from non-silent calculators" (or French/German-localized translation thereof) button in the left pane, below the menu. |
I'll need to look further (later), but for now that button doesn't seem to do much for me, unless I already select a variable in the dir-list to download. |
By the way, I've had a quick look at the current code, and it really seems that non-silent recv is not hooked up for any calcs that aren't a TI82 or TI 85: tilp_and_gfm/tilp/trunk/src/tilp.c Lines 530 to 534 in 0a52561
tilp_and_gfm/tilp/trunk/src/tilp.c Lines 408 to 441 in 0a52561
tilp_and_gfm/tilp/trunk/src/tilp_calcs.c Lines 894 to 902 in 0a52561
The tilp_and_gfm/tilp/trunk/src/tilp_calcs.c Lines 832 to 892 in 0a52561
The tilp_and_gfm/tilp/trunk/src/tilp_calcs.c Lines 653 to 830 in 0a52561
I don't know when I have the time to experiment, but it might not be too hard to add a third branch to |
OS: Kubuntu 22.04.2 LTS x86_64
Software:
TiLP2 - Tilp Is a Linking Program - 1.18
Framework version (cables=1.3.5, files=1.1.7, calcs=1.1.9, conv=1.1.5)
Cable: Silverlink
Calculator: TI-92 II
Expected behavior:
Clicking on folders in variable list expands them to show specific variables
Right-clicking those variables allows the user to download them
Actual behavior:
Only full backup possible
The text was updated successfully, but these errors were encountered: