Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 7, 2017 15:58:46 GMT -5
Also, for anyone wondering what the code tick = tick + 1 And 1
is doing, I'll explain. Since Wraith wanted tick to be equal to 1 and 0 only, and reset to 0 when tick = 2, this does exactly that. Many moons ago, a user named moon had used something similar in an example he had posted on the forums. These are called "bitwise functions", and come in 3 flavors: And, Or, and Xor What the code above is doing is taking tick + 1 and then perform the And function on it and the number 1. So what does the And function do? It takes the values of "tick" and "1" in their binary form and returns the values that match up in the same locations. For example, if tick = 5, in binary, it would look like: 0101, while 1 looks like 0001 (I'm only using 4 bits for this example). So what values are in the same location? 0X01 for "tick" and 0X01 for "1". The X represents a mismatch. A mismatch turns into a 0. We carry these down, and we get 0001. When tick = 1, then runs into this line of code, it really looks like: 1+1 And 1 -> 2 And 1 -> 0010 And 0001 -> result = 0 The Or function returns values if either bit is a 1, so using the first example (tick = 5) And 1 it would result in: 0101 Or 0001 = 0101. Because the bit is 1 in the first value Or the 2nd value, it returns a 1. The Xor function (eXclusive Or) means it will return a 1 if only a 1 is present in either value in the bit location. Using tick = 5 again: 0101 Xor 0001 = 010X Xor 000X = 0100 Only the 0100 is exclusive here. Hope this helps someone
|
|
|
Post by wraith on Jul 7, 2017 18:18:57 GMT -5
I was wondering what the "tick" does. I did notice that code outside of the vblank, once enabled, doesn't appear to have time to run? Tick Tock goes the Clock... to give the "rotation" a centered axis. <|] It's a resource eater, continually reading/writing VRAM setting pixel data.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jul 7, 2017 18:38:00 GMT -5
ohhhh, okay!
|
|
|
Post by wraith on Jul 28, 2017 22:31:02 GMT -5
|
|
|
Post by wraith on Aug 1, 2017 4:12:36 GMT -5
|
|
|
Post by tiberiyltim on Aug 26, 2017 6:07:26 GMT -5
wraith, only vertical scaling? Show a code?
|
|
|
Post by wraith on Mar 14, 2018 3:27:38 GMT -5
|
|
AdeO
PooP MonkeeH
Posts: 5
|
Post by AdeO on Sept 16, 2018 0:20:55 GMT -5
wraith, only vertical scaling? Show a code? I would also like to see that, i'm killing myself trying to get the it with " hex$(VdpRamRead(address)" and decoding it...but it only (kinda) works with backgrounds when we use unique tiles to screen X, Y and the VdpRamWrite, but again it's a mess beyound what I can understand 1 hour later after coding (I'm laughing on the outside, but crying on the inside)
|
|