senior_falcon Posted June 28, 2017 Share Posted June 28, 2017 (edited) 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 Edit>Debugger 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 June 28, 2017 by senior_falcon 7 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted June 22, 2018 Share Posted June 22, 2018 RXB 2018 now has CALL VDPSTACK(address) so you can move the VDP STACK to a desired location. 1 Quote Link to comment Share on other sites More sharing options...
kl99 Posted August 4, 2019 Share Posted August 4, 2019 I just discovered this possibility that might be useful in a certain situation. You can not only use RUN inside a program in combination with some FILE to load another file. You can also use RUN inside a program with a certain Program Line. The difference to a GOTO with the same Program Line is that all variables are reintialized. Extended Basic 100 A=1 110 RUN 130 120 B=2 130 C=3 140 PRINT "A : ":A;" REINITIALIZED BY RUN" 150 PRINT "B : ":B;" SKIPPED LIKE WITH GOTO" 160 PRINT "C : ":C RUN leads to the following output A : 0 REINITIALIZED BY RUN B : 0 SKIPPED LIKE WITH GOTO C : 3 3 2 Quote Link to comment Share on other sites More sharing options...
RXB Posted August 5, 2019 Share Posted August 5, 2019 RXB 2019 also has CALL PLOAD(B,"DSK1.PNAME") for example you could load into memory at >B000 new lines to an XB program while running a XB program. As long as that new section does not have any new variables or strings not initialized or commands not checked by prescan it should work fine. Thus you could replace 4K of lines in a program and page in as many as you want from a running program. (Without needing RUN that would erase all variables values.) Of course you have to carefully construct the XB program so the boundary lies exactly at >B000 but a REM line can pad it to proper size. 1 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.