I have an annoying issue with loading program into absolute address. I am developing a new game half in basic and half in ML. Everytime I load the ML part with the ,,1 switch I am unable to "RUN" the basic part because I get an "?out of memory error". I tried by relocating pointers and CLRing, but the only effective thing to do seems to be NEW and loading the BAS part again. This is quite annoying when developing because I usually switch back and forth between compiler and VIC-20.
Someone suggested that I have a keyboard macro for typing all the LOADs and NEWs but VICE doesn't work with WIN32 macro players. Is there any cartdrige that allows keyboard macros?
Listening to suggestions...
LOAD ,,1 behaviour
The pointers that change mainly are 45/46 (start of variables), 47/48, 49/50. What you really want is a LOAD routine that:
1. Stores the current values of the mentioned pointers.
2. Lowers RAMTOP (55/56) to the start address of the ML routine loaded and possibly adjusts 51/52 as well.
3. Restores the first set of pointers to their previous values.
Mike posted a great tip in the sticky "ROM calls" thread:
POKE147,0:SYS57809(N$),8,1:POKE780,0:SYS65493
The first SYS will set up a file, the second one will load it to RAM. No pointers affected. It is a bit more clumsy to write than LOAD"FILE",8,1 but works for your purpose. However, I believe it will work from within a program, so your first line of the Basic program could be:
1 POKE147,0:SYS57809("MACHINE CODE.PRG"),8,1:POKE780,0:SYS65493
1. Stores the current values of the mentioned pointers.
2. Lowers RAMTOP (55/56) to the start address of the ML routine loaded and possibly adjusts 51/52 as well.
3. Restores the first set of pointers to their previous values.
Mike posted a great tip in the sticky "ROM calls" thread:
POKE147,0:SYS57809(N$),8,1:POKE780,0:SYS65493
The first SYS will set up a file, the second one will load it to RAM. No pointers affected. It is a bit more clumsy to write than LOAD"FILE",8,1 but works for your purpose. However, I believe it will work from within a program, so your first line of the Basic program could be:
1 POKE147,0:SYS57809("MACHINE CODE.PRG"),8,1:POKE780,0:SYS65493
Anders Carlsson
Re: LOAD ,,1 behaviour
Which game are you developing ?nippur72 wrote:I am developing a new game half in basic and half in ML.
it's a clone of an Emerson-Arcadia game called "R-2D tank". It's something I dreamed to have on the VIC20 at the time, so now I'm going to implement itWhich game are you developing ?
Emerson ("Leonardo" in Italy) is an old 8-bit console with a graphic similar to VIC20 but with 4 sprites (8x8 mono).
I've already written the sprite routine but I'm having problems with space (1.5K is already gone) and execution time. The game itself is quite easy: you drive a tank and collect munitions, avoiding mines and another enemy tank.
This sprite routine I'm writing will be also useful for other games, mostly maze-based because my sprites move smoothly but always align with screen character matrix (as in the cart "Raid on Fort Knox").