Language…
17 users online: Adsila, Batata Douce, Blizzard Buffalo, BlueSheep123, David_Odie, Doopu, Ekimnoid, Hammerer, HD_DankBaron, LightAligns, LuigiTron, Maniek, MorrieTheMagpie, ppp9q,  Ringo, sinseiga, WalrusLife - Guests: 257 - Bots: 333
Users: 64,795 (2,375 active)
Latest user: mathew

Helpful Diagrams

That's awesome. It should totally go on the first page.
Kinda in hibernation for a while. I hope to be back in full swing soon.
good job #w{=3}
guest6777's Youtube Channel

--------------------



Kario: Hello, i love much this site Smw Central!

I always thought that most layer 2 effects are kinda a pain. Seeing as I use them rarly, I don't memorize them so I always have to go and test just how far the layer 2 ranges and such.
Especially annoying are the smash effects... because they glitch up if you have layer two in the wrong places, so here are some charts for lazy bumps like me. I uploaded them in two different sizes, the (slightly) smaller ones for posting and the bigger ones if somebody wants to download them.
Also, yes the Smash ones really do have such messed up controlls, they don't care about Mario's position, but actually about the possition of the camera. You can also trigger them by scrolling the camera left or right.

Links:
Layer 2 Smash 1 (680x868)
Layer 2 Smash 1 (480x613)
Layer 2 Smash 2 (679x732)
Layer 2 Smash 2 (480x517)
Various (680x845)
Various (480x596)
All In One (2037x868)


Images:
I'll just chuck this diagram I made for the 'SUPER MARIO WORLD' title screen graphics:

