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 - ASM\ExGFX Question | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 2457/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 12-16-04 05:18 AM Link | Quote
I just thought of a cool new custom block, but I don't know how to do it. The question should pretty much tell you what the idea is:

How can I load a different ExGFX/Super ExGFX file during the level?
Vortex

Paragoomba
Level: 15

Posts: 69/75
EXP: 15864
For next: 520

Since: 03-15-04

Since last post: 280 days
Last activity: 268 days
Posted on 12-16-04 05:32 AM Link | Quote
you could always just make a teleport block when you hit it you go to another level with the same characteristics just different gfx, and the starting point is where you put the block in the other level. Unless you want instantanous gfx change i dont know.

edit: actaully my idea sounds kind of interesting for my hack. the blur effect would be the level transforming (maybe have a level which has a dark and light world like in some of the zelda games). Only problem is enemies would go back to their starting point, instead of seeing them where you saw them last.


(edited by Vortex on 12-15-04 08:36 PM)
cpubasic13
17 years old now. Time to buy some M rated games by myself!
Level: 54

Posts: 783/1346
EXP: 1206934
For next: 26936

Since: 03-15-04
From: Blame my parents, Eddy

Since last post: 2 days
Last activity: 1 day
Posted on 12-16-04 05:48 AM Link | Quote
...sounds fairly familiar to Yoshi's Island... a few levels in that did exactly what you want in SMW...

Hmmm... I would try to look in Yoshi's Island and see what that does. Maybe it could help... then again, to do that they used a sprite... so...

And what makes it harder is the fact you could have a whole lot of ExGFX files in a hack and to decide what ExGFX files loads up in what slot would be a pain... although making it to where the palette and header are could be done if you used the original palette and graphics only...
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 2458/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 12-16-04 10:03 AM Link | Quote
Originally posted by Vortex
you could always just make a teleport block when you hit it you go to another level with the same characteristics just different gfx, and the starting point is where you put the block in the other level. Unless you want instantanous gfx change i dont know.

You could do that (I used it for a changing water level effect) but I'm looking for instant change. I don't see trying to choose a slot as being a problem, there's ~4000 available. Palettes could be an issue but you could always use the Palette Blocks to load palettes from other levels, or I could even hack something into the blocks to load new palette data as well.

Also I don't think copying YI will help since it's done totally differently.
BMF98567
BLACK HAS BUILT A SILLY DICE-MAZE!
GO!

