Jump to content
Sign in to follow this  
Retro Lord

Shields like in Yars' Revenge?

Recommended Posts

I'm curious on how the rotating shields are done in Yars' Revenge, and I was wondering if someone has done something like that and pehaps could offer an explanation on the subject?

Share this post


Link to post
Share on other sites

Orange shield - just keep an array in Ram and do rotates on the bytes periodically.

Problem with 6502 rotate instructions is that they include the carry which is something you often don't want.

Rotating left, there's an easy workaround - just CMP #$80 / ROL gives an 8 bit rotate left.

Rotating right, you generally want to do a save/restore operation e.g. TAX / LSR A / TXA ROR A

 

Middle of screen - fairly sure that just cycles through parts of the game Rom, which can be sort of sufficient to give random numbers.

Share this post


Link to post
Share on other sites

Of course, Rybags advice is easy to do in assembly but I'm not sure how to apply it to batari BASIC. The only equivelent technique I can think of is scrambling the player0pointerhi variable to make the player0 sprite look like a random jumble.

crash
 counter = counter + 1
 player0pointerhi = rand
 NUSIZ0 = $30
 COLUP0 = counter
 drawscreen
 if counter = 2 then goto aftercrash else goto crash

aftercrash
  • Like 1

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.

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