dciabrin / ngdevkit

Open source development for Neo-Geo
GNU Lesser General Public License v3.0
262 stars 26 forks source link

Disable eye catcher #19

Closed totologic closed 4 years ago

totologic commented 5 years ago

Hi

The eye catcher is running on Mame whereas it doesn't run on real hardware.

Is there a way to enable/disable the eye catcher on both platforms ?

Preferably, I would like to disable it completely.

totologic commented 4 years ago

More precisely, the eye catcher plays both on Mame and real hardware if in MVS mode. It doesn't play neither on Mame nor hardware if AES mode.

I tried to modify the crt0.o file at line 59: dc.b 0x01 /* BIOS shows logo at startup */

But without result. It didn't change anything. Maybe is there a proper way to compile this file in the project ?

dciabrin commented 4 years ago

Right, let me make this parameter configurable in the link script so that you can override it without using a custom crt0.

dciabrin commented 4 years ago

I tried to modify the crt0.o file at line 59: dc.b 0x01 /* BIOS shows logo at startup */

But without result. It didn't change anything. Maybe is there a proper way to compile this file in the project ?

OK so from https://wiki.neogeodev.org/index.php?title=68k_program_header it looks to me that setting this value to 0x2 should be enough to skip eye catcher altogether.

I've created https://github.com/dciabrin/ngdevkit/pull/28 to allow you to configure the value to be passed for your ROM at link time. You would need to change the way you link your elf file:

$ m68k-neogeo-elf-gcc `pkg-config --libs ngdevkit` main.o -Wl,--defsym,rom_eye_catcher=2 -o rom.elf

And you can verify that the correct value is used in the generated ROM with e.g. od:

$ m68k-neogeo-elf-objcopy -O binary -S -R .comment rom.elf rom/202-p1.p1 && dd if=rom/202-p1.p1 of=rom/202-p1.p1 conv=notrunc,swab
$ od -tx1 rom/202-p1.p1 | head -16
0000000 10 00 00 f3 c0 00 02 04 c0 00 08 04 c0 00 0e 04
0000020 c0 00 14 04 c0 00 1a 04 c0 00 1a 04 c0 00 1a 04
0000040 c0 00 1a 04 c0 00 20 04 c0 00 26 04 c0 00 26 04
0000060 c0 00 26 04 c0 00 26 04 c0 00 26 04 c0 00 2c 04
0000100 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0000140 c0 00 32 04 00 00 2c 02 00 00 68 02 00 00 00 00
0000160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000200 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
*
0000400 45 4e 2d 4f 45 47 00 4f 39 05 10 00 00 00 10 00
**0000420 00 00 00 00 00 02** 00 00 00 02 00 00 00 02 00 00
0000440 00 02 f9 4e 00 00 90 02 f9 4e 00 00 1c 03 f9 4e
0000460 00 00 1e 03 ff ff ff ff ff ff ff ff ff ff ff ff
0000500 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

the 02 at offset 420 is your flag.

Could you give it a try a check whether it fixes your issue?

totologic commented 4 years ago

Switching the value to 02 gives the expected result. It turns off the eye catcher both on AES and MVS modes.

dciabrin commented 4 years ago

Switching the value to 02 gives the expected result. It turns off the eye catcher both on AES and MVS modes.

Excellent, merged the PR and closed this issue accordingly. Thanks

dciabrin commented 4 years ago

Heads up @totologic : I just changed the name of the flag in order to implement #11 without name clash.