Newsgroups: comp.sys.ti
Subject: German GRAM-Carte
From: nouspike@cmu.unige.ch (Thierry Nouspikel)
Date: 22 Dec 92 19:25:52 +0200
Organization: University of Geneva, Switzerland

As a continuation of Joe's discussion of GRAM devices, I shall describe here
the german GRAM-Carte. There are 2 kinds: 512K and 128K, I have the 128K, so
that's the one I'll discuss here.


HARDWARE

The 128K are splitted in two 64K GRAM blocks that map at >9800 and >9820.
This can be changed with DIP switches (in case you have several cards in the PE
box) but the two blocks are always >0020 apart.
The lower 24K (up to >5FFF) are normally turned off, not to interfere with
console GROMS, but they can be turned on via CRU and their drivers should
easily override the GROMs.

The second block is also used as "cartridge" RAM: a fixed 8K bank at >6000 and
a software selectable 8K bank at >7000. Sixteen such banks can be selected (one
being the same as the fixed bank) via CRU and writting to >6000 (bank 0), >6002
(bank 1), etc.

Thus one can have 2 modules loaded at the same time, one of them with possible
RAM banks (the first banks correspond to the end of the 2nd block GRAM).

CRU map (The card CRU address is set with a DIP switch, normally >1700)
Bit 0: 0=Card ROM disable  1=ROM enable (also LED on/off)
Bit 1: 0=RAM banks enable  1=Disable
Bit 2: GRAM enable2 ?? Enable second block ??
Bit 3: 0=Reading in GRAM enable 1=Disable (writing is always enabled)
Bit 4: 0=RAM bank write protect 1=Write enable
Bit 5: 0=Console GROMs 1=Card GRAMs at >0000-5FFF
Bit 6: 0=Switchable banks 1=Fixed bank (1 out of 4, selected with DIP switch)
Bit 7: 0=Switching enable 1=Disable

The card also has an 8K RAM at >4000 with onboard software.
Namely, a power-up routine that checks for the presence of a cartridge and
turns the card on if there is none (via CRU).

A loader that can either be called from basic with CALL GRAM of selected from
the main menu (press 1 for TI Basic, 2 for Gramcard >9800, 3 for review module
library: this checking the >9820 domain). This loader can:
 - Dump GROMs in memory-image files (with a6 bytes header as follow:
   >A5A5 / GRAM Address / Size in bytes).
 - Dump cartridges ROMs in memory-image files (with a different header:
   >5A5A / Bank code (>6000, >6002...) / Size in bytes). The file will be
   loaded at >6000 if the size is bigger than >2000, otherwise it will be
   loaded at >7000 (in the selected bank).
 - Load GRAMs and RAMs from the above files.
 - Load GRAMs with a GPL-assembler object file.
 - Load banks with a 9900 assembler object file (no REF/DEF, non-relocatable).
 - Turn on/off the lower 24K GRAM.
 - Load several of the above files, listed in a DV80 load file.

A memory editor, allowing for manipulation of the 3 types of memory (cpu,G, vdp)
that can be called from basic by CALL EDITMEM (VERY usefull).

An utility, called with CALL MODULE, that turns basic programs into modules to
be loaded and executed from the GRAM card (such programs cannot be edited any
more).


SOFTWARES

To my knowledge there is little GRAM-Card specific softwares: the card is
essentially used to emulate cartridges. However it has lots of interesting
possibilites:

1) Using the card to store data. This is done by the RAM-disk utility (see
below) and by my MIXIMAGE program, that can store up to 8 bit-mode images in the
GRAM-Card (plus 2 in cpu memory).

2) Using the card to store assembly language programs, that can then be dumped
into cpu memory and executed (this requires a 3 lines GPL program). This way,
you don't need to load your favorite programs from disk, every time.
I modified the following programs in this way: DM1000, DiskU, TI-Writer (editor
and formatter in the card), EA (editor, assembler plus my GPL assembler in the
card) and MG's Advanced Diagnostics.
Since most of this is copyrighted stuff, I won't state here that I'm willing to
communicate these to anybody requesting them, but...

3) Loading real GPL programs in the card. Two came with the card I bought:
- A RAM-disk utility, that stores one (1) file in the card. Unfortunately this 
  only works with basic (or XB) since most assembly programs don't search the
  GROM headers for DSR.
- A converter (conversion between various types of Basic? I never used it, no
  manual was available).
- I'm currently completing a GRAM-based disassembler, written in GPL (not to use
  any cpu memory). It thus can disassemble the whole 64K range of cpu memory,
  including card ROMs and cartridges banks. On Andy Webster's suggestion, I'm
  trying to adapt it so that it can also disassemble RAMBO banks. Since I don't
  have a RAMBO device for the moment being, the testing and bug-fixing will be
  done by Andy, and he'll have to do a Gram-Kraker version, too. 
  (So you'll probably be able to get the soft directly from him, right Andy?).

I'm also writting an extended loader that should load and link both GPL and 
9900 (including REF/DEFs, relocatable code and bank-loading).

The only problem with GPL is that you need a special device to load it, and
there are not that many people (at least in Europe) who own a GRAM-Card or a
Gram-Kracker. So programers writing a general use program, rather write it in
assembly language! 

-- 
"Un technocrate, c'est un mec,	  !	Thierry Nouspikel, MD
 tu lui poses une question,	  !	Genetics and Microbiology Department
 quand il a fini de rpondre	  !	CMU, University of Geneva
 tu comprends plus ta question!"  !	1211 Geneva 4, Switzerland
				  !	E-Mail:NOUSPIKE@cmu.unige.ch
 Michel Colucci dit "Coluche"	  !	Fax: 41/22/329.34.04