Jump to content

Photo

How does one do horizontal scrolling


4 replies to this topic

#1 VGAGuy OFFLINE  

VGAGuy

    Space Invader

  • 33 posts
  • Avid Bankswitcher

Posted Fri Oct 20, 2017 1:16 AM

I am sort of porting Irritating Stick to the 2600, but I can't figure out how to get scrolling to work.

I looked at Princess Rescue's code, but I can't figure out how it loads the level and then scrolls it.

 

I would like it to be as simple as possible, due to my low programming skill.

 

 

Also, any name ideas?

 

Thanks,

 

VGAGuy



#2 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 8,851 posts

Posted Fri Oct 20, 2017 8:29 AM

Not an example but the source of my Great Giana Sisters homage is here:
http://atariage.com/...ed/?hl= santuci

Talks to get Black Forest Games blessing kinda stalled so it was a no go. But, I think it's one of the very few side scrolling batari basic engines out there.

#3 Lewis2907 OFFLINE  

Lewis2907

    Chopper Commander

  • 138 posts
  • Location:Senatobia, MS

Posted Fri Oct 20, 2017 9:52 AM

Gemintronic,

I am trying to get the below to work so you scroll left and right. It will jerk left and that's about it. I understand some of the code, but no where near an expert. Also I tried to go up to 32kSC to have the banks and extra memory to work and it loaded, but failed to scroll etc. If I can get this to work it will open some doors up on games. Thanks again for any information you can provide. 

 

print_screenright
if counter{0} then return
if player1x < 13 then gosub warp_object
player1x = player1x - 4
if !halfbit then halfbit = 1: goto start_print else halfbit = 0 : worldx = worldx + 1
if change = 32 then worldx = rand*16 : change = 0 else change = change + 1
start_print
column = screens[worldx]
if column{7} then pfpixel 0 7 on else pfpixel 0 7 off
if column{6} then pfpixel 0 6 on else pfpixel 0 6 off
if column{5} then pfpixel 0 5 on else pfpixel 0 5 off
if column{4} then pfpixel 0 4 on else pfpixel 0 4 off
if column{3} then pfpixel 0 3 on else pfpixel 0 3 off
if column{2} then pfpixel 0 2 on else pfpixel 0 2 off
if column{1} then pfpixel 0 1 on else pfpixel 0 1 off
if column{0} then pfpixel 0 0 on else pfpixel 0 0 off
tempvar = pfscroll(0, 8, 255, 0)
return

Attached Files



#4 hloberg OFFLINE  

hloberg

    Dragonstomper

  • 685 posts
  • Location:Now south of Austin. Really.

Posted Fri Oct 20, 2017 12:58 PM

what kernel are you using? it's easy in standard kernel, impossible in multi-sprite, hard but doable in DPC+

here is the code I use in DPC+

 

rem scroll section

  scrldly=scrldly+1: if scrldly<23 then goto _bp3 else scrldly=1: rem this slows down the scroll
 
  if pfread(0,20) then t1=1 else t1=0 : rem read 1st pixiel in rows 20 & 19 which are the only 2 rows I scroll
  if pfread(0,19) then t5=1 else t5=0

  for t2=1 to 32
     
     if pfread(t2 ,19) then t3=1 else t3=0 : rem loop check left to right and move the pixels
     t4=t2-1 : if t3=0 then pfpixel t4 19 off else pfpixel t4 19 on
    if pfread(t2 ,20) then t3=1 else t3=0
     t4=t2-1 : if t3=0 then pfpixel t4 20 off else pfpixel t4 20 on

  next

 if t5=0 then pfpixel 31 19 off else pfpixel 31 19 on : rem do last pixels on right
 if t1=0 then pfpixel 31 20 off else pfpixel 31 20 on     

with the DLC+ kernel you read each pixel then redraw it to the left
    
_bp3

 

here is standard kernel

 

 scldly=scldly+1 : if scldly> 30 then pfscroll left : scldly=0 : rem ignore player1x = player1x - c : rem pfscroll does the trick. i scrolls the whole screen i
 

with standard kernel you do a pfscroll, much easier. I'm looping the playfield in bot examples.

 

multi-sprite can not be scrolled as it flip images on the playfield.left-right

 

hope that helps.



#5 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 8,851 posts

Posted Fri Oct 20, 2017 3:17 PM

Gemintronic,
I am trying to get the below to work so you scroll left and right. It will jerk left and that's about it. I understand some of the code, but no where near an expert. Also I tried to go up to 32kSC to have the banks and extra memory to work and it loaded, but failed to scroll etc. If I can get this to work it will open some doors up on games. Thanks again for any information you can provide.


So far that engine scrolls like the original Super Mario Brothers so no backtracking to the left.

I was hesitant to provide a link to my 4-way scrolling engine out as it's more complicated. Also, it uses a TON of CPU time. But, if he's just scrolling in a new screen it might work.
http://atariage.com/...ata-want-4-way/




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users