[logo]
WELCOME TO THE '65 SITE' WITH STUFF ABOUT

COMMODORE C65

HEXTIME 07E8.0A.0D 0F.19.33
HOME INFOS TIPS SOFTWARE BASIC 10 S-BASIC 65 MEM MAP EMULATOR LINKS ABOUT 

DIR

"TIPS            " 65 1D
60   "USE SPRITES 320BINFO
67   "LIST 'FILENAME'"  INFO
106  "MERGE WORKAROUNDINFO
2927 BLOCKS FREE

READY.
TYPE "TIPS"

 USE SPRITES IN 320 BITMAP MODES                                   ­ (added: 2021/06/27) 

If you want to use sprites in the 320 bitmap modes with BASIC 10, becauses of a bug, you have to copy the sprite pointers used by the textmode and 640 bitmap modes from [$0FF8-$1007] to [$0BF8-$0C07], the place where the 320 bitmap modes uses them from.

For doing this you can use e.g. this code in your BASIC 10 program before you use your sprites in the 320 bitmap mode, but after the definition of your sprites:

FOR A=0 TO 15:POKE 3064+A,PEEK(4088+A):NEXT A

----------------------------------------------------------------------------------------

 LIST "FILENAME"                                                   ­ (added: 2020/11/22) 

In BASIC 10 there is an extended LIST command compared to the earlier Commodore BASIC versions.

You can use it to display not only a BASIC program that is currently in memory as usual, but also a BASIC program that is on the disc:

LIST "filename" [, Ddrive] [<, | ON> Udevice]

lists the program 'filename' without(!) destroying or changing the current BASIC program in the memory.

For example, it is convenient to have the listing of a program displayed to look something up there without having to save the current BASIC program first.

LIST "filename" works in direct mode and also as a command in the program with filename 'PROGRAM1' or with 'P*' or '*' for the filename.
----------------------------------------------------------------------------------------

 MERGE TWO BASIC 10 PROGRAMS                                       ­ (added: 2020/10/11) 

BASIC 10 doesn't have a MERGE command to merge two BASIC programs from disc into one.

Here is a workaround for merging two BASIC 10 programs:

Load the first program with:

DLOAD "PROGRAM 1"

Then type in direct mode:

B=(256*PEEK(175)+PEEK(174))-2
POKE 46,B/256
POKE 45,B-PEEK(46)*256


After that load the second program with:

DLOAD "PROGRAM 2"

Finish the 'MERGE' with:

POKE 45,1:POKE 46,32
CLR



Here is a short explanation of the technical background of this workaround:

The start address of the BASIC 10 program is stored in addresses 45 and 46 ($2D-$2E). In the addresses 174 and 175 ($AE-$AF) you can find the end address of the BASIC 10 program.

With the workaround, after the first program is loaded, the start address will be temporarily set to the end of the first program (-2, since two end markers are 'too many').

The second program then loads to this new start address (which is the end of the first).

After loading, the start address is set back to the default value 8193 ($2001).

With the final CLR command you clean up the variables, etc., just to "be on the safe side".
----------------------------------------------------------------------------------------

READY.