From 3f415f5f6f24c27e572840f32d9748c8e555e50f Mon Sep 17 00:00:00 2001 From: redcode Date: Wed, 5 Feb 2025 01:58:49 +0100 Subject: [PATCH] Code generation tools. --- .github/workflows/build-and-test-library.yml | 4 ++++ sources/generate-daa-af-table.c | 4 ++-- sources/generate-pf-parity-table.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test-library.yml b/.github/workflows/build-and-test-library.yml index a832d72..3fee7ac 100644 --- a/.github/workflows/build-and-test-library.yml +++ b/.github/workflows/build-and-test-library.yml @@ -6,6 +6,8 @@ on: - '.github/workflows/build-and-test-library.yml' - 'API/**' - 'CMake/FindZeta.cmake' + - 'sources/generate-daa-af-table.c' + - 'sources/generate-pf-parity-table.c' - 'sources/test-Z80.c' - 'sources/Z80.c' - 'sources/Z80.rc.in' @@ -16,6 +18,8 @@ on: - '.github/workflows/build-and-test-library.yml' - 'API/**' - 'CMake/FindZeta.cmake' + - 'sources/generate-daa-af-table.c' + - 'sources/generate-pf-parity-table.c' - 'sources/test-Z80.c' - 'sources/Z80.c' - 'sources/Z80.rc.in' diff --git a/sources/generate-daa-af-table.c b/sources/generate-daa-af-table.c index e3ef136..c6e89d7 100644 --- a/sources/generate-daa-af-table.c +++ b/sources/generate-daa-af-table.c @@ -55,7 +55,7 @@ int main(int argc, char **argv) for (y = 0; y < 16; y++) { - printf("/* %X */", y); + printf("/* %X */", (zuint)y); for (x = 0; x < 16; x++) { @@ -65,7 +65,7 @@ int main(int argc, char **argv) z80_execute(&cpu, 1); printf( " H(%04X)%s", - Z80_AF(cpu), + (zuint)Z80_AF(cpu), x == 15 && y == 15 && hnc == 7 ? "};" : ","); } diff --git a/sources/generate-pf-parity-table.c b/sources/generate-pf-parity-table.c index 6c9910c..a2dc6fd 100644 --- a/sources/generate-pf-parity-table.c +++ b/sources/generate-pf-parity-table.c @@ -41,11 +41,11 @@ int main(int argc, char **argv) for (y = 0; y < 16; y++) { - printf("/* %X */", y); + printf("/* %X */", (zuint)y); for (x = 0; x < 16; x++) printf(" %u%s", - pf_parity(y * 16 + x), + (zuint)pf_parity(y * 16 + x), x == 15 && y == 15 ? "};" : ","); putchar('\n');