These two programs are stored on tape. I'm hitting a problem where I get an error after loading the second program.
1) if I place a LOAD"":RUN command in the first program, it will load the second program but fails with an OUT OF DATA error on a line that has a READ command. Listing the program at this stage and the program is corrupt - it changes colours half way through, the line numbers go extremely high and I see garbage characters throughout. The last line number is suspiciously 65535 followed by a load of pi characters.
2) If I load and tun the first program, but stop it before it loads the second program and type LOAD"" myself and then run it, it works fine. Listing the program there is no corruption at all.
So I know both tape programs will load and run, just not the second one when I try to load it from the first. I expect I am doing something stupid here. What is the proper way for one BASIC program to load and run a second program?
Some additional information about my two BASIC programs
- I have tried CLR, RESTORE in the first program before loading the second program.
- I am poking 28 to 52 and 56, following the example in the Vic 20 Programmers Reference Guide, so I can poke 255 to 36869 so I can redrefine a small number of characters at 7168. I have tried pokine 30 back into locations 52 and 56, CLR, and poking 240 into 36869 to return to the original values but this has no effect.
Here is a copy of the code I have in the first program to load the second (line 50 I've added during testing to attempt to return to the defaults):
Code: Select all
50 poke36869,240:poke52,30:poke56,30:clr:restore:clr
51 load"":run:rem load the game