CHAIN ASSET LOAD

For posting library code and examples.
Post Reply
User avatar
ahenry3068
Posts: 1136
Joined: Tue Apr 04, 2023 9:57 pm

CHAIN ASSET LOAD

Post by ahenry3068 »

Demonstrates Using the LOAD command in a BASIC program and the communications buffer at 0:BF00 to pass a string between Loaded Programs. Allows loading assets to VRAM, BRAM golden Ram on startup without having those routines take memory from your program. Each time LOAD Is invoked the LOAD.ed module has ALL low Ram to itself. To just do what this example does it's really not necessary, but this is to make the technique clear.

This example chains two programs. KENNEDY.PRG is the main program to LOAD --> RUN (You'll know why its called Kennedy).

LOAD goes like this.

KENNEDY --> Puts it's name in at 0:BF00 --> LOADS --> LOADASSETS

LOADASSETS --> BLOADS KENNEDY.ZCM in Banked RAM. --> LOADS ZSMLOADER

ZSMLOADER --> Checks 0:BF00 for a valid file name (the main program) --> LOADS and Initializes ZSMKIT
(MooingLemur's sound driver/player). Will create ZSMKIT binary if not found.
---> PLACES THE MESSAGE "ZSMLOADED" or "ZSMFAILED" at 0:BF00
then LOADS (the program found previously at 0:BF00).

KENNEDY --> finds that ZSMKIT is loaded and plays the ZCM file and exits.

I'M NOT SURE WHY I'M HAVING PROBLEMS WITH TRYIT NOW. WHEN YOU GET TO THE EMULATOR WINDOW
LOAD "KENNEDY.PRG" RUN


Try It Now!

THE CODE:
Attachments
KENNEDY.ZIP
(258.65 KiB) Downloaded 72 times
Post Reply