Skip to content

Commit ed430f7

Browse files
committed
Z80_WITH_PARITY_COMPUTATION and Z80_WITH_PRECOMPUTED_DAA.
1 parent ba32d41 commit ed430f7

File tree

7 files changed

+52
-5
lines changed

7 files changed

+52
-5
lines changed

.github/workflows/build-and-test-library.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ env:
3838
Z80_WITH_EXECUTE: YES
3939
Z80_WITH_FULL_IM0: YES
4040
Z80_WITH_IM0_RETX_NOTIFICATIONS: YES
41+
Z80_WITH_PARITY_COMPUTATION: NO
42+
Z80_WITH_PRECOMPUTED_DAA: NO
4143
Z80_WITH_Q: YES
4244
Z80_WITH_SPECIAL_RESET: YES
4345
Z80_WITH_UNOFFICIAL_RETI: NO
@@ -84,6 +86,8 @@ jobs:
8486
-DZ80_WITH_EXECUTE=${{ env.Z80_WITH_EXECUTE }}
8587
-DZ80_WITH_FULL_IM0=${{ env.Z80_WITH_FULL_IM0 }}
8688
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=${{ env.Z80_WITH_IM0_RETX_NOTIFICATIONS }}
89+
-DZ80_WITH_PARITY_COMPUTATION=${{ env.Z80_WITH_PARITY_COMPUTATION }}
90+
-DZ80_WITH_PRECOMPUTED_DAA=${{ env.Z80_WITH_PRECOMPUTED_DAA }}
8791
-DZ80_WITH_Q=${{ env.Z80_WITH_Q }}
8892
-DZ80_WITH_SPECIAL_RESET=${{ env.Z80_WITH_SPECIAL_RESET }}
8993
-DZ80_WITH_UNOFFICIAL_RETI=${{ env.Z80_WITH_UNOFFICIAL_RETI }}

.github/workflows/step-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ env:
3535
Z80_WITH_EXECUTE: YES
3636
Z80_WITH_FULL_IM0: YES
3737
Z80_WITH_IM0_RETX_NOTIFICATIONS: YES
38+
Z80_WITH_PARITY_COMPUTATION: NO
39+
Z80_WITH_PRECOMPUTED_DAA: NO
3840
Z80_WITH_Q: YES
3941
Z80_WITH_SPECIAL_RESET: YES
4042
Z80_WITH_UNOFFICIAL_RETI: NO
@@ -77,6 +79,8 @@ jobs:
7779
-DZ80_WITH_EXECUTE=${{ env.Z80_WITH_EXECUTE }}
7880
-DZ80_WITH_FULL_IM0=${{ env.Z80_WITH_FULL_IM0 }}
7981
-DZ80_WITH_IM0_RETX_NOTIFICATIONS=${{ env.Z80_WITH_IM0_RETX_NOTIFICATIONS }}
82+
-DZ80_WITH_PARITY_COMPUTATION=${{ env.Z80_WITH_PARITY_COMPUTATION }}
83+
-DZ80_WITH_PRECOMPUTED_DAA=${{ env.Z80_WITH_PRECOMPUTED_DAA }}
8084
-DZ80_WITH_Q=${{ env.Z80_WITH_Q }}
8185
-DZ80_WITH_SPECIAL_RESET=${{ env.Z80_WITH_SPECIAL_RESET }}
8286
-DZ80_WITH_UNOFFICIAL_RETI=${{ env.Z80_WITH_UNOFFICIAL_RETI }}

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,13 @@ NO)
123123
option(${PROJECT_NAME}_WITH_PARITY_COMPUTATION
124124
"${PROJECT_NAME}: \
125125
Enable actual parity calculation for the P/V flag instead of using a \
126-
table of precomputed values (this is for benchmarks, DO NOT ENABLE in \
127-
production builds)."
126+
table of precomputed values (NOT RECOMMENDED for production builds)."
128127
NO)
129128

130129
option(${PROJECT_NAME}_WITH_PRECOMPUTED_DAA
131130
"${PROJECT_NAME}: \
132-
Use a table of precomputed values in the `daa` instruction (this is for \
133-
benchmarks, DO NOT ENABLE in production builds)."
131+
Use a table of precomputed values to emulate the `daa` instruction (NOT \
132+
RECOMMENDED for production builds)."
134133
NO)
135134

