Jump to content
Sign in to follow this  
MausGames

Scrolling single playfield rows

Recommended Posts

I'm trying to create a parallax graveyard for a Halloween display. How would I go about only scrolling one row of playfield data at a time? I want it to wrap, so that the column that scrolls off of the left side of the screen reappears on the right side of the screen. I've tried a few different things, but nothing has worked so far.

 

By the way, I'm using the Superchip and a pfres of 30.

Edited by MausGames

Share this post


Link to post
Share on other sites

If you constrain yourself to using the parallax in the portion of the playfield that uses normal ram instead of superchip ram, it's fairly easy to do by rolling your own scroll routines.

 

Disclaimer: I'm no great shakes at 6507 assembly...

 

[edited the code out for brevity.]

 

...this is just a first pass. You could make a short general line scroll instead of unrolling the code like I have here. But hopefully this puts you in the right direction.

 

If you need to use parallax with the superchip ram area it becomes a bit more involved and cycle hungry, because you can't simply roll the memory locations. You need to read in the read-location sc-memory, roll the resgister, then store the result in the write-location sc-memory.

 

parallax.bas

parallax.bas.bin

Edited by RevEng

Share this post


Link to post
Share on other sites

Thank you for that! Very awesome stuff. Unfortunately, when you enable the superchip, all of the playfield is moved into superchip ram. This is very handy information though, I really appreciate it!

Share this post


Link to post
Share on other sites

Ah, looks like I misread the bB guide. Dang.

 

Well, easy enough to adapt. Each asm roll needs to change to something like...

lda r000
ror ; or rol depending on which pf byte
sta w000

 

Unfortunately I don't have the time right to fix it in time for your halloween demo. :(

 

If someone doesn't beat me to it I'll post a real SC parallax example in a day or so.

Share this post


Link to post
Share on other sites

Ah, looks like I misread the bB guide. Dang.

 

Well, easy enough to adapt. Each asm roll needs to change to something like...

lda r000
ror ; or rol depending on which pf byte
sta w000

 

Unfortunately I don't have the time right to fix it in time for your halloween demo. :(

 

If someone doesn't beat me to it I'll post a real SC parallax example in a day or so.

I haven't checked your routine yet, but here's an idea... Leave your scroll routine as is. When you want to scroll a row of the Superchip playfield, copy the four bytes for that row into zero-page RAM where your routine wants them to be, then call your scroll routine, then copy the scrolled bytes back into the Superchip area.

 

Michael

Share this post


Link to post
Share on other sites

Would it be technically possible to separately scroll each row of the playfield in alternating directions, on every frame? In full Superchip resolution that would be 31 rows.

Share this post


Link to post
Share on other sites

MausGames, not sure what you mean. Wouldn't scrolling every other line in alternate directions just make the lines jiggle? Or do you mean scroll the lines in alternate directions until they're off the screen, like a fancy screen wipe?

 

Michael, that was an excellent suggestion, but I figured I'd write the superchip version and write up a rolled-up version at the same time.

 

parallaxwrap.bas.bin

parallaxwrap.bas

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...