maziac / DeZog

Visual Studio Code Debugger for Z80/ZX Spectrum.
MIT License
210 stars 34 forks source link

Data misalignment for ZX128K SNA with Active BANK6 in zsim #126

Closed dotkoval closed 1 week ago

dotkoval commented 1 week ago

Describe the bug When loading a ZX128K snapshot with an active BANK6 in zsim, slot2 (#8000-#BFFF) incorrectly contains BANK6 data instead of BANK2 data, which should contain the actual code.

To Reproduce Steps to reproduce the behavior:

  1. Start debugging the attached SNA file with active BANK6.
  2. Click on the 'Disassembly' view or check the memory dump starting from #8000.
  3. Observe 'nop'-s at #8000...#800C

Expected behavior At #8000...#800C, you should see data from BANK2 with the actual program.

Screenshots image

Version etc. (please complete the following information):

Additional context Here is an project example to reproduce the bug:

        SLDOPT COMMENT WPMEM, LOGPOINT, ASSERTION
        device zxspectrum128

        ORG #8000
MAIN
        di : xor a
l1      out (#fe),a : dec a : jp l2         ; "jp" just to align t-states inbetween "out"
l2      out (#fe),a : inc a : jp l1

        PAGE 6
        savesna "_dezog_test.sna", MAIN

It seems like zsim correctly loads the .sna file with any other BANK active except for BANK6. You can fill BANK6 with any values to check, that it is mapped to SLOT2 in zsim after loading.

sna_page6_dezog_bug.zip

maziac commented 1 week ago

Thanks for submitting this bug. Please try the attached vsix to check if it fixes your problem: dezog-3.3.4-rc1.vsix.zip

dotkoval commented 1 week ago

Yes, it seems that 3.3.4-rc1 version does not have such a problem. I tested it on my project with various active pages in the snapshot, and it appears that everything is working as it should now. Thanks!

maziac commented 1 week ago

Fixed in 3.3.4