Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Super Mario World hacking: labmaster | 3 guests
Acmlm's Board - I2 Archive - Super Mario World hacking - HDMA backgraounds?
  
User name:
Password:
Reply:
 

UserPost
Sukasa
Posts: 907/1981
well, if you're not sure, simply write JSL $378984 or whatever into notepad, save it as a .asm file, and compile it. That should give you a place to work off of.
Dark Ludwig
Posts: 36/172
My bad, I forgot to mention that. Umm, like I said with the PALASM issue, I might not have done that part correctly, as i'm only 50% sure I do JSL's right.
Sukasa
Posts: 899/1981
You never mentioned hooking the nmi routine to JSL to hdmamain.bin. did you do that?
Dark Ludwig
Posts: 35/172
BMF and darkflight, Thanks for the description of an RATS tag and how to use it.

I worked for a while on the thingies I had to do to get the HDMA effects into my backgrounds, and I ended up (just like smallhacker) corrupting my rom... Good thing I made a backup before I did it...

I downloaded PALASM.zip, applied the IPS to the rom, and changed that pointer in the rom that PALASM.txt said to modify, it was a JSL (little endian). I might have done this wrong.

Then, I downloaded hdmamain.bin and hdmasub.bin. I put hdmamain.bin into an RATS tag after all the used data in the rom (and I terminated the RATS tag with an FF), then I put hdmasub.bin into an RATS tag right after that, and I terminated that RATS tag with an FF, too.

I then got the starting address for hdmasub.bin, assuming it was a pre-made HDMA effect. I converted it into SNES addresses, changed that byte somewhere around 0x80000 PC address in the rom to the first byte of that SNES address, and finally, on level 105 I made a custom palette, with palette entry 0xF8 being the last two bytes of the SNES address of hdmasub.bin, minus the 0x8000 bytes, of course.

I tried after all those hours to run the rom, and it crashed.

My only ideas of what possibly could have gone wrong are:

1.) There were FF's in hdmasub.bin, so putting it in an RATS tag probably caused it to terminate wrongly.

2.) I didn't get 127D60 converted to a SNES address correctly, I had 24FD60.

3.) I didn't modify the pointers right, I thought and still think that for pointers, for example, if it's pointing to PC address 456FB2, then you have 22-XX-XX-XX as your JSL. I thought you put in the first byte last and the last byte first, so then you have 22-B2-6F-45. Or do I have to perform a bitwise flip to the three pointer bytes? I dunno.

4.) I need to study more about 65C816 assembly.

All I would like is some help from someone who has done this correctly, and their knowledge what what I did wrong.

Thanks.
BMF98567
Posts: 942/1261
Originally posted by Darkflight
To be honest, I'm not exactly sure what the "inverse" of the size is. It could either be the bitwise inverse (in which case you'd flip every bit: 1 becomes 0, 0 becomes 1, etc.), or it could be the maximum size, 0x10000, minus the size (and then minus one, in keeping with the format). In any case, the inverse size is probably there just as a check to ensure that this is indeed a RATS tag.

Remember to terminate your RATS sequence with an FF, and good luck!
Just subtract the final size, minus 1, from 0xFFFF. That's your inverse.

Example:
Data is 378 bytes, or 0x17A hex.
0x17A - 1 = 0x179, little endian = 79 01 (size-1)
0xFFFF - 0x179 = 0xFE86, little endian = 86 FE (inverse of size-1)

Simply add the size and the inverse together when you're done. If they equal FFFF, congrats!

Also, there's no need to terminate a RATS tag with 0xFF...
Sukasa
Posts: 896/1981
I can't really explain it the best, just a part of it. Begin your RATS tag with STAR in the rom, by entering the ascii values for it into a four-byte section. Then there are four more bytes, that were explained to me by escherial.


Ok, I'm assuming that you're confused with the size part (the "SSSSSSSS ssssssss" and "CCCCCCCC cccccccc").

First of all, when he says "Size-1", he means "the length in bytes of the enclosed tag minus 1". Therefore, 1 byte of RATS-protected data would have (Size-1) = 0.

As I'm sure you know, 16 and higher bit numbers can be represented in either little-endian or big-endian format. Big-endian is how we normally write numbers (e.g. in 1000, "1" is the "big end" of the number) -- little-endian just flips that, so the "big end" is at the end. For 16 bit numbers, you can simply flip the order of the two bytes that comprise it to convert a big-endian number to little-endian or vice versa. So, in summary, write out the number as you normally would in hex, then flip the two bytes and you're good.

To be honest, I'm not exactly sure what the "inverse" of the size is. It could either be the bitwise inverse (in which case you'd flip every bit: 1 becomes 0, 0 becomes 1, etc.), or it could be the maximum size, 0x10000, minus the size (and then minus one, in keeping with the format). In any case, the inverse size is probably there just as a check to ensure that this is indeed a RATS tag.

Remember to terminate your RATS sequence with an FF, and good luck!

