Difference between revisions of "Myarc Extended BASIC II"
Stephen Shaw (talk | contribs) (→Requirements: add note re Myarc XB and Funlweb 4 workround re cartridge header) |
Stephen Shaw (talk | contribs) m (→Running DF80 machine code: improve clarity) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 20: | Line 20: | ||
PAGE 4: MORE basic interpreter and the value stack. | PAGE 4: MORE basic interpreter and the value stack. | ||
As the supplied system disk is referenced you | As the supplied system disk is referenced often, you can improve matters by copying it to a ramdisk in the 512k ram card for much greater speed. In VN 2.11. the file 128K OS instead of slavishly loading everything every time after a QUIT, checks memory to see what is there. In general, provided you have not switched the ram card off, the system will only need to reload two files from the system disk,. a great saving in time! | ||
===CASSETTE INTERFACE=== | ===CASSETTE INTERFACE=== | ||
Cassette handling has not been included possibly as a result of differing VDP mapping | Cassette handling has not been included possibly as a result of differing VDP mapping | ||
===Running Funlweb system - workround=== | ===Running [[Funlweb]] system - workround=== | ||
Myarc 128K-OS always writes its boot header and code into cartridge RAM on power-up, even if the 128K-OS is NOT enabled. This destroys anything else you want to keep in your Cache Card, DEBUG for instance or FWB even. | Myarc 128K-OS always writes its boot header and code into cartridge RAM on power-up, even if the 128K-OS is NOT enabled. This destroys anything else you want to keep in your Cache Card, DEBUG for instance or FWB even. | ||
Line 41: | Line 41: | ||
An undocumented feature you will like- remember TI's canard that you could not have sprite automotion in bit map mode? This is repeated in the Myarc XB manual I have - but in truth. you CAN switch Myarc XB to bit map mode. and then call sprites with auto-motion. Neat. | An undocumented feature you will like- remember TI's canard that you could not have sprite automotion in bit map mode? This is repeated in the Myarc XB manual I have - but in truth. you CAN switch Myarc XB to bit map mode. and then call sprites with auto-motion. Neat. | ||
====Example plotting routine==== | |||
The program below is a routine for a chaotic graphics plot, and really does take a very long time to finish! The end result is interesting as total order, represented by a single line, becomes total chaos after repeated bifurcation. | |||
100 CALL GRAPHICS(3) | |||
110 ! ORBITDGM PROGRAM | |||
120 ! | |||
130 FOR C=-2 TO 0.25 STEP .00625 | |||
140 X=0 :: M=160*(C+2) :: FOR I=0 TO 200 | |||
150 X=X*X+C :: IF I<50 THEN 170 | |||
160 N=(180/4)*(2-X) :: CALL POINT(1,X,Y) | |||
170 NEXT I | |||
180 REM | |||
190 CALL WRITE(0,160,80,"* done *") | |||
200 REM | |||
210 STOP | |||
===VIDEO RAM ACCESS=== | ===VIDEO RAM ACCESS=== | ||
You now have PEEKV and POKEV available. | You now have PEEKV and POKEV available. | ||
Line 51: | Line 68: | ||
You may set a default disk drive and subsequently omit "DSK1" when using OLD and SAVE or RUN. | You may set a default disk drive and subsequently omit "DSK1" when using OLD and SAVE or RUN. | ||
===Running TI | ===Running [[TI BASIC]] programs=== | ||
Because more VDP is available, Myarc XB can load AND run those very long TI Basic programs that will NOT load in TI XB. You may need to use CALL FILES(1) to load them from disk - but a clever bit of sidestepping allows the Myarc XB to load a longer TIB file than TI's XB can. Also the TI Basic extra character sets lacking in TI XB ARE available in Myarc XB. | Because more VDP is available, Myarc XB can load AND run those very long TI Basic programs that will NOT load in TI XB. You may need to use CALL FILES(1) to load them from disk - but a clever bit of sidestepping allows the Myarc XB to load a longer TIB file than TI's XB can. Also the TI Basic extra character sets lacking in TI XB ARE available in Myarc XB. | ||
===Running TI Extended BASIC programs=== | |||
===Running TI [[Extended BASIC]] programs=== | |||
Generally no problems apart from some commercial programs that have used the PROTECTED flag AND also test the memory location to ensure you haven't removed it. Myarc XB uses a different location so such checks will fail and the program assume you have hacked it. | Generally no problems apart from some commercial programs that have used the PROTECTED flag AND also test the memory location to ensure you haven't removed it. Myarc XB uses a different location so such checks will fail and the program assume you have hacked it. | ||
Line 111: | Line 129: | ||
DF8O files written for TI XB may require you to use a utility program to reset VDP registers, or may not function at all. | DF8O files written for TI XB may require you to use a utility program to reset VDP registers, or may not function at all. | ||
Assembly programs written specifically for TI XB module may not function however due to different mapping. If the DF80 code will run with Editor Assembler or Mini Memory it should run without problem. Myarc have provided an additional DF8O utility program called TIVDP which sets the VDP registers to correspond to TI XB and using this seems to solve most DF80 problems. | |||
The format is: | The format is: | ||
Line 133: | Line 151: | ||
Also in COMMAND MODE you can omit quotation marks when using OLD, SAVE and RUN, so OLD DSK1.FILENAME is OK. However you must still use quotation marks when using PRINT or DELETE from the command line. | Also in COMMAND MODE you can omit quotation marks when using OLD, SAVE and RUN, so OLD DSK1.FILENAME is OK. However you must still use quotation marks when using PRINT or DELETE from the command line. | ||
In TI Extended Basic if you type PRINT VAL("") you will receive an error. In Myarc Extended Basic you will receive a 0 (zero). | |||
TI FORTH- Do not use the original TI loader for Ed/As. it will not function. Instead use the later modification for mini/memory (the Universal loader). Return to OS with MON may not work. | TI FORTH- Do not use the original TI loader for Ed/As. it will not function. Instead use the later modification for mini/memory (the Universal loader). Return to OS with MON may not work. |
Latest revision as of 20:51, 5 January 2015
MYARC XB has had a number of versions, the last and definitive version being Vn 2.12.
Requirements
Summary
Myarc Extended Basic 2 has the disadvantage of REQUIRING the Myarc 512k ram card, as the Ex Bas itself resides in RAM. This does allow for some increase in speed. Myarc XB is in the form of a module which contains a loader plus ram, a disk, and a chip for the ram card.
The MODULE contains ram (>6000 to >8000) into which the memory management routines go. These are needed as there is a lot of paging going on.
In 128k of your 512k ram card there are four pages of 32k each:
Looking at the 24k area >A000 to >FFE8 first: PAGE 1= EX BAS PROGRAM PAGE 2= VARIABLES PAGE 3= STRINGS PAGE 4= Basic Interpreter
In the 8k area >2000 to >4000. you have:
PAGE 1: For your machine code routines PAGE 2: Basic interpreter again. and a small area of what Myarc call RAM DISK. PAGE 3: routines for VDP and Speech. and i/o buffers PAGE 4: MORE basic interpreter and the value stack.
As the supplied system disk is referenced often, you can improve matters by copying it to a ramdisk in the 512k ram card for much greater speed. In VN 2.11. the file 128K OS instead of slavishly loading everything every time after a QUIT, checks memory to see what is there. In general, provided you have not switched the ram card off, the system will only need to reload two files from the system disk,. a great saving in time!
CASSETTE INTERFACE
Cassette handling has not been included possibly as a result of differing VDP mapping
Running Funlweb system - workround
Myarc 128K-OS always writes its boot header and code into cartridge RAM on power-up, even if the 128K-OS is NOT enabled. This destroys anything else you want to keep in your Cache Card, DEBUG for instance or FWB even.
To return to MYARC XB from FUNLWEB 4, do not use the RETURN TO XB option as that only works with TI XB. Instead go to DM1000 and choose the CART RAM option- this will cause MYARC XB to be reloaded from disk (do keep the Myarc disk in place for this!) as the Myarc module retains the loading routine all the time as noted by Tony.
Added features
Graphics
The Myarc XB has good true bit map graphics, variable screen windowing with both 32 and 40 column text modes. CALL CHAR is available from 0 to 255 and you may have 32 sprites. There is a full range of bit map graphics commands- draw, drawto, circle, point, rectangle, fill, write, dcolor, and uniquely you can determine if a pixel is on or off.
The 32 and 40 column screens use identical commands, except for colour: in 40 column mode text colour is set by using two parameters with CALL SCREEN
You have available 256 definable characters in 32 character sets - and 32 sprites. CALL CHARSET restores characters 32 to 95 only, maintaining compatability. but CALL GRAPHICS(N) restores all predefined characters. as well as restoring default colours and clearing the screen ....
An undocumented feature you will like- remember TI's canard that you could not have sprite automotion in bit map mode? This is repeated in the Myarc XB manual I have - but in truth. you CAN switch Myarc XB to bit map mode. and then call sprites with auto-motion. Neat.
Example plotting routine
The program below is a routine for a chaotic graphics plot, and really does take a very long time to finish! The end result is interesting as total order, represented by a single line, becomes total chaos after repeated bifurcation.
100 CALL GRAPHICS(3) 110 ! ORBITDGM PROGRAM 120 ! 130 FOR C=-2 TO 0.25 STEP .00625 140 X=0 :: M=160*(C+2) :: FOR I=0 TO 200 150 X=X*X+C :: IF I<50 THEN 170 160 N=(180/4)*(2-X) :: CALL POINT(1,X,Y) 170 NEXT I 180 REM 190 CALL WRITE(0,160,80,"* done *") 200 REM 210 STOP
VIDEO RAM ACCESS
You now have PEEKV and POKEV available.
Integer Math
Added extras include integer and real variables- with integer variables processing a little faster than real ones. Myarc usage differs from everyone else- the integer is ROUNDED not stripped of the decimal if there is one.
If you want an array of integer numbers the way to do it is:
100 DEFINT DIM A(20)
Default Disk Drive
You may set a default disk drive and subsequently omit "DSK1" when using OLD and SAVE or RUN.
Running TI BASIC programs
Because more VDP is available, Myarc XB can load AND run those very long TI Basic programs that will NOT load in TI XB. You may need to use CALL FILES(1) to load them from disk - but a clever bit of sidestepping allows the Myarc XB to load a longer TIB file than TI's XB can. Also the TI Basic extra character sets lacking in TI XB ARE available in Myarc XB.
Running TI Extended BASIC programs
Generally no problems apart from some commercial programs that have used the PROTECTED flag AND also test the memory location to ensure you haven't removed it. Myarc XB uses a different location so such checks will fail and the program assume you have hacked it.
You can avoid the auto-load of DSK1.LOAD by holding down FCTN and 4 (CLEAR). NEW also auto-loads DSK1.LOAD.
GCHAR returned values 96 (>60) greater than the true value which could cause problems.
Variable Names
Myarc XB2 will permit you to use variable names with lower case characters and treat them as different variables to upper case usage. eg A=4 :: a=5. TI XB will accept this but if you edit the line in TI XB the lower case number will be changed to upper case.
Pre Scan Bug
The prescan check of for-next loops does not function correctly- and this can make debugging very interesting! If a NEXT is missing, the error message:
FOR-NEXT NESTING IN NNNN is given.
Unfortunately the number NNNN has little resemblance to any line number in your program!. Remember to check that every FOR has its NEXT yourself if you have problems! For existing debugged TI XB programs this change to pre-scan makes no difference.
ACCEPT AT / DISPLAY AT
Some differences to TI XB which potentially may cause problems with programs written for TI XB but I haven't actually found any. You may find the change useful.
ACCEPT AT(11,12)SIZE(32):A$
does what? In TI XB it blanks from line 12, column 11 to the end of line 12 and accepts A$ from column 11 to column 28.
In Myarc XB however, it blanks from line 12, column 11, to column 11 of line 13, and the ACCEPT cursor appears on LINE 13. eg the SIZE has rolled over to the next line.
DISPLAY AT(11,12),SIZE(32):A$ makes the same deletion, spreading over two lines, but at least the display starts in the right place.
ACCEPT AT(24,12)SIZE(32):A$ will place the cursor on ROW 1
ACCEPT AT(12,2)SIZE(-255):A$. Nothing is blanked. but the input field for A$ measures 255 chars from (12,2), including any positions outside current margins (eg edge characters). You can therefore type in quite a lot of text. and have it accepted with one key push into one string.
FILE HANDLING
Alas a bug. The APPEND option is NOT supported. The file will open but you can't write to it BUT you will receive no error message to tell you the write has failed.
Error Trapping
Some of the error messages have been changed and in once instance an error will crash the system. Try this one:
100 DEF T(N)=T(N)-1 110 PRINT T(N)
Not it isn't right, and TI XB will tell you UDF REFS ITSELF whereas Myarc XB crashes.
TI XB error SYNTAX ERROR SYNTAX ERROR : RECURSIVE SUBPROGRAM CALL will appear in Myarc XB as just SYNTAX ERROR.
You will sometimes receive SYNTAX ERROR instead of BAD VALUE.
If your bad programming has produced:
100 GOTO 120 110 SUB TRAP 120 PRINT "ERROR MESSAGE=" 130 SUBEND
then TI XB will give you INVALID ERROR NUMBER IN NNNN but Myarc XB 2.12 will throw out the multi line error message:
WARNING NUMERIC OVERFLOW IN 130 WARNING NUMERIC OVERFLOW IN 130 WARNING NUMERIC OVERFLOW IN 515 WARNING NUMERIC OVERFLOW IN 515
at which point your only option is to QUIT as the keyboard is unresponsive. No there isn't a line 515 in the code.
Running Program format machine code
You may RUN many program format machine code programs directly.
Running DF80 machine code
DF8O files written for TI XB may require you to use a utility program to reset VDP registers, or may not function at all.
Assembly programs written specifically for TI XB module may not function however due to different mapping. If the DF80 code will run with Editor Assembler or Mini Memory it should run without problem. Myarc have provided an additional DF8O utility program called TIVDP which sets the VDP registers to correspond to TI XB and using this seems to solve most DF80 problems.
The format is:
CALL INIT :: CALL LOAD("DSK1.TIVDP") :: CALL INIT :: CALL LOAD("DSK1.PROGNAME")
and it is NOT a mistake to show CALL INIT twice above.
If using TIVDP fails. then try switching to one of the other graphics modes (2 or 3) before loading the machine code program. The DM1000 file MGR3 on the Funlwriter disk is an example: try to load it in GRAPHICS MODE(1) and you meet a blank screen - although it will function correctly. To see what you are doing you need to type in: CALL GRAPHICS(2) :: RUN "DSK1.MGR3" and off you go.
Some DF80 files may be too long to load and produce an error message MEMORY OVERFLOW - you can instead use the UTILITY option on the Funlwriter menu if you have that program.
RUNning a program from a program
When your program loads another program you can use a variable name
RUN A$
and if you are loading part two of a game say, you can load part two AND RETAIN the values of the variables in part one by using:
RUN "DSK1.PART2",CONTINUE
Other
Myarc XB allows you to run many memory image files which otherwise would require a SuperCart (EdAs with 8k ram) as the Myarc module contains ram in the correct location.
Strangely Unix-like COMMAND MODE commands include CHD and PWD to change and print the default device name, so you can old a file on say DSK1 with just OLD "FILENAME". The device name is inserted when you use RUN, SAVE And OLD.
Also in COMMAND MODE you can omit quotation marks when using OLD, SAVE and RUN, so OLD DSK1.FILENAME is OK. However you must still use quotation marks when using PRINT or DELETE from the command line.
In TI Extended Basic if you type PRINT VAL("") you will receive an error. In Myarc Extended Basic you will receive a 0 (zero).
TI FORTH- Do not use the original TI loader for Ed/As. it will not function. Instead use the later modification for mini/memory (the Universal loader). Return to OS with MON may not work.
FUNLWRITER/ FUNLWEB package: The easiest way into FUNLWRITER is with:
CALL LOAD("DSK1.LDFW")
the file LDFW is part of the Funlwriter package. Funlwriter remembers its source drive number. and resets various things to allow you access to otherwise difficult programs which may be anticipating an environment not matched by Myarc XB.
Interrupt Routines: My observation is that any program using the interrupt vector >83C4 is more than likely to misbehave or totally crash the system. A few programs use this address as an alternative to TI's standard auto-start.