Jump to content


TI Extended BASIC (Stuff)

TI-99/4A XB

26 replies to this topic

#26 senior_falcon OFFLINE  



  • 1,516 posts
  • Location:Lansing, NY, USA

Posted Wed Jun 28, 2017 6:44 AM

Using Classic99's debugger and Rich's source code I found the XB code where the stack pointers are set.  At Grom >690B the code is BF240958 BD6E24 BDA3886E or in human-speak:
DST  >0958,@>8324    Initialize base of value stack
DST  @>8324,@>836E    Initialize value stack pointer
DST  @>836E,V@>0388   Initialize pointer in VDP too
You can see that the XB cart is hard coded to always set the stack to be >0958.
By making a minor change to the grom code at >690B the programmer can have the ability to reserve VDP ram by changing  the base of the value stack. 
DST V@>0958,@>8324 
This code copies the value stored in V0958 into >8324.  If the value at >0958 is >095A then the stack space is as large as it can be: just 2 bytes less than standard XB.
To try this out in Classic 99:
Press 2 for Extended BASIC
Press F1 to freeze the program
Where the cursor is flashing:
G690B=BD apply  \
G690D=A9 apply    Choose yes when asked to modify grom 
G690E=58 apply  / 
V0958=09 apply
V0959=58 apply
Press F1 to unfreeze XB. Now any value you put at V0958 will change the stack pointer and reserve vdp memory.  Try putting >1820 into V0958 and now VDP ram from >095A to >181F is reserved - XB will not touch it. (XB256 and Missing Link use this technique but with an interrupt routine so they will work with a standard XB cartridge.)
If you wanted to permanently modify XB you would need to change the grom code as above and add 5 bytes of code early in XB startup to put >095A into V0958. (DST >095A,V@>0958) 
Other than that nothing else should be needed. Since anyone using this would be programming in assembly anyway, there is really no need for a new CALL.  It is simple enough to write an assembly subroutine such as CALL LINK("RESVDP",6176) to change the value at V0958.

Edited by senior_falcon, Wed Jun 28, 2017 11:16 AM.



    River Patroller

  • 3,602 posts
  • Location:Vancouver, Washington, USA

Posted Thu Jun 21, 2018 8:25 PM

RXB 2018 now has CALL VDPSTACK(address) so you can move the VDP STACK to a desired location.

Also tagged with one or more of these keywords: TI-99/4A, XB

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users