News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: External Tool needed for Snes emulators (superimpose a sprite on a layer)  (Read 1144 times)

someguy777

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
I know that Snes games pull their palettes from within the rom that's how hacks are done but...
Is it possible to attach an external program to render a sprite to the emulator and have it display on a layer within a game/rom? If so how hard would it be to develop that program because I need it.

Ive been busy hacking a snes game and trying to change an enemys sprite and found his palette code but if I change the number that represents that palette it offsets that palette which effects the entire level, I find it impossible to just alter one enemy without effecting the entire level and the other enemy's. All enemy's on a level are all tied to the same palette.
I've tried yy-chr but the rom only displays the main characters sprite the rest is just fuzzy noise.

So is there anyone out there who would take up such a project? PS there is a program called CustomDesktopLogo which can display a sprite overtop other windows on your computer and can even pull animations from a folder too, but I need those sprites to display within a layer in the game.
« Last Edit: June 29, 2019, 03:29:23 am by someguy777 »

FAST6191

  • Hero Member
  • *****
  • Posts: 3008
    • View Profile
That is quite an odd way of setting about sorting a problem.

So it sounds like your palette is shared between a background layer and the sprite. Such things are a known problem for a lot of things.
The main workaround will depend upon graphics modes involved but might see you have to either set a different palette or palette segment. Alternatively if there are suitable colours elsewhere in the palette you can find the sprite and change all the bits to reflect the desired changes -- if you want value 3 pixels to be red but changing the palette entry messes stuff up but value 15 is an acceptable red (or suitable for change) then change all value 3s in the sprites to value 15 aka if the mountain will not come to Muhammad, then Muhammad must go to the mountain.

As for layering things. I don't know what build of the emulator the TAS folks are using these days but if if matches its Lua based features with FCEUX (the gold standard for this sort of thing) then it should be able to do something there. We have a few NES hacks that do generate things for the game probably akin to what you want (the metroid map one is a good one here), or you could forcibly add things to the memory via the same.
As far as editing memory goes then you could possibly do it with cheats, or with a cheat attachment program like emuhaste if the internal cheats are not good enough.
If you are not just forcing it in with Lua though then you might as well do the hack for real unless it is just a silly animation you want to make, and in that case I would probably go the other way and screengrab layers and animate it myself.

someguy777

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
I didn't mean to confuse anyone I just reread my post, when I say entire level I meant all the enemy's of the level not the background.

Here's some screenshots to clear things up a bit.
Megaman X
https://i.imgur.com/luNG5wG.png Top
https://i.imgur.com/mpGadrp.png Middle
https://i.imgur.com/whSlYlY.png Bottom


Top pic is the palette for the boss as you can see it messes up all the other enemy sprites.

Middle pic is the exact frame the palette switch takes place on and I stop it.
I freeze the values in order to stop the switch still not a solution.

Bottom pic is the palette all the enemy's are using. But it screws up the boss I'm trying to place. As you can see with the boss he's sharing the bats palette so even if I could alter it in
yy-chr that would screw up the bats palette.

I'm assuming I need both palettes loaded at the same time somehow in order to get what I want to work.
That's where I got the idea to see if superimposing a sprite on the screen was a good idea or not.
I'm no expert with rom hacks and have never made one yet but really want to.
« Last Edit: June 29, 2019, 08:19:34 am by someguy777 »

DarkSamus993

  • Sr. Member
  • ****
  • Posts: 291
    • View Profile
Since the bosses are expected to only be in the boss room without other sprites loaded, the boss's sprites take up all the enemy slots in VRAM.


To accomplish what you want (it sounds like you want boss + enemies?), you'd have to completely rewrite the sprite assembly, VRAM loading data, and the (compressed) graphics to load things dynamically into a smaller section of VRAM. You'd also still have to delete some enemies from the level section where you want to load the boss.

There is actually an enemy that does dynamic loading (Rush Roader), so that's a good example of what I'm talking about. Its graphics are decompressed to WRAM and then uploaded to VRAM.


While this is all theoretically possible, it would be a HUGE time investment reworking the boss data (and not something I'd recommend for a beginner project).

someguy777

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Well that is way more work than I'm willing to invest, it's so easy to hack enemy spawns and would be awesome to mix up a variety but those palettes are the immovable objects to my unstoppable force(AKA motivation).

Here's a video demonstrating what I have done so far.
https://vimeo.com/345283986
the video quality could be better but I'm stuck with free software for now.

I know the community here probably thinks this idea of mine is stupid because the sprite is faked, but the result looks very cool.

Again I'm using that CustomDesktopLogo program so that zero is floating on my desktop screen.
I changed a value to make MegamanX invisible but he's still there and I can move him in any direction I want.

Using Megaman's X and Y coordinates and attaching this sprite to it looks cool but he wont be able to respond to layers that are suppose to be in front of him, unless there's a way to fake that too which is what I really want.

I'm not sure how people would respond to a tool like this being made for emulators since it's cheating with a sprite not really being there but it would save soooo much of a headache universally for all games on a emulator with this tool I'm requesting.
« Last Edit: June 30, 2019, 04:37:11 am by someguy777 »