Jump to content
IGNORED

Changing The Kernel/Inline ASM


MausBoy

Recommended Posts

This is a request thread for some random things I've been wanting to do in bB games, that can't be done without making changes to the kernel or using asm.

 

The first thing I've been trying to do is alter the background (not the playfield) to be two colors, alternating every other line. Is it possible? I'm studying the asm tutorials I've found and I don't really know where to start. Thanks in advance for any replies, I really appreciate help with this.

Link to comment
Share on other sites

This is a request thread for some random things I've been wanting to do in bB games, that can't be done without making changes to the kernel or using asm.

 

The first thing I've been trying to do is alter the background (not the playfield) to be two colors, alternating every other line. Is it possible? I'm studying the asm tutorials I've found and I don't really know where to start. Thanks in advance for any replies, I really appreciate help with this.

There are (at least) two ways you could do this in bB.

 

One way is to create your own kernel using inline assembly, without changing bB's "canned kernel"-- i.e., your custom kernel wouldn't replace the existing kernel, it would be a second kernel within the code. An advantage to doing this would be that the standard kernel would still be intact and available for use whenever you wanted to call it (using "drawscreen"). But some disadvantages are that the standard kernel would still be there taking up ROM space, so it would eat up more ROM to have a second kernel in the game; and also, your custom kernel might not have all of the features of the standard kernel, meaning there might be some things you wouldn't be able to use when calling your custom kernel.

 

Another way is to create a modified version of the standard "canned kernel"-- an alternate version of the std_kernel.asm file-- and then include the alternate file in place of the standard file when you compile your program. An advantage of this is that you wouldn't need to have two kernels in ROM at the same time, thus saving some space. But a possible disadvantage is that the standard kernel was carefully written and I think the timing is tight, so adding the logic to use different background colors on alternating lines may mess up the kernel's timing. I'll have to experiment later with customizing the std_kernel.asm file, but it might take me several days before I can spend any decent amount of time on it.

 

Michael Rideout

Link to comment
Share on other sites

Thanks! Your explanations definately cleared up a lot of my confusion, the only missing piece for me now is how to work out includes, and how much of what I want to do could use functions containing inline.

 

What you posted definately helps, but what I was hoping for was someone would post an inline example that changes the way the background is drawn. The way you explain it though, it's all or nothing - either replace the whole kernel with inline (what??) or create a whole new kernel file.

Link to comment
Share on other sites

What I'd really love to do also, that would be useful in virtually every game I'm working on, is add COLUBK2 and BK2SIZE commands.

I want these so the background can be two colors, and BK2SIZE determines where the second color starts. Then I can do stuff like top half light blue, bottom dark blue (the sky and the ocean) 2/3rds blue 1/3 green (the sky and a grassy field).

 

I don't even know where to start on adding commands to bB, but I'm determined to figure it out, especially since bB is supposed to be a stepping stone to being able to do this sort of thing with asm.

Edited by MausBoy
Link to comment
Share on other sites

The way you explain it though, it's all or nothing - either replace the whole kernel with inline (what??) or create a whole new kernel file.

Well, you can just modify the existing kernel. That would give you a little more than "all or nothing".

Link to comment
Share on other sites

What I'd really love to do also, that would be useful in virtually every game I'm working on, is add COLUBK2 and BK2SIZE commands.

I want these so the background can be two colors, and BK2SIZE determines where the second color starts. Then I can do stuff like top half light blue, bottom dark blue (the sky and the ocean) 2/3rds blue 1/3 green (the sky and a grassy field).

 

I don't even know where to start on adding commands to bB, but I'm determined to figure it out, especially since bB is supposed to be a stepping stone to being able to do this sort of thing with asm.

That sounds like it might be a little easier to work into the existing kernel than your first request (alternating colors every other scan line).

 

Michael Rideout

Link to comment
Share on other sites

Well, you can just modify the existing kernel. That would give you a little more than "all or nothing".

 

I have a lot of respect for everyone who has released an ASM game for the 2600, and bB is a different level. I'm sure I am capable of learning ASM, but I'm not going to get to the point of being able to add commands to bB anytime soon. So far all of my attempts at changing the standard kernel have failed. With learning ASM, it really does seem to be "all or nothing".

 

That sounds like it might be a little easier to work into the existing kernel than your first request (alternating colors every other scan line).

 

Michael Rideout

 

It's good to know that it at least sounds possible. The standard kernel I have allows for multiple vertical playfield colors, or background colors, but not both at once. I won't be satisfied with my games until I figure out how to have both, but in the method described in my first post. I really only need two seperate background colors.

Edited by MausBoy
Link to comment
Share on other sites

This is a request thread for some random things I've been wanting to do in bB games, that can't be done without making changes to the kernel or using asm.

 

The first thing I've been trying to do is alter the background (not the playfield) to be two colors, alternating every other line. Is it possible? I'm studying the asm tutorials I've found and I don't really know where to start. Thanks in advance for any replies, I really appreciate help with this.

 

i've requested a few similar things / changes in the kernel that i'm waiting for before i can continue on my projects:

for the standard kernel:

 

- table-driven coloring for BG/PF/P0/P1 (selectable because of speed). you can define a data table in basic and assign it to either background/pf/p0 or p1

- pfheight implementation in the standard kernel, but for asymetrical pf's , similar as in the multisprite kernel.

- usage of include .bas files to split up things. right now IDE hangs because of too much code + it makes it cleaner.

this should be easy to achieve in the 2600bas compiler

 

any suggestions on how to go about this would be helpful. the table driven coloring would also achieve mausboy's request.

Link to comment
Share on other sites

The latest improvements to bB take care of your first two requests. The reason it dosnt take care of mine is because you can only set a table for the playfield OR the background, not both. I don't need a table for the background, just two seperate colors.

 

This is probably the way it will stay with bB, so what I was requesting here were tips and advice on how to make said changes myself. I know I should have worded it more clearly, but it looks like no clear help will be offered anyway.

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