Jump to content
IGNORED

Emulator accuracy: Handy or Mednafen?


drludos

Recommended Posts

As I don't have any way to test games on my real Lynx for now, I'm wondering: which emulator is the most accurate compared to real hardware?

 

More specifically, is Handy or Mednafen the most accurate regarding the "limits" of Suzy rendering?

 

I'm programming in C with CC65 (karri edition). For my little project, the rendering is made of a single 20 SCB chain + 5-6 call to the text drawing routine. I'd like to target 60 fps.

 

On Handy, with the 20 sprites chain and a couple of text displayw, everything goes smoothly. But when I add more text calls (5-6 in total), the framerate drops dramatically to 30fps (tested on Windows and PSP versions of Handy) from time to time.

 

However, the same test with Mednafen (windows) runs at 60 fps without any framerate drops, even if I add more than 5-6 text drawing call.

 

In such a case, which emulators is faithful to the original hardware limitation : Handy or Mednafen?

 

Edited by drludos
Link to comment
Share on other sites

I must confess I like the "smooth" feeling created with a 60fps game, although I know many Atari Lynx games don't run at 60fps and are still as much fun. But seeing that my game is currently so close to running at 60 fps all the time, I wanted to see if you could do it. I'm also inspired by Nop90's Xump who managed to make it 60 fps :).

 

But, if you were to code a 30fps games on a Lynx, how would you do it?

AFAIK, you can't set a 30 fps refresh rate, so do you use a 60hz refresh rate but you swap your graphics buffer every 2 VBlanks only?

 

Link to comment
Share on other sites

Try to modify the text rendering to use the sprite chain, this will boost the performance a little.

 

But in m experience there are othe things that slow down the FPS with the CC65 compiler, the first one is the use of structures. Try to avoid structures and most of all any array of structures (except the sprites chain).

 

Link to comment
Share on other sites

38 minutes ago, Nop90 said:

Try to modify the text rendering to use the sprite chain, this will boost the performance a little.

 

But in m experience there are othe things that slow down the FPS with the CC65 compiler, the first one is the use of structures. Try to avoid structures and most of all any array of structures (except the sprites chain).

 

Thanks for those optimization tips! I use 2 structs array, I'll see if I can get rid of them (oddly enough, I don't use an array to hold the sprite chain: I always draw the same 20 sprites, but modify their position / graphics data according to the current game state).

 

Regarding text rendering, do you mean that it's faster to display letters/words through individual sprites instead of using the tgi_outtext fonctions?

Link to comment
Share on other sites

I can personally relate to the 60 fps target, but the occasional framedrop from 60 to 30 fps is much worse than a 30-fps locked game in a fast-paced game.

 

If your game is not fast-paced, and objects on oscreen don't cross 60 px per second, then the framedrop might be less noticeable (assuming the movement of objects doesn't simply slow down, but correctly handles skipped frame).

 

But, if that's the case, then there's zero point in having 60 fps in the first place. The game would definitely benefit from another ~56,467 cycles (*) of 65C02 that would be always available. Think of what other features you could do with all those cycles.

 

Don't forget that during 60fps, you pay the hefty price of clearing the screen and your available cycle budget is decimated. But when you go for 30 fps, you don't clear the framebuffer second time, so you do gain those additional ~56,467 cycles. That's a lot (assuming you don't just kill them waiting for Suzy to finish her business) !

 

 

*56,467 cycles: those are available to CPU after Mikey reads the framebuffer (which consumes about 10,200 cycles (8,160 [Bytes] * 5 [cycles] / 4 [16 MHz vs 4 MHz ratio]  ) from the original 66,667 cycles). That's my current best estimate from the documentation available. I'm assuming here Mikey knows how to cross the page non-accidentally and avoid 1c per page cross (if not, that's only about 32 pages = 32 cycles, anyway).

Link to comment
Share on other sites

9 hours ago, drludos said:

More specifically, is Handy or Mednafen the most accurate regarding the "limits" of Suzy rendering?

In such a case, which emulators is faithful to the original hardware limitation : Handy or Mednafen?

 

Same code base.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...