+OLD CS1 Posted May 3, 2021 Share Posted May 3, 2021 Another post indicates that checking the value at -31952 (>8330, I believe) will indicate the absence of 32k RAM if the return is 55. However, I have now tested this on real hardware and in Classic99 and I get 255 for 32k RAM present but that changes to a different value once a program is loaded. Classic99 returned 55 then 29 after a program loaded (32k disabled,) while one console returns 63 with no 32k attached. I assume there is an accepted "standard" for detecting 32k from Extended BASIC -- remembering that I can neither LOAD values into 32k space nor CALL INIT without incurring a fatal error. I tried catching a CALL INIT error with ON ERROR, but the RETURN sends execution right back to the bad statement. I also tried some other fancy shenanigans to no avail. 1 ON ERROR 100 :: ON BREAK NEXT 2 CALL INIT 3 PRINT "SUCCESS" 4 STOP 100 CALL ERR(A,B,C,D):: PRINT A;B;C;D :: BREAK 2 :: RETURN Arrrr Extended BASIC... she be a harsh mistress. 2 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted May 3, 2021 Share Posted May 3, 2021 (edited) CALL PEEK(-31860,A,B) CALL PEEK(-31868,A,B) Should be 255,231 with memory expansion; 0,0 if no memory CALL INIT CALL LOAD(-31868,0,0,0,0) turns off memory expansion as far as XB is concerned. Programs will run from VDP memory, but you can still load assembly support! (Edit) It is -31868. You really only need to look at the first byte. If A=0 then no memory expansion. Edited May 4, 2021 by senior_falcon 1 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted May 3, 2021 Author Share Posted May 3, 2021 @senior_falcon I will give it a try, thank you. This also means I have to release an update to my last game. ::sigh:: 2 Quote Link to comment Share on other sites More sharing options...
atrax27407 Posted May 3, 2021 Share Posted May 3, 2021 This might be of help. CALL LOADS.pdf 1 1 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted May 3, 2021 Author Share Posted May 3, 2021 @atrax27407 Tah. This is where I found the 55 value I was using, but I see I missed other possibilities in it. "-31952,X IF x=55 then memory expansion is off else it is on." 1 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted May 3, 2021 Share Posted May 3, 2021 Dumb fingers. It should be CALL PEEK(-31868,A,B) 1 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted May 4, 2021 Share Posted May 4, 2021 4 hours ago, atrax27407 said: This might be of help. CALL LOADS.pdf 269.02 kB · 6 downloads Man, where was this document in 1985? 1 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted May 4, 2021 Author Share Posted May 4, 2021 1 hour ago, TheBF said: Man, where was this document in 1985? Scattered around various user group newsletters. I recall a few example programs in ours. But it appears the only two PEEKs in the document regarding 32k detection are incorrect. 1 Quote Link to comment Share on other sites More sharing options...
atrax27407 Posted May 4, 2021 Share Posted May 4, 2021 I think there was an extensive list in "The Smart Programmer" by Miller's Graphics and a bunch of them appeared in MICROpendium as well. The one I posted is a copy of several lists that were thrown together into a single list. 1 Quote Link to comment Share on other sites More sharing options...
Casey Posted May 4, 2021 Share Posted May 4, 2021 I think this works the way you wanted your example program to work? 1 ON ERROR 100 2 CALL INIT 3 PRINT "SUCCESS" 4 STOP 100 CALL ERR(A,B,C,D)::PRINT A;B;C;D::RETURN NEXT On real hardware, without 32K, this prints the 4 error numbers, then prints "SUCCESS" and stops. With 32K, it only prints SUCCESS. 1 1 Quote Link to comment Share on other sites More sharing options...
+OLD CS1 Posted May 4, 2021 Author Share Posted May 4, 2021 2 hours ago, Casey said: RETURN NEXT Sunnuva gun! I completely forgot about that construct. Yes, that would work as well to set a flag for the 32k present or not (the assumption being that CALL INIT will return a * SYNTAX ERROR.) 3 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted May 4, 2021 Share Posted May 4, 2021 Again: 10 CALL PEEK(-31868,X)::IF X=0 THEN PRINT "NO 32K" ELSE PRINT "32K" This will always work and is about as simple as it can be. 4 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.