136135
option(${PROJECT_NAME}_WITH_Q

README

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,16 @@ library by predefining macros that enable optional features:
194194
executed during the interrupt mode 0 response.
195195
The default is `NO`.
196196

197+
-DZ80_WITH_PARITY_COMPUTATION=(YES|NO)
198+
Enable actual parity calculation for the P/V flag instead of using a
199+
table of precomputed values (NOT RECOMMENDED for production builds).
200+
The default is `NO`.
201+
202+
-DZ80_WITH_PRECOMPUTED_DAA=(YES|NO)
203+
Use a table of precomputed values to emulate the `daa` instruction (NOT
204+
RECOMMENDED for production builds).
205+
The default is `NO`.
206+
197207
-DZ80_WITH_Q=(YES|NO)
198208
Build the implementation of Q.
199209
The default is `NO`.
@@ -313,6 +323,8 @@ have the same name as their CMake equivalents:
313323
#define Z80_WITH_EXECUTE
314324
#define Z80_WITH_FULL_IM0
315325
#define Z80_WITH_IM0_RETX_NOTIFICATIONS
326+
#define Z80_WITH_PARITY_COMPUTATION
327+
#define Z80_WITH_PRECOMPUTED_DAA
316328
#define Z80_WITH_Q
317329
#define Z80_WITH_SPECIAL_RESET
318330
#define Z80_WITH_UNOFFICIAL_RETI
@@ -343,4 +355,4 @@ with this library. If not, see <http://www.gnu.org/licenses/>.
343355

344356

345357
________________________________________________________________________________
346-
Last update: 2024-11-18 README EOF
358+
Last update: 2024-12-30 README EOF

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,14 @@ If in doubt, read the [CMake documentation](https://cmake.org/documentation/) fo
470470
Enable optional notifications for any `reti` or `retn` instruction executed during the interrupt mode 0 response.
471471
The default is `NO`.
472472

473+
* <span id="cmake_option_z80_with_parity_computation">**`-DZ80_WITH_PARITY_COMPUTATION=(YES|NO)`**</span>
474+
Enable actual parity calculation for the P/V flag instead of using a table of precomputed values (NOT RECOMMENDED for production builds).
475+
The default is `NO`.
476+
477+
* <span id="cmake_option_z80_with_precomputed_daa">**`-DZ80_WITH_PRECOMPUTED_DAA=(YES|NO)`**</span>
478+
Use a table of precomputed values to emulate the `daa` instruction (NOT RECOMMENDED for production builds).
479+
The default is `NO`.
480+
473481
* <span id="cmake_option_z80_with_q">**`-DZ80_WITH_Q=(YES|NO)`**</span>
474482
Build the implementation of [Q](https://worldofspectrum.org/forums/discussion/41704).
475483
The default is `NO`.
@@ -649,6 +657,8 @@ The optional features of the emulator mentioned in "[Installation from sources](
649657
* **<code>#define [Z80_WITH_EXECUTE](#cmake_option_z80_with_execute)</code>**
650658
* **<code>#define [Z80_WITH_FULL_IM0](#cmake_option_z80_with_full_im0)</code>**
651659
* **<code>#define [Z80_WITH_IM0_RETX_NOTIFICATIONS](#cmake_option_z80_with_im0_retx_notifications)</code>**
660+
* **<code>#define [Z80_WITH_PARITY_COMPUTATION](#cmake_option_z80_with_parity_computation)</code>**
661+
* **<code>#define [Z80_WITH_PRECOMPUTED_DAA](#cmake_option_z80_with_precomputed_daa)</code>**
652662
* **<code>#define [Z80_WITH_Q](#cmake_option_z80_with_q)</code>**
653663
* **<code>#define [Z80_WITH_SPECIAL_RESET](#cmake_option_z80_with_special_reset)</code>**
654664
* **<code>#define [Z80_WITH_UNOFFICIAL_RETI](#cmake_option_z80_with_unofficial_reti)</code>**

documentation/installation-from-sources.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,16 @@ The second group of package-specific options configures the source code of the l
166166
Enable optional notifications for any ``reti`` or ``retn`` instruction executed during the interrupt mode 0 response. |br| |nl|
167167
The default is ``NO``.
168168

169+
.. option:: -DZ80_WITH_PARITY_COMPUTATION=(YES|NO)
170+
171+
Enable actual parity calculation for the P/V flag instead of using a table of precomputed values (NOT RECOMMENDED for production builds). |br| |nl|
172+
The default is ``NO``.
173+
174+
.. option:: -DZ80_WITH_PRECOMPUTED_DAA=(YES|NO)
175+
176+
Use a table of precomputed values to emulate the ``daa`` instruction (NOT RECOMMENDED for production builds). |br| |nl|
177+
The default is ``NO``.
178+
169179
.. option:: -DZ80_WITH_Q=(YES|NO)
170180

171181
Build the implementation of `Q <https://worldofspectrum.org/forums/discussion/41704>`_. |br| |nl|

documentation/integration.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ The :ref:`optional features <Introduction:Optional features>` of the emulator me
8686
8787
Enables optional notifications for any ``reti`` or ``retn`` instruction executed during the interrupt mode 0 response.
8888

89+
.. c:macro:: Z80_WITH_PARITY_COMPUTATION
90+
91+
Enables actual parity calculation for the P/V flag instead of using a table of precomputed values.
92+
93+
.. c:macro:: Z80_WITH_PRECOMPUTED_DAA
94+
95+
Enables the use of a table of precomputed values to emulate the ``daa`` instruction.
96+
8997
.. c:macro:: Z80_WITH_Q
9098
9199
Enables the implementation of `Q <https://worldofspectrum.org/forums/discussion/41704>`_.

0 commit comments

Comments
 (0)