Skip to content

Commit

Permalink
Code generation tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
redcode committed Feb 5, 2025
1 parent 5d00cd5 commit 3f415f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build-and-test-library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions sources/generate-daa-af-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand All @@ -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
? "};" : ",");
}
Expand Down
4 changes: 2 additions & 2 deletions sources/generate-pf-parity-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 3f415f5

Please sign in to comment.