alvieboy / ZXInterfaceZ

ZX Spectrum InterfaceZ
32 stars 4 forks source link

interfacez_io.vhd address match is using a cryptic address match condition #82

Open sky-ruimartins opened 3 years ago

sky-ruimartins commented 3 years ago

https://github.com/alvieboy/ZXInterfaceZ/blob/601a4b2fd1ad24d9577ee1b66cf71cf5b5a258a3/fpga/rtl/common/interfacez_io.vhd#L173

Instead of using: if adr_i(0)='1' and adr_i(1)='1' and adr_i(5)='1' and adr_i(7)='0' then

define constantes for a MASK and MATCH value, so that these magic numbers disappear and it becomes easier to read.

alvieboy commented 3 years ago

Will also restructure the packages so that we have only a single port listing instead of two like we have right now. The matches will also use a different approach, by using "x" placeholders instead of value/mask pairs. This makes them easier to read and less error prone (at least one of the masks seems to be currently incorrect)