Join us on Discord!
You can help CodeWalrus stay online by donating here.

Making a Modern TI-82 Include

Started by CVSoft, December 15, 2015, 02:10:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CVSoft

In pursuit of bettering what is already TI's greatest invention since the integrated circuit, I'm writing a new ti82.inc based on TI's ti83asm.inc and BrandonW's ti83.inc, targeting the SNG shell. SNG only has 30 ROM calls documented in its standard include file sng10.inc, and was the most complete one until now. So far, I have identified 138 ROM calls, using a Python script that follows call tables to compare the code of the routines mentioned in ti83.inc to the call table at the end of the TI-82's ROM page 0. It does not find calls that are on page 0; I need to do this manually, so those will take longer to identify.

RAM equates were fairly straightforward, except for the StatVars saferam area. Because the statistics implementation for the TI-82 is not nearly as advanced as the TI-83's, there will be significantly less saferam available there (279 bytes at most, compared to 531). Finding IY flag equivalents should not be terribly hard if I can find ROM calls common to both models that use a particular flag.

The latest version of the include file can be found here. Addresses here are for ROMs 15.0 and 16.0.

There are some necessary changes to ROM_CALL() that need to be made to support all of these calls. With the TI-83, TI introduced indirect calling, allowing the user to access some lesser-used functions outside of page 0. However, as user assembly wasn't implemented in the TI-82, there is no directly way to access these calls from page 0. Instead, you have to ROM_CALL(___bank_call) \ .dw addr \ .db page. You'll notice that this requires looking ahead three bytes, and ___bank_call (in ROM 16.0, at $2E46) does this by looking at the stack. This isn't compatible with the existing ROM_CALL() routines. For reasons of efficiency I will probably use a separate BANK_CALL() macro for this. Furthermore, to achieve compatibility with ROMs before 15.0, the ROM_CALL() routine needs to be updated with the new values for each of those ROM versions and take account for the missing values in the call table. Since all of this will happen within the shell, this is less important.

PROGRESS:

  • ☑ Find names for page 0 call table functions
  • ☑ Find TI-82 calls not on TI-83 page $0C
  • ☑ Find RAM equates*
  • ☐ Find IY flag equates
  • ☐ Add in key code equates
  • ☐ Test the ROM calls, RAM equates (I need people to test the uncertain ROM calls)
  • ☐ Find address corrections for ROMs before 15.0
*RAM equates may be of different size

I'm not responsible for any RAM clears or property damage (probably through user rage) that results from using this experimental include file.
  • Calculators owned: TI-73, TI-81, TI-81, TI-81, TI-81, TI-81, TI-81, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-83, TI-83, TI-83 Plus, TI-84 Plus, TI-85, TI-86, TI-89 Titanium

alexgt

Most of that when over my head but from what I understood it sounds pretty cool :)
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Dream of Omnimaga

That is cool @CVSoft. I wonder if that could be handy for making new games for multiple platforms that imclude the TI-82? I wish that calc was documented like this earlier.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Max Leiter

Very cool you're doing this, like DJ said. Is the script opensource/available online somewhere? I'm curious as to how it works

CVSoft

@DJ Omnimaga yeah, it'll make porting things over significantly easier. It will make it possible to port over a lot of things to the TI-82 from the TI-83, but not everything can because of different saferam and missing calls.

@Max Leiter I'll release it when it's done -- I don't think it's ready for exposure as I still need to finish the methods it uses to map out calls. The tools will probably be GPLv2 licensed but the include file produced will only require attribution within the include itself.
  • Calculators owned: TI-73, TI-81, TI-81, TI-81, TI-81, TI-81, TI-81, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-83, TI-83, TI-83 Plus, TI-84 Plus, TI-85, TI-86, TI-89 Titanium

utz

@CVSoft Thanks a lot for this excellent work! I'm sure this will come in handy for my projects at some point.
Do you have any plans to add addresses for ROM versions 17.0-19.0?
  • Calculators owned: TI-82, TI-83, TI-83+, TI-85, TI-86, TI-92+, Sharp PC-1403

CVSoft

For the sake of compatibility, ROM_CALL() and BANK_CALL() will take care of adjusting addresses to the correct values.
  • Calculators owned: TI-73, TI-81, TI-81, TI-81, TI-81, TI-81, TI-81, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-82, TI-83, TI-83, TI-83 Plus, TI-84 Plus, TI-85, TI-86, TI-89 Titanium

Powered by EzPortal