Author Topic: Where does TI (84) OS store the sprite sheets for chars?  (Read 4671 times)

0 Members and 1 Guest are viewing this topic.

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Where does TI (84) OS store the sprite sheets for chars?
« on: March 07, 2015, 01:24:17 pm »
I wanted to make a custom text drawer, overall better then  the defualt OS one. Ime guessing that the OS stores the sprite sheet with all the symbols on it somewhere in mem ,and as Google sherches revealed nothing, does anyone know the address? 
-German Kuznetsov
The impossible chemical compound.

Offline Iambian

  • Coder Of Tomorrow
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 739
  • Rating: +216/-3
  • Cherry Flavoured Nommer of Fishies
    • View Profile
Re: Where does TI (84) OS store the sprite sheets for chars?
« Reply #1 on: March 07, 2015, 01:54:10 pm »
No. The OS's font table is embedded in the OS itself and its address varies depending on what version it is since it's compiled with the OS as part of a single file.

To get this information, you'll need some disassembly tools and an eye to search the romcall tables (located at the top of page 0x7B) for where PutC is, then disassemble the routine to find out where the font table is.

For the Ti-84 Plus (SE), you'll want to load Calcsys. If you're using the CSE, you'll need Micros.
A Cherry-Flavored Iambian draws near... what do you do? ...

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Where does TI (84) OS store the sprite sheets for chars?
« Reply #2 on: March 07, 2015, 04:43:30 pm »
Not sure exactly what you are wanting to do, but if you simply want to use a custom font Zstart can do that. Latest version: https://www.omnimaga.org/ti-z80-calculator-projects/zstart-an-app-that-runs-on-ram-clears/msg361451/#msg361451

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Re: Where does TI (84) OS store the sprite sheets for chars?
« Reply #3 on: March 07, 2015, 08:40:05 pm »
The exact thing I wanted to do was instead of using the axe text() command to use a custom one that could draw to both the front and back axe buffer. If I had a pointer to the fonts, I could use the axe pt-on() command to draw the chars.
-German Kuznetsov
The impossible chemical compound.

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Where does TI (84) OS store the sprite sheets for chars?
« Reply #4 on: March 07, 2015, 09:28:06 pm »
So basically you want to be able to write text to the back buffer or front buffer? I'd suggest just creating your own font as sprites in axe and then you can put them on whichever buffer you like.

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Where does TI (84) OS store the sprite sheets for chars?
« Reply #5 on: March 07, 2015, 09:41:03 pm »
Did you know that one of the features of my GrayLib library is the ability to print text with any combination of 3- or 4-level grayscale foreground and background colors? If you're making a grayscale program, you might be interested in the library for other reasons as well.

But if that doesn't float your boat, you probably want to look into the _LoadPattern, _Load_SFont, and _Load_LFontV system calls. The first two are documented in TI's 83psysroutines.pdf and the third is documented on WikiTI.

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Re: Where does TI (84) OS store the sprite sheets for chars?
« Reply #6 on: March 08, 2015, 06:35:53 pm »
So coming from java i might need some help understanding this asm:
When looking at the asm at the "example" under Load_SFont i see something like this.
Code: [Select]
LD          A,'F'
LD          L,A 
LD          H,0
ADD         HL,HL
ADD         HL,HL
ADD         HL,HL; * multiply HL by 8
B_CALL      Load_SFont ;sFont_record =03,00,02,04,06,04,04,00

So now the HL register contains a pointer to the bitmap of the letter 'f'; one that i could render with axe? If that is so, well big thanks! ;D (altho i might need some help converting it to hex). If not then idk where to go next.
Update:
I guess this is an axe thing now, but i tried the following axe code:
Code: [Select]
'F' .Load the number corresponding to "f" into HL (axe's "ans" variable)
Asm(292929) .Multiply by 8
Asm(CD806F) .BCall Load_LFont
->A .Store to A
ClrDraw
Bitmap(0,0,A)
DispGraph
Repear getKey
End
This just displays things that look nothing like the letter "f".
 ._.
« Last Edit: March 08, 2015, 07:07:39 pm by c4ooo »
-German Kuznetsov
The impossible chemical compound.

Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Where does TI (84) OS store the sprite sheets for chars?
« Reply #7 on: March 08, 2015, 08:56:22 pm »
The approach looks correct. But some specifics are off.

Firstly, B_CALL(_Load_LFontV) should be assembled as ED6F80. It's a little surprising that what you had didn't just crash your calculator, as it calls a somewhat random point of RAM.

Secondly, although documentation and people may refer to the data copied to RAM as a font "bitmap," it's not in a format to be displayed by Axe's Bitmap() command. The first byte is the width of the character, which is variable for the small font (but often 4) and fixed as 6 for the large font. The next 7 bytes are the character "bitmap," where each byte represents a row, and in each byte, the image data is in the lowest bits. So to display this with Axe, you'd at the very least want to add a zero as an 8th byte of data so you can display it with a normal sprite command, and then due to the data being in the lowest bits, you'd have to adjust the x coordinate by a formula like X-8+width.

At least, I hope that information's correct. I haven't tried any of this, but this would be my best guess as to doing it correctly.
« Last Edit: March 14, 2015, 12:11:52 pm by Runer112 »

Offline Digital

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 107
  • Rating: +0/-0
  • 10101
    • View Profile
    • Digital's Hp
Re: Where does TI (84) OS store the sprite sheets for chars?
« Reply #8 on: March 18, 2015, 02:19:02 pm »
@Runer112 : wait bcall(_load_lFontV) is assembled as EF6F80 isn't it?
@c4ooo instead of asm(292929) you can write *8 it works too.

whith this changes this code works pretty fine.
I'm sorry if i might make some mistakes, I'm German so English isn't my first language. Please correct me :)