Information about the TI83 memorymapper (v1.0) ============================================== Copyright (C) 2000 Erik Mansson (goodbyte@goodbyte.cjb.net) http://www.goodbyte.cjb.net If you have any questions, corrections or additions plase contact me at the address above. The document may freely be disturbuted in unmodified form. This information was collected during rainy day in June, when I tried to write a font renderer, using the build-in variable font. I had major problems getting _sfont_len to work, and finaly I decided to dissicate _vputmap to gain some information about how it works. As a result I stumbled accress _far_call which lead to some new aspects about the way the TI83 works (at least to me). Well here we go! The TI83 memory is divided into three parts: 0x0000-0x3FFF static mapped rom (page 0) 0x4000-0x7FFF memory mapped rom 0x8000-0xFFFF ram The total size of the TI83 rom is ~256kb, and to access all this memory you need to change the current page in 0x4000-0x7FFF. There is a total of 16 pages (page 0 is static mapped and not interesting). To set current page, send the low three bits of the page index to port 2, with bits 4-7 equal to 10001b (arithmetical-or with 0x88). The high bit is sent to port 0, in bit 5, with bits 6 and 7 high (has to do with the configuration of the link port). Ex. Set active page to 3 ld a, 3 | 88h out (2), a ld a, 0C0h out (0), a There is one nice ROM function to make calls to functions in other pages easier. I don't know TI's name, but i call it _far_call and it's located at 0x2ECB. What _far_call does is that it reads the address and page after the function call and jumps to that address instead. Look at the following code for a call to _vputmap: _redir_vputmap: call _far_call .dw 58EFh ; The address of code for _vputmap... .db 1 ; ... which is placed in page 1 _far_call will change to page 01 and jump to address 0x58EF, but it will also remember current page and modify the stack so _vputmap will return to another function (0x2F0E after _far_call) which will restore the old page and return to the function that called _redir_vputmap! One warning about using _far_call, place your redirections in functions that don't use the stack. Consider following example: push hl call _far_call .dw 58EFh .db 01h When 58EF has executed, it will return to the address in HL! Off-topic discussion about the variable font ============================================ Have any of you tried to use _sfont_len? Even if you have found the message on ticalc.org, saying that hl should be multiplied by eight, have you managed to read the fontdata from (hl)? The problem here (which not is mentioned in the documentation) is that the fontdata is contained in another page (page 3), so you will end up reading in the function call redirection tables. Not good. But if you just switch to page three, you have all the fontdata at your fingertips (The fontdata struct is BYTE len, BYTE font[6], BYTE 0) where font[6] is the sprite data and len is number of used bits from left in the sprite). The only thing to remember is to restore back to the "default" page before calling any other function, which btw. is page 12)