Hacking Emulator Code Request to runf off backgroun (NINTENDO DS) Megaman Zero Collection USA

gamefaqs99

New Member
OP
Newbie
Joined
Aug 30, 2022
Messages
4
Trophies
0
Age
25
Location
TEXAS
XP
56
Country
Mexico
Hi, I wonder if someone knows how to turn off layers in Megaman zero collection USA for the nintendo ds with cheat codes,
I found that desmume have a option in the settings but I'm using bizhawk since that emulator have options that I'm using for research in the game, that's why I'm trying to achieve turn off backgrounds and other layers with codes, I used these cheats as guides

MEGA MAN X4 (PS1)
Turn off foreground (turn on value to 1)
30141A93 0000
30141AE7 0000
turn off background (turn on value change to 1)
30141B3B 0000
do not display player (turn on value change to 1)
301419AB 0000 Remaining
shadow (turn off value change to 0)
30141A34 0001

it seems that layers on nintendo ds doesn't work just with 0= off and 1=On
since I can't find the correct adrees I request a little help, thanks in advance :unsure:
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,795
Trophies
5
XP
28,507
Country
United Kingdom
This is not something that cheat engines tend to handle, however if it is for an emulator you might be able to get something done.

The DS is something of a tarted up GBA so it might help to understand that first
http://problemkaputt.de/gbatek.htm#lcdiodisplaycontrol
DS stuff
http://problemkaputt.de/gbatek.htm#dsvideobgmodescontrol
http://problemkaputt.de/gbatek.htm#dsvideodisplaysystemblockdiagram

You then get to tickle displaycnt (display control)
Bits 8 though 12 as seen on the GBA link first of all, possible again for the B screen as well if necessary.

People have done stuff like this for forcing screens to be on different displays than intended. For emulators that don't care it is one thing, for hardware or accuracy focused emulators that do then that is harder.

In an ideal world you would be able to do a masked write.
https://doc.kodewerx.org/hacking_nds.html
Hack #2 - ORR/AND/ADD Codes
023FE424 E0033004Makes the D4 code type execute a 'AND' instruction.

Data Register Codes
Type 0xD4
Add Value
D4000000 XXXXXXXX
Adds 'XXXXXXXX' to the data register used by codetypes 0xD6 - 0xDB.
More arithmetical/logical operations can be set using the 'NDS AR HACK #2'.


Type 0xD9
32-Bit Load
D9000000 XXXXXXXX
Loads the word at [XXXXXXXX+offset] and stores it in the'Dx data register'.


4000000h - DISPCNT - LCD Control (Read/Write)

Bit Expl.
0-2 BG Mode (0-5=Video Mode 0-5, 6-7=Prohibited)
3 Reserved / CGB Mode (0=GBA, 1=CGB; can be set only by BIOS opcodes)
4 Display Frame Select (0-1=Frame 0-1) (for BG Modes 4,5 only)
5 H-Blank Interval Free (1=Allow access to OAM during H-Blank)
6 OBJ Character VRAM Mapping (0=Two dimensional, 1=One dimensional)
7 Forced Blank (1=Allow FAST access to VRAM,Palette,OAM)
8 Screen Display BG0 (0=Off, 1=On)
9 Screen Display BG1 (0=Off, 1=On)
10 Screen Display BG2 (0=Off, 1=On)
11 Screen Display BG3 (0=Off, 1=On)
12 Screen Display OBJ (0=Off, 1=On)
13 Window 0 Display Flag (0=Off, 1=On)
14 Window 1 Display Flag (0=Off, 1=On)
15 OBJ Window Display Flag (0=Off, 1=On)

The first should load the contents of the display register into the AR code's own internal tweaks. The AND instruction will hopefully have been done or otherwise available. Delete after the # to make it a more normal code list.
Most basic of codes that likely won't work
023FE424 E0033004 #Changes to add function to instead be Boolean AND
D9000000 04000000 # Loads the display controller data into the internal register
D4000000 FF0FFFFF # ANDS the display controller data such as to set all the background layers disabled.
D6000000 04000000 # Writes it back to the dispcnt
D3000000 00000000 # Resets the offset
D0000000 00000000 # Terminates the loop.

Whether you add a button prompt to it is up to you but that is covered elsewhere.

11111111000011111111111111111111 in binary is FF0FFFFF. Hopefully you can change the relevant 0s to 1 as that one will probably disable all layers (sprites still around though). Anyway AND if you have not done Boolean logic in a while is 1 only when both the item being ANDed and the thing itself are 1. That is to say having everything you don't want changed be a 1 will result in the 0s in your provided AND participant turning their matching counterparts to 0 as well.

I don't know how often the game will enable the layers if you disable them (some will do it nearly every frame, others not so much). Again this is also a cheat engine which normally only speaks to normal memory and struggles a bit with registers. If you want to do it in hardware then you would do much the same thing and set the relevant bits of the dispcnt (that only does the A engine, 041000000 is the B engine) to be low. This is a bit more involved than a simple write as https://gbatemp.net/threads/action-replay-code-to-switch-screens.355486/page-2 would indicate.

If in bizhawk some systems do support lua enabling and disabling layers
https://tasvideos.org/Bizhawk/LuaFunctions (click NES and SNES)
Sadly its DS aspect (based on melonds it looks like) does not support this if that is anything to go by. Whether you could use Lua to do the writing above (it will support memory manipulation, possibly even quite fancy by looking at other things and determining if it should be doing it).

Option the... we will call it third.
What is in the layer you want disabled? If you can find it in the game itself then you can possibly overwrite all the relevant pixels with alpha and achieve much the same effect. Most do this more for simple backgrounds or HUD elements but nothing stopping you from doing it for something more involved.
 

gamefaqs99

New Member
OP
Newbie
Joined
Aug 30, 2022
Messages
4
Trophies
0
Age
25
Location
TEXAS
XP
56
Country
Mexico
I wanto disable the BG3, but now I have a new question about searching values, when using bizhawk with "ram search" is possible freeze a group of values, but those values maybe never change even from the frame 0 of the emulation, is there a way to change all those values at once?, I have to test 1 by 1 on groups of hundred and hundred to see how each one affects on the display, it seems that the emulator doesn't have a option to set all the values at once. If I could change a group of 100 values for example to 1 or 0, I could find the correct adress by brute force, but at this moment the values in the red square have to be testes 1 by 1


cheat test.png
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,795
Trophies
5
XP
28,507
Country
United Kingdom
Why are you sticking with bizhawk? There are other emulators that might serve you better here -- the emulator you play with and the emulator you hack/make cheats with need not be the same thing.

Anyway two main options here.

1) In conventional cheats then changing many things at once is the domain of so called slide codes. Recall the previous post when it had an extra line to reset the offset, instead of resetting it then use the options it provides to do one write, move to the next bit and write again until you reach your limit. Used more to do repeated actions across lots of characters (think set HP back to full or stats to max for a party of 30, or make your inventory maxxed out when each item is handled individually and there are potentially hundreds you don't want to do codes for each) or more exotic things that might be context specific (if less than set to otherwise do nothing for a long list) but should do for this.
https://doc.kodewerx.org/hacking_nds.html again has listings.
Type 0x0C
Type 0xD1
Type 0xD6
Type 0xD5
Those will probably be what you want to look at.

2) Savestates are memory dumps. If the game does not change them then easy enough to take a savestate, overwrite what you want (various hex editors should be able to do this, might even use the boolean logic options except do an OR with FFFF to make sure it is all high if you want to set it all to what you want, or AND it with 0000 to set low) and load it back up to see the changes.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: https://www.youtube.com/watch?v=rgDtgyzVZYk