Jump to content

Photo

Bitmap Minikernel


24 replies to this topic

#1 RevEng OFFLINE  

RevEng

    River Patroller

  • 4,704 posts
  • Bitnik
  • Location:Canada

Posted Wed Sep 1, 2010 2:13 PM

As a spin-off from my titlescreen kernel work, I created a Bitmap Minikernel.

Its already been incorporated into one game, Cliff Friedel's Passthrough, which uses it to display a logo above the score.

But it also has the optional capability to display only part of a larger bitmap, depending on where the "bitmap_index" variable is pointing. This can be used for scrolling or skipping between the images being displayed.

I've included some high level docs this time around too. Hopefully this will point would-be users in the right direction.



All demo source, bins, and the docs...
Attached File  bitmapdemo.zip   222.25KB   172 downloads

The docs...
Attached File  BitmapMinikernelHowTo.pdf   235.31KB   387 downloads

The "advanced" demo screenshot, and the "advanced" bin...
bitmapdemo.bas.bin_1.png
Attached File  bitmapdemo.advanced.bin   4KB   140 downloads


#2 jwierer OFFLINE  

jwierer

    Dragonstomper

  • 902 posts
  • Location:Seattle,WA

Posted Wed Sep 1, 2010 7:33 PM

I like it. Awesome addition to bB. Good work!

-Jeff

#3 SeaGtGruff OFFLINE  

SeaGtGruff

    Quadrunner

  • 5,558 posts
  • Location:Georgia, USA

Posted Wed Sep 1, 2010 7:55 PM

This is great! I haven't tried it yet, but it's definitely one to add to the ol' bB minikernel archive. :)

Which raises an interesting point or three. I haven't kept track of all the available minikernels that have been posted since the "invention" of bB minikernels, and it would be nice if

(1) there were a centralized location or archive for storing all the existing and future minikernels, so new bB users can grab them all at once instead of having to search through multiple threads for them; and

(2) there were some kind of standard or guidelines for documenting minikernels and how they're used. It would also be nice if

(3) batari included the available minikernels with the bB installation packets. However, I think he recently said that he isn't planning on doing that, nor will he include custom kernels (especially if they're too specialized to be generically useful). I can certainly understand the logic behind that decision, because minikernels and custom kernels aren't part of an "official/standard" bB installation-- they're more like user-written applets, and should more properly be archived, maintained, and documented by some kind of "batari Basic users' group." This also applies to any user-written functions and routines.

Is Random Terrain or anyone else listing and documenting minikernels, custom kernels, user functions, etc. as they're posted in this forum? I'm hoping to write and post a minikernel myself, once I work out all the details and kinks of how it will work.

Michael

#4 Cliff Friedel OFFLINE  

Cliff Friedel

    Dragonstomper

  • 603 posts

Posted Wed Sep 1, 2010 8:18 PM

This is great! I haven't tried it yet, but it's definitely one to add to the ol' bB minikernel archive. :)

Which raises an interesting point or three. I haven't kept track of all the available minikernels that have been posted since the "invention" of bB minikernels, and it would be nice if

(1) there were a centralized location or archive for storing all the existing and future minikernels, so new bB users can grab them all at once instead of having to search through multiple threads for them; and

(2) there were some kind of standard or guidelines for documenting minikernels and how they're used. It would also be nice if

(3) batari included the available minikernels with the bB installation packets. However, I think he recently said that he isn't planning on doing that, nor will he include custom kernels (especially if they're too specialized to be generically useful). I can certainly understand the logic behind that decision, because minikernels and custom kernels aren't part of an "official/standard" bB installation-- they're more like user-written applets, and should more properly be archived, maintained, and documented by some kind of "batari Basic users' group." This also applies to any user-written functions and routines.

Is Random Terrain or anyone else listing and documenting minikernels, custom kernels, user functions, etc. as they're posted in this forum? I'm hoping to write and post a minikernel myself, once I work out all the details and kinks of how it will work.

Michael


It would be nice to have a central repository of them. I would be willing to give space on my webserver if someone wanted to collect them and put them somewhere. Just let me know. These things definitely need to be kept and documented so people don't end up reinventing the wheel and because they do add a lot of functionality to bB.

Cliff

#5 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

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

Posted Wed Sep 1, 2010 8:36 PM

Is Random Terrain or anyone else listing and documenting minikernels, custom kernels, user functions, etc. as they're posted in this forum? I'm hoping to write and post a minikernel myself, once I work out all the details and kinks of how it will work.

The downloadable zip file on my web site has the manual and a folder with images and a slowly growing number of bB example programs (it's just a copy of the folder I have online). If someone has the time to give links to minikernels that really work with bB (not buggy stuff or stuff that only works with an ancient version of bB), I can either link to the AtariAge threads or put the files in the bB folder and link to them from the bB page. If I put them in the folder, they'll be available online or offline. Whatever you guys want to do is fine with me. Just let me know.

#6 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 8,851 posts

Posted Wed Sep 1, 2010 8:46 PM

COMFORT ZONE VIOLATED

Wow! That was a surprise chuckle! Respect points given and earned!

I could just see this kernel example actually being used in 80's "sensitivity" training courses.

#7 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,704 posts
  • Bitnik
  • Location:Canada

Posted Thu Sep 2, 2010 6:45 AM

Thanks for the positive comments guys.

Michael, your point (1) has been on my mind for a while too. I hate releasing stuff and watching it slide off the first page into oblivion a few weeks later. I also hate working on a project and later finding some guy did the same thing a few years back.

Al keeps mentioning the file storage module that he paid for but hasn't had the time to implement. From the sounds of it, users will be able to tag uploaded files with categories and other searchable meta info.

That said, having a secondary home would be good. The natural place this would a Unofficial/Contributed bB code section of batari's or RT's website.

Release docs/guidelines (2) would be helpful. A start could be a README template with release info up top.

E.g...
name:______ release date:_____ author:______
code type: minikernel/kernel/subroutine/demo
kernels tested with: standard/multisprite/none/NA

I'm not sure where to take your idea beyond that. I don't have much experience writing formal docs.

@theloon: I look forward to the label contest for Space Invader and its upcoming sequel "Good Touch/Bad Touch". ;)

#8 Cliff Friedel OFFLINE  

Cliff Friedel

    Dragonstomper

  • 603 posts

Posted Thu Sep 2, 2010 10:43 AM

@theloon: I look forward to the label contest for Space Invader and its upcoming sequel "Good Touch/Bad Touch". ;)


The label has to have Sexual Harassment Panda on it =)

Cliff

#9 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 8,851 posts

Posted Thu Sep 2, 2010 12:48 PM

Oh man, now I hafta make a new label with Panda! :P

Attached Thumbnails

  • badtouch.jpg


#10 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,704 posts
  • Bitnik
  • Location:Canada

Posted Thu Sep 2, 2010 2:03 PM

:lol: :lol: :lol:

#11 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,704 posts
  • Bitnik
  • Location:Canada

Posted Mon Sep 6, 2010 7:53 PM

...
I've included some high level docs this time around too. Hopefully this will point would-be users in the right direction.
...

Has any body actually tried to give this a go? I'm fully expecting the answer to be "no" since it's only been out for a bit, but I figured I'd ask.

I'm planning an official release of the Titlescreen Kernel in the next few weeks with docs based on these ones, since importing data for the Bitmap minikernel is pretty similar. If there's anything lacking or unclear in the docs let me know!

#12 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

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

Posted Mon Sep 6, 2010 8:05 PM

If there's anything lacking or unclear in the docs let me know!

I can't think of any of my works in progress that would use this, but every game will use the other thing you're working on. :thumbsup:

I just took a look at this PDF file and it looks pretty good except for stuff like this:

2.5. Open the Bitmap Minikernel file “bitmap_img.asm” in Windows notepad or a
similar text editor.
2.6. Copy each block of BYTE text from IMG2CODE into the corresponding section of
the bitmap_img.asm file, replacing any existing BYTE lines in that section.
2.7. Set the “bitmap_window” value at the top of the file to the displayed height. (14 in
our example) and the “bitmap_height” value to the total height of the bitmap file you
created. (28 in our example)
2.8. Save the bitmap_img.asm file.

For my eyeballs, there are two problems with that. There are no blank lines between the sections and I have a hard time reading indented paragraphs. I could read this better:

2.5.
Open the Bitmap Minikernel file “bitmap_img.asm” in Windows notepad or a
similar text editor.

2.6.
Copy each block of BYTE text from IMG2CODE into the corresponding section of
the bitmap_img.asm file, replacing any existing BYTE lines in that section.

2.7.
Set the “bitmap_window” value at the top of the file to the displayed height. (14 in
our example) and the “bitmap_height” value to the total height of the bitmap file you
created. (28 in our example.)

2.8.
Save the bitmap_img.asm file.


#13 Animan OFFLINE  

Animan

    River Patroller

  • 2,391 posts
  • Just some guy who plays Atari and watches Anime.
  • Location:Texas

Posted Mon Sep 6, 2010 8:47 PM

Right when I threw the whole score system out of Trashmania and replaced it with the logo. Oh well. This looks really neat, and definitely a good addition to the (really small) minikernal library.

#14 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,704 posts
  • Bitnik
  • Location:Canada

Posted Mon Sep 6, 2010 9:01 PM

Thanks Animan!

And thanks for the tip on the whitespace and indenting, RT! I do feel that your re-formatted example is easier to read.

#15 Gateway OFFLINE  

Gateway

    River Patroller

  • 2,165 posts
  • Trotter Atari Globetrotter now on Facebook!
  • Location:St. Joseph area, Missouri

Posted Tue Sep 7, 2010 2:36 AM

Please continue working on this and the Titlescreen kernals, etc.

I have nothing to show yet, but I have been reading all of your stuff and studying the code when I can find the time. :)

#16 Gateway OFFLINE  

Gateway

    River Patroller

  • 2,165 posts
  • Trotter Atari Globetrotter now on Facebook!
  • Location:St. Joseph area, Missouri

Posted Sun Nov 7, 2010 5:33 AM

