6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 12:47 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Tue Sep 01, 2020 6:30 pm 
Offline

Joined: Thu Feb 06, 2020 5:37 pm
Posts: 6
lib65816 seems to be the best option for cycle-accurate 65816 emulation. The problem I have with it is that it takes over the main loop of the program (something I'm not a fan of in any library except for GUI-central ones), which makes emulating a whole system outside of lib65816's scope more difficult.

For one, I need to simulate wait states from reading certain sections of the address space, and when copying video data from RAM to the display device.

Anyone has any tips for dealing with this?


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 02, 2020 11:17 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
I think it's common enough for general machine emulators to run some number of instructions and then handover to the emulation of peripherals such as video, and this turns out not to be a good match for highly detailed emulations which need accurate cycle-by-cycle accesses.

Possibly a good start would be to take the leaf routines from lib65816 and rework them into a different framework. But then, these routines won't be taking care to perform cycle by cycle activity, so they might need a fair bit of work.

For hints on approaches, I do recommend the blog posts on the construction of JSBeeb: it's a different language, but a very accurate simulator of a 6502 system.
https://xania.org/201405/jsbeeb-emulati ... javascript


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 02, 2020 4:39 pm 
Offline

Joined: Thu Feb 06, 2020 5:37 pm
Posts: 6
I see. I probably won't do that, though, since lib65816 is very intimidating, and I know little about the 65816's internal behaviour. I'd rather just lose that level of accuracy for getting the system emulator out sooner (and it's my own design, so I have more freedom there).


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 02, 2020 4:52 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Sounds like a good idea! Cycle-accurate emulation should only be needed for the most intricate low-level code: graphical demos and copy protection routines spring to mind. And anything which races the beam. On a new system design none of that need apply.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: