MEGA65 / mega65-tools

Tools and Utilities for the MEGA65 Retro Computers
GNU General Public License v3.0
30 stars 32 forks source link

fix(m65): extract IDCODE independent of host's byteorder #202

Closed zeldin closed 2 months ago

zeldin commented 2 months ago

Without this fix m65 -q did not work on my Talos II because it didn't read out the idcode correctly. With the fix m65 -q works fine and runs the bitstream.

lydon42 commented 2 months ago

I wonder if this is the only place where byteorder matters... one would assume that the rest of the code should also be riddled by this.

zeldin commented 2 months ago

Most of it looks ok, since it uses macros like INT32 which are portable. The other suspicious place I found was the magic check in fpgajtag_main(), but that is dead code anyway since xflag and mflag are always 0.