Jump to content

Photo

bB 256k, 128k, 64k, 32k, Multikernel Frameworks


26 replies to this topic

#1 RevEng OFFLINE  

RevEng

    Quadrunner

  • 5,026 posts
  • Bitnik
  • Location:bottom of the stack

Posted Mon Jan 20, 2014 10:20 PM

I've created bB frameworks for the new 256k and 128k boards by CPUWIZ, and I've also included 64k and 32k frameworks here, as well as superchip versions of all, for completeness.

In a nutshell, these frameworks provide an example of how to build up a larger game out of individual 4k projects.

While this makes it a bit more cumbersome to build a game - I'd only recommend it for people that are very familiar with bB and the build process - it has the benefit of doing away with some bB limitations that people sometimes complain about...
  • Each bank can have a different instance of the kernel. This means different sprite definitions, different playfields, different kernel compile options.
  • There can be multiple banks with title screens. Use them for their intended purpose, game over screens, in-game displays, hidden easter egg screens, scrolling game credits, or whatever.
It should be pointed out that the framework can't be used to mix completely different kernels, like the multisprite and standard kernels, due to the fact they use different vcs initialization and differing memory maps.


How the framework works

Each 4k project is built separately, with a custom bB score_graphics.asm file that adds a bankswitch table to the binary. Each project except for the "bank 1" project gets a custom bB 2600basicfooter.asm file that ensures bank 1 is the start-up bank.

When you want to change to another bank, you just issue a "temp1=switchbank(#)" in your bB code. This will switch banks and starts running the bB code at the top of the selected bank. It's up to you to decide how to make that work within your game flow.

If you want to make an empty bank/project without a standard kernel, you just need to stick a dummy std_kernel.asm in your project. The framework includes an example of this with the titlescreen held in bank 8. It's also recommended you use a custom default.inc in any bank without a kernel, to remove unused bB routines, e.g. the playfield routines.


Putting it all together

To build the project you need to build each bank individually (as you usually do) and then glue all the binaries together by double-clicking the included "make.bat" file (windows) or typing "make" from the parent directory. (Linux, probably OSX)

The sample bin is also attached here. The score displays the current bank, and pressing the fire button brings you to the next bank.

To run 128k or 256k binaries in emulation, you'll need stella 3.9.3 or later. To run 128k or 256k binaries on real hardware, you'll need an eeprom burner and a board from CPUWIZ, or the forthcoming Harmony Encore.


Attached File  32kMultikernelFramework.zip   84.73KB   280 downloads
Attached File  32kSCMultikernelFramework.zip   83.96KB   252 downloads
Attached File  64kMultikernelFramework.zip   112.64KB   263 downloads
Attached File  64kSCMultikernelFramework.zip   62.3KB   261 downloads
Attached File  128kMultikernelFramework.zip   167.59KB   265 downloads
Attached File  128kSCMultikernelFramework.zip   126.29KB   232 downloads
Attached File  256kMultikernelFramework.zip   281.7KB   246 downloads
Attached File  256kSCMultikernelFramework.zip   248.39KB   272 downloads

Special thanks to CPUWIZ, stephena, and batari for laying the groundwork.

#2 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 28,803 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Mon Jan 20, 2014 10:40 PM

So I can replace the 32k Multikernel Framework link and the 64k Multikernel Framework link on the bB page with just one to this thread?



#3 RevEng OFFLINE  

RevEng

    Quadrunner

  • Topic Starter
  • 5,026 posts
  • Bitnik
  • Location:bottom of the stack

Posted Mon Jan 20, 2014 10:46 PM

Yup, that's right. I figured it would be easier with it all in one thread.

#4 CPUWIZ OFFLINE  

CPUWIZ

    Commander

  • 34,383 posts
  • I am the one who knocks!
  • Location:SoCal

Posted Mon Jan 20, 2014 10:52 PM

Crap, now I have to re-route the board design (some traces are too close) and actually have them made. :ponder:



#5 RevEng OFFLINE  

RevEng

    Quadrunner

  • Topic Starter
  • 5,026 posts
  • Bitnik
  • Location:bottom of the stack

Posted Mon Jan 20, 2014 11:31 PM

It will take them a while to fill up 128k or 256k, so you have some time. :)

#6 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,255 posts

Posted Tue Jan 21, 2014 12:02 AM

