Author Topic: TI-OS Optimizations  (Read 6153 times)

0 Members and 1 Guest are viewing this topic.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
TI-OS Optimizations
« on: April 11, 2015, 07:58:56 am »
I've had this project sitting in a folder for over a year now, and I decided to pick it back up. I'm posting now because I'm actually making progress that I would consider release-worthy, rather than just a toy.

Everyone knows TI-OS is horribly bloated and slow, but we've built so much software into the existing system that no one's too anxious to leave. So, why not fix the problems and keep the OS as it is?

That's what I'm doing. Reprogramming bits and pieces of TI-OS to be faster, better, smarter, stronger, etc.

All the work is being done based on OS 2.41 for 84+SE at the moment. (Although, currently it's all taking place in page 00, so that's pretty much moot) Some of the optimizations will definitely be ported to the other models, but others (like improved USB) obviously wouldn't apply. Ideally, though, the modifications would converge to a single OS version that works on ALL the models in the 83+/84+SE range. (No, I'm not planning to support the CSE or CE. At least, not for now.)

If I release anything, to avoid copyright concerns, it will be patches against the ROMs I specify. It's a historically non-grey method of distributing hacked and modded software, so I hope I can avoid any nasty legal letters with this.

So, without further ado, here's what I've done so far: (I will edit this list with updates)

* Optimized LCD_Delay routine in Page00. It saves a minimum of 260 cycles per screen command on all models, for any software that uses the built in routines. (Not Axe, or most Asm). This results in roughly a 10% improvement in display-heavy routines in TI-BASIC, for example.

Here's what else I want to look into, but haven't done yet:

* The TI-BASIC interpreter (I bet this is loaded with goodies)
* Floating point optimizations
* Various frequently used system bcalls
* Improved Graphing (mostly through optimized fp and draw commands, but also ideally by not updating the screen until it's drawn fully)

Let me know of any suggestions, ideas, discouragements, etc. you may have.
« Last Edit: April 12, 2015, 06:13:22 am by willrandship »

Offline harold

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 226
  • Rating: +41/-3
    • View Profile
Re: TI-OS Optimizations
« Reply #1 on: April 11, 2015, 08:54:32 am »
I'd like to see faster graphing, some of the things you mentioned will already do that as a side effect but it could probably benefit from some direct attention.
Blog about bitmath: bitmath.blogspot.nl
Check the haroldbot thread for the supported commands and syntax.
You can use haroldbot from this website.

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: TI-OS Optimizations
« Reply #2 on: April 11, 2015, 10:01:15 am »
A lot of Xeda's math stuff could probably be useful. I don't really use bcalls for stuff other than messing with memory, so i can't think of any other ideas. I'm not sure if this is essentially what you did, but GrBufCpy could use a speed bump too.

EDIT: Just realized "speed bump" might be misinterpreted, i meant a speed "boost" ;)
« Last Edit: April 11, 2015, 10:04:40 am by chickendude »

Offline Ivoah

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +3/-0
    • View Profile
    • Codinghobbit
Re: TI-OS Optimizations
« Reply #3 on: April 11, 2015, 11:00:13 am »
* The TI-BASIC interpreter (I bet this is loaded with goodies)

That would be awesome!
http://codinghobbit.no-ip.org
My Calcs:
TI-86 (now broken) $2
TI SR-56 - $0
TI-Nspire CX CAS - $152
TI-84+ Silver Edition - $56
TI-84+ Silver Edition - $0
TI-85 - $0
TI-73 Explorer VS - $10
ViewScreen - $3

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: TI-OS Optimizations
« Reply #4 on: April 11, 2015, 11:47:49 am »
A lot of Xeda's math stuff could probably be useful. I don't really use bcalls for stuff other than messing with memory, so i can't think of any other ideas. I'm not sure if this is essentially what you did, but GrBufCpy could use a speed bump too.

EDIT: Just realized "speed bump" might be misinterpreted, i meant a speed "boost" ;)
The thing with the TIOS routines is that they use BCD while xedas routines use base 2, and thus rounding differences would appear.

Also, this is a nice idea! But, isn't the TIOS somehow copyrighted?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: TI-OS Optimizations
« Reply #5 on: April 11, 2015, 12:48:56 pm »
This sounds like a really diffucult project, but if it works, it would be awesome.

A suggestion if you have extra time at the end of this project would be a better mathPrint. I know the OS you're trying to optimize doesn't have it, so it might be hard to do, but I've seen calculators that are much simpler than the 84+ that had something similar to MathPrint that was far better and also faster than what the 84+ MP OSes have.

And better floating points would be cool too (I heard that if you use real binary floats, you can get both better performance and better accuraccy), but that would probably require a rewrite of almost the entire core of the OS (and also of huge parts of the BASIC interpreter).

BTW: are you mainly trying to increase performance, or could it be possible to also free up an extra page or two?
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: TI-OS Optimizations
« Reply #6 on: April 11, 2015, 01:02:44 pm »
Wait, wouldn't all the bcall adresses change? Or do they have a fixed jumptable?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: TI-OS Optimizations
« Reply #7 on: April 11, 2015, 07:08:59 pm »
@harold faster graphing is a possibility, especially if I optimize the line drawing and screen updating functions.

@Sorunome The patching should hopefully evade the copyright concerns as far as sending changes. Also, I'm intentionally padding modified areas to preserve their alignment in the system, at least until I can get a full build with dynamic bcall labeling built.

@ben_g Mathprint functionality isn't impossible (Kerm demonstrated it actually works on the 83+ BE as is) but if I use it I'll have to extensively modify the code. Also, I definitely plan on improving the floats. Changing from BCD to IEEE or similar would be difficult, since so many routines use it, but it would make several things far faster.

Also, another important point: I'll be avoiding anything that causes incompatibility problems in general. BCALLs won't be changing positions in the table, although unused ones may be moved and new ones added, etc. All LCD drivers should work, no matter how buggy and slow. TI-BASIC programs should work without modification. Timings for various things will change, but programs that don't rely on extremely precise timing should continue to work.
« Last Edit: April 11, 2015, 09:46:17 pm by willrandship »

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: TI-OS Optimizations
« Reply #8 on: April 12, 2015, 05:20:09 am »
[...]
@Sorunome The patching should hopefully evade the copyright concerns as far as sending changes. Also, I'm intentionally padding modified areas to preserve their alignment in the system, at least until I can get a full build with dynamic bcall labeling built.
[...]
Oh, yes, patches should work, copyright-wise.

Also good to hear that everything should work without having to modify it :)

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline harold

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 226
  • Rating: +41/-3
    • View Profile
Re: TI-OS Optimizations
« Reply #9 on: July 13, 2015, 08:09:23 am »
How is this going? Any news?
Blog about bitmath: bitmath.blogspot.nl
Check the haroldbot thread for the supported commands and syntax.
You can use haroldbot from this website.