Current list of BURNING FURY >8( recipients:
- Yiffy Kitten (x2)
- Xkeeper
Level: 53

Posts: 536/1261
EXP: 1094149
For next: 62970

Since: 03-15-04
From: Blobaria
Special Move: Rising Meatloaf Backhand Combo

Since last post: 21 hours
Last activity: 1 hour
Posted on 12-16-04 04:05 PM Link | Quote
All the code would have to do is decompress the ExGFX to VRAM. Sounds simple enough, but I don't know exactly how it's done, or how long it takes (what happens if custom code takes more than one frame to finish?).

I wish FuSoYa came around more often, maybe he could shed some light on this subject...
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 2459/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 12-16-04 04:11 PM Link | Quote
I think there would just be a slight lag, you might have to disable interrupts though. I know how to load new graphics, the problem is how to go from an ExGFX file # to a ROM address and decompress them. (Plus since ExGFX is loaded during the level decompression, I imagine there's a routine that does it all, unless the SNES has a feature like GB where you can turn the video off and have full access to VRAM? In that case I might have to write a custom routine for it...)
Juggling Joker

Boomerang Brother
SMW Hacking Moderator
Yeah, JAMH is still being worked on.
Level: 48

Posts: 416/1033
EXP: 811447
For next: 12096

Since: 03-15-04
From: Wyoming

Since last post: 2 days
Last activity: 3 hours
Posted on 12-16-04 09:16 PM Link | Quote
You have no idea how much use I would get out of this. I get all goosebumpy just thinking of the possibilities.
Alastor the Stylish
Hey! I made a cool game! It's called "I poisoned half the food, so if you eat you might die!" Have a taco.


Level: 114

Posts: 3567/7620
EXP: 16258468
For next: 51099

Since: 03-15-04
From: Oregon, US

Since last post: 2 hours
Last activity: 2 hours
Posted on 12-16-04 09:30 PM Link | Quote
Yeh JJ, I think we can all come up with uses for it...
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 2474/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 12-17-04 08:05 AM Link | Quote
I do too, and I'm not exactly great at graphics. It's hard not to find a use for something like that...
Atma X

Bandit
Level: 43

Posts: 661/801
EXP: 553639
For next: 11407

Since: 03-16-04
From: Derrière vous!!!

Since last post: 43 days
Last activity: 14 days
Posted on 12-17-04 08:56 AM Link | Quote
If you already know exactly what I am about to say, then it could be useful for someone else to get a little familiar with this concept:

Instead of trying to make the level load a different ExGfx File, program your Custom Block to load a set of Uncompressed Graphics (because uncomp gfx takes a lot less time to load) from any location in the Rom over the area in VRAM that your Block is using at the start of the level (which is defined by the 16x16 block that it will use).

For Example: In Sonic 2 (I'm more familiar with Sonic 2) the Level uses an are in the Rom to load it's main set of Graphics into VRAM (similar to the Gfx & ExGfx Files in SMW), but you can also load Gfx into the level through other methods. In Sonic 2, they sometimes use something called a "Pattern Load Cue" to load Gfx from an entirely different area of the Rom, over an area in VRAM,... which is specified in the Pattern Load Cue (this'll simply "replace" just the area in VRAM that you specify with the Graphics you tell it to use which is loaded from an Address that you specify). In Sonic 2, graphics is also loaded in that manner by the Animation setup.

Simple explenation:
Graphics to use is at Address XXXXXX.
Use that Graphics, and load it over Tiles XXX-XXX in VRAM.


Another way of explaining it: Say you make your Block use Tile # 8D in VRAM (through Map 16), then make it so the Code in your Custom Block will load Gfx from Address "170060" over Tile # 8D in VRAM (meaning that the starting gfx thats used for your Block will be loaded from the ExGfx Files that the Level loads, and then it'll be replaced by the graphics from the location in the Rom that you specify [through the Code of your Custom Block]).

I don't know the 65816 language yet, so I don't know what code you would use to write something such as that, but I think you should be able to use the same concept to make it work.

hmm,... actually, I think the Pattern Load Cues and the Animation Sequences in Sonic 2 may be Routines (I don't know how to interpret any of the code that sets those two things up [because I don't know the language yet], so I can't say for sure). So I guess you may have to write your own routine after all (but that should still be easier than changing a premade Routine (the Routine that the Level uses), because you'd have to find it first, and take time to understand how the routine is set up.



(edited by Atma X on 12-16-04 11:57 PM)
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 2487/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 12-17-04 09:42 PM Link | Quote
I get what you're saying, and yes I could do that but it would be a lot harder to work with, since you'd have to manually import uncompressed GFX and program their location into the block code, which would also take up more space. Decompression time shouldn't be too big a deal if done right. (Force the player to proceed slowly through an area in which they can't see the graphics that are being modified.) If need be, the custom block could act as a trigger, just writing a source, destination and size to some unused RAM address, and a routine hooked into vblank could handle actually loading the graphics (thus avoiding huge delays as the game can continue while loading). I still need to know how to convert an ExGFX number to the graphics' location, though...
Atma X

Bandit
Level: 43

Posts: 668/801
EXP: 553639
For next: 11407

Since: 03-16-04
From: Derrière vous!!!

Since last post: 43 days
Last activity: 14 days
Posted on 12-18-04 01:57 AM Link | Quote
Originally posted by HyperHacker
I still need to know how to convert an ExGFX number to the graphics' location, though...


I'm not entirely sure what you mean by that. What I'm getting out of it is that you want to insert the graphics at any location in the Rom and are unsure of how to place the graphics data in the right area.

There are two ways that you can do that using uncompressed data (the second method will work easily for both compressed and uncompressed grahics). The first way is to use a Tile Editor to insert the graphics into the Rom at an unused location (or at the end of the Rom), or you can use a Hex Editor for the final step (inserting the graphics to the Rom).

First way:
Open the Rom in a Hex Editor, find a large blank area in the Rom and write like 8 lines (or however many even # of lines you want) of the number/color F (Snes's format isn't as friendly as the Genesis's, so F's are all that'll work) to that blank area (preferably the End of the Rom). Then open the Rom in a Tile Editor and look for the several lines of the Color F (btw 2 lines of Hex, or 32 Bytes is a single 8x8 Tile), and from the begining of that area, start copying over the 8x8 Tiles that you're going to use.

Second Way (I think it's easier this way):
First, make/import your graphics as save it in a Tile Editor. Then in a Hex Editor, open the File containing your graphics, copy the whole thing (Ctrl+A in Hex Workshop, like in many other programs as well). Now close that file, open your Rom, and Paste the data in an unused area of the Rom (if you want the Tiles to look neat, if for say you decide to look at them in a Tile Editor, then paste then on an even line in the Hex Editor... example: at Address 130020, 130040, 130060 etc.). If you insert them at the end of the Rom, then you only have to click Paste, and it'll insert it automatically. If you replace an area somewhere in the middle of Rom, then you need to calculate how much space that you'll need to replace (so you don't insert extra by accedient,... Hex Workshop will warn you if you're about to insert extra data by accident). I'm sure you know how to calculate the data's size with the starting Address, to find the ending Address in which you will need to insert your graphics.

@ anyone who doesn't know how: Simply add the Ending Address of your Data (gfx, code, level data, etc.) to the Starting Address of the Rom (the area you plan to start inserting at). The Answer that it gives you is the Ending Address (the area that you will stop inserting data at)

Example: My Graphics or other Data File is 2A60 Bytes, and the Address that I want to insert it at in the Rom is 135020. Add the two together, and it'll = 137A80 (137A80 is the Ending Address).

So now, I'm going to insert my Data from Address 135020 to 137A80.


(edited by Atma X on 12-17-04 06:51 PM)
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 2500/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 12-18-04 01:56 PM Link | Quote
When you insert ExGFX, you give them a number. Somehow, that number gets converted to the ROM address of the graphics, when the new graphics are being loaded. I need to do that. 2500 posts. Woo.


(edited by HyperHacker on 12-18-04 04:56 AM)
BMF98567
BLACK HAS BUILT A SILLY DICE-MAZE!
GO!

Current list of BURNING FURY >8( recipients:
- Yiffy Kitten (x2)
- Xkeeper
Level: 53

Posts: 537/1261
EXP: 1094149
For next: 62970

Since: 03-15-04
From: Blobaria
Special Move: Rising Meatloaf Backhand Combo

Since last post: 21 hours
Last activity: 1 hour
Posted on 12-18-04 03:14 PM Link | Quote
It would appear that the 24-bit ExGFX pointers are stored in order at the following locations:

For ExGFX 0-FF: $7F800
For ExGFX 100-FFF: $D0200 (this starts with a RATS tag, so I'm assuming LM can store it in a different location if necessary)

I think I may have also found FuSoYa's ExGFX loading routines:

For ExGFX 0-FF: $7F360
For ExGFX 100-FFF: $7FA40
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 2501/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 12-18-04 09:40 PM Link | Quote
Awesome. So these are pointer tables? (That's a lot of pointers. ) I'll check that out.

Hmm, going through the code here...
PHA
LDA $7FC009
CMP #$42
BEQ $800D
PLA
LDA #$00
RTS
PLA
PHX
PHY
PHP
ASL
TAY
REP #$30
LDA $7FC006
STA $8A
LDA $7FC007
STA $8B
LDA [$8A],Y
CMP #$0100
BCC $8047
SBC #$0100
STA $8A
ASL
CLC
ADC $8A
TAX
LDA $10806E,X
STA $8A
LDA $10806F,X
STA $8B
JSR $F1F8
PLP
PLY
PLX
LDA #$6001
JSR $F1B7
BRA $804C

I'm not sure entirely how that branch works but it looks like it aborts if $7FC009 == #$42. *Looks up address* Nothing listed for it, but it's near the custom animation frame ($7FC004), so I assume it has to do with something Fu added. (Bah, this would be so much easier with breakpoints. ) I don't quite get what it's doing after it changes to 16-bit mode though.

*tinkers a bit*

OK, that's definetely the loading routine. I went and broke it. Loading file #$1CE for FG1, it looks like the initial value of A is 8, X is 0, and Y is #$FF. Also $7FC009 is zero, but that's after breaking the ExGFX routine to get these dumps.

...Jackpot! $7FC006 = #$10, $7FC007 = #$CE. (Yes, 10, not 01. ) Changing those (via PAR code) is just messing up the graphics and levels into a huge mess though.


(edited by HyperHacker on 12-18-04 02:29 PM)
Atma X

Bandit
Level: 43

Posts: 673/801
EXP: 553639
For next: 11407

Since: 03-16-04
From: Derrière vous!!!

Since last post: 43 days
Last activity: 14 days
Posted on 12-19-04 12:00 AM Link | Quote
Originally posted by HyperHacker
When you insert ExGFX, you give them a number. Somehow, that number gets converted to the ROM address of the graphics, when the new graphics are being loaded. I need to do that. 2500 posts. Woo.


To explain a little: This Pointer Table (like many, if not all others,... depends on the Code that sets it up) has some Code (routine I suppose,... code of some sort) that says, that starting at the Address it specifies, each Gfx/ExGfx # from 0-FF will be assigned 3 Bytes (the Bytes vary between Pointer Tables) and will follow in order by Gfx/ExGfx #. So the first 3 Bytes will specify an Address to load Graphics from, and will use the Graphics at that Address for Gfx/ExGfx # 00. Then, the next 3 Bytes will specify an Address to load Graphics for Gfx/ExGfx # 01, and so on, until it reaches the end of the Pointer Table.
So if you want to change the Address in the Rom that the Graphics is being read from for a certain Gfx/ExGfx #, change the 3 Bytes in the Pointer Table that coresponds to that Gfx/ExGfx # to whatever you want,... and then it'll use a different Address to read the Grahpics from.

You'll find that Pointer Tables (also refered to a Offset Indexes) are used in numerous places in any Rom (I personally like Pointer Tables a lot . They make things a lot easier).

I hope this explination is helpful in some way.

Also, thanks BMF for supplying those Addresses, maybe I'll have some use for it in a little bit.


(edited by Atma X on 12-18-04 03:10 PM)
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 2518/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 12-19-04 03:01 AM Link | Quote
I know about that. I can't very well change the pointer table in ROM while the game is running though. What I need to figure out is how to work this routine, specifically, how to pass it the ExGFX number.
Atma X

Bandit
Level: 43

Posts: 679/801
EXP: 553639
For next: 11407

Since: 03-16-04
From: Derrière vous!!!

Since last post: 43 days
Last activity: 14 days
Posted on 12-19-04 03:39 AM Link | Quote
Ok, I think I see what you're saying,... or at least part of what you're saying (so are you looking for the Address that it is loaded into RAM, so you can have part of the code in your Routine change it while the game is running, right?,... and then aside from that, you also need to figure out what way you need to write the Routine to make it function properly, correct?).
Also, btw, I'm learning some of this stuff right now, so I may have some questions,... and I may explain something in a little too much detail (or explain something that you already know to make sure that I know how it works,...and then I may even get carried away and explain it as if you didn't know that yet,... um, so yea, sorry about that last post. I got a bit carried away on that)


(edited by Atma X on 12-18-04 07:36 PM)
BMF98567
BLACK HAS BUILT A SILLY DICE-MAZE!
GO!

Current list of BURNING FURY >8( recipients:
- Yiffy Kitten (x2)
- Xkeeper
Level: 53

Posts: 539/1261
EXP: 1094149
For next: 62970

Since: 03-15-04
From: Blobaria
Special Move: Rising Meatloaf Backhand Combo

Since last post: 21 hours
Last activity: 1 hour
Posted on 12-19-04 04:08 PM Link | Quote
The part of that routine that tipped me off was this:

LDA $10806E,X
STA $8A
LDA $10806F,X
STA $8B

Those two 24-bit addresses are the first and second bytes of the ExGFX 100-FFF pointer table (they're different in my ROM, just as I suspected), so I knew I was in the right place.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Super Mario World hacking - ASM\ExGFX Question | |


ABII


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



Page rendered in 0.022 seconds.