Dark Ludwig
Posts: 34/172
I don't know very much about 65C816 assembly, but I have looked at numerous tidbits of imformation in threads, guides, and looked at opcode descriptions everywhere, so I have seemed to just start understanding it a little recently. I want to implement these HDMA effects into SMW, and I read BMF's post. I understood everything before and after the RATS tag, but I had no clue what it was. I have seen people talk about RATS tags here.

What is an RATS tag? Is it some undefined opcode? Is it a sequence of integers that makes everything inside it special in some way? And, most importantly, what sequence of integers is required to open and close an RATS tag?

If I'm correct, I copy and paste the data from hdmamain.bin somewhere into the rom, put it into an RATS tag, modify a pointer, then I put the data from hdmasub.bin somewhere into the rom, but what then? I didn't see anything about modifying any other pointers for that separate data... I am so stupid, I didn't see the part about the palette entry acting as a pointer, never mind my second question.

Someone, please answer these two questions my question for me. Thanks!
mikepjr
Posts: 138/242
What am i planing to do?

Mainly just the gradiants and the effect that has different parts of the backdrop move at different speeds, ya know, it make the background look as if it has more then one layer?

And that is really all i care to do at the moment.

No other effects really interest me at the moment, nor would any other effects benafit anything im working on.
d4s
Posts: 236/325
i'd say im pretty experienced with hdma, ive coded various hdma effects in the last few months and actually, its pretty easy to use.
knowing the ins and outs of assembler is a must, though.
you can also implement it very fast, as a full hdma transfer setup doesnt take more than 10 lines of code.

its just hard to understand how it works in the beginning.
im not too sure if using precompiled code from someone else is the best way to learn it.

try reading the hdma section of this text aswell:
http://www.geocities.com/Qwertie256/attic/snesemu/qsnesdoc.html

if you understand that one, you almost got it.

Sukasa
Posts: 885/1981
Well, I've gotten a bit... I think I know how to implement HDMA to an extent, but I also think I know how to fix a few glitches in it, with extra coding. Anyways, what are you looking to do?
mikepjr
Posts: 137/242
First off, id like to say that i am sorry that it takes me so long to reply back.
But anyhow, thanks Darkflight, and i will do the same, that is ill help you if i can figure it out.

It is a bit confusing, but i think if i try to stick with it, ill be able to understand it better myself.

As is, im constantly reading what he says about it, and i think that sooner or later it will sink in and ill get it.
HyperLamer
Posts: 5067/8210
Originally posted by Smallhacker
Nonono. Don't look at me. My ASM knowledge is pretty much limited to jumping around the ROM and writing/reading stuff to/from the RAM... I'm too lazy to fully learn it.
You should. Once you're that far the rest isn't too hard, and is teh fun.
Sukasa
Posts: 881/1981
Your first guess was right. Anyways, I'm looking through that stuff because I am planning on learning it, so when I figure anything out, I will help you.
mikepjr
Posts: 136/242
LOL, ok ok ok.
But still, i hope someone might make something to edit background effects.

But i am still a bit confused.
Was what i said earlyer right thogh?

I use a hex editor and open the bin file and copy code from it to the rom, or do i use something to patch the bin file to it?
Smallhacker
Posts: 1744/2273
Nonono. Don't look at me. My ASM knowledge is pretty much limited to jumping around the ROM and writing/reading stuff to/from the RAM... I'm too lazy to fully learn it.
mikepjr
Posts: 135/242
Well, right now im just haveing a hard time understanding how to insert the bin file, i think that once i get past that it may not be as hard.
But, i mainly just wanted to do gradiants.

This is why a small program might be cool, i figured that by now smallhacker or someone, would have made a small tool for it.
Kind of like those tools that are used to change the status bar and what not.

And don't take it the wrong way BMF, it's just that after haveing smallhacker help me to understand some ASM, i thought i would be able to tackle this head on.

Man, this is a bummer.
BMF98567
Posts: 934/1261
If you can't understand the directions in that post, then HDMA is still too complex for you. I honestly can't explain it any better than I already did.

Besides, even if you get the code inserted, you still need a pretty good understanding of ASM in order to get any use out of it...
Sukasa
Posts: 874/1981
Do you understand everything that BMF says in that thread? It is pretty complicated, and I don't understand it yet.
mikepjr
Posts: 134/242
So, in other words, i have to open the BIN files with a hex editor and past the code from the BIN file to the rom?

All i know is that, im probebly still too new to ASM hacking to be trying to do this now.

I say that because im pretty confused already.
Sukasa
Posts: 870/1981
For that, copy and paste the .bin files he gives you into your ROM, by highlighting his code (Hex editor specific), then in the ROM, locate a big enough area, RATS it, and paste the copied code over the FF's that are there.
This is a long thread. Click here to view it.
Acmlm's Board - I2 Archive - Super Mario World hacking - HDMA backgraounds?


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.012 seconds.