Mte90 / GBAATM-Rebirth

From the original source code a new rebirth, to add a Trainer in your GBA roms!
GNU General Public License v3.0
62 stars 3 forks source link

Wrong REG_VCOUNT address #5

Closed blackrose28 closed 4 years ago

blackrose28 commented 4 years ago

I believe it's 04000006, not 04000206 in vblank_int, and it's 16 bit, not 32 bit to use ldr r0,[r1]

Mte90 commented 4 years ago

The line you refer is https://github.com/Mte90/GBAATM-Rebirth/blob/master/core/romfuncs.cpp#L201

I already changed the ones on eddisint to have a 1:1 rom with the original tool. The problem for me is to convert this binary values in string so I can debug better.

blackrose28 commented 4 years ago

I'm using Visualboy Advance SDL H to debug, just set breakpoint at the address the GBAATM output to stdout

Mte90 commented 4 years ago

I need to convert all those strings so we can see if there are also other errors.

Right now I don't know how to test the vblank feature so I prefer to check carefully everything.

Mte90 commented 4 years ago

I am just checked the rom generated by the old tool on windows and the one generated by this one and the rom is the same. So You are saying that the original assembly code was wrong?

I am looking for a simple way to convert all this binary data in assembly code but seems that is not simple at all and require a manual conversion.

Can you help me on that @blackrose28 ?

blackrose28 commented 4 years ago

Yes, I believe the original code also wrong on Vblank. I will have some time on Monday, I'll convert those binary to assembly. No promise, but the the chance is high that all of them convertible

Mte90 commented 4 years ago

Thanks! With the assembly code we con debug more easily and see if there are other errors.

blackrose28 commented 4 years ago

GBAATM binary.txt @Mte90 If you want another binary to code or just want some clarification, ping me again

Mte90 commented 4 years ago

Wow there is everything :-D, I will add it in the readme! With This is just data what do you mean? As 04000206 is just data so change it will really fix it?

blackrose28 commented 4 years ago

Wow there is everything :-D, I will add it in the readme! With This is just data what do you mean? As 04000206 is just data so change it will really fix it?

If the code never run to the address and those bytes are just serving as data for the ldr and str opcode, I mark them as "data". You also need to add opcodes to mask 32 bit to 16 bit to fix vblank function, changing 04000206 to 04000006 is not enough.

blackrose28 commented 4 years ago

My mistake in vblankint, the hex was E59F100C, translate to code was: ldr r1, [pc, #0x0c], not E59F1010 : ldr r1, [pc, #0x10] in the last txt attachment

Mte90 commented 4 years ago

Ported to a wiki page https://github.com/Mte90/GBAATM-Rebirth/wiki I can do this change I don't know so much GBA assembly, so I don't know the different address what contain. For the opcodes do you have any suggestions about the changes to do?

blackrose28 commented 4 years ago

Ported to a wiki page https://github.com/Mte90/GBAATM-Rebirth/wiki I can do this change I don't know so much GBA assembly, so I don't know the different address what contain. For the opcodes do you have any suggestions about the changes to do?

You can try this: { 0xE59F1010, 0xE5910000, 0xE20000FF, 0xE35000A0, 0xAA000001, 0xE12FFF1E, 0x4000006 }; translate to code of E20000FF : "and r0, r0, #0xff", this would mask the register to 16 bit

Mte90 commented 4 years ago

I did a new branch with this new code https://github.com/Mte90/GBAATM-Rebirth/tree/vblankint Require some testings, do you have any hints? maybe test with a specific rom?

blackrose28 commented 4 years ago

I did a new branch with this new code https://github.com/Mte90/GBAATM-Rebirth/tree/vblankint Require some testings, do you have any hints? maybe test with a specific rom?

No need to test with specific rom, any rom will do. You can watch the memory auto update area in visual boy advance-m to verify the function work.

Mte90 commented 4 years ago

I never used VBA-M but I will do some tests to see if the trainer menu generation is broken.

Mte90 commented 4 years ago

I tested the code and the trainer still works. I will merge it in the next days.

Mte90 commented 4 years ago

New code is on the master branch :-)