summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/event.cpp
diff options
context:
space:
mode:
authorGravatar bunnei2014-05-29 20:00:44 -0400
committerGravatar bunnei2014-05-29 20:00:44 -0400
commitd51c84dde22549c7413e52a682158e6da3ff1fdc (patch)
tree7865ea94d3221ba823de7a743eca675adea0b993 /src/core/hle/kernel/event.cpp
parentservice: added additional hack to return success on unimplemented service calls (diff)
downloadyuzu-d51c84dde22549c7413e52a682158e6da3ff1fdc.tar.gz
yuzu-d51c84dde22549c7413e52a682158e6da3ff1fdc.tar.xz
yuzu-d51c84dde22549c7413e52a682158e6da3ff1fdc.zip
event: added support for ClearEvent, fixed a bug with CreateEvent, fixed some comments
Diffstat (limited to 'src/core/hle/kernel/event.cpp')
-rw-r--r--src/core/hle/kernel/event.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp
index e85f39f0d..7cb8c5142 100644
--- a/src/core/hle/kernel/event.cpp
+++ b/src/core/hle/kernel/event.cpp
@@ -54,11 +54,16 @@ public:
54 * Changes whether an event is locked or not 54 * Changes whether an event is locked or not
55 * @param handle Handle to event to change 55 * @param handle Handle to event to change
56 * @param locked Boolean locked value to set event 56 * @param locked Boolean locked value to set event
57 * @return Result of operation, 0 on success, otherwise error code
57 */ 58 */
58void SetEventLocked(const Handle handle, const bool locked) { 59Result SetEventLocked(const Handle handle, const bool locked) {
59 Event* evt = g_object_pool.GetFast<Event>(handle); 60 Event* evt = g_object_pool.GetFast<Event>(handle);
61 if (!evt) {
62 ERROR_LOG(KERNEL, "SetEventLocked called with unknown handle=0x%08X", handle);
63 return -1;
64 }
60 evt->locked = locked; 65 evt->locked = locked;
61 return; 66 return 0;
62} 67}
63 68
64/** 69/**
@@ -67,23 +72,22 @@ void SetEventLocked(const Handle handle, const bool locked) {
67 * @return Result of operation, 0 on success, otherwise error code 72 * @return Result of operation, 0 on success, otherwise error code
68 */ 73 */
69Result ClearEvent(Handle handle) { 74Result ClearEvent(Handle handle) {
70 ERROR_LOG(KERNEL, "Unimplemented function ClearEvent"); 75 return SetEventLocked(handle, true);
71 return 0;
72} 76}
73 77
74/** 78/**
75 * Creates an event 79 * Creates an event
76 * @param handle Reference to handle for the newly created mutex 80 * @param handle Reference to handle for the newly created mutex
77 * @param reset_type ResetType describing how to create event 81 * @param reset_type ResetType describing how to create event
78 * @return Handle to newly created object 82 * @return Newly created Event object
79 */ 83 */
80Event* CreateEvent(Handle& handle, const ResetType reset_type) { 84Event* CreateEvent(Handle& handle, const ResetType reset_type) {
81 Event* evt = new Event; 85 Event* evt = new Event;
82 86
83 handle = Kernel::g_object_pool.Create(evt); 87 handle = Kernel::g_object_pool.Create(evt);
84 88
89 evt->locked = true;
85 evt->reset_type = evt->intitial_reset_type = reset_type; 90 evt->reset_type = evt->intitial_reset_type = reset_type;
86 evt->locked = false;
87 91
88 return evt; 92 return evt;
89} 93}
@@ -91,7 +95,7 @@ Event* CreateEvent(Handle& handle, const ResetType reset_type) {
91/** 95/**
92 * Creates an event 96 * Creates an event
93 * @param reset_type ResetType describing how to create event 97 * @param reset_type ResetType describing how to create event
94 * @return Handle to newly created object 98 * @return Handle to newly created Event object
95 */ 99 */
96Handle CreateEvent(const ResetType reset_type) { 100Handle CreateEvent(const ResetType reset_type) {
97 Handle handle; 101 Handle handle;