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

RTC not correctly recognized in Pokémon Fire Red rom-hack (Radical Red) #105

Closed
dogepotion opened this issue Sep 24, 2021 · 14 comments
Closed

Comments

@dogepotion
Copy link

dogepotion commented Sep 24, 2021

This is a bit of a trivial issue but it is something I noticed. With the MiSTer GBA core the game gives a warning that the RTC could not be read and that you may experience issues with the day/night cycle, however this does not occur in any software emulators I have tried (mGBA, NanoboyAdvance), on real hardware with the EZ Flash Omega DE flashcart, or with GBARunner2 on a DSi or original DS (GBARunner2 has many other issues however).

I have heard this problem also occurs on real hardware if you are using an Everdrive X5/Mini (correction- you need to manually enable RTC for the game in the Everdrive menu, once you do it works fine), so I am unsure if how it behaves is a result of how accurately either flash-cart simulates a GBA cartridge or something entirely different. However, seeing as the fairly accurate software emulators I have tried as well as the EZ Flash and GBARunner2 don't experience this issue I am inclined to believe there is possibly something wrong with how this core is handling this specific game.

@RobertPeip
Copy link
Member

The reason is most likely that the game is not in the RTC list.
As it is written in the readme, only some games are supported for RTC.
"If there is a game you want to play that also uses one of these features, but is not listed, please open a bug request."

The reason is simple: i cannot activate RTC for all games, because it overwrites some part of the ROM, which would break normal games.
So we either must have a RTC recognition(which we don't have as this is very difficult in FPGA) or a whitelist.

You can find the whitelist in code here(gpio_quirk):
https://github.com/MiSTer-devel/GBA_MiSTer/blob/master/GBA.sv#L686-L700

As I don't have this romhack, you must help at this point.
Please open the ROM with a hexeditor and look at address A0 for the name, so it can be added to the list.

It looks like this for Pokemon Emerald:
poke_eme

Best would be if you can also make a screenshot and show here.

Warning: if they use the same code as normal Pokemon Red, this method cannot work, as it would break normal Pokemon Red. In this case we have to think what else can be done.
But please look first.

Thanks!

@dogepotion
Copy link
Author

Here is what's in the hex editor. I've previously used tools to change this from Fire Red to Emerald and it got rid of the issue, however I'm not sure if there are any downsides to doing that.

Screenshot 2021-09-25 011002

@RobertPeip
Copy link
Member

There are no downsides, as this code is used for nothing else.

Also it's the same string as the original firered, so i cannot add it to the list, without breaking firered.

Until someone comes with a good idea, the best is probably to patch the game.

I would add a OSD option to force the game to use it, but people using it on non-rtc games will result in mysterious bugs, so i'd rather not do that.

@dogepotion
Copy link
Author

Maybe some config file or other partially hidden menu where you can set a flag to enable it for certain games? It's not something 99% of people will need, and if they do need it they won't need it very often, so I don't think it needs to be in the main OSD. Maybe it could be done for non-whitelisted games by having the user just create a file alongside the ROM with the exact same filename as the ROM but the extention .rtc and the core would check for that file to see if RTC should be used?

@RobertPeip
Copy link
Member

The core cannot check for files on the SDCard, only HPS can.

I will leave this open. When I have time, I will check what the emulators do to search for RTC. Maybe there is a hidden string somewhere like there is for 1Mbit flash.
If it's not too complicated, FPGA logic can also do it.

@missionfloyd
Copy link
Contributor

@RobertPeip
Copy link
Member

Thanks for looking it up.

So that means we can most likely not do much about it if a romhack using the original game ID but needs additional features.

@zeroum
Copy link

zeroum commented Jun 9, 2022

Hello! I came here looking for the same "Pokémon FireRed romhack does not detect RTC" problem, but with a different romhack(Unbound). Surprisingly the hack even has instructions on how to deal with this problem in some more popuar emulators, but this core is not in their list.

Some extra info: FireRed is often used as a base for dozens of hacks, as its code is cleaner and more stable than other versions.

I would add a OSD option to force the game to use it, but people using it on non-rtc games will result in mysterious bugs, so i'd rather not do that.

Can we change your mind? I'd buy you a cup of coffee :-)

I know I'm not the one in the end that receives the bug reports(I do too, but not in this project), but I feel it's better to solve a problem some people are having for real today, than a possible future one. It's just unfortunate there aren't enough tools to deal with it more surgically.

Suggestion: A Debug/Hacks/Advanced menu with an option saying "Force RTC support (DO NOT USE in non-RTC games)", with a big warning text. Yeah it's crude.

@RobertPeip
Copy link
Member

I make you an offer: i create a special version tomorrow that will always enable it on firered and leafgreen just as for e.g. emerald.
You can use this version forever for your romhacks.

If you want the change to be in future versions too, please play a while on the unmodded firered game with this, then save ingame, then save to sdcard. If the savefile is 128kbyte -> RTC area was not used by the original game and we can savely always enable it for these two games.

@twinfami
Copy link

I would add a OSD option to force the game to use it, but people using it on non-rtc games will result in mysterious bugs, so i'd rather not do that.

Kinda a dumb excuse not to do if you ask me. I'd say do it, especially with how popular these hacks are. People are gonna be stupid. You can't be responsible for stupid.

@birdybro
Copy link
Member

If you add a bunch of options for every hack that is improperly made then it gets bloated eventually and you get a lot of false positive bug submissions. You have to think of the long-term maintenance of this sort of thing from the perspective of the developer. If the ROM hack devs had done the hack with a different game ID then a quirk could have been made to account for it.

@RobertPeip
Copy link
Member

When i find time, i will add a OSD option for RTC that is hidden until you press a special button combo that is mentioned in the readme with a big warning. That way it can be used and prevents people from having a bad experience by getting random crashes just because they think RTC on = good.

@SerjTargarien
Copy link

Thanks for that last solution, Robert. Would rather play my romhacks in the mister rather than a small handheld screen if i can help it. The hidden setting is a great compromise. Looking forward to it.

@RobertPeip
Copy link
Member

New feature is available in OSD to enable RTC for any romhack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants