Platform TI Calculators - z88dk/z88dk GitHub Wiki
Hardware summary
TI82, TI83
- 6MHZ z80
- 32kb RAM
- Display: 96x64 pixels or 16x8 characters
TI83+
- 6MHZ z80
- 32kb RAM
- 160kb Flash ROM
- Display: 96x64 pixels or 16x8 characters
TI85
- 6MHz z80
- 32kb RAM
- Display: 128x64 pixels or 21x8 characters
TI86
- 6MHz z80
- 128kb RAM
- Display: 128x64 pixels or 21x8 characters
Quick start
The TI calculators port has been thought to get a common compatibility layer. The VT/ANSI library features the same text resolution for all the platforms, permitting the applications to be easily ported.
zcc +ti82 -lm -o adv_a -create-app adv_a.c
zcc +ti83 -lm -o adv_a -create-app adv_a.c
zcc +ti83p -lm -o adv_a -create-app adv_a.c
zcc +ti85 -lm -o adv_a -create-app adv_a.c
zcc +ti86 -lm -o adv_a -create-app adv_a.c
or, for special text support...
zcc +ti82 -lndos -O3 -create-app -pragma-need=ansiterminal -pragma-define:ansicolumns=24 -o adv_a adv_a.c
..being 'ansicolums' an optional parameter (normally set to 32) which for the TI82..TI84 models can be 12, 13, 16, 19, 24 or 32.
On the TI85..TI86 models you can choose between 16, 18, 21, 25, 32 and 42.
Supported Calculators
Every calculator has specific hardware and software requirement.
Some calculator is able to run machine code directly, some is not; however we suggest to use always a shell for your calculator. It is a sort of "operating system" making your calculator being capable to run machine code programs.
You can download a suitable shell at ticalc.org.
TI82
To compile programs for this platform you need to specify the "+ti82" parameter. The only supported shell is "CrASH".
TI83
To compile programs for this platform you need to specify the "+ti83" parameter. The default supported shell is "ION", but you can change this behaviour by passing "-startup=X" parameter, where 'X' can be:
1 - Ion; Ti-Explorer (default)
2 - Venus;
3 - ZES;
4 - Anova; SOS
5 - Ti-Explorer, AShell; SOS, Anova (same as 6)
6 - AShell, Ti-Explorer; SOS, Anova (same as 5)
7 - SOS; Anova
8 - Venus Explorer; Venus
9 - Ion, Ti-Explorer; ZASMLOAD, plain TIOS
10 - Plain TIOS, ZASMLOAD
Types can be specified also with the "-subtype=" command line option.
Valid values are (referred to the table above):
1 - venus
2 - zes
3 - anova
4 - tiexp
5 - ashell
6 - sos
7 - venusexp
8 - ion
9 - asm
External resources
Assembly programming notes on WikiTI
TI83 Plus
To compile programs for this platform you need to specify the "+ti83p" parameter. The default supported shell is "ION", but you can change this behaviour by passing "-startup=X" parameter, where 'X' can be:
1 - Ion (default)
2 - MirageOS without quit key
3 - (reserved)
4 - TSE Kernel
10 - asm( executable
Types can be specified also with the "-subtype=" command line option.
Valid values are (referred to the table above): mirage tse asm app_one_page app_first_page app_sub_page
Due to possible differences in the backup tools your TI calculator (or emulator) may require a slightly different file; if in trouble we suggest to try adding "-Cz--oldfmt" to your zcc command line.
Flash applications
Flash applications, or just apps, are another way to compile your programs for the TI83 plus and TI84 plus. The primary difference between normal RAM programs and flash apps are that rather than being stored as calculator variables, flash apps are cryptographically signed and stored on flash storage. The upside to this is that you can make much larger programs, the downside is that the user only has a relatively small amount of applications that can be installed on their calculator.
There are two types of apps: multi-page, and single-page apps. The calculator, due to the nature of a 16-bit system, can't contain large apps entirely in memory, so it splits your program in 16kb segments, called pages. If your program is larger than 16kb, you must split it up into multiple pages.
Multi-page applications
An example of a multi-page app is available in examples/ticalc/multi_page_flash_app. Because of the non-user accessible paging mechanism, each bank needs to be compiled to a binary before inclusion into the multi-page application.
Furthermore, the TI paging mechanism is quite slow, and although calling a __banked
function within the same page is functional, it is not recommended. Alternatively, simply using a __banked
function to call a normal function is a workaround to prevent the need to involve the TI paging mechanism for normal function calls.
Care should be taken when using non-const static variables - the available RAM has to be shared between banks and can't be laid out automatically so usage of -pragma-define:CRT_ORG_BSS
is required.
External resources
Assembly programming notes on WikiTI
TI85
To compile programs for this platform you need to specify the "+ti85" parameter. The default supported shell is "Rigel", but you can change this behaviour by passing "-startup=X" parameter, where 'X' can be:
1 - Rigel (default)
3 - PhatOS (unstable)
Note that some TI85 shell is able to run some program in TI83 format, but it won't take benefit of the wider screen.
TI86
To compile programs for this platform you need to specify the "+ti86" parameter.
The default supported shell is "ION", but you can change this behaviour by passing "-startup=X" parameter, where 'X' can be:
1 - LASM (default)
2 - ASE, Rascal, emanon, etc.
3 - zap2000
4 - emanon
5 - Embedded LargeLd - !!!EXPERIMENTAL!!!
10 - asm() executable
Types can be specified also with the "-subtype=" command line option.
Valid values are (referred to the table above): ase zap2000 emanon largeld asm
#pragma parameters
Depending on the Shell being used it might be possible to export further "special" informations, such as an icon or an application title. This can be done placing #pragma directives directly in the C source program.
Application name
To make the shell display a specific name:
#pragma string name `<application name>`
This will work on:
-
Anova
-
AShell
-
ASE
-
CrASH
-
Emanon
-
Ion
-
MirageOS
-
PhatOS
-
Rascal
-
Rigel
-
SOS
-
Ti-Explorer
-
TSE Kernel
-
Venus
-
Venus Explorer
-
Zap2000
Icon
Some shell displays an Icon associated to the application, normally near its name; when required Z88DK shows a default picture, a small "C+" logo, but it can be replaced with a custom one.
Icons might be handled in slightly different ways depending on the Shell. Some of them require 8x8 icons, but sometimes the resolution is different.
To make the shell display the 8x8 smiley icon:
#pragma data icon 0x3C, 0x42, 0xA5, 0xA5, 0x81, 0xA5, 0x5A, 0x3C ;
This will work on:
-
AShell (8x8)
-
Anova (8x5)
-
Emanon (7x7)
-
SOS (8x8)
-
MirageOS (15x15 - see below)
-
TI-Explorer (8x8)
-
Venus (7x7)
-
Venus Explorer (7x7)
-
Zap2000 (8x8)
On TI83 Plus, an icon for MirageOS can be defined as follows:
#pragma data mirage_icon `<30 bytes: data for 15x15 pixels>` ;
Links
Video:Programando en C para la TI-82 STATS (TI-83)