Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32x-skeleton freezes at the start in Gens #20

Open
Dasutin opened this issue Jan 26, 2022 · 3 comments
Open

32x-skeleton freezes at the start in Gens #20

Dasutin opened this issue Jan 26, 2022 · 3 comments
Labels

Comments

@Dasutin
Copy link

Dasutin commented Jan 26, 2022

Building the 32X-skeleton, or any 32X project built off of the current release (2021.04) and running it in Gens results in the ROM freezing at the start. Any other emulator, like BizHawk or RetroArch, works. Running it on real hardware works.

I can not replicate this issue with the 2020.01 release in Gens.

@andwn
Copy link
Owner

andwn commented Jan 27, 2022

Wonder if it has to do with GCC 9 vs 10. I can't get GCC 11 to even compile for SH-2 and have held off upgrading because of it. Will have to compare when I have some time later.
Edit: typo

@Dasutin
Copy link
Author

Dasutin commented Jan 30, 2022

I was doing some testing and narrowed down where the problem is coming from. I reverted all changes to m68k_crt1.s. Removed the added linker file md_crt1.ld.

Last I modified the Makefile to remove the changes and add back the old

- m68k_crt0.bin: m68k_crt0.s
-	$(MDAS) $(MDASFLAGS) $< -o [email protected]
-	$(MDLD) $(MDLDFLAGS) --oformat=binary [email protected] -o $@

- m68k_crt1.bin: m68k_crt1.s $(MDOBJS)
-	$(MDAS) $(MDASFLAGS) m68k_crt1.s -o m68k_crt1.o
-	$(MDLD) -nostdlib -T md_crt1.ld --oformat=binary m68k_crt1.o $(MDOBJS) -o m68k_crt1.bin

+ m68k_crt%.bin: m68k_crt%.s
+	$(MDAS) $(MDASFLAGS) $< -o [email protected]
+	$(MDLD) -nostdlib --oformat=binary [email protected] -o $@

Making the changes allowed my project to work in Gens. I also make the same changes to the 32x-skeleton example code and it works too.

I also noticed parts of my project where I was printing some text from the Genesis was causing the ROM to freeze on real hardware. I'm not doing it everywhere on my ROM so I didn't catch it before. It works in emulation (except Gens) but was causing some glitching on the top left of the screen. After making those changes, printing text from the Genesis isn't freezing on real hardware, and the glitching on the top left of the screen is gone (Gens works).

Hope this helps narrow the problem down.

@andwn
Copy link
Owner

andwn commented Jan 31, 2022

I did that so C code could be run both on SH and M68000 CPUs (the code would be copied into and run from RAM), but guess it's still wonky. Maybe it would be best to revert it for now and try again when I'm in the mood to experiment with 32X again. Or better yet stick to assembly on m68k 😝

@andwn andwn added the bug label Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants