CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: ACagliano on January 20, 2016, 01:46:01 AM

Title: Calculator Strange Behavior
Post by: ACagliano on January 20, 2016, 01:46:01 AM
For a while, I have been working on a Yatzee game for the calculator. Testing it in the emulator produced some weird results, namely graphics issues, and crashes. Upon most careful observation, I noticed that at some point, the value of HL was not changing. Even an instruction like ld hl,Address would leave HL unchanged and pointing to $0000. This was causing a great deal of other issues, including executing from that address and writing to it. At one point, this even caused the program to execute my jmptbl label as code, not as data.

Thinking that this might be an emulator issue, against my better judgement I decided to run the program on my calculator (yes, I do dumb things sometimes). Ever since then, I have had weird issues with sending files to and from my calculator. It worked once more since, but every other time, sending a program or app of any kind yields "Serious communication error has occurred" in TI Data Editor. The calculator shows up in the aforementioned program, but I cannot view anything on the device or send a file to it. TILP cannot even detect the calculator present. Using the TI-OS Restore program works fine to send a new OS to the calculator, but my connectivity issues persist.

What the heck is going on? Could I have damaged something else critical to the transfer? Is my computer's port not working? The calculators? But I would think that a hardware issue would mean I can't send a new OS either.

I've enclosed the program I ran on the calc here.
Title: Re: Calculator Strange Behavior
Post by: Dream of Omnimaga on January 20, 2016, 03:16:43 AM
Hm strange. I don't know ASM, but could you have hit the flash memory or changed some ports by accident? I also forgot if there are any program that can check if your certificate is still valid.
Title: Re: Calculator Strange Behavior
Post by: ACagliano on January 20, 2016, 05:25:32 AM
If any of those are true, what steps can I take to fix it? A full reset/OS reinstall isnt correcting it.
Title: Re: Calculator Strange Behavior
Post by: Dream of Omnimaga on January 20, 2016, 09:06:31 PM
Could you share the source code of your prigram? That said, not many people on CW do ASM so it might be better to ask on multiple forums. Maybe @tr1p1ea might be able to help? I hope that your calculator is safe, though.
Title: Re: Calculator Strange Behavior
Post by: tr1p1ea on January 20, 2016, 09:11:05 PM
I was wondering how you were coming to the conclusion regarding HL=$0000? Are you using a debugger (which emulator if so)?

Also do you utilise any interrupts in your program?

I'd be happy to take a look for you.

(Also love Yatzee :)).
Title: Re: Calculator Strange Behavior
Post by: ACagliano on January 21, 2016, 12:18:58 AM
Quote from: tr1p1ea on January 20, 2016, 09:11:05 PM
I was wondering how you were coming to the conclusion regarding HL=$0000? Are you using a debugger (which emulator if so)?

Also do you utilise any interrupts in your program?

I'd be happy to take a look for you.

(Also love Yatzee :)).

Debugger, Windows version of WabbitEmu, run via Wine on OSX. I had the debugger up and noticed HL = $0000 and not changing.
No interrupts occur in the program. The source is here: http://pastebin.com/F4NG7Tgf
Title: Re: Calculator Strange Behavior
Post by: Dream of Omnimaga on January 26, 2016, 07:28:44 AM
Oh, by the way you know that WabbitEmu emulation is not as accurate as TilEm and jsTIfied, right? Because if you mostly test on WabbitEmu and take its emulation behavior for granted, then that could explain why you have troubles running your game on a real calculator. The emulator usually does the job well, but it's always better to try in multiple emulators from time to time, in case.