{"id":13219,"date":"2006-10-25T02:12:06","date_gmt":"2006-10-25T02:12:06","guid":{"rendered":"http:\/\/127.0.0.1\/ef\/?p=13219"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T22:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/www.emu-france.com\/?p=13219","title":{"rendered":"[www] Bsnes WIP"},"content":{"rendered":"<p>Des nouvelles pour cet \u00e9mulateur de SuperNes:<\/p>\n<p><em>    Wrote a scheduler for bsnes which gains an extra <strong>~8-16% speedup<\/strong>, depending on how much communication occurs between the S-CPU and S-SMP. This new scheduler basically allows either the S-CPU or S-SMP to run an entire frames&rsquo; worth of opcodes before synchronizing if possible, whereas before there was a force sync after every opcode. The scheduler is also now completely responsible for interfacing with libco, so all cothreading is handled here. Now, for instance, synchronization between the S-CPU and S-SMP involves a direct thread switch from the S-CPU thread to the S-SMP thread, whereas before this would require a switch from S-CPU to the main execution thread, and then to the S-SMP thread. Lastly, it also optimizes one more edge case. If one processor tries reading from or writing to another processor, but the processor performing this read\/write request is currently behind execution of the other processor, then no synchronization is necessary. bsnes can now execute the theoretical limit of CPU\/SMP opcodes in a row with absolutely zero accuracy loss. I doubt I will be able to gain any more speed out of libco. It has now increased speed in totality from the old cycle-based cores by over 40%. One last great thing about the new scheduler is that it also will allow multiple clocks of varying frequencies to be run at the same time. Meaning, even though I&rsquo;ve no interest in adding either at this time, a CPUSA1 or CPUSFX sync clock would now be far easier to implement. I also optimized the CPUSMP clock to perform a 32*32=64bit multiplication, thanks to TRAC pointing out my casting mistake which was performing a far more costly 32*64=64bit multiplication when not necessary.<br \/>\n    Next up, the S-DSP is now enslaved inside the S-SMP, meaning S-DSP SPCRAM accesses will no longer desynchronize with the S-SMP for up to one opcode as in bsnes v0.017-v0.018.<br \/>\n    Lastly, some fixes to the S-SMP opcode core. Added support for reads that occur during most of the mov instructions, and corrected cmpw to take four cycles instead of five like addw and subw. I also adjusted the S-DSP to run at 32040hz, and moved PAL S-CPU&rsquo;s speed back to 21281370hz, which is more in line of what has been observed in the past. NTSC S-CPU remains unchanged at 21477272hz. Earthworm Jim 2 sound effects still work in all regions.<\/em><\/p>\n<p class=\"p_site_officiel\"><a href=\"http:\/\/byuu.cinnamonpirate.com\/?page=bsnes_news\" class=\"site_officiel\" target=\"_blank\">Site Officiel<\/a><\/p>\n<div class=\"fcbkbttn_buttons_block\" id=\"fcbkbttn_left\"><div class=\"fb-share-button  \" data-href=\"https:\/\/www.emu-france.com\/?p=13219\" data-type=\"button_count\" data-size=\"small\"><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Des nouvelles pour cet \u00e9mulateur de SuperNes: Wrote a scheduler for bsnes which gains an extra ~8-16% speedup, depending on how much communication occurs between the S-CPU and S-SMP. This new scheduler basically allows either the S-CPU or S-SMP to &#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[],"class_list":["post-13219","post","type-post","status-publish","format-standard","hentry","uentry","postonpage-1","odd","post-author-Jets"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/sKi2R-","jetpack_likes_enabled":false,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.emu-france.com\/index.php?rest_route=\/wp\/v2\/posts\/13219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.emu-france.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.emu-france.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.emu-france.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.emu-france.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=13219"}],"version-history":[{"count":0,"href":"https:\/\/www.emu-france.com\/index.php?rest_route=\/wp\/v2\/posts\/13219\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.emu-france.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=13219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.emu-france.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=13219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.emu-france.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=13219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}