Programming cross z80 calculators

From WikiTI
Revision as of 06:56, 19 April 2010 by Galandros (Talk | contribs)

Jump to: navigation, search
This article is a stub. You can help WikiTI by expanding it.


Introduction

It is a nice feature to do in your games and other programs to be able to use them across all the z80 calculators.

The difficulty to port depends on every case. In some games, it is enough changes in some graphics routines, safe ram locations and to bcalls to make it work. Some cases might be a nightmare (in practical too difficult) or simply impossible. (use strange bcalls and specific stuff)

Calculators Current Interest

Note that the TI-83+ series (TI-83+, TI-83+SE, TI-84+, TI-84+SE) are the most common worldwide. Most development is done to this series. And this calculators specifics are used as reference to what is normal feature. There are in less number TI-82, TI-83 (Regular) users. They will rejoice without a build for them. TI-85 and TI-86 are no longer produced, there is few visible development and interest on them and are deprecated.

By any means feel unmotivated or affected by the current interest, there are still old calculator enthusiasts who enjoy new stuff for their legacy calculator. Also assembling for more models is a nice thing to do.

General Advices

  • avoid b_calls (when possible, of course)
  • use a assembler that supports #if #else #endif directives (give a example on how to use)
  • use a linker capable to output all z80 calculators format (notably SPASM)
  • See in Z80 Routines a set of graphic routines to all calculators (not right now...)

Help Documentation

Safe Rams

Safe ram is simply some portions of fixed ram (re)usable to programmers without any conflict to the TI-OS. But their location and existence depend from calculator to calculator model. Here is a table to illustrate what is available or not across the z80 calculators:

This article is a stub. You can help WikiTI by expanding it.


Safe ram location / Calculator Model TI-82 TI-83 TI-85 TI-86 TI-83+/84+/SE
tempswaparea
plotsscreen

bcalls (system calls)

There are two advices to solve the bcalls across calculators: - do not use bcalls (or just a few) - use complete include files and bcall macro for each calculator model

Note that on TI-83, there is no bcall macro, you just use a normal call to a jump table.


Shells

While TI-83+ series run assembly programs without shells (called no-stub) all others require some shell or exploit to run assembly code. So knowing the shells is important for testing on emulator and release to public.

TI-82 TI-83 and TI-83+ most common shell is Ion and other compatible to it. TI-85 TI-86

Specific calculator info

Here you have important aspects of calculators, mostly hardware related.


TI-73

  • just APPS programming (?)

TI-81

  • there is no link cable, programs must be typed on the calculator
  • note again that few people own one and very few use it

TI-82

  • No Hooks

TI-85

  • memory mapped LCD (great but others don't)

TI-86

  • memory mapped LCD (great but others don't)

TI-83

  • Link port is different from TI-83+
  • there is no bcall, instead it is just a call

TI-83+

  • most usual z80 platform, compatible with TI-83+SE and TI-84+ calculators
  • APPS programming

TI-83+SE

  • CPU is around 3x faster (16 MHz) (good but not always)
  • time crystals
  • APPS programming

TI-84+/84+SE

  • CPU is around 3x faster (16 MHz) (good but not always)
  • time crystals
  • Some bad LCD can screw your beautiful graphics, use a safe fastcopy routine
  • APPS programming

Program in RAM template

#ifdef TI73
#include ti73.inc
;TI73 asm execution normally is on a APPS
#endif

#ifdef TI82
;#include ti82.inc
;depends on shell (?)
#endif

#ifdef TI83
#include ti83.inc
 .org userMem
#endif

#ifdef TI83P
#include	ti83plus.inc
 .org userMem-2
 .db t2ByteTok,tAsmCmp   ; .db $BB,$6D tokens for ASM program
#endif

#ifdef TI85
;#include ti85.inc
.org asm_exec_ram-2
 .db $8E,$28
 nop
 jp lblStart
 .dw 0
 .dw tTitle ;no idea of what this is
#endif

#ifdef TI86
;#include ti86.inc
.org asm_exec_ram-2
 .db $8E,$28 ;no idea of what this is
 nop
 jp lblStart
 .dw 0
 .dw tTitle
#endif


Start:
#ifdef TI83P
	b_call(_RunIndicOff)
	b_call(_GrBufClr)
#endif
	
	
	ret
End:
 

APPS template

;Free APPS header