Hello! I would like to apologize ahead if my question was hard to understand.
I am making a virtual machine emulator in Godot. It's a custom machine, my own CPU implementation, GPU, et cetera.
The important thing to understand is that currently, the
_process routine and the
_physics_process are the important parts. The
_process routine takes the current picture from the emulated GPU and displays it as a texture. The
_physics_process calls the CPU once so that it can process instructions.
_process routine is called 60 times every second (if possible) so the screen is updated 60 times per second, and that's perfectly fine. But since
_physics_process is called 60 times per second by default, this makes the CPU run at 60 Hz, and even the first Nintendo ran at 1,790,000 Hz (1.7 MHz). To help improve this, I have set the physics FPS setting to 480 Hz, and that did improve the speed of the emulated CPU a lot. But I can't help but doubt that this is the right way to approach this problem.
Since 480 Hz is still quite slow for a CPU, I would like to increase this to at least 1,024 or 2,048 Hz. I'm sure I can just try setting the physics FPS to that, but I would like to ask first if I am approaching this correctly, or if there are better ways to handle this situation.
The code is open-source, and the code responsible for calling the CPU and updating the screen can be seen here.
I kindly ask for the community's guidance regarding this. Thank you very much in advance!