Okay, am I missing something?

This does not seem to work with the multisprite kernal. All I get is a blank screen when I run the binary, though it seems to compile fine.

I cut the playfield in the bitmapdemo.bas file down so its 16 wide and set multisprite kernal at the top, along with screenheight = 80 and pfheight =7

Any help is appreciated, as I would like this minikernal in my game. I don't mind shrinking the vertical playfield area for more space, however the multisprite kernal is limited to a screehheight of 80 at the current smallest.

Thanks :)

Edited by Gateway, Sun Nov 7, 2010 5:33 AM.


#17 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,704 posts
  • Bitnik
  • Location:Canada

Posted Sun Nov 7, 2010 10:45 AM

I think it's stack memory. Try this version of the bitmap_mk.asm...

Attached File  bitmap_mk.asm.txt   4.3KB   88 downloads

...don't forget to remove the .txt extension. If it doesn't work out better then post a .bas.

#18 Gateway OFFLINE  

Gateway

    River Patroller

  • 2,165 posts
  • Trotter Atari Globetrotter now on Facebook!
  • Location:St. Joseph area, Missouri

Posted Sat Nov 20, 2010 6:32 PM

Thanks,RevEng, for the modified file. It works well with "SpaceInvader" demo now using the multisprite kernel, though I had to shorten the playfield to use 10 height instead of the usual 11, in order for it to look right.

However, I then added the pfscore bars to each side of the score, but that seems to be in conflict with the scorepointers or something else the bitmap kernel uses. So only 1 pfscore bar appears on the left side. There must be a conflict between the two minikernels. I have some free time today, I will play around with the code some more.

#19 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,704 posts
  • Bitnik
  • Location:Canada

Posted Sat Nov 20, 2010 7:11 PM

Ok, I'll take a look at the scorepointer conflict. I have a feeling I know what it is, though fixing it will take some doing.

#20 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,704 posts
  • Bitnik
  • Location:Canada

Posted Sun Nov 21, 2010 10:20 AM

Ok, here's the problem in a nutshell... I need 3 temporary bytes of ram, plus the tempN variables. The bB guide says that aux3-6 are reserved exclusively for minikernels, but that's not entirely true. These same bytes are also used for various optional functions in the score display. (aux3=pointer to lives shape or pfscore1, aux4=life color or pfscore2, ...)

It looks like there just isn't any free ram that I can borrow without colliding with some optional bB feature.

So the following version uses aux3, aux5 and aux6 as before, unless your basic program has dimensioned bmmk1, bmmk2, and bmmk3, in which case it uses them instead...

 rem *** one example...
 rem *** the following are temporary bytes for the bitmap minikernel
 dim bmmk1=var44
 dim bmmk2=var45
 dim bmmk3=var46

Attached File  bitmap_mk.asm.txt   4.21KB   103 downloads

Edited by RevEng, Sun Nov 21, 2010 10:20 AM.


#21 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 281 posts

Posted Fri Aug 11, 2017 6:36 PM

Why does my game go apesh*t? I did everything that's supposed to be done and included the file at the very top of my game, and all that happens is that the screen turns into a color flickering mess, I can't even play the game.



#22 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,704 posts
  • Bitnik
  • Location:Canada

Posted Sat Aug 12, 2017 6:09 PM

Don't know. The demos still compile and run. Is your game using the standard kernel, or another?



#23 STGraves OFFLINE  

STGraves

    Moonsweeper

  • 281 posts

Posted Sun Aug 13, 2017 4:16 PM

Is using the standar kernel, maybe it has to do with the titlescreen kernel, but I can't seem to include it after the titlescreen so that it shows only during the main gameplay

Edit

I tried the one I made in the demo game and works perfectly fine but on my game it just causes the screen to go insane


Edited by STGraves, Sun Aug 13, 2017 6:30 PM.


#24 EvoMikeUK OFFLINE  

EvoMikeUK

    Space Invader

  • 38 posts

Posted Fri Sep 22, 2017 6:44 AM

As a spin-off from my titlescreen kernel work, I created a Bitmap Minikernel.

Its already been incorporated into one game, Cliff Friedel's Passthrough, which uses it to display a logo above the score.

But it also has the optional capability to display only part of a larger bitmap, depending on where the "bitmap_index" variable is pointing. This can be used for scrolling or skipping between the images being displayed.

I've included some high level docs this time around too. Hopefully this will point would-be users in the right direction.



All demo source, bins, and the docs...
attachicon.gifbitmapdemo.zip

The docs...
attachicon.gifBitmapMinikernelHowTo.pdf

The "advanced" demo screenshot, and the "advanced" bin...
attachicon.gifbitmapdemo.bas.bin_1.png
attachicon.gifbitmapdemo.advanced.bin

Can I use this to display a few bitmaps for text? Using a conditional statement?



#25 kdgarris OFFLINE  

kdgarris

    Chopper Commander

  • 210 posts

Posted Fri Sep 22, 2017 11:28 AM

In the post you quoted, there is a document named BitmapMinikernelHowTo.pdf.  In that document, take a look at the section "An Advanced Example".






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users