tursilion / libti99

GCC Library for the TI-99/4A
29 stars 10 forks source link

dsrlnkraw doesn't detect when no matching DSR was found #22

Closed mcvde closed 1 year ago

mcvde commented 1 year ago

Calling dsrlnk with PAB with name set to some non-DSR valid value, such as "abc" doesn't indicate an error occurred or that the DSR call was not serviced. Seems line #62 is the key, where no error is actually set.

This can be worked around this by first capturing all the DSR names and then ensuring those passed to dsrlnk/dsrlnkraw match.

tursilion commented 1 year ago

hm. That's an interesting one. The E/A DSRLNK it's based on reports the error in the equal bit, with error code 0 meaning not found... but as you've seen in the code, that's really more of a side effect than an error code.

I suppose since I'm actually writing the library and defining the returns, it's okay to have one more return value and call it DSR_NOT_FOUND.

tursilion commented 1 year ago

Not completely tested, but this should work. Gonna close this, but reopen if you have issues.

mcvde commented 1 year ago

Awesome. I'm looking forward to this change and will check it out after I get back from vacation next week.