|
4 | 4 | ____ \/__/ /\_\ __ \\ \/\ \ ________________________________________________ |
5 | 5 | | /\_____\\_____\\_____\ | |
6 | 6 | | Zilog \/_____//_____//_____/ CPU Emulator - Step Testing Tool | |
7 | | -| Copyright (C) 2024-2025 Manuel Sainz de Baranda y Goñi. | |
| 7 | +| Copyright (C) 2024-2026 Manuel Sainz de Baranda y Goñi. | |
8 | 8 | | | |
9 | 9 | | This program is free software: you can redistribute it and/or modify it | |
10 | 10 | | under the terms of the GNU General Public License as published by the Free | |
@@ -50,9 +50,9 @@ typedef struct { |
50 | 50 | '====================================================================*/ |
51 | 51 |
|
52 | 52 | typedef Z_PACKED_STRUCTURE_BEGIN { |
53 | | - zuint16 address; /* Value on the address bus. */ |
54 | | - zsint16 value; /* Value on the data bus. */ |
55 | | - char pins[4]; /* State of the pins. */ |
| 53 | + zuint16 address; /* Value on the address bus. */ |
| 54 | + zsint16 value; /* Value on the data bus (-1 = do not check). */ |
| 55 | + char pins[4]; /* State of the pins: /RD, WR, /MREQ, /IORQ. */ |
56 | 56 | } Z_PACKED_STRUCTURE_END Cycle; |
57 | 57 |
|
58 | 58 | typedef Z_PACKED_STRUCTURE_BEGIN { |
@@ -159,9 +159,8 @@ static void add_port(zuint16 port, zuint8 value, char direction) |
159 | 159 | if (ports_index == ports_size) |
160 | 160 | { |
161 | 161 | if (cpu_break) return; |
162 | | - ports_size += Z80_MAXIMUM_CYCLES_PER_STEP; |
163 | 162 |
|
164 | | - if ((p = realloc(ports, ports_size * sizeof(Port))) == Z_NULL) |
| 163 | + if ((p = realloc(ports, ++ports_size * sizeof(Port))) == Z_NULL) |
165 | 164 | { |
166 | 165 | z80_break(&cpu); |
167 | 166 | cpu_break = Z_TRUE; |
@@ -320,10 +319,10 @@ static zbool validate_test_state(cJSON *state) |
320 | 319 |
|
321 | 320 | return Z_TRUE; |
322 | 321 |
|
323 | | - /*-------------------------------------------------------------. |
324 | | - | EI and P are mutually exclusive, as the previous instruction | |
325 | | - | cannot be `ei` and `ld a,{i|r}` at the same time. | |
326 | | - '============================================================= |
| 322 | + /*--------------------------------------------------------------. |
| 323 | + | `"ei"` and `"p"` are mutually exclusive, as the previous | |
| 324 | + | instruction cannot be `ei` and `ld a,{i|r}` at the same time. | |
| 325 | + '============================================================== |
327 | 326 | return 2.0 != |
328 | 327 | cJSON_GetNumberValue(cJSON_GetObjectItem(state, "ei")) + |
329 | 328 | cJSON_GetNumberValue(cJSON_GetObjectItem(state, "p" ));*/ |
@@ -579,7 +578,7 @@ int main(int argc, char **argv) |
579 | 578 | if (string_is_option(option, "V-version")) |
580 | 579 | { |
581 | 580 | puts( "step-test-Z80 v" Z80_LIBRARY_VERSION_STRING "\n" |
582 | | - "Copyright (C) 2024-2025 Manuel Sainz de Baranda y Goñi.\n" |
| 581 | + "Copyright (C) 2024-2026 Manuel Sainz de Baranda y Goñi.\n" |
583 | 582 | "Released under the terms of the GNU General Public License v3."); |
584 | 583 |
|
585 | 584 | return 0; |
@@ -961,7 +960,6 @@ int main(int argc, char **argv) |
961 | 960 | array_check_end(); |
962 | 961 |
|
963 | 962 | /* Check cycles. */ |
964 | | - |
965 | 963 | if (test_pins) |
966 | 964 | { |
967 | 965 | for (j = 0; j != expected_cycle_count; j++) |
@@ -990,7 +988,6 @@ int main(int argc, char **argv) |
990 | 988 | } |
991 | 989 |
|
992 | 990 | /* Check ports. */ |
993 | | - |
994 | 991 | for (j = 0; j != expected_port_count; j++) |
995 | 992 | { |
996 | 993 | Port expected_port = read_port_item(cJSON_GetArrayItem(expected_ports, (int)j)); |
@@ -1042,7 +1039,6 @@ int main(int argc, char **argv) |
1042 | 1039 | } |
1043 | 1040 |
|
1044 | 1041 | /* Print the results. */ |
1045 | | - |
1046 | 1042 | printf( "\nResults:%c%u file%s in total", |
1047 | 1043 | test_format_and_exit ? ' ' : '\n', |
1048 | 1044 | file_count, |
|
0 commit comments