[Coco] D(S)ECB Question
theother_bob
theother_bob at yahoo.com
Wed Oct 1 08:13:52 EDT 2008
Another issue I had when experimenting with the same problem is that MERGE is extrememly slow loading, due to the ascii format. A file that normally takes about 15-20 seconds to load can take well over a minute as ascii.
I would suggest one of the following: Make a Random Access data file that would allow you to read in whichever subroutine you want, loading it into a variable. Then use VARPTR to locate your code.
Alternatively you could use the sole unused memory block in a 128K CC3 as a RAMDISK. It takes a POKE or two to change a memory block. I swapped the existing HGET buffer block with the unused block, which effectively doubles the amount of graphics you can have stored, but you're not relegated to use it for that purpose. You could use this space to store ML code or other data just as easily.
Either way you would create a separate program to create the data file(s). Color FOG has working examples of these techniques. The Installation program creates random access data files from DATA statements. Then the main program(s) read the data file to populate string variables instead of using Basic memory to declare variables.
Bob
www.geocities.com\theother_bob
----- Original Message ----
From: Arthur Flexser <flexser at fiu.edu>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Monday, September 29, 2008 11:08:29 PM
Subject: Re: [Coco] D(S)ECB Question
P.S. Another consideration with using the MERGE command is that all of your
various subprograms would need to be in ASCII format, which takes up a lot more
disk space than standard format. That may well negate the disk storage
advantage you'd get from having only one copy of the main program on the disk,
in addition to slowing down the loading of subprograms.
Art
On Mon, 29 Sep 2008, CoCo Mongrel wrote:
> Hi CoCo Folk
>
> I'm working on a rework of an old game in BASIC for the CoCo 3. I know you
> can chain-load one program from another. What I'd like to do is have a
> program that displays a splash screen, preloads some graphics into memory,
> takes some input from the player, and then loads up the main program. But
> here's the catch. I want it to load the main program and one of several
> alternate versions of some subroutines, stored separately on disk. The
> different subroutines are different game strategies for the AI opponent.
> I'm concerned about running out of BASIC program space if I include all the
> alternate subroutines. I guess I could have separate copies of the program
> with each alternate subroutine, but that's too clunky and I need to conserve
> disk space as well. The subs don't have to be loaded by the setup program.
> It could just poke a value somewhere and let the main program check that
> value and load the appropriate subroutine itself after it gets loaded and
> run. But the point is that I need to be able to load the subroutine without
> clearing out the existing main program.
>
> I seem to have a fuzzy recollection that you can do something like this if
> you save one or both programs as ASCII instead of tokenized, or am I making
> that up? Can BASIC be patched so it doesn't clear everything else out?
> Needless to say the line numbers of the subroutines would be chosen so that
> they don't conflict with the main program.
>
> cocomongrel
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>
--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco
More information about the Coco
mailing list