Author Topic: RAM addresses  (Read 12639 times)

0 Members and 1 Guest are viewing this topic.

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: RAM addresses
« Reply #15 on: July 02, 2012, 08:48:26 pm »
The way most programs/apps  that do that use a font hook instead of modifying a Flash location. Overwriting the font data would be a pain (backup parts of the page that should not be overwritten, then erasing the page containing the data, restoring the backup content, and writing to the proper parts).
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: RAM addresses
« Reply #16 on: July 02, 2012, 09:43:08 pm »
Right, and if you want an app to change your TI-83 Plus's font, Omnicalc can do that :)

Wonder why zStart doesn't support fonts on the TI-83 Plus, though.




Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: RAM addresses
« Reply #17 on: July 03, 2012, 12:48:55 am »
Hey, so I was writing this post when I realized that I can make fonts work on the 83+BE.

First of all, we need to remember that the font hook needs to be lightning fast. Basically, it has to be so fast that people don't even realize it's running. Here's why: the font hook is called for every single character that is displayed to the screen. For simple tasks like typing, only 1-5 characters are displayed at at time, but when you press clear, open a menu, or scroll a menu, up to 128 characters have to be rendered. At 100 characters per render, each .001 second that my font hook takes corresponds to 1 extra second to scroll 10 names in the program menu. (Which is enough to make you turn the hook off)

Next, we need to look at the memory setup I have to deal with. zStart is an app, which means that it is going to be executing from a flash page. We'll assume the standard situation where the font is archived so it is also on a flash page. Lastly, the location where I need to copy the font data is in the $845A region. Also, to make things worse, we're running in a really common hook, which means we can't touch any memory besides $845A which is what we're supposed to change.

So, in order to get the job done, we need to have zStart executing code, the archived font, and $845A all exposed at the same time. We have three memory blocks, $4000, $8000, and $C000. On the 84+, $4000 can have either flash or ram, $8000 can have either flash or ram, and $C000 can have any of the ram pages. Here's the setup I use to do the copying:
$4000 - zStart
$8000 - flash page of font
$C000 - ram page 1 (this allows me to virtually move $845A to $C45A)
In this position, the copying is rather easy, just stream from $8000 to $C000.

There is another way I could have done this to avoid the memory mess, and that is:
$4000 - flash page of font
$8000 - regular with zStart code copied here
$C000 - flash page 0 (this won't be used)
This works, but there are two key flaws with it: 1) This is a very common hook, so if I destroy like 200 bytes several times a second, I'm going to break a lot of stuff 2) Copying 200 bytes every character would severely slow the calculator down


So that's the reason I didn't think I could do it before. But I just figured out how I can do it. Instead of copying the font data to $845A immediately, I'll copy it into a part of the stack that I allocated, and then I can copy that back to $845A.

Next time I work on zStart, this is going to happen.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Re: RAM addresses
« Reply #18 on: July 14, 2012, 01:21:54 am »
Not sure what you said about the stack, but glad to hear ;D