{"action":"created","comment":{"url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/comments/240051043","pull_request_review_id":182992511,"id":240051043,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDA1MTA0Mw==","diff_hunk":"@@ -0,0 +1,156 @@\n+// Copyright 2018 Dolphin Emulator Project\n+// Licensed under GPLv2+\n+// Refer to the license.txt file included.\n+\n+#include \"Core/HW/SI/SI_DeviceGCPedometer.h\"\n+\n+#include <cstring>\n+\n+#include \"Common/ChunkFile.h\"\n+#include \"Common/CommonTypes.h\"\n+#include \"Common/Logging/Log.h\"\n+#include \"Common/MsgHandler.h\"\n+#include \"Common/Swap.h\"\n+#include \"Core/HW/SI/SI_Device.h\"\n+\n+namespace SerialInterface\n+{\n+// Gamecube Pedometer aka Inro-Kun\n+CSIDevice_GCPedometer::CSIDevice_GCPedometer(SIDevices device, int device_number)\n+    : ISIDevice(device, device_number)\n+{\n+}\n+\n+int CSIDevice_GCPedometer::RunBuffer(u8* buffer, int length)\n+{\n+  // For debug logging only\n+  ISIDevice::RunBuffer(buffer, length);\n+\n+  // Read the command\n+  EBufferCommands command = static_cast<EBufferCommands>(buffer[0]);\n+\n+  // Process command\n+  switch (command)\n+  {\n+  case CMD_RESET:\n+  {\n+    // Return joybus ID for buffer commands\n+    u32 id = Common::swap32(SI_GC_PEDOMETER);\n+    std::memcpy(buffer, &id, sizeof(id));\n+    break;\n+  }\n+\n+  // Return data from pedometer\n+  case CMD_DATA:\n+  {\n+    // Pedometer expects 0x51 bytes from buffer\n+    if (length == 0x51)\n+    {\n+      // Clear existing data on SI buffer for pedometer response\n+      for(int i = 0; i < length; i++)","path":"Source/Core/Core/HW/SI/SI_DeviceGCPedometer.cpp","position":null,"original_position":50,"commit_id":"1effc4d50a4b19dff5a3f0369a4da67196c00612","original_commit_id":"59d144aca1123afaa9e1c369220360e0d477aeef","user":{"login":"shonumi","id":7418176,"node_id":"MDQ6VXNlcjc0MTgxNzY=","avatar_url":"https://avatars0.githubusercontent.com/u/7418176?v=4","gravatar_id":"","url":"https://api.github.com/users/shonumi","html_url":"https://github.com/shonumi","followers_url":"https://api.github.com/users/shonumi/followers","following_url":"https://api.github.com/users/shonumi/following{/other_user}","gists_url":"https://api.github.com/users/shonumi/gists{/gist_id}","starred_url":"https://api.github.com/users/shonumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shonumi/subscriptions","organizations_url":"https://api.github.com/users/shonumi/orgs","repos_url":"https://api.github.com/users/shonumi/repos","events_url":"https://api.github.com/users/shonumi/events{/privacy}","received_events_url":"https://api.github.com/users/shonumi/received_events","type":"User","site_admin":false},"body":"Wasn't sure what convention to use. Any preference between memset or fill_n?","created_at":"2018-12-09T20:05:00Z","updated_at":"2018-12-09T20:05:00Z","html_url":"https://github.com/dolphin-emu/dolphin/pull/7615#discussion_r240051043","pull_request_url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/7615","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/comments/240051043"},"html":{"href":"https://github.com/dolphin-emu/dolphin/pull/7615#discussion_r240051043"},"pull_request":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/7615"}},"in_reply_to_id":240050869},"pull_request":{"url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/7615","id":237103963,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MTAzOTYz","html_url":"https://github.com/dolphin-emu/dolphin/pull/7615","diff_url":"https://github.com/dolphin-emu/dolphin/pull/7615.diff","patch_url":"https://github.com/dolphin-emu/dolphin/pull/7615.patch","issue_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/7615","number":7615,"state":"open","locked":false,"title":"Implement GC pedometer as input device","user":{"login":"shonumi","id":7418176,"node_id":"MDQ6VXNlcjc0MTgxNzY=","avatar_url":"https://avatars0.githubusercontent.com/u/7418176?v=4","gravatar_id":"","url":"https://api.github.com/users/shonumi","html_url":"https://github.com/shonumi","followers_url":"https://api.github.com/users/shonumi/followers","following_url":"https://api.github.com/users/shonumi/following{/other_user}","gists_url":"https://api.github.com/users/shonumi/gists{/gist_id}","starred_url":"https://api.github.com/users/shonumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shonumi/subscriptions","organizations_url":"https://api.github.com/users/shonumi/orgs","repos_url":"https://api.github.com/users/shonumi/repos","events_url":"https://api.github.com/users/shonumi/events{/privacy}","received_events_url":"https://api.github.com/users/shonumi/received_events","type":"User","site_admin":false},"body":"The GameCube game Ohenro-san: Hosshin no Dojo came bundled with a pedometer that plugs into the 4th controller port. This implements the basics of the pedometer as an SI device. It's enough to get the game to register the emulated device:\r\n\r\n**Before**\r\n![Before](https://i.ibb.co/xmhK3MK/GODJGA-1.png)\r\n\r\n**After**\r\n![After](https://i.ibb.co/KVJFVDT/GODJGA-2.png)\r\n\r\nCurrently this does not let users specify data the pedometer sends (such as height, weight, number of steps, etc). I would like to break that up into other PRs down the road (to make code reviews easier), once I better figure out Dolphin's codebase.","created_at":"2018-12-09T02:36:00Z","updated_at":"2018-12-09T20:05:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf91b9ac167b26d46fc7284f02e67164863f7034","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/7615/commits","review_comments_url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/7615/comments","review_comment_url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/7615/comments","statuses_url":"https://api.github.com/repos/dolphin-emu/dolphin/statuses/1effc4d50a4b19dff5a3f0369a4da67196c00612","head":{"label":"shonumi:gamecube-pedometer","ref":"gamecube-pedometer","sha":"1effc4d50a4b19dff5a3f0369a4da67196c00612","user":{"login":"shonumi","id":7418176,"node_id":"MDQ6VXNlcjc0MTgxNzY=","avatar_url":"https://avatars0.githubusercontent.com/u/7418176?v=4","gravatar_id":"","url":"https://api.github.com/users/shonumi","html_url":"https://github.com/shonumi","followers_url":"https://api.github.com/users/shonumi/followers","following_url":"https://api.github.com/users/shonumi/following{/other_user}","gists_url":"https://api.github.com/users/shonumi/gists{/gist_id}","starred_url":"https://api.github.com/users/shonumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shonumi/subscriptions","organizations_url":"https://api.github.com/users/shonumi/orgs","repos_url":"https://api.github.com/users/shonumi/repos","events_url":"https://api.github.com/users/shonumi/events{/privacy}","received_events_url":"https://api.github.com/users/shonumi/received_events","type":"User","site_admin":false},"repo":{"id":159905643,"node_id":"MDEwOlJlcG9zaXRvcnkxNTk5MDU2NDM=","name":"dolphin","full_name":"shonumi/dolphin","private":false,"owner":{"login":"shonumi","id":7418176,"node_id":"MDQ6VXNlcjc0MTgxNzY=","avatar_url":"https://avatars0.githubusercontent.com/u/7418176?v=4","gravatar_id":"","url":"https://api.github.com/users/shonumi","html_url":"https://github.com/shonumi","followers_url":"https://api.github.com/users/shonumi/followers","following_url":"https://api.github.com/users/shonumi/following{/other_user}","gists_url":"https://api.github.com/users/shonumi/gists{/gist_id}","starred_url":"https://api.github.com/users/shonumi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shonumi/subscriptions","organizations_url":"https://api.github.com/users/shonumi/orgs","repos_url":"https://api.github.com/users/shonumi/repos","events_url":"https://api.github.com/users/shonumi/events{/privacy}","received_events_url":"https://api.github.com/users/shonumi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/shonumi/dolphin","description":"Dolphin is a GameCube / Wii emulator, allowing you to play games for these two platforms on PC with improvements.","fork":true,"url":"https://api.github.com/repos/shonumi/dolphin","forks_url":"https://api.github.com/repos/shonumi/dolphin/forks","keys_url":"https://api.github.com/repos/shonumi/dolphin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shonumi/dolphin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shonumi/dolphin/teams","hooks_url":"https://api.github.com/repos/shonumi/dolphin/hooks","issue_events_url":"https://api.github.com/repos/shonumi/dolphin/issues/events{/number}","events_url":"https://api.github.com/repos/shonumi/dolphin/events","assignees_url":"https://api.github.com/repos/shonumi/dolphin/assignees{/user}","branches_url":"https://api.github.com/repos/shonumi/dolphin/branches{/branch}","tags_url":"https://api.github.com/repos/shonumi/dolphin/tags","blobs_url":"https://api.github.com/repos/shonumi/dolphin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shonumi/dolphin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shonumi/dolphin/git/refs{/sha}","trees_url":"https://api.github.com/repos/shonumi/dolphin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shonumi/dolphin/statuses/{sha}","languages_url":"https://api.github.com/repos/shonumi/dolphin/languages","stargazers_url":"https://api.github.com/repos/shonumi/dolphin/stargazers","contributors_url":"https://api.github.com/repos/shonumi/dolphin/contributors","subscribers_url":"https://api.github.com/repos/shonumi/dolphin/subscribers","subscription_url":"https://api.github.com/repos/shonumi/dolphin/subscription","commits_url":"https://api.github.com/repos/shonumi/dolphin/commits{/sha}","git_commits_url":"https://api.github.com/repos/shonumi/dolphin/git/commits{/sha}","comments_url":"https://api.github.com/repos/shonumi/dolphin/comments{/number}","issue_comment_url":"https://api.github.com/repos/shonumi/dolphin/issues/comments{/number}","contents_url":"https://api.github.com/repos/shonumi/dolphin/contents/{+path}","compare_url":"https://api.github.com/repos/shonumi/dolphin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shonumi/dolphin/merges","archive_url":"https://api.github.com/repos/shonumi/dolphin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shonumi/dolphin/downloads","issues_url":"https://api.github.com/repos/shonumi/dolphin/issues{/number}","pulls_url":"https://api.github.com/repos/shonumi/dolphin/pulls{/number}","milestones_url":"https://api.github.com/repos/shonumi/dolphin/milestones{/number}","notifications_url":"https://api.github.com/repos/shonumi/dolphin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shonumi/dolphin/labels{/name}","releases_url":"https://api.github.com/repos/shonumi/dolphin/releases{/id}","deployments_url":"https://api.github.com/repos/shonumi/dolphin/deployments","created_at":"2018-12-01T03:36:35Z","updated_at":"2018-12-01T03:36:52Z","pushed_at":"2018-12-09T20:03:14Z","git_url":"git://github.com/shonumi/dolphin.git","ssh_url":"git@github.com:shonumi/dolphin.git","clone_url":"https://github.com/shonumi/dolphin.git","svn_url":"https://github.com/shonumi/dolphin","homepage":"https://dolphin-emu.org/","size":332683,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dolphin-emu:master","ref":"master","sha":"f510f6ef0d72764cae23a1c662ffdc92c45acd9e","user":{"login":"dolphin-emu","id":5050316,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwNTAzMTY=","avatar_url":"https://avatars2.githubusercontent.com/u/5050316?v=4","gravatar_id":"","url":"https://api.github.com/users/dolphin-emu","html_url":"https://github.com/dolphin-emu","followers_url":"https://api.github.com/users/dolphin-emu/followers","following_url":"https://api.github.com/users/dolphin-emu/following{/other_user}","gists_url":"https://api.github.com/users/dolphin-emu/gists{/gist_id}","starred_url":"https://api.github.com/users/dolphin-emu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolphin-emu/subscriptions","organizations_url":"https://api.github.com/users/dolphin-emu/orgs","repos_url":"https://api.github.com/users/dolphin-emu/repos","events_url":"https://api.github.com/users/dolphin-emu/events{/privacy}","received_events_url":"https://api.github.com/users/dolphin-emu/received_events","type":"Organization","site_admin":false},"repo":{"id":11577304,"node_id":"MDEwOlJlcG9zaXRvcnkxMTU3NzMwNA==","name":"dolphin","full_name":"dolphin-emu/dolphin","private":false,"owner":{"login":"dolphin-emu","id":5050316,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwNTAzMTY=","avatar_url":"https://avatars2.githubusercontent.com/u/5050316?v=4","gravatar_id":"","url":"https://api.github.com/users/dolphin-emu","html_url":"https://github.com/dolphin-emu","followers_url":"https://api.github.com/users/dolphin-emu/followers","following_url":"https://api.github.com/users/dolphin-emu/following{/other_user}","gists_url":"https://api.github.com/users/dolphin-emu/gists{/gist_id}","starred_url":"https://api.github.com/users/dolphin-emu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dolphin-emu/subscriptions","organizations_url":"https://api.github.com/users/dolphin-emu/orgs","repos_url":"https://api.github.com/users/dolphin-emu/repos","events_url":"https://api.github.com/users/dolphin-emu/events{/privacy}","received_events_url":"https://api.github.com/users/dolphin-emu/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/dolphin-emu/dolphin","description":"Dolphin is a GameCube / Wii emulator, allowing you to play games for these two platforms on PC with improvements.","fork":false,"url":"https://api.github.com/repos/dolphin-emu/dolphin","forks_url":"https://api.github.com/repos/dolphin-emu/dolphin/forks","keys_url":"https://api.github.com/repos/dolphin-emu/dolphin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dolphin-emu/dolphin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dolphin-emu/dolphin/teams","hooks_url":"https://api.github.com/repos/dolphin-emu/dolphin/hooks","issue_events_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/events{/number}","events_url":"https://api.github.com/repos/dolphin-emu/dolphin/events","assignees_url":"https://api.github.com/repos/dolphin-emu/dolphin/assignees{/user}","branches_url":"https://api.github.com/repos/dolphin-emu/dolphin/branches{/branch}","tags_url":"https://api.github.com/repos/dolphin-emu/dolphin/tags","blobs_url":"https://api.github.com/repos/dolphin-emu/dolphin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dolphin-emu/dolphin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dolphin-emu/dolphin/git/refs{/sha}","trees_url":"https://api.github.com/repos/dolphin-emu/dolphin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dolphin-emu/dolphin/statuses/{sha}","languages_url":"https://api.github.com/repos/dolphin-emu/dolphin/languages","stargazers_url":"https://api.github.com/repos/dolphin-emu/dolphin/stargazers","contributors_url":"https://api.github.com/repos/dolphin-emu/dolphin/contributors","subscribers_url":"https://api.github.com/repos/dolphin-emu/dolphin/subscribers","subscription_url":"https://api.github.com/repos/dolphin-emu/dolphin/subscription","commits_url":"https://api.github.com/repos/dolphin-emu/dolphin/commits{/sha}","git_commits_url":"https://api.github.com/repos/dolphin-emu/dolphin/git/commits{/sha}","comments_url":"https://api.github.com/repos/dolphin-emu/dolphin/comments{/number}","issue_comment_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/comments{/number}","contents_url":"https://api.github.com/repos/dolphin-emu/dolphin/contents/{+path}","compare_url":"https://api.github.com/repos/dolphin-emu/dolphin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dolphin-emu/dolphin/merges","archive_url":"https://api.github.com/repos/dolphin-emu/dolphin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dolphin-emu/dolphin/downloads","issues_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues{/number}","pulls_url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls{/number}","milestones_url":"https://api.github.com/repos/dolphin-emu/dolphin/milestones{/number}","notifications_url":"https://api.github.com/repos/dolphin-emu/dolphin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dolphin-emu/dolphin/labels{/name}","releases_url":"https://api.github.com/repos/dolphin-emu/dolphin/releases{/id}","deployments_url":"https://api.github.com/repos/dolphin-emu/dolphin/deployments","created_at":"2013-07-22T09:07:57Z","updated_at":"2018-12-09T13:53:47Z","pushed_at":"2018-12-09T20:03:17Z","git_url":"git://github.com/dolphin-emu/dolphin.git","ssh_url":"git@github.com:dolphin-emu/dolphin.git","clone_url":"https://github.com/dolphin-emu/dolphin.git","svn_url":"https://github.com/dolphin-emu/dolphin","homepage":"https://dolphin-emu.org/","size":370770,"stargazers_count":4876,"watchers_count":4876,"language":"C++","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1146,"mirror_url":null,"archived":false,"open_issues_count":120,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":1146,"open_issues":120,"watchers":4876,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/7615"},"html":{"href":"https://github.com/dolphin-emu/dolphin/pull/7615"},"issue":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/issues/7615"},"comments":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/issues/7615/comments"},"review_comments":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/7615/comments"},"review_comment":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/7615/commits"},"statuses":{"href":"https://api.github.com/repos/dolphin-emu/dolphin/statuses/1effc4d50a4b19dff5a3f0369a4da67196c00612"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"shonumi"}}