News:

11 March 2016 - Forum Rules

Main Menu

Mega Man X3 menu hacking

Started by justin3009, March 26, 2012, 10:28:05 PM

Previous topic - Next topic

KingMike

Since these topics seem to be about the same thing, I merged them.
"My watch says 30 chickens" Google, 2018

justin3009

#21
Edit: ...I just found a better way -_-  I was looking this morning and I found a way to redraw every single tile.

Edit 2: I've ran into another problem.

- This is how it appears in Slot 1 thus far.  Works nicely.
- This is what happens when you scroll over to Slot 2 or more.

I'm very confused by this as the text and ride chips are CONSISTENTLY being written to screen much like everything else yet they just disappear when the tiles are rewritten.  Why would they not appear again even though the screens being constantly written to?  Also, this works on ZSNES just fine but not SNES9X.  These emulator discrepancies are getting on my nerves.

Also to clarify a bit more, the tile rewriting only occurs when you increase the save slot.  Otherwise it's not always happening.  So this is rather strange.  I would mimic the way the weapon icons and sub-tanks are written but there's no more room in VRAM for that.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

MottZilla

Did you check the order in which you are drawing tiles? By the way BSNES probably doesn't work because it won't map SRAM to Cx4 games most likely.

You could "test" with BSNES if you can use some upper WorkRAM instead of SRAM. If the game never touches the end of WRAM (7FFFFF) then see if you can fit your save data there to test with BSNES maybe.

Your idea looks very nice. I hope you can manage to implement it. But you might want to have two versions, one password and one SRAM. Incase of compatibility issues.

justin3009

I've been able to fix that issue for the most part.  The issue now is that I'm having horrible issues keeping the X/Zero sprite on screen.  It overwrites text and even the lives get cut off, sometimes ride chips and such.  I'm just completely lost on how to fix half of this >.<
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

MottZilla

How exactly, is your new menu running? Are you utilizing the NMI program/update system the game has in place already or are you doing it entirely yourself? On the SNES you actually could just avoid NMI, just turn it off, and just use looped waits for running your menu. If NMI is enabled and you aren't actually interacting with it maybe it keeps updating things in NMI and messing up what you are trying to do.


justin3009

As far as I know the NMI is disabled, but I can take a look and check to see if it is.  If so, as you said, that's probably what's screwing me over.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

MottZilla

NMI enable is bit7 of $4200. If you need auto-joypad reading just write #$01 to $4200 or write #$00 if you don't. IRQ enable is also in this register but I doubt you are using IRQs for anything. I hope it is something as simple as not disabling NMI that is your problem.

justin3009

That doesn't seem to do anything to help, sadly.  Nothing changes at all.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

MottZilla

How are you drawing to the screen anyway? Try this, before drawing, turn off the screen. When all drawing is done, turn the screen on again. Just write #$80 to $2100 to force blank and #$00 when you are done. See if that doesn't atleast get the background updating properly.

If you are using sprites be sure nothing could be trashing or messing up OAM/Sprite RAM.

justin3009

I believe the game essentially already does that in order to redraw the tiles when moving to a new save slot.

And it's possibly something with that but each sprite is stored into a new area so I'm unsure what's going on.  I'd check a savestate with ZSNES but it works flawlessly there and BSNES insta crashes because of SRAM being there >.<
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

MottZilla

What exactly is sprites and what is the background layers?

Are the disappearing text bits BG or sprites? I'm sure you can figure this out. When developing my BS-Zelda patch there were times where something just didn't work right and I didn't see why. Usually it was just some silly mistake from being so tired.

justin3009

The only sprites on screen are X and/or Zero along with the 4 password numbers.  Everything else is purely background layer.  It just screws up when X/Zero appear on screen and it erases everything on the background practically.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

MottZilla

Ok, so how are you transferring data then? If you're using DMA, particularly the same channel, are you making sure you are initializing everything for sprite ram transfers and then VRAM transfers?

It's unfortunately difficult to guess what could be wrong without seeing the actual code. But you can always try to comment out pieces and try to narrow down where the problem is occurring.

justin3009

#33
I've gone through most of the code and it seems to come from a specific area.  I'll have to go through the code again sometime once I'm done copying data over to my new compy.  All i know is that Zero, for some reason, erases less data than X which is extremely odd.

Edit: If not.  I'll copy/paste each routine that it uses into pastebin or something and designate what each part does so there's a full idea of what's going on.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

kuja killer

#34
sorry for being so late to even read this post for the first time, but i do believe you'll defintely be able to make a whole save-game system

I did it for my megaman 3 hack, odyssey...exactly what you described in the beginning...about replacing the whole entire password stuff, with a custom built save-game system from ground up scratch. I basically just completely tore down the whole password system in the rom, every possible trace of code related to it in any way, and did everything myself when making my save screen/system.

dont know if you've seen it before, anyway im sure you'll succeed with yours. :)
The box at the top is the main status box which will display about 20 different messages for whatever the case may be, hehe. :P "select file, data loaded, file deleted, please wait, etc. :P

justin3009

#35
Well.. this is.. interesting.  I copied everything over to my new computer that just came yesterday and tested it out again.  The only thing that's wrong now is some of the Ride Chips get removed and the lives.  Everything else works fine O_o.  This is incredibly odd.  But this gives me new hope in possibly fixing these bugs.  I'm going to track through the code.  If I'm still having issues, I'll post the entire loop of what everything does with it labeled.

Edit: http://pastebin.com/kN7LKjkM - Run through of the entire code.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

MottZilla

I'm not sure if you left anything out, but by looking through the code and hearing that Zero and X disappear different things, it sounds to me like you are writing out of VBlank. Did you try writing #$80 to $2100 to put the PPU in force blanking mode before writing to $2116 and $2118 etc?

Just force blank before any writing to the PPU and then write #$0F to $2100 when you are done. This isn't what you'll want to do in the finished code, but it should prevent some things from not being drawn and such.

justin3009

It semi worked.  X was missing massive chunks of his sprites though with a constant black line through the screen.  I must seriously be effing this code up.

Edit: I'm starting to think it's probably a better idea to NOT have the screen consistently being written to.  Maybe have it written to once on start-up then have it only done so once more when you move save slots.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

MottZilla

You definitely shouldn't write to the screen more than required. And you need to be sure that you are writing to the PPU at the correct time. If you do not use NMI, you need to loop reading the appropriate register, $4210 I believe.

Basically do a loop like
- lda $4210
bpl -

And it will loop until the NMI/VBlank flag is set. However you might want to consider that you could be catching the VBlank peroid late. In this case, do two loops of the same thing to be sure you have the maximum amount of time to write to the PPU.

When you first start the password screen turn off the display with $2100. Write all the constant background tiles first and then worry about what needs to be updated. You can't have that much to update so it shouldn't be a problem fitting that into the VBlank period. But you may have problems if you are both calculating changes and writing to the PPU at the same time, but don't worry about that unless you have problems.

justin3009

#39
Alright, another issue has come up.  I've removed the entirety of the screen being written to constantly except for the sprites (That's a gimme).

Now it's doing what it did before.  You move over a slot, it literally erases everything off the screen except for the weapons/sub-tanks.  You CAN see them flash though just as you move over though.  I'm not sure why they'd randomly erase again since nothing else is being written to it.  Kind of confuses me.

Edit: An interesting note though.  If X's sprite decides to write correctly to the screen, nothing gets erased off screen except for Ride Chips/Lives.  Right now it has a chance to load correctly.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'