It is currently Thu Dec 14, 2017 8:19 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Tue Aug 23, 2005 12:12 pm 
Offline
User avatar

Joined: Tue Dec 21, 2004 8:35 pm
Posts: 600
Location: Argentina
I just want to know what is better for cpu emulation:

- Has a big "switch" with all opcodes inside it (method i used before); (if the compiler compiles to a jump table of course)
- Has a function per opcode, and call it with a pointer from a table, i mean an array of function pointers. Im implementing some type of "cache" too...
takes the same or regarding the NES the half of memory of cpu ((0x8000) * 4 bytes) size, and when an emulated opcode (function) has been executed is "recorded" in the array related to PC, so when this PC Value is read again jumps directly without the compiler to seek in the table it searched before. (method im actually using)
- Write the cpu core in asm to create global scope labels (wich i dont know if this can be done in VC++ c compiler), and implement that "cache". (i wrote one about one yaer ago but was just "c code translated to asm)". And emu the opcodes with the similar machine opcodes (of course this affects portability).(third method)

anyway, i have heard that a pointer to function table (second method, the one that im using) can compromise CPU target Cache mem, that why im thinking in changing the emu cpu core.

_________________
ANes


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 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:  
Powered by phpBB® Forum Software © phpBB Group