News for hackers. Stuff that matters.
Re:Nuked-MD-FPGA – accurate Sega Genesis re-implementation b... by pjc50 on Friday August 04, 2023 @04:33AM (#36997138)
I _think_ the argument is that the emulator runs on a per-frame basis, and the treatment of very short sub-frame-duration button presses may be different?
Re:Nuked-MD-FPGA – accurate Sega Genesis re-implementation b... by rasz on Friday August 04, 2023 @06:07AM (#36997797)
Afaik no emulator runs at frame granularity.

Emulators have tons of sync points, less than real hardware, but still plenty. The more sync points you add the slower emulation gets most of the time. Do we emulate transferring x length of bytes to a buffer in another part of hardware (video ram for example) one system bus wide word at a time or do we just cope it all at once and move on? etc.

Re:Nuked-MD-FPGA – accurate Sega Genesis re-implementation b... by grishka on Friday August 04, 2023 @07:08AM (#36998282)
> Do we emulate transferring x length of bytes to a buffer in another part of hardware (video ram for example) one system bus wide word at a time or do we just cope it all at once and move on? etc.

Syncing aspects of the emulated hardware with each other is easy. You still have to count clock cycles somewhere. So you just execute the necessary number of CPU cycles while your DMA is running, then set the flag that it's done or whatever. And you have to do the same thing with hardware timers anyway — you trigger an interrupt after X clock cycles.

It's syncing the emulator itself to real time that's tricky.

Re:Nuked-MD-FPGA – accurate Sega Genesis re-implementation b... by fredoralive on Friday August 04, 2023 @06:35AM (#36997974)
Don't most games of the era basically only poll inputs once per frame anyway? The Mega Drive six button controller basically relies on that behaviour, and the list of games that need to be forced into 3 button mode is quite short.
Re:Nuked-MD-FPGA – accurate Sega Genesis re-implementation b... by grishka on Friday August 04, 2023 @06:59AM (#36998205)
For starters, you can't run this kind of emulator on a per-frame basis (i.e. run all the game code for one frame, then wait for vsync on the host system, then repeat) if you want sound. Games rely on running at a certain clock speed and they generate sound by writing to the registers of the sound chip. They sometimes do it more frequently than the refresh rate of the screen. You have to sync with real time much more often than once per frame for everything to work as intended.
Re:Nuked-MD-FPGA – accurate Sega Genesis re-implementation b... by ghusbands on Friday August 04, 2023 @09:41AM (#36999901)
That doesn't make sense. You're confusing inside-emulation time with outside-emulation time. It's entirely possible to run an emulator for a frame at a time and get the sound right; the emulator just needs to run things in the right order or with the right internal synchrony.

It's also entirely possible to run an emulator at many times real-time and get the sound output correct, however you use it. You can use this to quickly get wav/mp3 copies of game music, for example.

Re:Nuked-MD-FPGA – accurate Sega Genesis re-implementation b... by circuit10 on Saturday August 05, 2023 @10:09AM (#37012154)
Can’t you just queue up a frame of sound and then play it?