Cybearg #1 Posted August 2, 2013 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? Quote Share this post Link to post Share on other sites
+Gemintronic #2 Posted August 2, 2013 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 Quote Share this post Link to post Share on other sites
Cybearg #3 Posted August 2, 2013 (edited) 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 August 2, 2013 by Cybearg Quote Share this post Link to post Share on other sites
bogax #4 Posted August 2, 2013 (edited) 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 August 3, 2013 by bogax Quote Share this post Link to post Share on other sites
+Gemintronic #5 Posted August 3, 2013 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 Quote Share this post Link to post Share on other sites
bogax #6 Posted August 3, 2013 (edited) 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 August 3, 2013 by bogax 1 Quote Share this post Link to post Share on other sites