{"action":"created","issue":{"url":"https://api.github.com/repos/gonetz/GLideN64/issues/684","labels_url":"https://api.github.com/repos/gonetz/GLideN64/issues/684/labels{/name}","comments_url":"https://api.github.com/repos/gonetz/GLideN64/issues/684/comments","events_url":"https://api.github.com/repos/gonetz/GLideN64/issues/684/events","html_url":"https://github.com/gonetz/GLideN64/issues/684","id":103307169,"number":684,"title":"convert CPU reads/writes into callbacks","user":{"login":"purplemarshmallow","id":7283660,"avatar_url":"https://avatars.githubusercontent.com/u/7283660?v=3","gravatar_id":"","url":"https://api.github.com/users/purplemarshmallow","html_url":"https://github.com/purplemarshmallow","followers_url":"https://api.github.com/users/purplemarshmallow/followers","following_url":"https://api.github.com/users/purplemarshmallow/following{/other_user}","gists_url":"https://api.github.com/users/purplemarshmallow/gists{/gist_id}","starred_url":"https://api.github.com/users/purplemarshmallow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/purplemarshmallow/subscriptions","organizations_url":"https://api.github.com/users/purplemarshmallow/orgs","repos_url":"https://api.github.com/users/purplemarshmallow/repos","events_url":"https://api.github.com/users/purplemarshmallow/events{/privacy}","received_events_url":"https://api.github.com/users/purplemarshmallow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-08-26T16:08:23Z","updated_at":"2015-08-28T16:28:03Z","closed_at":null,"body":"I got this advice from degasus, a dolphin developer\r\n>you should look for a way to detect when the CPU is trying to access the memory range. Those read & writes can be transformed in callbacks which to all of this ugly copying work \"live\". \r\n\r\nCopying to and from RDRAM is very ugly indeed. CPU based effects should be emulated this way. Emulator and gfx developers need to work together on this one."},"comment":{"url":"https://api.github.com/repos/gonetz/GLideN64/issues/comments/135825277","html_url":"https://github.com/gonetz/GLideN64/issues/684#issuecomment-135825277","issue_url":"https://api.github.com/repos/gonetz/GLideN64/issues/684","id":135825277,"user":{"login":"gonetz","id":8983092,"avatar_url":"https://avatars.githubusercontent.com/u/8983092?v=3","gravatar_id":"","url":"https://api.github.com/users/gonetz","html_url":"https://github.com/gonetz","followers_url":"https://api.github.com/users/gonetz/followers","following_url":"https://api.github.com/users/gonetz/following{/other_user}","gists_url":"https://api.github.com/users/gonetz/gists{/gist_id}","starred_url":"https://api.github.com/users/gonetz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gonetz/subscriptions","organizations_url":"https://api.github.com/users/gonetz/orgs","repos_url":"https://api.github.com/users/gonetz/repos","events_url":"https://api.github.com/users/gonetz/events{/privacy}","received_events_url":"https://api.github.com/users/gonetz/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T16:28:03Z","updated_at":"2015-08-28T16:28:03Z","body":"IMO:\r\n\r\n1 cite: \"If the CPU modifies the framebuffer this operation is converted into a GPU operation and frame buffer on the GPU is modified instead. Dolphin calls this \"efb poke\" \"\r\n\r\nI see no point for such technique. It would be enough if emulator will notify graphics plugin that color buffer is modified. The plugin will load the color buffer as texture and blend it with current frame buffer. That is the way, how \"Render frame buffer as texture\" works, but the help from emulator side will allow plugin not to do it every frame.\r\n\r\n2. Notification, that CPU is going to read from frame buffer may help with frame and depth buffer emulation greatly. Especially for depth buffer emulation. Currently plugin reads data from graphics card for every pixel in RDRAM depth buffer. CPU usually needs only few pixels to probe and decide should the object (corona) be drawn. If emulator will ask plugin to read hundred pixels instead of 640x480 area, it will be great speed up. Also it will fix issue with data synchronization, which we have in HLE/LLE mode. Reads from graphics card will be performed right when they needed. But emulator must wait until that data is read.\r\n"}}