I created this image for the binary shifting (so don't delete the image with the AND/ORA/EOR diagram. I am working on it with alcaro until he gets annoyed.


Is there anything wrong or mistakes in this image?
Alcaro introduce what does ROL and ROR does:
Originally posted by Alcaro
On a slightly less agressive topic, you may also want to include ROL and ROR; they're very similar to LSR and ASL. ROL is like ASL, except that the green bit is the previous value of the carry flag, not zero. ROR is LSR, with the same change.
ROL #2 is ROL : ROL, so the left green bit will be the previous carry, the right green bit is the same as the left red bit, and the right red bit ends up in the carry flag.

I got confuse about what is he trying to say, I went to Smwiki about the 65c816 instructions
I assume that ROL and ROR wraps digits when they go off the 8-bits range because of the word "rotate bits left/right".
Give thanks to RPG hacker for working on Asar.
Well you explained ROR and ROL kinda wrong, those don't just shift Bit0 into Bit 7 and vice versa, there actuall is the carry inbetween.

Like so:
Code
CLC	;Clear Carry
LDA #$01	;0000 0001 (C = 0)
ROR	;0000 0000 (C = 1)
ROR	;1000 0000 (C = 0)


The LSB (Bit0 (the one on the very right)) gets shifted into the carry, and the content of the carry get shifted to the MSB (Bit7).
ROL works the same but in the other direction.
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
ASL/LSR/ROR/ROL $address does NOT shift depending on the address; it shifts the bits in the address itself. LDA #$02 : LSR $20 : STA $11 will store #$02 to $11 no matter what value is in $20. $20 itself is shifted down by one bit (bit 0 going into carry).

youre also implying they take an operand in immediate mode; the constant is indeed the number of shifts, but it's an assembler thing, not a SNES thing. if you only need to shift once, then an operand is not needed, or you can use A instead of a constant (ASL A). also, i prefer using decimal for multiple shifts (ROL #3), but thats just a personal thing

and yeah; you never explained carry, which is CRUCIAL for these operators. in addition, bits are counted from 0-7, not from 1-8
improved:


[check] include carry bit in ROL/ROR
[check] remove false information
Give thanks to RPG hacker for working on Asar.
ROR/ROL can use pseudo-operands just like LSR/ASL

LSR/ASL also make use of carry:
Code
00000001 0
LSR
00000000 1
LSR
00000000 0
-------------
0 10000000
ASL
1 00000000
ASL
0 00000000


also, you're still using LSR/ASL #$01 in your examples. nothing wrong with it, it's just redundant. so remove it.
LSR and ROR might be the exact same command since they both wrap the digits all the way to the right after they past the carry bit.

Give thanks to RPG hacker for working on Asar.
no, they arent the same. LSR's bit 7 is replaced with 0, just like ASL's bit 0.

and like i said before, you can do ROR/ROL #value (to move multiple times)
Yup, like Ladida said, you'll have to remove the blue line in the LSR command, as the bit doesn't wrap around


You might wanna change the text for the pink box, since we know it actually gets into the carry.
And what happened to the zeros being green for ASL/LSR ?
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
Originally posted by Ladida
ROR/ROL can use pseudo-operands just like LSR/ASL

LSR/ASL also make use of carry:
Code
00000001 0
LSR
00000000 1
LSR
00000000 0
-------------
0 10000000
ASL
1 00000000
ASL
0 00000000


also, you're still using LSR/ASL #$01 in your examples. nothing wrong with it, it's just redundant. so remove it.


Oh I get what it means now, the number under the "----" isn't using the ones above it, that means that the number on top and bottom aren't the same, just separating the section.

I see now, LSR and ASL is the same as ROR and ROL except that they rotate bits, but they both use the carry bit. If shifting beyond the carry bit box, the bit is reset.


Give thanks to RPG hacker for working on Asar.

They don't wrap. Bit0 get's into the Carry and Bit7 is replaced with 0, that's it

And just for the record (again, just saying, you don't necessarly need to change this)
There is no real difference between using

Code
LSR : LSR

and

Code
LSR #2

The assambler will insert LSR #2 as two times the command LSR, so it's the same as after being inserted, though if you like plan to use it 4 times, it might look better to just write LSR #4.
It's the same as the NOP command.
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
Oops, forgot to remove that line.

(hopefully no errors this time)
Give thanks to RPG hacker for working on Asar.
looks ok to me

dunno if anyone else has complaints
ok then, can anyone submit this image to the media?
Give thanks to RPG hacker for working on Asar.
As I've already said multiple times, if you want me to add that, you are going to explain that LSR $19 will not do what the user would expect.

LDA #$02 sets A to 2.
LDA $19 sets A to the value in $19.
LSR #2 shifts A two steps.
#2 is equivalent to #$02.
The logical conclusion is that LSR $19 will shift A a varying number of steps.
This is not true. The real behaviour is reading $19, shifting it one step, and storing it back to $19; it alters the flags, but leaves A unchanged. In other words, it's identical to PHA : LDA $19 : LSR : STA $19 : PLA (except faster and smaller). To shift a variable number of steps, you need either a loop, a jump table, or self modifying code. (Don't bother mentioning jump tables or self modifying codes, they're irrelevant in this context.)

That LSR $19 will act unexpected must be explained. You may use another RAM address, or a placeholder (for example $-- or !ram), if you prefer that; and I'm happy with a "won't work" notice, you don't need to explain what actually happens. The RAM-using shifts are very rare, anyways.


Things I haven't said half a dozen times:
- I'd call it "accumulator" or "A register" instead, not "normal bit".
- The ROR/ROL descriptions are still wrong; if carry is set prior to entering those codes, A will be #$80 or #$03. Add a CLC or SEC. (Preferably SEC in at least one of them, to make it clearer what happens. Or both, your choice.)
- I'd put "shifting digits multiple steps" on one line. No reason to split lines when not needed, it
just makes
things harder to read.
- "Resetted" isn't a word I normally use; I normally say "cleared". Clearing a bit that's removed doesn't make much sense either; say that those values are thrown away.
<blm> zsnes users are the flatearthers of emulation
Originally posted by Alcaro
As I've already said multiple times, if you want me to add that, you are going to explain that LSR $19 will not do what the user would expect.

LDA #$02 sets A to 2.
LDA $19 sets A to the value in $19.
LSR #2 shifts A two steps.
#2 is equivalent to #$02.
The logical conclusion is that LSR $19 will shift A a varying number of steps.
This is not true. The real behaviour is reading $19, shifting it one step, and storing it back to $19; it alters the flags, but leaves A unchanged. In other words, it's identical to PHA : LDA $19 : LSR : STA $19 : PLA (except faster and smaller). To shift a variable number of steps, you need either a loop, a jump table, or self modifying code. (Don't bother mentioning jump tables or self modifying codes, they're irrelevant in this context.)

That LSR $19 will act unexpected must be explained. You may use another RAM address, or a placeholder (for example $-- or !ram), if you prefer that; and I'm happy with a "won't work" notice, you don't need to explain what actually happens. The RAM-using shifts are very rare, anyways.


Things I haven't said half a dozen times:
- I'd call it "accumulator" or "A register" instead, not "normal bit".
- The ROR/ROL descriptions are still wrong; if carry is set prior to entering those codes, A will be #$80 or #$03. Add a CLC or SEC. (Preferably SEC in at least one of them, to make it clearer what happens. Or both, your choice.)
- I'd put "shifting digits multiple steps" on one line. No reason to split lines when not needed, it
just makes
things harder to read.
- "Resetted" isn't a word I normally use; I normally say "cleared". Clearing a bit that's removed doesn't make much sense either; say that those values are thrown away.


I get it now, ram address $19 is different than most ram address when using the ASL/LSR. (I don't know why, is it the game's programming?)
[check] remove the vague "normal bit" saying.
[check] added a reset bit at the top of ROR/ROL so that its clear (use SEC).
[check] "shifting digits multiple steps" is now in one line like a title
[check] remove the vague "resseted" saying
Image.
Give thanks to RPG hacker for working on Asar.
Hmmmm... I'm not sure about the discription about ROL and ROR. When you use SEC then you set the carry (look at the command ADC: when the carry is set then the value of #$xx will be added + one) so you should use CLC which clears the carry IIRC.

Edit: I'll check with an ingame counter (like with RPG Hacker's VWF dialogues patch).

Edit: O.k., SEC is wrong. Install RPG Hacker and paste the code below into a message.

Code
.body
db $F1
dl .DoSomeMath1
db "CLC + ROR ",$F6
dl $7E0059
db $FD
db "CLC + ROL ",$F6
dl $7E005A
db $FA,$ED
db $F1
dl .DoSomeMath2
db SEC + ROR ",$F6
dl $7E0059
db $FD
db "SEC + ROL ",$F6
dl $7E005A
db $FA,$FF

.DoSomeMath1
CLC
LDA #$01
ROR
STA $59
CLC
LDA #$01
ROL
STA $5A
RTL

.DoSomeMath2
SEC
LDA #$01
ROR
STA $59
SEC
LDA #$01
ROL
STA $5A
RTL