summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2025-06-22 15:22:16 +0200
committer hap <happppp@users.noreply.github.com>2025-06-22 15:22:16 +0200
commitca1438d15e7c1077d8556cdc2ddd2afdf5da9772 (patch)
treef5a9b7d7e6ce9fadea7dee10eb09a3612adaa816
parent0fe74ac8e186a398443713a53cb0aa8a24c5d7d0 (diff)
k051733: simpler sqrt function (result is same)
-rw-r--r--src/mame/konami/k051733.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/mame/konami/k051733.cpp b/src/mame/konami/k051733.cpp
index 35bbf7aa4de..600e7bec0cc 100644
--- a/src/mame/konami/k051733.cpp
+++ b/src/mame/konami/k051733.cpp
@@ -91,20 +91,10 @@ void k051733_device::clock_lfsr()
u32 k051733_device::u32_sqrt(u32 op)
{
- u32 i = 0x8000;
- u32 step = 0x4000;
-
- while (step)
- {
- if (i * i == op)
- break;
- else if (i * i > op)
- i -= step;
- else
- i += step;
- step >>= 1;
- }
- return i & ~1;
+ if (op)
+ return u32(sqrt(op)) & ~1;
+ else
+ return 0;
}
u8 k051733_device::read(offs_t offset)