Jump to content

bB starfield effect


Recommended Posts

I was able to recreate the famous starfield effect from Cosmic Ark in bB. If you're not acquainted with it, the effect exploits a TIA bug to repeatedly re-trigger one of the display objects, without any additional cycle time required in-kernel.


This is particularly cool for bB, since certain kernel options take away missile0, and this hack gives you another way to use missile0. In the demo I've enabled no_blank_lines, to demonstrate.


The demo cycles through different adjustments to "missile0x", which affects the starfield speed and direction. The starfield is a bit regular, but it's better than nothing.


Feel free to take the routines and copy or adapt to your games. Enjoy!





  • Like 13
Link to comment
Share on other sites

It looks like it's possible to do a very good starfield scroll in all directions!


I originally used +17/-17 for up/down, but it was a bit slow, so I substituted +34/-34. That's slightly fast, so it might be better to alternate 17 and 34.


Looks like alternating the angle directions (16, 18) is better for up and down, because the star formation matches the other directions better.





Not sure if this will work universally on all TIA releases. I hope it does, as it's pretty useful.




DPC+ version attachments. These should be universal, since they don't rely on the TIA bug:




[edit - removed the DPCplus_kernel.asm file. This is no longer required if you're using a recent updated bB.]

Link to comment
Share on other sites

People should consider this for "grasslands" for a Dragonstomper type game as well :)


Meaning, a green background turns this effect from stars in space to grass on land.

I was thinking light blue or white on dark blue would be good for underwater action. Stay Frosty uses the effect for snow, and I think it could decently represent rain too.



Not sure if this will work universally on all TIA releases. I hope it does, as it's pretty useful.

The Cosmic Ark effect is a bit different on TIAs made in China after 1989, which means a fairly small percentage of consoles may have trouble. The effect loses some dots on these units, so you get diagonal stars instead of diamond clusters.


I think sideways scroll on these decks would be fine, albeit with stars in line formation. No idea if diagonal scroll or up+down scroll works - it might just be more flickery, or it may destroy the effect. If those directions don't work on those units, we might get it to work again doubled missle0x adjustments, though that would double the scroll speed too.


If someone with a PAL 7800 deck could test the current version, we'd have an answer.

  • Like 2
Link to comment
Share on other sites



I like the program that you made. It does open up some interesting possibilities for games. I personally like to program in DPC and I was trying to convert this program over to DPC and ran into the vblank issue. Currently the program will compile and run as it, but is missing the starfield. Not sure if there is a work around to have something similar to what you created for DPC, thanks.


; vblank will not work in DPC. Maybe there is another solution.
; Per http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#dpc_vblank
; The DPC+ kernel itself uses vblank to do its own setup, so there
; would only be a few free cycles left in vblank for your program.
; In the the DPC+ kernel, vblank would need to go in bank 1, but
; improvements to the DPC+ kernel have used up almost all available
; space in the first bank, so there is virtually no room for vblank
; code. As of March of 2016, the DPC+ kernel has 524 cycles available
; in vblank, but that could shrink significantly as more changes are
; made to the kernel. In other words, if you are using the DPC+ kernel,
; avoid vblank.



Link to comment
Share on other sites

Ok, I looked at the DPC+ problem from another angle. Instead of utilizing the HMOVE bug, this one just repositions missile0 every scan line, since the DPC+ kernel is already spending the cycles to hit HMOVE for other reasons.

A DPC+ version of the starfield scroll is now attached in the second post above.

I needed to very minorly tweak the bB DPC+ kernel (also in the second post) because it originally ran the user's vblank routine prior to object positioning, instead of after like the standard kernel. Other than that the DPC+ kernel didn't change and is 100% compatible with non-starfield projects.

I'll update the "reveng" bB dist with this kernel when I get a sec.


[the reveng bB dist was updated. With it there's no need for any extra assembly files]

  • Like 2
Link to comment
Share on other sites

  • 4 weeks later...

Bb Team,


I have 2 questions so far. How do you remove the "starfield effect" when moving to another screen or level. Also for the code that Mountain King has for a scrolling background. How would you know where to start it and end it? So it's not just a continuous scrolling effect? I'm thinking it could be used as something similar to Mario Bros where you have pipes / openings to explore and return to. Not sure if I am taking on more that I know so far about Bb.


If you step on the white opening you fall to the underground level. While in the underground level if you go all the way to the right you will return to the top level.


Thanks again for any help anyone can provide.

The Quest 24 Dec 16.txt


Link to comment
Share on other sites

Well, I can answer one of your questions. Since you are looking at my code, I am using the ball object as a marker. You may not see it since I have it match the color of the back ground. But when it hits one edge or the other it activates a counter. (variable P). As you move right it counts up and as you move left it counts down. the intention was to create unique events that could happen when P reaches a certain value.


As for stopping the snow, I had no intention of stopping in my game. I can get it to freeze and stop falling, but I can't get it to completely disappear.


Edited by Mountain King
Link to comment
Share on other sites

  • 2 weeks later...

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