Now that I know it's %100 percent possible to make a 256k game my next project will be designed as such.  THANKS REVENG AND CPUWIZ!!!!!!!

 

As a side I realized the last question in the CPUWIZ 128k 265k cart topic was never addressed:

http://atariage.com/...n/#entry2876504

 

Should I plan on scrounging around for donor SARA carts?



#7 CPUWIZ OFFLINE  

CPUWIZ

    Commander

  • 34,383 posts
  • I am the one who knocks!
  • Location:SoCal

Posted Tue Jan 21, 2014 12:23 AM

If you need SARA, yes.  I have some ideas about a pin compatible replacement, but it is just that, I doubt it'd be "cheap".



#8 Sprybug OFFLINE  

Sprybug

    Dragonstomper

  • 563 posts

Posted Tue Jan 21, 2014 4:39 AM

Here's a totally ridiculous idea I thought up.

Would this be able to support a game that used the entire 128k or 256k?

Not saying I would make such a game (although I could.....)



#9 RetroFiends OFFLINE  

RetroFiends

    Chopper Commander

  • 166 posts

Posted Tue Jan 21, 2014 5:50 AM

This is absolutely insane. This is NES ROM size territory. We're talking, near the end of the console's life NES ROM sizes.
I'm just going to go out on a limb here and guess my Harmony isn't going to touch these ROMs?
Edit: Of course it wouldn't, and it says so in the thread. I Just saw 256 and my mind was blown across the wall.


Edited by RetroFiends, Tue Jan 21, 2014 5:52 AM.


#10 RevEng OFFLINE  

RevEng

    Quadrunner

  • Topic Starter
  • 5,026 posts
  • Bitnik
  • Location:bottom of the stack

Posted Tue Jan 21, 2014 7:19 AM

Would this be able to support a game that used the entire 128k or 256k?


That's totally the point of it, though you need to write your game in 4k modules. Conceptually it's not all that different from regular bB bankswitching, except for 2 things...

