Detecting ROM Version


[Prev][Next][Index][Thread]

Detecting ROM Version



Let's say I want to auto-detect what ROM version (TI-82) someone has.
Could someone send me some (preferably tested) source code.  This is vital
information for the project I'm working on.  So far I've got nothing except
a half a dozen calculator crashes.  Here is my best lead for source code:

#include "ti-82.h"

.ORG 0
.DB "Test ROM Ver.",0

  ROM_CALL(CLEARLCD)
  ld hl,0              ; 0 -> l, 0 -> h
  ld (CURSOR_POS),hl   ; l -> (CURSOR_ROW), h -> (CURSOR_COL)
  ld A, %10001111      ; Switch to ROM page 7
  out (2), A
  ld A, ($7FFF)        ; Now A should have the version byte
                       ; (note, on the TI-85, it's not the same as the
                       ; actual number, so you'll have to have a list of
                       ; equivelancies in your program).
  push af              ; Temporarily store A on the stack
  ld A, %10001000      ; Switch to ROM page 0
  out (2), A
  pop af               ; Recall A from the stack
  ROM_CALL(TX_CHARPUT) ; Display A

KeyLoop:
  ROM_CALL(_getkey)
  cp $40
  ret Z
  jr KeyLoop

.END

The program seems to work fine until I attempt to exit, at which point it
locks up.  The lines which switch to ROM page 0 are probably incorrect
because I don't know which ROM page to return to.  Any help would be
appreciated.

TIA,
Thomas J. Hruska

|----------------------------------------------------|
|             Shining Light Productions              |
|      "Meeting the needs of fellow programmers"     |
|                                                    |
|   C/C++ programs                                   |
|   QBasic programs                                  |
|   JavaScript                                       |
|   TI-Basic                                         |
|   HTML                                             |
|                                                    |
| Search for our web site at                         |
| www.geocities.com/SiliconValley/Heights/8504/      |
|                                                    |
| We use a dynamic web server for most of our        |
| documents!!!                                       |
| Soon to go to a full JavaScript 1.1 web site!      |
|----------------------------------------------------|