1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-12-11 18:49:16 +00:00

Adjust C header generation to take CSV header into account.

This commit is contained in:
Radosław Kujawa 2017-01-20 23:23:25 +01:00
parent d2dc51cbd3
commit 1820418c62

View File

@ -7,14 +7,16 @@ BEGIN {
print "#include \"emulation.h\""
print "const struct instrdef instrs[] = {"
opcode = 0
}
{
printf "#define %s 0x%X\n", $1, NR-1
if (NR < 256)
/^OP_/{
printf "#define %s 0x%X\n", $1, opcode
if (opcode < 0xFF)
printf "\t{ %s, %s, %s, %d, %s },\n", $1, $2, $3, $4, $5
else
printf "\t{ %s, %s, %s, %d, %s }\n", $1, $2, $3, $4, $5
opcode++
}