1. each bank is compiled as a separate 4k bB project. (but can jump to any other 4k module at any time.)
2. the "switchbank" command will drop you at the top of the bB code in the destination bank/module, rather than at a specific label. Its up to you to manage the flow from there. (easily done with a variable and on...goto, if there's more than one destination routine)

I chose this whole framework thing for the new formats because native 128k and 256k support in bB seemed silly, with the current restriction that all of the graphics data needs to go in the last bank, sharing 4k of space with the kernel. (and lifting that restriction in another way isn't feasible)

#11 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,255 posts

Posted Tue Jan 21, 2014 8:17 AM

Sounds like there's at least two developers on board for 256k development.  How about a full motion rotoscoped Seaweed Assault?



#12 RetroFiends OFFLINE  

RetroFiends

    Chopper Commander

  • 166 posts

Posted Tue Jan 21, 2014 4:07 PM

I already have some ideas...
Are the boards required already available?
And on the topic of EPROM Burners, what would you recommend?



#13 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,255 posts

Posted Tue Jan 21, 2014 4:35 PM

are the boards required already available?

Crap, now I have to re-route the board design (some traces are too close) and actually have them made. :ponder:

 

I've been anticipating this move from 64k boards to 256k.  The best plan is allocating game engine sections per 16 different banks.  When 256k boards become reality then you can just allocate 4x the space for each part of your game :)



#14 iesposta OFFLINE  

iesposta

    River Patroller

  • 3,859 posts
  • Retro-gaming w/my VCS
  • Location:Pennsylvania

Posted Tue Jan 21, 2014 4:35 PM

Here's a totally ridiculous idea I thought up.

Would this be able to support a game that used the entire 128k or 256k?

Not saying I would make such a game (although I could.....)

Is your Zippy programmed this way? (Separate 4K projects?)



#15 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,255 posts

Posted Tue Feb 18, 2014 3:42 PM

I'm not sure if custom multi-sprite kernels work with this framework but I plan on trying the one used in Flappy by iesposta:

http://atariage.com/...-released-game/

 

Will report back when I have a chance to try it!



#16 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,255 posts

Posted Wed Feb 19, 2014 11:31 AM

I'm not sure if custom multi-sprite kernels work with this framework but I plan on trying the one used in Flappy by iesposta:

http://atariage.com/...-released-game/

 

Will report back when I have a chance to try it!

 

Okay!  I have confirmed that you can put a custom multisprite_kernel.asm in each bank folder and successfully compile a multi-kernel framework game!

 

On a different subject..  would it be possible to edit the score graphics in the bank folders?

 

I mean, manually editing the score_asm data:

 

       .byte %00111100
       .byte %01100110
       .byte %01100110
       .byte %01100110
       .byte %01100110
       .byte %01100110
       .byte %01100110
       .byte %00111100

 

Does the bank switching code rely on them being the stock font?

 

UPDATE: Seems to work when I hax the score font.  Probably would barf if I tried expanding the score to a full 16 characters..

 

UPDATE II:  I just mixed and matched multi-sprite and standard kernels.  It CAN compile a working ROM but there are collisions between kernels that need to be dealt with.  So, this goes from "can not" to "you better know what you're doing" territory!



#17 Sprybug OFFLINE  

Sprybug

    Dragonstomper

  • 563 posts

Posted Sat Nov 15, 2014 9:46 PM

Is your Zippy programmed this way? (Separate 4K projects?)

Nope.  The entire source is in one file, each bank separated with the bank # function.  I'm on my next project now and I'm looking at how easy it is to implement multikernel functionality without me having to jump through too many hoops to make it happen. My brain can only hand so much at the same time.  These games I make require a lot of my logical brain, and to take on well you gotta do this, this, this, this and this to employ this technique...not sure if my brain could handle another thing like that.



#18 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 282 posts

Posted Tue May 26, 2015 2:47 PM

I've created bB frameworks for the new 256k and 128k boards by CPUWIZ, and I've also included 64k and 32k frameworks here, as well as superchip versions of all, for completeness.

In a nutshell, these frameworks provide an example of how to build up a larger game out of individual 4k projects.

While this makes it a bit more cumbersome to build a game - I'd only recommend it for people that are very familiar with bB and the build process - it has the benefit of doing away with some bB limitations that people sometimes complain about...

  • Each bank can have a different instance of the kernel. This means different sprite definitions, different playfields, different kernel compile options.
  • There can be multiple banks with title screens. Use them for their intended purpose, game over screens, in-game displays, hidden easter egg screens, scrolling game credits, or whatever.
It should be pointed out that the framework can't be used to mix completely different kernels, like the multisprite and standard kernels, due to the fact they use different vcs initialization and differing memory maps.


How the framework works

Each 4k project is built separately, with a custom bB score_graphics.asm file that adds a bankswitch table to the binary. Each project except for the "bank 1" project gets a custom bB 2600basicfooter.asm file that ensures bank 1 is the start-up bank.

When you want to change to another bank, you just issue a "temp1=switchbank(#)" in your bB code. This will switch banks and starts running the bB code at the top of the selected bank. It's up to you to decide how to make that work within your game flow.

If you want to make an empty bank/project without a standard kernel, you just need to stick a dummy std_kernel.asm in your project. The framework includes an example of this with the titlescreen held in bank 8. It's also recommended you use a custom default.inc in any bank without a kernel, to remove unused bB routines, e.g. the playfield routines.


Putting it all together

To build the project you need to build each bank individually (as you usually do) and then glue all the binaries together by double-clicking the included "make.bat" file (windows) or typing "make" from the parent directory. (Linux, probably OSX)

The sample bin is also attached here. The score displays the current bank, and pressing the fire button brings you to the next bank.

To run 128k or 256k binaries in emulation, you'll need stella 3.9.3 or later. To run 128k or 256k binaries on real hardware, you'll need an eeprom burner and a board from CPUWIZ, or the forthcoming Harmony Encore.


attachicon.gif32kMultikernelFramework.zip
attachicon.gif32kSCMultikernelFramework.zip
attachicon.gif64kMultikernelFramework.zip
attachicon.gif64kSCMultikernelFramework.zip
attachicon.gif128kMultikernelFramework.zip
attachicon.gif128kSCMultikernelFramework.zip
attachicon.gif256kMultikernelFramework.zip
attachicon.gif256kSCMultikernelFramework.zip

Special thanks to CPUWIZ, stephena, and batari for laying the groundwork.

 

How can I use it in bB, I tried but with no luck, I want to use it to add 1 title screen, 1 dead screen, and perhaps 1 or 2 level transition screens, help please



#19 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 28,803 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Tue May 26, 2015 4:03 PM

Since theloon brought it up, maybe he can walk you through it step by step.



#20 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,255 posts

Posted Wed May 27, 2015 8:16 AM

Since theloon brought it up, maybe he can walk you through it step by step.

 

I had to admit that it's an advanced technique that I hardly know :)  I personally still scavenge the preview code that VisualbB uses for demo'ing a title screen.  It'll take me awhile to get back into bB and cough up some example code.  Gotta finish a Sega Genesis game first and then get back into my 256k Tunnels & Trolls game.



#21 graywest OFFLINE  

graywest

    Moonsweeper

  • 336 posts
  • Location:Indianapolis, IN

Posted Wed Aug 15, 2018 6:15 PM

I've probably missed something simple, but I'm having a hard time getting my 32kb multikernel project to compile. I'm starting with the first 4kb bank that I've created.

 

Basically, it barfs when I get to the line that switches banks:

if joy0fire then temp1=switchbank(2)

 

Throws an unresolved symbol list with a whole bunch of things in it. Compiling without that line works fine.

 

I'm using Crimson Editor - have not had any problems with this setup. Do I need to include the additional .asm files that came with the 32kb Multikernel Framework example? Like bank1.bas.asm, score_graphics.asm, and 2600basicheader.asm? I tried that and got some other errors.

 

Other things I've tried - trying to compile the original, unedited bank1.bas from the 32kb Multikernel Framework example also throws an "unresolved symbol list" on switchbank. Leads me to believe that I'm missing files that add that switchbank keyword to bB.

 

This is my first try at using the multikernel framework, so apologies if this is a dumb question. Thanks for the help!

 

Each 4k project is built separately, with a custom bB score_graphics.asm file that adds a bankswitch table to the binary. Each project except for the "bank 1" project gets a custom bB 2600basicfooter.asm file that ensures bank 1 is the start-up bank.


When you want to change to another bank, you just issue a "temp1=switchbank(#)" in your bB code. This will switch banks and starts running the bB code at the top of the selected bank. It's up to you to decide how to make that work within your game flow.

Edited by graywest, Wed Aug 15, 2018 7:12 PM.


#22 RevEng OFFLINE  

RevEng

    Quadrunner

  • Topic Starter
  • 5,026 posts
  • Bitnik
  • Location:bottom of the stack

Posted Wed Aug 15, 2018 7:57 PM

You need the score_graphics.asm and 2600basicheader.asm present in each bank's folder. bB uses these files instead of the official ones, if it finds them in the same folder as your basic file.

If you have the files present already, then your crimson editor may not be switching the working directory to your project directory, when it does the build. This may break other advanced stuff, like includes.

#23 graywest OFFLINE  

graywest

    Moonsweeper

  • 336 posts
  • Location:Indianapolis, IN

Posted Thu Aug 16, 2018 8:18 PM

You need the score_graphics.asm and 2600basicheader.asm present in each bank's folder. bB uses these files instead of the official ones, if it finds them in the same folder as your basic file.

If you have the files present already, then your crimson editor may not be switching the working directory to your project directory, when it does the build. This may break other advanced stuff, like includes.

 

Thanks!! I switched over to using the latest Visual Batari Basic, and that seems to have fixed the issue. Everything is compiling correctly now and I was able to build the 32kb .bin. I think you're right about Crimson Editor and the working directory.

 

There may be a way to get it working in Crimson Editor, but this seemed to be the easier solution for me.



#24 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,255 posts

Posted Mon Nov 19, 2018 3:27 PM

Does the framework support extra characters?  I tried manually adding A-F and the compiler did not like it.  I also tried editing score_graphics.asm.21stcentury and using the  const font=.21stcentury with the same result.



#25 RevEng OFFLINE  

RevEng

    Quadrunner

  • Topic Starter
  • 5,026 posts
  • Bitnik
  • Location:bottom of the stack

Posted Mon Nov 19, 2018 11:21 PM

It doesn't restrict you from using extra characters, but you need to make changes uniformly for all banks.

i.e. When you edit the provided score_graphics.asm in one bank (and change the start of the graphics to allow for more characters) you need to modify the score_graphics.asm graphics start location similarly in all banks.

The underlying reasons you need to do this are 1)bank-switch routines normally need to be the same place in each bank, and 2)the bank-switch switch routine for these frameworks is in the score_graphics file, right after the graphics data.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users