Jump to content
IGNORED

bB with custom assembly kernel, example


RevEng

Recommended Posts

I've been meaning to post an example of this for a while. It shows how to use your own custom assembly display kernel in bB.

 

Care has been taken to use the bB overscan and vblank timings, so you should be able to flip back and forth between your custom kernel and a stock kernel without any screen roll.

 

The program displays the custom rainbow kernel until the player holds down the joystick button, at which point the standard bB kernel is displayed.

 

Enjoy!

 

 

rainbowbasic.bas

rainbowkernel.asm

rainbowbasic.bas.bin

  • Like 5
Link to comment
Share on other sites

Maybe it's just me, but this won't compile in bB. I get errors, such as a syntax error on line 35, column 37, three warnings including one for "the," (line 52, column 74) "rainbowdrawscreen," (line 27, column 7) and "asm" (line 38, column 1) and it gets an error while compiling.

 

I have version 1.0 (build 566) of bBasic and am using the most recent version of dasm.exe that I could find, which is from 4/10/2008 or so.

 

Also, making it go horizontally is an "exercise" in the same way that winning the Olympics is a "warm-up."

Link to comment
Share on other sites

Now make it roll the other way (horizontaly) :)

This is just a rough first attempt. The timing's a bit off (the colors on the first visible line are lined up differently than on the rest of the lines), but other than that it works. Interesting effect is that there appear to be 15 or 16 shades of each color due to the way the colors overlap from one frame to the next.

rainbowkernel2.asm

rainbowbasic2.bas

rainbowbasic2.bas.bin

  • Like 1
Link to comment
Share on other sites

temp1 = frame & 3

if temp1 = 0 then colorindex = colorindex+1

Oh, yeah. That fixed it for me, too. Thanks!

Also, holy crap, SeaGt! That's awesome! I've been having some issues with

. It's all working pretty well except that I seriously need a way to have multiple colors in the same row on-screen at once. Do you think this would work for that? I don't know Assembly at all, so if so, how could/would it be implemented?
Link to comment
Share on other sites

Oh, yeah. That fixed it for me, too. Thanks!

Also, holy crap, SeaGt! That's awesome! I've been having some issues with

. It's all working pretty well except that I seriously need a way to have multiple colors in the same row on-screen at once. Do you think this would work for that? I don't know Assembly at all, so if so, how could/would it be implemented?

I doubt the changes I made to RevEng's kernel would be of much use to you-- these sorts of kernels are really just demos rather than useful general-purpose kernels, because they're too specific in what they do. But the same concept (changing one or more color registers mid-line) would be useful.

 

I haven't read the thread about your game idea yet. After I do, I'll see if I can suggest anything that might be useful.

Link to comment
Share on other sites

only problem I had was line 25 of the .bas file

doesn't like the condition expression

changed it to

 

temp1 = frame & 3

if temp1 = 0 then colorindex = colorindex+1

 

I updated the attachment in the first post to include this change.

 

I usually try to write for the lowest common denominator, but I guess I've gotten too used to complex math statements in later releases of bB. :)

Link to comment
Share on other sites

I usually try to write for the lowest common denominator

Oh, ouch.

 

Anyway, I thought that Visual bB was just an IDE that one could update bB as required for, but apparently they're tied together in ways that they can't be separated?

 

Maybe I should invest in bB. I mean, what does Visual bB offer above just bB? The ability to work within an environment that organizes files for you? One could just have Visual bB running for the nice visual interfaces for setting up playfields, sprites, etc., then copy it on over to normal bB, right?

Link to comment
Share on other sites

Oh, ouch.

It wasn't meant as an insult. I meant lowest common denominator in the sense that the official website bB release is very old and doesn't have a bunch of features that showed up in later versions. batari has provided a bunch of updates, but hasn't yet rolled-up a new official version on the website.

 

Anyway, I thought that Visual bB was just an IDE that one could update bB as required for, but apparently they're tied together in ways that they can't be separated?

That's correct as I understand it, and they're mostly version independent. vbb wasn't responsible for the syntax error you ran into, the early website release of bB was. (along with my use of the updated syntax)

Link to comment
Share on other sites

Oh, ouch.

 

Anyway, I thought that Visual bB was just an IDE that one could update bB as required for, but apparently they're tied together in ways that they can't be separated?

 

Maybe I should invest in bB. I mean, what does Visual bB offer above just bB? The ability to work within an environment that organizes files for you? One could just have Visual bB running for the nice visual interfaces for setting up playfields, sprites, etc., then copy it on over to normal bB, right?

Yes, Visual bB is just an IDE, although Visual bB is specifically for use with bB and has a lot of nice built-in tools to help with designing bB games. As the bB language gets updated, Visual bB often has to be updated accordingly.

 

I don't use Visual bB myself, because I've been using Crimson Editor for several years as my free IDE of choice for batari Basic, 6502 assembly, Free BASIC, etc. I keep telling myself that one of these days I'm going to switch to Visual bB, but today keeps becoming yesterday, and I still haven't made the switch yet-- too lazy, I guess!

 

You should be able to use any decent IDE for your bB programming, as long as you set up a user-defined tool for calling the bB compiler batch to compile your program, and another tool for calling Stella or other emulator to run your program.

Link to comment
Share on other sites

Anyway, I thought that Visual bB was just an IDE that one could update bB as required for, but apparently they're tied together in ways that they can't be separated?

Is is just the IDE, it calls bB underneath the covers for compilation, so any compilation problems you see in vbB you would also see using bB by itself. Features will turn on and off based on the version of the compiler. What it can't protect is a user trying to compile newer code with an older compiler which is what happened to you. Hopefully there will be an official upgrade to bB in the near future which should eliminate all the version and patching confusion.

 

-Jeff

Link to comment
Share on other sites

I think Random Terrain's bB reference page *may* have a link to the newest versions of the compiler and include files, under the "Getting Started" section-- but I haven't checked the zip file it links to yet to see if it contains the latest versions.

 

Here's a direct link to that section:

 

www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#gettingstarted

 

I just edited that section a little and added an image, so you'll probably need to refresh the page.

Link to comment
Share on other sites

As it says in step 2 below, you can download the latest beta version of Visual batari Basic (the batari Basic IDE) in jwierer's blog:

 

www.randomterrain.com/atari-2600-memories-batari-basic-vbb.html#install_vbb

 

That's usually a later build than what is in the official thread.

 

 

Later versions of batari Basic that include the magical DCP+ stuff are buggy and various things are broken. If you try to compile a non-DCP+ program with it, some things may no longer work properly. If you're not going to use the DCP+ stuff, it's best to use the older version of batari Basic found in the bBWin7_64bit.zip file.

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.

Guest
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.

Loading...
  • Recently Browsing   0 members

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