summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_32.cpp35
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_32.h5
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_64.cpp42
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_64.h5
-rw-r--r--src/core/hle/service/am/am.cpp17
-rw-r--r--src/core/hle/service/am/am.h1
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp8
7 files changed, 57 insertions, 56 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
index 53d78de32..08d889135 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
@@ -114,18 +114,17 @@ public:
114 static constexpr u64 minimum_run_cycles = 1000U; 114 static constexpr u64 minimum_run_cycles = 1000U;
115}; 115};
116 116
117std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable& page_table, 117std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* page_table) const {
118 std::size_t address_space_bits) const {
119 Dynarmic::A32::UserConfig config; 118 Dynarmic::A32::UserConfig config;
120 config.callbacks = cb.get(); 119 config.callbacks = cb.get();
121 // TODO(bunnei): Implement page table for 32-bit
122 // config.page_table = &page_table.pointers;
123 config.coprocessors[15] = cp15; 120 config.coprocessors[15] = cp15;
124 config.define_unpredictable_behaviour = true; 121 config.define_unpredictable_behaviour = true;
125 static constexpr std::size_t PAGE_BITS = 12; 122 static constexpr std::size_t PAGE_BITS = 12;
126 static constexpr std::size_t NUM_PAGE_TABLE_ENTRIES = 1 << (32 - PAGE_BITS); 123 static constexpr std::size_t NUM_PAGE_TABLE_ENTRIES = 1 << (32 - PAGE_BITS);
127 config.page_table = reinterpret_cast<std::array<std::uint8_t*, NUM_PAGE_TABLE_ENTRIES>*>( 124 if (page_table) {
128 page_table.pointers.data()); 125 config.page_table = reinterpret_cast<std::array<std::uint8_t*, NUM_PAGE_TABLE_ENTRIES>*>(
126 page_table->pointers.data());
127 }
129 config.absolute_offset_page_table = true; 128 config.absolute_offset_page_table = true;
130 config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS; 129 config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS;
131 config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; 130 config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128;
@@ -138,6 +137,10 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable&
138 // Timing 137 // Timing
139 config.wall_clock_cntpct = uses_wall_clock; 138 config.wall_clock_cntpct = uses_wall_clock;
140 139
140 // Code cache size
141 config.code_cache_size = 512 * 1024 * 1024;
142 config.far_code_offset = 256 * 1024 * 1024;
143
141 // Safe optimizations 144 // Safe optimizations
142 if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::DebugMode) { 145 if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::DebugMode) {
143 if (!Settings::values.cpuopt_page_tables) { 146 if (!Settings::values.cpuopt_page_tables) {
@@ -201,7 +204,8 @@ ARM_Dynarmic_32::ARM_Dynarmic_32(System& system, CPUInterrupts& interrupt_handle
201 : ARM_Interface{system, interrupt_handlers, uses_wall_clock}, 204 : ARM_Interface{system, interrupt_handlers, uses_wall_clock},
202 cb(std::make_unique<DynarmicCallbacks32>(*this)), 205 cb(std::make_unique<DynarmicCallbacks32>(*this)),
203 cp15(std::make_shared<DynarmicCP15>(*this)), core_index{core_index}, 206 cp15(std::make_shared<DynarmicCP15>(*this)), core_index{core_index},
204 exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {} 207 exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)},
208 jit(MakeJit(nullptr)) {}
205 209
206ARM_Dynarmic_32::~ARM_Dynarmic_32() = default; 210ARM_Dynarmic_32::~ARM_Dynarmic_32() = default;
207 211
@@ -256,9 +260,6 @@ void ARM_Dynarmic_32::ChangeProcessorID(std::size_t new_core_id) {
256} 260}
257 261
258void ARM_Dynarmic_32::SaveContext(ThreadContext32& ctx) { 262void ARM_Dynarmic_32::SaveContext(ThreadContext32& ctx) {
259 if (!jit) {
260 return;
261 }
262 Dynarmic::A32::Context context; 263 Dynarmic::A32::Context context;
263 jit->SaveContext(context); 264 jit->SaveContext(context);
264 ctx.cpu_registers = context.Regs(); 265 ctx.cpu_registers = context.Regs();
@@ -268,9 +269,6 @@ void ARM_Dynarmic_32::SaveContext(ThreadContext32& ctx) {
268} 269}
269 270
270void ARM_Dynarmic_32::LoadContext(const ThreadContext32& ctx) { 271void ARM_Dynarmic_32::LoadContext(const ThreadContext32& ctx) {
271 if (!jit) {
272 return;
273 }
274 Dynarmic::A32::Context context; 272 Dynarmic::A32::Context context;
275 context.Regs() = ctx.cpu_registers; 273 context.Regs() = ctx.cpu_registers;
276 context.ExtRegs() = ctx.extension_registers; 274 context.ExtRegs() = ctx.extension_registers;
@@ -284,23 +282,14 @@ void ARM_Dynarmic_32::PrepareReschedule() {
284} 282}
285 283
286void ARM_Dynarmic_32::ClearInstructionCache() { 284void ARM_Dynarmic_32::ClearInstructionCache() {
287 if (!jit) {
288 return;
289 }
290 jit->ClearCache(); 285 jit->ClearCache();
291} 286}
292 287
293void ARM_Dynarmic_32::InvalidateCacheRange(VAddr addr, std::size_t size) { 288void ARM_Dynarmic_32::InvalidateCacheRange(VAddr addr, std::size_t size) {
294 if (!jit) {
295 return;
296 }
297 jit->InvalidateCacheRange(static_cast<u32>(addr), size); 289 jit->InvalidateCacheRange(static_cast<u32>(addr), size);
298} 290}
299 291
300void ARM_Dynarmic_32::ClearExclusiveState() { 292void ARM_Dynarmic_32::ClearExclusiveState() {
301 if (!jit) {
302 return;
303 }
304 jit->ClearExclusiveState(); 293 jit->ClearExclusiveState();
305} 294}
306 295
@@ -316,7 +305,7 @@ void ARM_Dynarmic_32::PageTableChanged(Common::PageTable& page_table,
316 LoadContext(ctx); 305 LoadContext(ctx);
317 return; 306 return;
318 } 307 }
319 jit = MakeJit(page_table, new_address_space_size_in_bits); 308 jit = MakeJit(&page_table);
320 LoadContext(ctx); 309 LoadContext(ctx);
321 jit_cache.emplace(key, jit); 310 jit_cache.emplace(key, jit);
322} 311}
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.h b/src/core/arm/dynarmic/arm_dynarmic_32.h
index f6c4d4db9..d40aef7a9 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_32.h
+++ b/src/core/arm/dynarmic/arm_dynarmic_32.h
@@ -68,8 +68,7 @@ public:
68 std::size_t new_address_space_size_in_bits) override; 68 std::size_t new_address_space_size_in_bits) override;
69 69
70private: 70private:
71 std::shared_ptr<Dynarmic::A32::Jit> MakeJit(Common::PageTable& page_table, 71 std::shared_ptr<Dynarmic::A32::Jit> MakeJit(Common::PageTable* page_table) const;
72 std::size_t address_space_bits) const;
73 72
74 using JitCacheKey = std::pair<Common::PageTable*, std::size_t>; 73 using JitCacheKey = std::pair<Common::PageTable*, std::size_t>;
75 using JitCacheType = 74 using JitCacheType =
@@ -80,10 +79,10 @@ private:
80 79
81 std::unique_ptr<DynarmicCallbacks32> cb; 80 std::unique_ptr<DynarmicCallbacks32> cb;
82 JitCacheType jit_cache; 81 JitCacheType jit_cache;
83 std::shared_ptr<Dynarmic::A32::Jit> jit;
84 std::shared_ptr<DynarmicCP15> cp15; 82 std::shared_ptr<DynarmicCP15> cp15;
85 std::size_t core_index; 83 std::size_t core_index;
86 DynarmicExclusiveMonitor& exclusive_monitor; 84 DynarmicExclusiveMonitor& exclusive_monitor;
85 std::shared_ptr<Dynarmic::A32::Jit> jit;
87}; 86};
88 87
89} // namespace Core 88} // namespace Core
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp
index b36b7d918..e12e50658 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp
@@ -142,7 +142,7 @@ public:
142 static constexpr u64 minimum_run_cycles = 1000U; 142 static constexpr u64 minimum_run_cycles = 1000U;
143}; 143};
144 144
145std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable& page_table, 145std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* page_table,
146 std::size_t address_space_bits) const { 146 std::size_t address_space_bits) const {
147 Dynarmic::A64::UserConfig config; 147 Dynarmic::A64::UserConfig config;
148 148
@@ -150,13 +150,15 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable&
150 config.callbacks = cb.get(); 150 config.callbacks = cb.get();
151 151
152 // Memory 152 // Memory
153 config.page_table = reinterpret_cast<void**>(page_table.pointers.data()); 153 if (page_table) {
154 config.page_table_address_space_bits = address_space_bits; 154 config.page_table = reinterpret_cast<void**>(page_table->pointers.data());
155 config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS; 155 config.page_table_address_space_bits = address_space_bits;
156 config.silently_mirror_page_table = false; 156 config.page_table_pointer_mask_bits = Common::PageTable::ATTRIBUTE_BITS;
157 config.absolute_offset_page_table = true; 157 config.silently_mirror_page_table = false;
158 config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128; 158 config.absolute_offset_page_table = true;
159 config.only_detect_misalignment_via_page_table_on_page_boundary = true; 159 config.detect_misaligned_access_via_page_table = 16 | 32 | 64 | 128;
160 config.only_detect_misalignment_via_page_table_on_page_boundary = true;
161 }
160 162
161 // Multi-process state 163 // Multi-process state
162 config.processor_id = core_index; 164 config.processor_id = core_index;
@@ -175,6 +177,10 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable&
175 // Timing 177 // Timing
176 config.wall_clock_cntpct = uses_wall_clock; 178 config.wall_clock_cntpct = uses_wall_clock;
177 179
180 // Code cache size
181 config.code_cache_size = 512 * 1024 * 1024;
182 config.far_code_offset = 256 * 1024 * 1024;
183
178 // Safe optimizations 184 // Safe optimizations
179 if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::DebugMode) { 185 if (Settings::values.cpu_accuracy == Settings::CPUAccuracy::DebugMode) {
180 if (!Settings::values.cpuopt_page_tables) { 186 if (!Settings::values.cpuopt_page_tables) {
@@ -237,7 +243,8 @@ ARM_Dynarmic_64::ARM_Dynarmic_64(System& system, CPUInterrupts& interrupt_handle
237 std::size_t core_index) 243 std::size_t core_index)
238 : ARM_Interface{system, interrupt_handlers, uses_wall_clock}, 244 : ARM_Interface{system, interrupt_handlers, uses_wall_clock},
239 cb(std::make_unique<DynarmicCallbacks64>(*this)), core_index{core_index}, 245 cb(std::make_unique<DynarmicCallbacks64>(*this)), core_index{core_index},
240 exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)} {} 246 exclusive_monitor{dynamic_cast<DynarmicExclusiveMonitor&>(exclusive_monitor)},
247 jit(MakeJit(nullptr, 48)) {}
241 248
242ARM_Dynarmic_64::~ARM_Dynarmic_64() = default; 249ARM_Dynarmic_64::~ARM_Dynarmic_64() = default;
243 250
@@ -294,9 +301,6 @@ void ARM_Dynarmic_64::ChangeProcessorID(std::size_t new_core_id) {
294} 301}
295 302
296void ARM_Dynarmic_64::SaveContext(ThreadContext64& ctx) { 303void ARM_Dynarmic_64::SaveContext(ThreadContext64& ctx) {
297 if (!jit) {
298 return;
299 }
300 ctx.cpu_registers = jit->GetRegisters(); 304 ctx.cpu_registers = jit->GetRegisters();
301 ctx.sp = jit->GetSP(); 305 ctx.sp = jit->GetSP();
302 ctx.pc = jit->GetPC(); 306 ctx.pc = jit->GetPC();
@@ -308,9 +312,6 @@ void ARM_Dynarmic_64::SaveContext(ThreadContext64& ctx) {
308} 312}
309 313
310void ARM_Dynarmic_64::LoadContext(const ThreadContext64& ctx) { 314void ARM_Dynarmic_64::LoadContext(const ThreadContext64& ctx) {
311 if (!jit) {
312 return;
313 }
314 jit->SetRegisters(ctx.cpu_registers); 315 jit->SetRegisters(ctx.cpu_registers);
315 jit->SetSP(ctx.sp); 316 jit->SetSP(ctx.sp);
316 jit->SetPC(ctx.pc); 317 jit->SetPC(ctx.pc);
@@ -326,23 +327,14 @@ void ARM_Dynarmic_64::PrepareReschedule() {
326} 327}
327 328
328void ARM_Dynarmic_64::ClearInstructionCache() { 329void ARM_Dynarmic_64::ClearInstructionCache() {
329 if (!jit) {
330 return;
331 }
332 jit->ClearCache(); 330 jit->ClearCache();
333} 331}
334 332
335void ARM_Dynarmic_64::InvalidateCacheRange(VAddr addr, std::size_t size) { 333void ARM_Dynarmic_64::InvalidateCacheRange(VAddr addr, std::size_t size) {
336 if (!jit) {
337 return;
338 }
339 jit->InvalidateCacheRange(addr, size); 334 jit->InvalidateCacheRange(addr, size);
340} 335}
341 336
342void ARM_Dynarmic_64::ClearExclusiveState() { 337void ARM_Dynarmic_64::ClearExclusiveState() {
343 if (!jit) {
344 return;
345 }
346 jit->ClearExclusiveState(); 338 jit->ClearExclusiveState();
347} 339}
348 340
@@ -358,7 +350,7 @@ void ARM_Dynarmic_64::PageTableChanged(Common::PageTable& page_table,
358 LoadContext(ctx); 350 LoadContext(ctx);
359 return; 351 return;
360 } 352 }
361 jit = MakeJit(page_table, new_address_space_size_in_bits); 353 jit = MakeJit(&page_table, new_address_space_size_in_bits);
362 LoadContext(ctx); 354 LoadContext(ctx);
363 jit_cache.emplace(key, jit); 355 jit_cache.emplace(key, jit);
364} 356}
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.h b/src/core/arm/dynarmic/arm_dynarmic_64.h
index 329b59a32..edef04376 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_64.h
+++ b/src/core/arm/dynarmic/arm_dynarmic_64.h
@@ -61,7 +61,7 @@ public:
61 std::size_t new_address_space_size_in_bits) override; 61 std::size_t new_address_space_size_in_bits) override;
62 62
63private: 63private:
64 std::shared_ptr<Dynarmic::A64::Jit> MakeJit(Common::PageTable& page_table, 64 std::shared_ptr<Dynarmic::A64::Jit> MakeJit(Common::PageTable* page_table,
65 std::size_t address_space_bits) const; 65 std::size_t address_space_bits) const;
66 66
67 using JitCacheKey = std::pair<Common::PageTable*, std::size_t>; 67 using JitCacheKey = std::pair<Common::PageTable*, std::size_t>;
@@ -71,10 +71,11 @@ private:
71 friend class DynarmicCallbacks64; 71 friend class DynarmicCallbacks64;
72 std::unique_ptr<DynarmicCallbacks64> cb; 72 std::unique_ptr<DynarmicCallbacks64> cb;
73 JitCacheType jit_cache; 73 JitCacheType jit_cache;
74 std::shared_ptr<Dynarmic::A64::Jit> jit;
75 74
76 std::size_t core_index; 75 std::size_t core_index;
77 DynarmicExclusiveMonitor& exclusive_monitor; 76 DynarmicExclusiveMonitor& exclusive_monitor;
77
78 std::shared_ptr<Dynarmic::A64::Jit> jit;
78}; 79};
79 80
80} // namespace Core 81} // namespace Core
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 8e1fe9438..d91237cba 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -295,7 +295,7 @@ ISelfController::ISelfController(Core::System& system_, NVFlinger::NVFlinger& nv
295 {80, nullptr, "SetWirelessPriorityMode"}, 295 {80, nullptr, "SetWirelessPriorityMode"},
296 {90, &ISelfController::GetAccumulatedSuspendedTickValue, "GetAccumulatedSuspendedTickValue"}, 296 {90, &ISelfController::GetAccumulatedSuspendedTickValue, "GetAccumulatedSuspendedTickValue"},
297 {91, &ISelfController::GetAccumulatedSuspendedTickChangedEvent, "GetAccumulatedSuspendedTickChangedEvent"}, 297 {91, &ISelfController::GetAccumulatedSuspendedTickChangedEvent, "GetAccumulatedSuspendedTickChangedEvent"},
298 {100, nullptr, "SetAlbumImageTakenNotificationEnabled"}, 298 {100, &ISelfController::SetAlbumImageTakenNotificationEnabled, "SetAlbumImageTakenNotificationEnabled"},
299 {110, nullptr, "SetApplicationAlbumUserData"}, 299 {110, nullptr, "SetApplicationAlbumUserData"},
300 {1000, nullptr, "GetDebugStorageChannel"}, 300 {1000, nullptr, "GetDebugStorageChannel"},
301 }; 301 };
@@ -560,6 +560,21 @@ void ISelfController::GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequest
560 rb.PushCopyObjects(accumulated_suspended_tick_changed_event->GetReadableEvent()); 560 rb.PushCopyObjects(accumulated_suspended_tick_changed_event->GetReadableEvent());
561} 561}
562 562
563void ISelfController::SetAlbumImageTakenNotificationEnabled(Kernel::HLERequestContext& ctx) {
564 IPC::RequestParser rp{ctx};
565
566 // This service call sets an internal flag whether a notification is shown when an image is
567 // captured. Currently we do not support capturing images via the capture button, so this can be
568 // stubbed for now.
569 const bool album_image_taken_notification_enabled = rp.Pop<bool>();
570
571 LOG_WARNING(Service_AM, "(STUBBED) called. album_image_taken_notification_enabled={}",
572 album_image_taken_notification_enabled);
573
574 IPC::ResponseBuilder rb{ctx, 2};
575 rb.Push(RESULT_SUCCESS);
576}
577
563AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel) { 578AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel) {
564 on_new_message = Kernel::KEvent::Create(kernel, "AMMessageQueue:OnMessageReceived"); 579 on_new_message = Kernel::KEvent::Create(kernel, "AMMessageQueue:OnMessageReceived");
565 on_new_message->Initialize(); 580 on_new_message->Initialize();
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 6911f0d6e..f6a453ab7 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -146,6 +146,7 @@ private:
146 void IsAutoSleepDisabled(Kernel::HLERequestContext& ctx); 146 void IsAutoSleepDisabled(Kernel::HLERequestContext& ctx);
147 void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx); 147 void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx);
148 void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx); 148 void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx);
149 void SetAlbumImageTakenNotificationEnabled(Kernel::HLERequestContext& ctx);
149 150
150 enum class ScreenshotPermission : u32 { 151 enum class ScreenshotPermission : u32 {
151 Inherit = 0, 152 Inherit = 0,
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 70b9f3824..1df62f98e 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -413,12 +413,16 @@ void Controller_NPad::RequestPadStateUpdate(u32 npad_id) {
413 lstick_entry.y = static_cast<s32>(stick_l_y_f * HID_JOYSTICK_MAX); 413 lstick_entry.y = static_cast<s32>(stick_l_y_f * HID_JOYSTICK_MAX);
414 } 414 }
415 415
416 if (controller_type == NPadControllerType::JoyLeft || 416 if (controller_type == NPadControllerType::JoyLeft) {
417 controller_type == NPadControllerType::JoyRight) {
418 pad_state.left_sl.Assign(button_state[SL - BUTTON_HID_BEGIN]->GetStatus()); 417 pad_state.left_sl.Assign(button_state[SL - BUTTON_HID_BEGIN]->GetStatus());
419 pad_state.left_sr.Assign(button_state[SR - BUTTON_HID_BEGIN]->GetStatus()); 418 pad_state.left_sr.Assign(button_state[SR - BUTTON_HID_BEGIN]->GetStatus());
420 } 419 }
421 420
421 if (controller_type == NPadControllerType::JoyRight) {
422 pad_state.right_sl.Assign(button_state[SL - BUTTON_HID_BEGIN]->GetStatus());
423 pad_state.right_sr.Assign(button_state[SR - BUTTON_HID_BEGIN]->GetStatus());
424 }
425
422 if (controller_type == NPadControllerType::GameCube) { 426 if (controller_type == NPadControllerType::GameCube) {
423 trigger_entry.l_analog = static_cast<s32>( 427 trigger_entry.l_analog = static_cast<s32>(
424 button_state[ZL - BUTTON_HID_BEGIN]->GetStatus() ? HID_TRIGGER_MAX : 0); 428 button_state[ZL - BUTTON_HID_BEGIN]->GetStatus() ? HID_TRIGGER_MAX : 0);