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

Author Topic: Question about graphical pointers  (Read 1134 times)

Chicken Knife

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Question about graphical pointers
« on: September 08, 2018, 04:14:49 pm »
I'm a newbie to romhacking and recently took on the project of restoring all the Japanese sprites in the NES Dragon Quest games back into the US versions.

My stumbling block is that in several cases, the US rom's pointers are accessing mirror images of tiles that make it impossible to reproduce sprites the way that I want.

Can anyone point me to resources I can use to learn how to locate these pointers and redirect them to different tiles? I've tried googling and searching youtube but haven't found any newbie friendly help for this.

nesrocks

  • Hero Member
  • *****
  • Posts: 515
    • View Profile
    • nesrocks.com
Re: Question about graphical pointers
« Reply #1 on: September 08, 2018, 06:32:05 pm »
I'm not sure there will be any guide like this other than learning assembly and the emulator's debugger (both tasks are surprisingly rewarding and not difficult!). Someone may correct me though, there may be specific tutorials for pointers. Maybe one of these? http://www.romhacking.net/?page=documents&category=&platform=&game=&author=&perpage=20&level=&title=&desc=pointer&docsearch=Go
Also, you're using either fceux or mesen, correct? Those have the best debuggers.

Chicken Knife

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Question about graphical pointers
« Reply #2 on: September 09, 2018, 08:58:05 am »
@nesrocks,

Thank you for pointing me to those faqs. I'll be referencing them!

And yes, I am using FCEUX. Seems like it provides a lot of tools that will be helpful when I learn how to use them.

Psyklax

  • Hero Member
  • *****
  • Posts: 711
    • View Profile
    • Psyklax Translations
Re: Question about graphical pointers
« Reply #3 on: September 09, 2018, 04:03:37 pm »
There's a reason we call it "reverse engineering": you start with what you can see and work backwards.

So once you've learnt how to use the fceux debugger and 6502 assembly (hah ;) ) you then read the nesdev wiki to realise how the NES specifically works. Then when you see the sprite that you want to change, you look in the RAM and see where it's stored, and use the debugger to see where that data came from in the first place.

It's not difficult per se, once you get the hang of it. It can take time, but if you're the kind of person who wants to hack, then it's all part of the fun. :)

Chicken Knife

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Question about graphical pointers
« Reply #4 on: September 10, 2018, 08:29:01 am »
Thank you Psyklax!

I appreciate that simple breakdown of the structure of what I'm going to be doing. I've just reached that point in my hacks where I can't really do any more work without learning how to dig into the code like this. Necessity is the great motivator!

Mister Xiado

  • Jr. Member
  • **
  • Posts: 39
  • Back from the dead, mostly.
    • View Profile
    • The Homepage of the Oldternet
Re: Question about graphical pointers
« Reply #5 on: September 10, 2018, 03:06:51 pm »
Maybe I'm completely misreading this, but if the issue is merely L-R mirroring in the sprite tiles, it doesn't seem that more effort beyond flipping tiles, or swapping "walking left tile 1" with "walking right tile 2, mirrored" is required. As in, copy tile from B to A, and in A, mirror the tile to match its orientation with the original tiles in A. Even my description is more complicated than the actual action.
Current project: (none)
The Homepage of the Oldternet - Where it's always 1992 (or so).
Youtube

Chicken Knife

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Question about graphical pointers
« Reply #6 on: September 11, 2018, 05:01:11 am »
@Mister Xiado I'm new to this but not *that* new to this. :laugh: I've done plenty of the work you describe but the kind of issues I'm facing are where the game is referencing the same tile location for multiple uses. If let's say the tile appears in sprite A as a non mirrored tile, but the game also utilizes that same tile L-R mirrored in sprite B, one of the two sprites is going to be screwed up in cases where, based on my sprite modifications, the mirror image of tile A is no longer appropriate to be mirrored. With my project of importing the Japanese sprites from the Dragon Quest games into the Dragon Warrior games, in most instances the frequent use of L-R mirroring doesn't present problems but maybe 15-20 percent of the time it does. Particularly when I attempted to replace the 4 direction Dragon Warrior 1 sprites with the forward facing only Dragon Quest 1 sprites. Whenever a sprite shows a weapon displayed on one side of their body, or if their two head tiles were not a mirror image of each other, the sprite graphics would come out bugged in at least one direction and I would have to either make the head symmetrical or eliminate their weapon. To reproduce these sprites perfectly, I'm pretty sure I need to get into the code for how the game maps those sprites and redirect the problematic pointers to different tiles. I encountered similar issues in later games in the series where the US version eliminated frames of animation for the priest because they changed the sprites to ones that don't hold a cross and less frames were required. This required me to reduce the overall animation frames when I imported the original graphics until I can redirect some of those pointers elsewhere. I've located plenty of unused space for tiles in all four games so I don't anticipate that as an issue.
« Last Edit: September 11, 2018, 09:35:01 am by Chicken Knife »