Jump to content

incbanner + bankswitching

Recommended Posts

I've been experimenting further with incbanner and sprites.


I can get static and sprites banners working nicely but this led me to thinking about using the banners for some simple animation (for a title screen for example).


However I then found that with the standard 48k romsize, my experiment splitting the screen in to 4 zones (top left, top right, bottom left etc) meant I quickly filled that 48k up if I had multiple banners of 80x72 in 160B


I can compile a 48k ROM that loads in and displays 4 screen sections with incbanner and plotbanner, each 80x72, no issues. (oh for a command to flip a sprite or banner! :D)








If I go to 5 or 6 sections loaded with incbanner,  I can load them but I get black blocks on the right side of the screen when displaying anyting, I assume this is because i'm running low on rom and this is causing an issue somewhere (displaylist ?).


I also noticed that if I use a superwide banner (say 160 pixels) then the last third gets cut off and pasted on the main image - I'll make a separate thread for that, this is why i'm splitting the banners at 80 pixels.




If I go beyond that I'm out of memory (at 7 I get "-1510 bytes of ROM space left in the main area"). 


Ok, lets move to a bigger size and bankswitch. I figured this would be easy enough as I've done bankswitching with Bb before, but I cannot seem to get anything to compile. I tried to switch to a bankswitch format, like 128k but whatever I compile, I get "*** (32): ERROR, graphics overrun in bank 0"


My understanding is that with a 128k scheme, I'd have 8 banks of 16kb, so 0 through 7. (I assume bank 0 is the first bank). I've tried moving the banners to their own bank (4 in bank 1, 4 in bank 2 etc.) 


bank 1

  incbanner gfx/FR1_TL.png 160B
  incbanner gfx/FR1_TR.png 160B
  incbanner gfx/FR1_BL.png 160B
  incbanner gfx/FR1_BR.png 160B

 bank 2

  incbanner gfx/FR2_TL.png 160B
  incbanner gfx/FR2_TR.png 160B
  incbanner gfx/FR2_BL.png 160B
  incbanner gfx/FR2_BR.png 160B

but this doesn't seem to work either.


I don't understand the graphics overrun error in bank 0 other than the obvious - ie I've put too much stuff in there. I don't know how to resolve the error.


I could reduce the colour resolution from 160B to 160A and that would probably work to reduce the banner sizes so I could get more in to 48k,  but i'd still eventually hit the wall on needing to bankswitch.


Any pointers would be appreciated!






works_no_bankswitch.bas bankswitch_doesnt_work.bas gfx.zip

Link to comment
Share on other sites

Hey Muddy!


First thing 160B will take up a lot more space than 160A!


Not sure about how 48K works but with 128K you get 8 Banks of 16K - within each bank you get 3 GFX blocks which work out to around 2048 bytes per GFX block I believe.


There are some key things to remember:

  • Bank 8 is shared (code and gfx) regardless of the bank you are drawing from. 
  • The remaining bank images are available ONLY where you call your drawing loop (was the 2600 the same? - can't remember). You can for example plotsprite an image from a totally separate bank but that bank MUST be active when you call drawscreen for it to render.
  • Make you DL Memory area bigger (using either set extradlmemory on [as you are] or convert to 128KRam as using something like set dlmemory $4000 $5fff) which may help with the rendering.
  • You may need to duplicate code across banks to further break up your game
  • Read the output log of the compiler as it will tell you how much space you have available in the GFX blocks (and it tells you what is in each)
  • If you are using the frame parameter of plotsprite to animate an object such as a ship ALL those images must be in the same GFX Block loaded in the order of render 


As an example in Arkanoid I have the level border, vaus, ball and brick images in Bank 8 so they can be accessed regardless of the state of the game.  The main (levels 1-32) game loop is in Bank 2 where I have the backgrounds for the 4 main levels and the main code for the game functionality.  The Doh (level 33) game loop is in Bank 3 with that background and the Doh head images - some of the game code from Bank 2 is duplicated in Bank 3.  The other things I do is use other banks for the title, intor/outro screens so I can store more gfx.  To finish Arkanoid, I am going to have to split Bank 2 into multiple banks as I have no room for the additional enemy objects I've yet to add!!


I hope that makes sense??  Unfortunately it isn't too much different from the 2600 in that you must work within your banks for certain things - just the banks are bigger.  It's still be a juggling act!  I have a custom 7800basic for Arkanoid with some stuff Mike has configured for DL memory and additional things for the pokey sound from Sythnpopalooza as I need more stuff available to be accessed from multiple banks!


I'll have a play around with your code above and see what I can make of it ?





  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Just from my quick play you are doing no wrong - it's just the amount of space required for gfx. Using 160A takes up 3 gfx blocks and 160B is 6 gfx blocks. So 128K is a problem with the 16k banks.

  • Like 2
Link to comment
Share on other sites

Thanks Matt, 


That's really helpful, appreciate the info.


I thought intuitively, more memory = more space for graphics. Seems that might have been a bit optimistic :D


I understand now that each bank has a bunch of memory available for gfx and I need to design how I'm going to utilise the resources. 


I'm learning a lot as I experiment with what I can or can't do.







  • Like 2
Link to comment
Share on other sites

All good mate! - yeah I though the same initially but I guess you do get more than the 2600 ?


I've definitely learnt a lot with everyone's help over the past 12 months - the community will get you through my friend ?

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...