home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1992 March & April / rerun-1992-03-04-side-a.d64 / bankswitch.txt < prev    next >
Text File  |  2022-09-20  |  3KB  |  22 lines

  1. EASY BANK SWITCHING
  2. By Gary Noakes
  3.  
  4. Scared of video bank switching? Many programmers are; after all, one incorrect Poke command can crash the program.  But without bank switching, redefined characters will devour the C-64's memory.
  5.  
  6. Video Bank Setup (VBS) Generator takes the worry out of video banking.  It does all the calculations to switch banks and relocate the screen and character set addresses, and then generates the Basic program that pulls the switch.
  7.  
  8. Use Menu 64 to copy VIDEO BANK SWT to a work disk. When run, the generator asks which video bank you wish to use for your own program, then lists all the possible screen locations within that bank (excluding those under Basic and Kernal ROMs in bank 3).  Enter your choice at the prompt.  Then it lists all the possible font addresses within the selected bank.  Again, enter your choice.  The last screen lets you check the starting and ending addresses, then either create the new program, start over or quit.  VBS Generator erases itself after creating the new program.
  9.  
  10. The generator automatically rejects the following: illegal screen addresses (those that interfere with the Character ROM images in banks 0 and 2), illegal font addresses (those that duplicate or overwrite the selected screen memory), incorrect screen addresses (those not evenly divisible by 1024) and incorrect font addresses (those not evenly divisible by 2048).
  11.  
  12. Although legal, font addresses 53248 and 55296 are beneath the I/O ROM, making it impossible to load to them from disk.  Therefore, fonts must be poked into these addresses from Data statements.  A prompt will remind you of this when the need arises.  The generator also creates the code to reset addresses to the defaults as you exit your program.
  13.  
  14. Here are some things to remember when programming in a new video bank:
  15. * In bank 1, 2 or 3, pressing run-stop/ restore makes the cursor seem to disappear.  Blindly type poke 648,4 and press return to redirect the Kernal and redisplay the cursor.
  16. * When selecting bank 1 or 3, be sure that character data is available before switching or the screen will turn to garbage.  The Character ROM is available only from banks 0 and 2.
  17. * Any font loaded from disk or poked into memory with Data statements must have the same address as that shown in the line 20 created by the generator.  Otherwise, your program might not be able to locate the font.
  18. * Once the screen has been moved, poking characters to it requires the offset that appears in newly-generated line 30.  For example, to poke a character to the bottom-right corner of the screen (normally address 2023), use poke (offset+ 2023).  Pokes to color memory remain the same.
  19. * The sprite pointers follow along when the screen moves.  The new start-of-sprites pointer appears in newly-generated line 30.
  20. * Newly-generated lines 10 through 30 are included only for your convenience.  Once your program is completed, you can delete them.
  21.  
  22.