News:

11 March 2016 - Forum Rules

Main Menu

Help with editing 3D NDS graphic protocol?

Started by a_friendly_irin, August 11, 2023, 07:31:49 PM

Previous topic - Next topic

a_friendly_irin

(This is somewhat a continuation of my last topic; apologies if I should have continued it, I'm unsure of the etiquette of necroposting vs. new topics.)

I'm attempting what I thought would be a simple text edit of the NDS game Devil Survivor, but I've discovered that the text I want to change is rendered as a 3D object, and I am unclear how to modify it. I'm using No$GBA debugger and have read its documentation on the subject, but I'm still lost on what to actually do next.



As you can see in this image, the / symbol displayed in the character entries on the lower screen cuts into some of the longer words. I would like to remove it, but it's a 3D object rather than normal text. According to No$GBA, it's rendered with the following code:
begin_vtxsSepQuad 00000001
color 00007FFF
texcoord 00700280
vtx_16 F800F800 00000000
color 00007FFF
texcoord 00F00280
vtx_16 0800F800 00000000
color 00007FFF
texcoord 00F002D0
vtx_16 08000800 00000000
color 00007FFF
texcoord 007002D0
vtx_16 F8000800 00000000
end_vtxs
mtx_pop ;MtxMode=2 00000001
mtx_mode 00000002
mtx_push ;MtxMode=2
I assume it should be straightforward to simply replace this code with nop to remove the object, but I don't understand how to find or edit this code in the NDS file. I tried watching the addresses the documentation claimed were instruction registers, but didn't see anything.

FAST6191

Do check the files first -- while there are multiple formats seen out in the wild if it is nsbtx (or possibly nsbmd with it embedded). Not to mention if it is a text thing then while it might ultimately be rendered in the 3d hardware (odd for that much text and that simple, assuming you are not mistaking a final render for the layers that go to it) it could still be a more conventional text setup/font (NTFR which sees multiple editors available being the Nintendo provided one but again multiple alternatives seen out in the wild, though more amenable to conventional 2d graphic editing).

As far as 3d hardware on the DS if it does come down to such fun and games (removing it rather than making it invisible/fail to load is probably the better choice) then things are passed to the hardware https://problemkaputt.de/gbatek.htm#ds3doverview so you are instead probably going to want to play with break on write to said same areas.

a_friendly_irin

#2
The graphical data is all stored as .cmp files, which I don't know how to unpack. (I'm using Tinke.) A quick search tells me Kuriimu can do it, but when I try to open it I'm told it needs .NET Core, despite my already having the latest version of .NET installed.

FAST6191

.cmp is perhaps not quite as common a choice as .pac or the like but going to be up there in the generic "just need an extension for this archive format" stakes. To that end I would be wary of claims of support for such things.

Equally plenty of archive formats house other formats without them (possibly even solo -- had a few such games where some dev made an archive and everything got shoved into it). Might be worth searching for the various magic stamps.
https://wiki.vg-resource.com/Nitro_Files#1._NSBMD_Format
https://www.romhacking.net/documents/%5B469%5Dnds_formats.htm

a_friendly_irin

I'm having trouble believing this is going to be easier than just deleting the draw code. How can I find that code in the game file?

Jorpho

Quote from: a_friendly_irin on August 12, 2023, 08:24:00 AMwhen I try to open it I'm told it needs .NET Core, despite my already having the latest version of .NET installed.
.NET is not backwards-compatible. It doesn't mater if you have the latest version of .NET if a program is compiled with an older version of .NET.

A moment of Googling (you did try Googling, right..?) suggests you need .NET 3.1.6.
https://www.gamebrew.org/wiki/Kuriimu2_3DS
This signature is an illusion and is a trap devisut by Satan. Go ahead dauntlessly! Make rapid progres!

lightbulbsun

I'm fairly certain I've identified the function call that draws the six slashes you want to get rid of, but I can't completely rule out this won't eliminate other stuff. Anyway, give this a shot:
Open the .nds file in a hex editor and go to offset 0x1af1c8.
There you should find the four bytes 0x55 0x6a 0xf9 0xeb.
Change those to 0x00 0x00 0xa0 0xe1.

a_friendly_irin

#7
Quote from: lightbulbsun on August 13, 2023, 05:50:03 AMOpen the .nds file in a hex editor and go to offset 0x1af1c8.
There you should find the four bytes 0x55 0x6a 0xf9 0xeb.
Change those to 0x00 0x00 0xa0 0xe1.
Your prediction of the bytes and their location was correct, but changing them doesn't seem to have done anything. Sorry I'm dumb, this worked for one fusion menu (selecting a fusion from your existing demons), but not for the other (searching for a desired fusion).