--- nono/m680x0/testacc.cpp 2026/04/29 17:05:15 1.1.1.5 +++ nono/m680x0/testacc.cpp 2026/04/29 17:05:30 1.1.1.7 @@ -5,7 +5,7 @@ // #include "mpu680x0.h" -#include "m68030acc.h" +#include "m680x0acc.h" #include #include @@ -61,7 +61,7 @@ xp_equal(uint32 expected, uint32 actual, // 値(32bitまで)と CCR を検査する static void -xp_equal(uint32 actValue, m68030ccr& actCCR, uint32 expValue, +xp_equal(uint32 actValue, m680x0CCR& actCCR, uint32 expValue, bool expX, bool expN, bool expZ, bool expV, bool expC) { if (expValue != actValue || @@ -95,7 +95,7 @@ xp_equal(uint32 actValue, m68030ccr& act // 値(64bit)と CCR を検査する static void __unused -xp_equal64(uint64 actValue, m68030ccr& actCCR, uint64 expValue, +xp_equal64(uint64 actValue, m680x0CCR& actCCR, uint64 expValue, bool expX, bool expN, bool expZ, bool expV, bool expC) { if (expValue != actValue || @@ -284,7 +284,7 @@ static uint32 add_table[] = { }; static void -test_add(m68030acc& acc, int sz) +test_add(m680x0ACC& acc, int sz) { for (int i = 0; i < countof(add_table); i++) { for (int j = 0; j < countof(add_table); j++) { @@ -314,7 +314,7 @@ test_add(m68030acc& acc, int sz) } static void -test_add_8(m68030acc& acc) +test_add_8(m680x0ACC& acc) { start_test(); test_add(acc, 8); @@ -322,7 +322,7 @@ test_add_8(m68030acc& acc) } static void -test_add_16(m68030acc& acc) +test_add_16(m680x0ACC& acc) { start_test(); test_add(acc, 16); @@ -330,7 +330,7 @@ test_add_16(m68030acc& acc) } static void -test_add_32(m68030acc& acc) +test_add_32(m680x0ACC& acc) { start_test(); test_add(acc, 32); @@ -338,7 +338,7 @@ test_add_32(m68030acc& acc) } static void -test_sub(m68030acc& acc, int sz) +test_sub(m680x0ACC& acc, int sz) { for (int i = 0; i < countof(add_table); i++) { for (int j = 0; j < countof(add_table); j++) { @@ -375,7 +375,7 @@ test_sub(m68030acc& acc, int sz) } static void -test_sub_8(m68030acc& acc) +test_sub_8(m680x0ACC& acc) { start_test(); test_sub(acc, 8); @@ -383,7 +383,7 @@ test_sub_8(m68030acc& acc) } static void -test_sub_16(m68030acc& acc) +test_sub_16(m680x0ACC& acc) { start_test(); test_sub(acc, 16); @@ -391,7 +391,7 @@ test_sub_16(m68030acc& acc) } static void -test_sub_32(m68030acc& acc) +test_sub_32(m680x0ACC& acc) { start_test(); test_sub(acc, 32); @@ -417,7 +417,7 @@ static struct { }; static void -test_addx_32(m68030acc& acc) +test_addx_32(m680x0ACC& acc) { start_test(); for (int i = 0; i < countof(addx32_table); i++) { @@ -429,7 +429,7 @@ test_addx_32(m68030acc& acc) bool expZ = addx32_table[i].expZ; bool expV = addx32_table[i].expV; bool expC = addx32_table[i].expC; - sprintf(where, "%08x + %08x + %d", src, dst, inX); + snprintf(where, sizeof(where), "%08x + %08x + %d", src, dst, inX); acc.SetX(inX); acc.SetZ(true); @@ -446,7 +446,7 @@ test_addx_32(m68030acc& acc) // ローテート/シフト系のパフォーマンス測定 #define DEFINE_PERF_ROTATE(name) \ static void \ -__CONCAT(perf_,name)(m68030acc& acc) \ +__CONCAT(perf_,name)(m680x0ACC& acc) \ { \ START_PERF; \ volatile uint32 dst = 0; \ @@ -470,7 +470,7 @@ DEFINE_PERF_ROTATE(roxr_32) DEFINE_PERF_ROTATE(ror_32) static void -perf_add_32(m68030acc& acc) +perf_add_32(m680x0ACC& acc) { START_PERF; volatile uint32 dst = 0; @@ -509,8 +509,8 @@ main(int ac, char *av[]) argc = ac; argv = av; - std::unique_ptr accptr(new m68030acc()); - m68030acc& acc = *(accptr.get()); + std::unique_ptr accptr(new m680x0ACC()); + m680x0ACC& acc = *(accptr.get()); if (do_test) { test_add_8(acc);