The Ibach Cartridge Conversion and Cartridge Swapping - 2 & 3 Three articles by Bob Fabris, program by Dave Ibach Version 1.01 - October 5, 2010 Note: These articles first appeared in volume four of the Bally Astrocade newsletter "The Arcadian." Article one is on Page 46 (March 5, 1982). The corrections from page 55 (April 9, 1982) have been merged into the article. The second article, an explanation of the first, appears on page 59 (April 9, 1982). Finally, part 3 is on page 76. The Ibach Cartridge Conversion I received a most interesting program from Dave Ibach, one that I have used a couple of times in the preparation of this issue. With this scheme, you will be able to load a program into the computer with one of the BASIC cartridges, and then swap cartridges. This program is placed into the RAM memory space by "POKING," and then a timing loop is generated to give you a chance to swap cartridges. And it works both ways. Let's assume that you are in a position I find myself in during production of this paper - we have no known way to use a printer with the AstroBasic cartridge, and a program comes in taped in 'AB.' What to do? Well, now I have no problem. First I load the program into the Arcade using AstroBASIC. Second, after RUNning it to see that it operates, I will CLEAR the screen and ask the computer two questions: (always pressing 'go') PRINT %(20000) The computer will come back with a number, usually a five digit negative number, for example -24787. Call this value 'a.' PRINT %(-24576) Again, the computer will respond with a number, this time a very small number. For example, 5. Call this number 'b.' Write both these numbers down. Now I will write a short program which the computer will perform instantly (because there are no line numbers) FOR N = 19900 TO 19915 STEP 2;CY=40; INPUT %(N); NEXT N Now the computer will move the cursor to the upper-left of the screen and write the symbol %(N). You are to enter the following list of numbers, pressing (go) after each one: 1779 8480 0 -13533 10364 4347 -15370 9313 This will look a little jumbled as new material is written on top of old. One last command- but get your Bally Basic cartridge ready, because when you press 'go' after this one, you have about 20 seconds to make the shift: CALL 19900 When time is up, you will see BALLY BASIC appear, then about a line and a half of letters. Press HALT, and enter two commands: %(-24576) = value 'b' from above (go) %(20050) = value 'a' from above (go) And I can now run the program in Bally BASIC and use the *PRINT command. If you were converting in the other direction, all steps except these four are the same: 1. The first PRINT statement is for location 20050 2. The last number of group of eight entered is 9475 3. Use the 'down arrow' instead of HALT 4. The last % statement is to location 20000 In the next issue we'll give you some explanation of all this, and a method to include this scheme into a program. Many thanks to Dave Ibach!! Cartridge Swapping - 2 Continuing Dave Ibach's scheme with some explanation - o The routine is "relocatable," meaning that if you already have something residing in location 19900, you can change the address. o Once the routine has been entered, do not allow scrolling, or it will be destroyed. o For a shorter delay loop (about 10 sec.) change 8480 to 8464. o Only the program and other occupants of the screen (string variables) are preserved. Contents of the variables (A, B, etc., and RM, FC, etc., are unpredictable. SZ will be correct, however. o If you want to erase the routine after the swap, POKE in values of zero, as: FOR N=19900 to 19915; %(N)=0; NEXT N This is the machine language routine, with comments: F3 DI ; Disable interrupts 06 20 LD B,32 ; Time wasting loop 21 00 00 LD HL,0 23 INC HL CB 7C BIT 7,H 28 FB JR Z,-5 10 F6 DJNZ -10 C3 03 25 JP 2503H ; Branch to new cartridge or C3 61 24 JP 2461H ; Branch to old cartridge Cartridge Swapping - 3 [This is the] final chapter in the ongoing saga as continued from page 59. This segment describes Dave Ibach's suggestions regarding storing a subroutine inside a program to automatically allow for conversion from new Astrobasic to the older BallyBasic. Dave suggests: - Have your program in place with the new basic in the cartridge slot. - Make the first statement of your basic program look something like this: 1 CY=40;PRINT "SWAP NOW";CALL19900 This is so that after loading the program with the new basic, you can simply RUN and automatically be instructed to swap and automatically call the routine. The last thing the routine does is to put a period [.] at %(-24574) so that this statement becomes a remark after the swap and you can RUN without executing it again. - Enter the routine like this: FOR N=19000 to 19972 STEP 2;CY=40;INPUT %(N);NEXT N and respond to prompts with the numbers below (read DOWN columns). The routine is relocatable, so put it elsewhere if necessary. - :PRINT to record the routine along with your program. - Execute as follows: Load with new basic RUN Swap with old basic RUN And here is the routine: 1779 -4618 9072 21485 24398 1870 8451 8464 8283 -388 20050 20130 1536 -24574 0 -20658 8272 255 10 32002 11838 -13533 3283 12793 31509 8221 1696 -29245 10364 8519 20430 22599 26207 20070 36 4347 20000 END OF ARTICLE Ver Version 1.01 - October 5, 2010 - Added End-of-Line breaks for easier reading online Version 1.0 - July 6, 2002 - First release