Jump to content
IGNORED

Flipped Playfield?


Cybearg

Recommended Posts

This is for the standard kernel, obviously.

 

Is there and efficient way to flip the playfield, both for horizontal flip and vertical flip? Any suggestions?

 

Vertical flip shouldn't be much more than swapping var0-47 around. Horizontal is another issue.

 

Did You Know?

The second and fourth playfield variables of each row have a reversed bit order. If you don't know they are reversed, you'd expect that

Link to comment
Share on other sites

Vertical flip should be much more than swapping var0-47 around. Horizontal is another issue.

 

You're right. Bleh, silly me!

 

Actually, the reversal of the playfield bits makes horizontally flipping the playfield super-easy:

 

for temp1 = 0 to 47 step 4
temp2 = var2[temp1]
temp3 = var3[temp1]
var3[temp1] = var0[temp1]
var2[temp1] = var1[temp1]
var0[temp1] = temp3
var1[temp1] = temp2
next

 

EDIT:

 

So here are the two flips as I've figured them out. Not sure if there's a more efficient way to do it or not, but if there is, please let me know!

 


flipvert
for temp1 = 0 to 23
temp2 = temp1 / 4
temp3 = 11 - temp2
temp4 = temp1 & 3
temp5 = temp3 * 4
temp6 = temp5 + temp4
temp2 = var0[temp1]
var0[temp1] = var0[temp6]
var0[temp6] = temp2
next
return thisbank

fliphoriz
for temp1 = 0 to 47 step 4
temp2 = var2[temp1]
temp3 = var3[temp1]
var3[temp1] = var0[temp1]
var2[temp1] = var1[temp1]
var0[temp1] = temp3
var1[temp1] = temp2
next
return thisbank

Edited by Cybearg
Link to comment
Share on other sites

Here's a couple UNTESTED possibilities for vertical flips

just off the top of my head.

 

for i = 0 to 23 step 4
j = 44 - i
temp1 = var0[i] : var0[i] = var0[j] : var0[j] = temp1
temp1 = var1[i] : var1[i] = var1[j] : var1[j] = temp1
temp1 = var2[i] : var2[i] = var2[j] : var2[j] = temp1
temp1 = var3[i] : var3[i] = var3[j] : var3[j] = temp1
next


i = 0
outer_loop
j = 44 - i
inner_loop
temp1 = var0[i] : var0[i] = var0[j] : var0[j] = temp1
i = i + 1 : j = j + 1
if i & 3 then inner_loop
if i <> 24 then outer_loop

Edited by bogax
Link to comment
Share on other sites

I'm not sure if I'm following y'all on horizontal flipping. Wouldn't you have to resort to bitwise operations because the weird way bB has to render the two inside columns of playfield?

 

Did You Know?

The second and fourth playfield variables of each row have a reversed bit order. If you don't know they are reversed, you'd expect that

Link to comment
Share on other sites

I'm not sure if I'm following y'all on horizontal flipping. Wouldn't you have to resort to bitwise operations because the weird way bB has to render the two inside columns of playfield?

 

no

basically the bytes are already reversed so you just have to swap them.

 

FRFR > RFRF

0123 > 3210

before the swap the forward bytes are displayed forward and the

reversed bytes get displayed reversed and end up forwards

after the swap the reversed bytes get displayed forward and the

forward bytes get displayed reversed

Edited by bogax
  • Like 1
Link to comment
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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...