Code Monkey home page Code Monkey logo

dezog's Introduction

Support

If you like DeZog please consider supporting it.

  

DeZog - The Z80 Debugger

The objective of this project is to provide a development environment for Z80 assembler programs that offers similar features to those found in high-level programming languages, such as Eclipse, Visual Studio, or XCode.

This includes functionalities like

  • easy stepping/navigation through source files with step-over, step-into and step-out capabilities
  • data representation through memory views and data watches
  • easy data access through hover-over information
  • data display in structures
  • a unit test framework

Additionally it offers some ZX Next specific capabilities like displaying sprites.

DeZog facilitates the debugging of Z80 assembler programs using Visual Studio Code (vscode) as the development environment. This tool can be used to build programs, step through sources, use labels, watches, memory views, and other useful features. Additionally, it can be used to reverse engineer old Z80 programs, such as ZX Spectrum or MAME arcade games, by debugging and creating commented list files of the program.

DeZog needs a "Remote" to execute the Z80 binaries. You can either use the built-in Z80/ZX simulator or connect to ZEsarUX, CSpect or MAME via a socket connection for more advanced projects.

Note: DeZog itself does not include any support for building from assembler sources. For this you need a build task and an assembler. For an example look here: https://github.com/maziac/z80-sample-program

Gallery

Sprites:

  • Display of sprites with register indices and position
  • Display of all patterns with indices

Execution time:

Unit tests:

Features

  • supports the ZEsarUX emulator
  • supports the CSpect emulator
  • supports MAME
  • can be used with the internal simulator (does not require ZEsarUX, CSpect, ...)
  • reads .list and .sld files
    • supports stepping through source code
    • either in .list file or in .asm files
  • step-over, step-in, step-out, continue, pause
  • reverse debugging via step back and reverse continue
  • code coverage visualization
  • state save/restore
  • breakpoints (and breakpoints with conditions)
  • display of
    • disassembly
    • Z80 registers
    • stack
    • callstack
    • data
    • tbblue sprites and patterns
  • changing of Z80 registers from vscode
  • labels
    • number-label resolution, i.e. along with numbers also the corresponding label is displayed
  • hovering
    • registers: reveals its contents and associated label
    • labels: reveals their value
  • watches of labels
  • formatting registers
    • customizable formatting for registers, e.g. format as hex and/or decimal and/or label etc.
    • different formatting for registers while hovering
  • memory viewer / editor
  • automatic display of memory that is pointed to by HL, DE, etc.
  • change of program counter through menu
  • display of ZXNext sprites and sprite patterns
  • supports banking ('long addresses')
  • support for Z80 unit tests
  • custom extensions to the internal simulator to simulate peripherals.
  • custom memory models

Installation

Prerequisites

In order to use DeZog you need at least vscode (Linux, macOS or Windows).

If you are writing pure Z80 programs or simple ZX Spectrum 48K programs this might already be sufficient as you can use the internal Z80 Simulator.

For more demanding projects you have the choice to install a real emulator.

These are the options:

  • the CSpect emulator (known to be interoperable is version 2.19.7.1)
  • the ZEsarUX emulator (known to be interoperable is version 11.0. Versions older than 10.3 are not compatible.)
  • MAME (known to be interoperable is version 0.242)

Note: The version numbers given here are versions that I have used myself. Newer versions probably also work, but I can't judge that myself.

The different DeZog/emulator configurations have different advantages. But which one you choose mainly depends on your personal preference. The table here shows a comparison of the features.

If you own a ZX Next you also have the option to debug your SW directly on the Next.

DeZog

In Visual Studio Code simply install "DeZog" (maziac.dezog) from the Marketplace.

There are a few other extensions that are not required to work with DeZog but may help:

  • ASM Code Lens:
    • Z80 assembler syntax highlighting
    • completions, references, jump to label, renaming
  • Z80 Instruction Set:
    • shows the opcode, affected flags and a description on hovering over a Z80 instruction
  • Hex Hover Converter:
    • converts numbers into their decimal, hexadecimal and binary format on hovering
  • ZX SNA File Viewer/ZX NEX File Viewer:
    • Viewer for the ZX Spectrum snapshot (.sna) format and the ZX Spectrum Next (.nex) file format (in marketplace search for "snafile" and "nexfile")

All can be installed directly inside vscode from the market place.

To use DeZog in Visual Studio Code, simply install the "DeZog" extension (maziac.dezog) from the Marketplace. Although not required, there are several other helpful extensions available, including:

  • ASM Code Lens, which provides syntax highlighting for Z80 assembler, as well as completions, references, jump to label, and renaming functionality.
  • Z80 Instruction Set, which displays opcode, affected flags, and a description when hovering over a Z80 instruction.
  • Hex Hover Converter, which converts numbers to decimal, hexadecimal, and binary formats when hovering over them.
  • ZX SNA File Viewer/ZX NEX File Viewer, which allow viewing of ZX Spectrum snapshot (.sna) and ZX Spectrum Next (.nex) files (search for "snafile" and "nexfile" in the Marketplace).

All of these extensions can be easily installed directly from the Visual Studio Code Marketplace.

Usage

Please refer to the 'Usage of DeZog' documentation.

You can also access the documentation from within vscode/DeZog. Enter "dezog: Show the DeZog Help page" in the command palette (F1 key) or reveal the "DeZog Help" from the debugging sidebar.

Contribution

If you would like to help extending the DeZog functionality in one of the following areas you are very welcome:

You can create a pull request so I can add your sources to the official release. Most probably I will first move them to a new feature branch for testing. Please note that all your contributions/sources should be under MIT license.

If you would like to contact me beforehand you can create a new issue in github and we can discuss.

License

DeZog is licensed under the MIT license.

The source code is available on github.

DeZog also includes a Z80/48k ZX Spectrum simulator. For this the original 48/128k ROM code is included and here is the copyright notice: "Amstrad have kindly given their permission for the redistribution of their copyrighted material but retain that copyright". See Amstrad ROM permissions.

Furthermore DeZog includes slightly modified sources of the Z80.js simulator. It was taken from https://bitbucket.org/DrGoldfire/z80.js/src/master/ which is MIT licensed. Many thanks to Molly Howell.

For the "What's New" feature the vscode-whats-new project from Alessandro Fragnani aka alefragni has been incorporated. The project is MIT licensed.

For the other included SW see the 'dependencies' section in package.json

Acknowledgements

I would like to express my gratitude to the following individuals for their invaluable support:

  • Cesar Hernandez Bano for developing the great ZEsarUX emulator which very early offered the possibility to remotely connect to it. And for being patient with all my request for the ZRCP protocol. Without ZEsarUX I wouldn't have started DeZog at all. So, if you like DeZog thank Cesar.
  • Mike Dailly for the wonderful CSpect emulator, for opening the debug interface to plugins and for giving support to use it properly.
  • Molly Howell/DrGoldfire for the Z80 CPU simulation code.
  • Kris Borowinski for his tireless efforts testing DeZog.
  • Peter Ped Helcmanovsky for his support to get the display of the relative-sprites correct and for the changes he implemented for DeZog in sjasmplus in the SLD format.
  • Cesar Wagener Moriana, Dean Belfield, Daren May, Patricia Curtis and A MAN IN HIS TECHNO SHED for writing tutorials.
  • Luciano Martorella for his contribution of the custom memory model.

Tutorials

Please note that the tutorials listed here are normally not updated when a new DeZog version arrives. Especially for changes in the 'launch.json' it might happen that some properties (names) have changed/removed/added.

If you are writing a tutorial please let me know, I'm happy to list it here. Any contributions are very welcome.

The tutorials that I'm aware of are listed here by date.

A Man in his Techno Shed

Date: Apr-2022, DeZog 2.7, ZX Next

The most recent and only tutorialtutorial for DeZog 2.x, by A MAN IN HIS TECHNO SHED. It shows debugging with a ZX Next and DeZog.

Patricia Curtis

Date: Sep-2020, DeZog 1.4, CSpect

A great tutorial by Patricia Curtis describing the setup with sjasmplus, CSpect and DeZog.

Retro Coder TV

Date: Sep-2020, DeZog 1.4, Internal Z80 Simulator, ZEsarUX, CSpect

A quite lengthy tutorial. But as a YouTube video it shows a 'live' DeZog setup. By Retro Coder TV.

L BREAK into program, 0:1

Date: Aug-2020, DeZog 1.4 (with a few updates for 2.0), ZEsarUX

And here is another shorter tutorial by Dean Belfield (L BREAK into program, 0:1).

Daren May

Date: May-2020, DeZog v1.2, CSpect

An excellent tutorial by Daren May which shows how to setup DeZog with CSpect on Windows. Although it was made for Windows you can easily apply it to macOS or Linux.

Please note: Daren creates an SD card image that is loaded when CSpect is started. For many projects this is not necessary as you can transfer .nex and .sna files directly from DeZog to CSpect.

Cesar Wagener Moriana

Date: Dec-2019, DeZog 0.9 (Z80 Debug), ZEsarUX

Here is an older (but still great) tutorial from Cesar Wagener Moriana. He documented how he put all things together. It describes how to setup an integrated development environment for ZEsarUX with DeZog. It deals with setting up

  • sjasmplus
  • ZEsarUX and the
  • DeZog

and is available in English, Spain and German here.

Please note: The tutorial is a bit outdated, it uses 'z80-debug'. This was the former name of the project. It has been renamed to 'dezog'. This means especially that in the launch.json files you need to change 'z80-debug' to 'dezog'.

Nevertheless Cesar (W. M.) also shows how to setup the system under Windows and explains a few features of z80-debug/DeZog so that it is a great advice to get you started.

Fork

The ZX81 Debugger by Sebastien Andrivet is a fork of DeZog that contains a complete development environment for the ZX81. I.e. it comes with an integrated Z80 assembler, an integrated ZX81 simulator, syntax highlighting, sample code that you just need to paste to get started and DeZog as a debugging backend. So if you're looking for a development program for the ZX81, you should give it a try. It's also much easier to set up than DeZog because you don't have any external dependencies. If you want to test the capabilities of DeZog without configuring anything, then you should also check it out.

dezog's People

Contributors

andrivet avatar lmartorella avatar maziac avatar remy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dezog's Issues

Support sjasmplus alias labels

Has a discussion with Ped to how to best solve the problem that the same data area (in assembler) could be used for different purposes.
I.e. the example was that a message is received and the contents is differently interpreted depending on the sent message.
Ped's proposal was to use STRUCTs and alias labels.
See here:
https://github.com/z00m128/sjasmplus/blob/master/tests/macro_examples/union_like_structures.asm

    STRUCT RECEIVE_BUFFER_CMD_READ_REGS, RECEIVE_BUFFER_HEADER
register_number     BYTE    0
    ENDS

    STRUCT RECEIVE_BUFFER_CMD_CONTINUE, RECEIVE_BUFFER_HEADER
bp1_enable          BYTE    0
bp1_address         WORD    0
bp2_enable          BYTE    0
bp2_address         WORD    0
    ENDS

    STRUCT RECEIVE_BUFFER_CMD_PED_TEST, RECEIVE_BUFFER_HEADER
pattern             BLOCK   256
    ENDS

; find the structure with maximum size to define how long the receive_buffer should be
RB_MAX_SIZE         = RECEIVE_BUFFER_HEADER
RB_MAX_SIZE         = RB_MAX_SIZE >? RECEIVE_BUFFER_CMD_READ_REGS
RB_MAX_SIZE         = RB_MAX_SIZE >? RECEIVE_BUFFER_CMD_CONTINUE
RB_MAX_SIZE         = RB_MAX_SIZE >? RECEIVE_BUFFER_CMD_PED_TEST

; reserve the memory for the receive_buffer (one buffer for all)
    ORG     $8000
receive_buffer      RECEIVE_BUFFER_HEADER
.data               BLOCK   RB_MAX_SIZE - RECEIVE_BUFFER_HEADER, 0

; definie alias labels for "receive_buffer" to access specific-command fields
rb_read_regs    RECEIVE_BUFFER_CMD_READ_REGS = receive_buffer
rb_continue     RECEIVE_BUFFER_CMD_CONTINUE = receive_buffer
rb_ped_test     RECEIVE_BUFFER_CMD_PED_TEST = receive_buffer

https://github.com/z00m128/sjasmplus/blob/master/tests/macro_examples/union_like_structures.lst


Value    Label
------ - -----------------------------------------------------------
0x0006   RECEIVE_BUFFER_HEADER
0x0000 X RECEIVE_BUFFER_HEADER.length
0x0004 X RECEIVE_BUFFER_HEADER.seq_no
0x0005 X RECEIVE_BUFFER_HEADER.command
0x0007   RECEIVE_BUFFER_CMD_READ_REGS
0x0006 X RECEIVE_BUFFER_CMD_READ_REGS.register_number
0x000C   RECEIVE_BUFFER_CMD_CONTINUE
0x0006 X RECEIVE_BUFFER_CMD_CONTINUE.bp1_enable
0x0007 X RECEIVE_BUFFER_CMD_CONTINUE.bp1_address
0x0009 X RECEIVE_BUFFER_CMD_CONTINUE.bp2_enable
0x000A X RECEIVE_BUFFER_CMD_CONTINUE.bp2_address
0x0106   RECEIVE_BUFFER_CMD_PED_TEST
0x0006 X RECEIVE_BUFFER_CMD_PED_TEST.pattern
0x0106   RB_MAX_SIZE
0x8000   receive_buffer
0x8000 X receive_buffer.length
0x8004 X receive_buffer.seq_no
0x8005   receive_buffer.command
0x8006 X receive_buffer.command.data
0x8000 X rb_read_regs
0x8006   rb_read_regs.register_number
0x8000 X rb_continue
0x8006   rb_continue.bp1_enable
0x8007   rb_continue.bp1_address
0x8009   rb_continue.bp2_enable
0x800A   rb_continue.bp2_address
0x8000 X rb_ped_test
0x8006   rb_ped_test.pattern
0xC000 X process_command
0xC00B   process_command.not_read_regs
0xC01F   process_command.not_continue

This would serve my purpose but DeZog cannot parse this at the moment.

I should extend the parsing also to the labels section.

Or maybe I should not parse the list file anymore but instead the SLD file and the labels file.
Should be easier and more complete.

[Feature Request] Watch struct support

Would it be possible to enhance the WATCH window to allow structured data to be conveniently visualised? The end result would be like viewing a struct or array of structures when debugging C in Visual Studio.

Currently for watches you can tell DeZog the number of elements to show and if it should show bytes, words or both. The format is:

label,size,types

with

  • label: The label, e.g. LBL_TEXT or just a number e.g. 0x4000
  • size: The number of elements to show. Defaults to 100 if omitted.
  • types: Determines if a byte array ('b'), a word array ('w') or both ('bw') should be shown. Defaults to 'bw'.

It would be very helpful for debugging if

  • size: could be extended to accept labels
  • types: could be extended to accept any numeric value or label to use as the structure size

For example:

        STRUCT Hitbox
x0      BYTE 0  ; min X
x1      BYTE 0  ; max X (inclusive)
y0      BYTE 0  ; min Y
y1      BYTE 0  ; max Y (inclusive)
        ENDS

        STRUCT Invader
active                  BYTE
type                    BYTE
pSpriteAttributes       WORD    ; address of sprite attributes
hitboxScreenSpace       Hitbox
        ENDS

INVADER_COUNT EQU 55
invaders DS INVADER_COUNT*Invader

When assembled with sjasmplus this produces in the .lst file (or .lables file if sjasmplus --lstlab option used)

0x0008   Invader
0x0000   Invader.active
0x0001   Invader.type
0x0002   Invader.pSpriteAttributes
0x0004   Invader.hitboxScreenSpace
0x0004 X Invader.hitboxScreenSpace.x0
0x0005 X Invader.hitboxScreenSpace.x1
0x0006 X Invader.hitboxScreenSpace.y0
0x0007 X Invader.hitboxScreenSpace.y1

As a first pass, if the label 'invaders' watched, the user could specify invaders,55,8b which would display the memory in groupings of 8 bytes.

v WATCH
  v invaders,55,8b
    v 8b: [0,54]
      v [0]
           [0]: 00h
           [1]: 00h
           [2]: 00h
           [3]: 00h
           [4]: 00h
           [5]: 00h
           [6]: 00h
           [7]: 00h
      v [1]
           [0]: 00h
           [1]: 00h
           [2]: 00h
           [3]: 00h
           [4]: 00h
           [5]: 00h
           [6]: 00h
           [7]: 00h
      > [2]
      > [3]
      > [4]
      ....
      > [54]

Better still, if the Watch window could access types from the lst, it would know the size of the Invader struct and the array size, so the user could enter invaders,INVADER_COUNT,Invader

v WATCH
  v invaders,INVADER_COUNT,Invader
    v Invader: [0,54]
      v [0]
           [0]: 00h
           [1]: 00h
           [2]: 00h
           [3]: 00h
           [4]: 00h
           [5]: 00h
           [6]: 00h
           [7]: 00h
      v [1]
           [0]: 00h
           [1]: 00h
           [2]: 00h
           [3]: 00h
           [4]: 00h
           [5]: 00h
           [6]: 00h
           [7]: 00h
      > [2]
      > [3]
      > [4]
      ....
      > [54]

Ideally, the Watch window would parse the list file to allow the individual element struct members to be shown with the name and type:

v WATCH
  v invaders,INVADER_COUNT,Invader
    v Invader: [0,54]
      v [0]
         active: 00h
         type: 00h
        pSpriteAttributes: 0000h
        v hitboxScreenSpace
          x0: 00h
          x1: 00h
          y0: 00h
          y1: 00h
      v [1]
        active: 00h
        type: 00h
        pSpriteAttributes: 0000h
        v hitboxScreenSpace
          x0: 00h
          x1: 00h
          y0: 00h
          y1: 00h
      > [2]
      > [3]
      > [4]
      ....
      > [54]

I appreciate that this might not be possible, but it would make a huge difference to the quality of the debugging experience.

Closing the help once prevents it from being opened again

Describe the bug

Using the "dezog help" sidebar panel - the first time I click on a help item, a webview opens.

If I close that webview, and then click on a different help item, nothing happens.

Expected behavior

The webview should relaunch to the newly selected help item.

Version etc. (please complete the following information):

  • DeZog SW Version: 2.2.0
  • OS: macos
  • Remote: zsim

Additional context

In VS Code devtools, clicking the second time or more, shows the following error:

ERR Webview is disposed: Error: Webview is disposed
    at r.assertNotDisposed (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:62797)
    at reveal (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:62645)
    at HelpView.reveal (/Users/remy/.vscode/extensions/maziac.dezog-2.2.0/out/src/views/baseview.js:146:26)
    at HelpProvider.createHelpView (/Users/remy/.vscode/extensions/maziac.dezog-2.2.0/out/src/help/helpprovider.js:195:23)
    at HelpProvider.navigateToChapter (/Users/remy/.vscode/extensions/maziac.dezog-2.2.0/out/src/help/helpprovider.js:203:14)
    at /Users/remy/.vscode/extensions/maziac.dezog-2.2.0/out/src/help/helpprovider.js:32:30
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:1836)
    at d.$onMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:87:53273)
    at p._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:10276)
    at p._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:9968)
    at p._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:8638)
    at p._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:7440)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:5568
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:1836)
    at d.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:63:15515)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:104:29104
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:1836)
    at d.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:63:15515)
    at t._receiveMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:63:20765)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:63:17659
    at v.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:55:1836)
    at u.acceptChunk (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:63:12880)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:63:12228
    at Socket.m (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:104:12375)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)

Sjasmplus list files does not work

First of all: really great work, I'm impressed with well structured code and smart async architecture of extension!

I tried to load sjasmplus list file into debugger and it seems to not working, I'm getting opened disasm.asm instead of source file.

I looked into code of current version from extensions marketplace and have not found any occurrences of string "sjasmplus". And in master branch there is some conditions on it. But master branch seems to not loading source files even in z80asm mode for .list files.

memdump in words

Hi There i just want to say awesome work on this, I have been using it on the spectrum next, and i was looking to see if the memory dump could be displayed as words rather than just bytes. I can't find the command :(

Many thanks

Patricia
luckyredfish.com

Originally posted by @infromthecold in #25 (comment)

Zsim: load instruction not executed properly for addresses between 0x0000 and 0x3FFF

Describe the bug
If a load instruction to an address in the range of 0x0000 and 0x3FFF is executed, the data in that memory cell will not change. This will happen regardless of the "loadZxRom" option in launch.json. A similar problem is encountered if the stack pointer is set in this range.

To Reproduce

  1. Create a launch.json, select "zsim" as the preferred simulator, add a "loadObjs" parameter and set it to the corresponding binary file and a start address of "0x0000".
  2. Assemble (preferably with sjasmplus) a source file which contains the following code:
;...
low_addr: equ 0x3FFF ;can be any value in range [0x0000, 0x3FFF]
    .db 00
;...
ld hl, low_addr
ld a, 0xFF ;can be any other value
ld (hl), a

high_addr: equ 0x4000 ;can be any value >= 0x4000
    .db 00
;....
ld hl, high_addr
ld a, 0xFF ;can be any other value
ld (hl), a
;...
  1. Run the program in debug mode and inspect the corresponding memory locations after the each set of instructions has been run. Only the higher address will actually be filled with 0xFF, the lower address will remain unchanged.

Expected behavior
Both memory locations ought to be filled with 0xFF.

Screenshots
I successfully reproduced this bug with unit tests
Z80Err
The following GIF illustrates the memory dump during the execution of UT_ld_low_addrs:
Z80UnitErrLow
For the UT_ld_high_addrs the memory behaviour is normal, i.e. no need to illustrate.
Version etc. (please complete the following information):

  • DeZog: 1.4.8
  • OS: Solus Linux
  • Remote: zsim

Additional context
I mainly use dezog and zsim to develop and debug firmware code(BIOS) for my own custom made Z80 computer and not for ZX Spectrum or any of it's variants. As far as I know, there is no reason why such behavior should occur on native Z80 (I personally tested similar code on a physical Z80 CPU chip), but I'm unfamiliar with ZX Spectrum memory layout and limitations. Perhaps this is the intended behavior of zsim, in which case this issue is irrelevant.

I originally encountered this issue when working with a different configuration, but later switched to a unit test and the issue persists. Here is the unit test configuration:

        {
            "type": "dezog",
            "request": "launch",
            "name": "Unit Tests",
            "unitTests": true,
            "remoteType": "zsim",
            "zsim": {
                "loadZxRom": false,
                "zxKeyboard": false,
                "visualMemory": false,
                "ulaScreen": false,
                "vsyncInterrupt": false,
                "cpuLoadInterruptRange": "0"
            },
            "resetOnLaunch": true,
            "skipInterrupt": true,
            "commandsAfterLaunch": [
                "-wpmem enable",
                "-assert enable",
                "-logpoint enable",
            ],
            "disassemblerArgs": {
                "esxdosRst": true
            },
            "listFiles": [
                {
                    "path": "unit_tests.lst",
                    "asm": "sjasmplus",
                    "mainFile": "unit_tests.asm"
                },
            ],
            "rootFolder": "${workspaceFolder}",
            "loadObjs": [
                {"path": "unit_tests.bin", "start": "0x0000"}
            ]
        }

Watch expression evaluates incorrect value for label within IFDEF

Describe the bug
Watch expression evaluates incorrect value for label within IFDEF. In the IFDEF below I have two definitions of Level. When referring to Level in a watch expression, the address of the second Level (which is the end of the first Level) is returned

SRC:

    DEFINE CURRENT_LEVEL_1

    ; code here...

    IFDEF CURRENT_LEVEL_1
Level   TileMapStruct 62,  60, 0, 0, 0, 0
    ELSE
Level   TileMapStruct 160, 40, 0, 0, 0, 0
    ENDIF

LST:

 239  89B0                  IFDEF CURRENT_LEVEL_1
 240  89B0 3E 3C 00 00  Level   TileMapStruct 62,  60, 0, 0, 0, 0
 240  89B4 00 00
 241  89B6                  ELSE
 242  89B6 ~            Level   TileMapStruct 160, 40, 0, 0, 0, 0
 243  89B6                  ENDIF
 244  89B6

Watches:
image

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
I expect Level to be evaluated to the value: $89B0 instead of $89B6
Screenshots
If applicable, add screenshots to help explain your problem.

Version etc. (please complete the following information):

  • DeZog SW Version: 1.3.0
  • OS: Windows 10 2004
  • Remote: CSPECT

Additional context
Please attach your launch.json file.

{
    "configurations": [
        {
            "type": "dezog",
            "request": "launch",
            "name": "DeZog",
            "remoteType": "cspect",
            "zsim": {
                "loadZxRom": true
            },
            "listFiles": [
                {
                    "path": "${workspaceRoot}\\project\\src\\Main.lst",
                    "asm": "sjasmplus",
                    "mainFile": "${workspaceRoot}\\project\\src\\Main.asm"
                },

            ],
            "startAutomatically": false,
            "skipInterrupt": true,
            "history": {
                "reverseDebugInstructionCount": 10000
            },
            "commandsAfterLaunch": [
                "-sprites",
                "-patterns"
            ],
            "disassemblerArgs": {
                "esxdosRst": true
            },
            "rootFolder": "${workspaceFolder}",
            "topOfStack": "stack_top",
            "load": "project.nex",
            "smallValuesMaximum": 513,
            "tmpDir": ".tmp"
       }    
    ]
}

Frequent crashes when debugging

Describe the bug
While debugging with ZESaruX v0.8 (stable) I get frequent crashes, where ZESaruX will terminate and the debugging will stop. There doesn't seem to be any commonality with these crashes, they seem to happen randomly. Sometimes while stepping through instructions, sometimes while paused on a single instruction. They are not corrolated with crashes of the Spectrum code.

To Reproduce
Steps to reproduce the behavior:

  1. Debug code as normal

Expected behavior
Stable debugging.

Version etc. (please complete the following information):

  • SW Version: 0.9.1
  • OS: Windows 10
  • ZEsarUX SW Version: 0.8

Additional context
{
// Verwendet IntelliSense zum Ermitteln möglicher Attribute.
// Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "z80-debug",
"request": "launch",
"name": "ThePit",
"zhostname": "localhost",
"zport": 10000,
"listFiles": [
{
"path": "memory.list",
"useFiles": true,
"asm": "sjasmplus",
"mainFile": "main.asm"
}
],
"startAutomatically": false,
"skipInterrupt": true,
"commandsAfterLaunch": [
//"-sprites",
//"-patterns"
],
"disassemblerArgs": {
"esxdosRst": true
},
"rootFolder": "${workspaceFolder}",
"topOfStack": "stack_top",
"load": "ThePit.sna",
"smallValuesMaximum": 513,
"tmpDir": ".tmp"
}

]

}

topOfStack by label "Cannot evaluate" error

Test.z80:

                DEVICE ZXSPECTRUM128

Code_Start:     EQU 0x8000

                ORG Code_Start
			    LD SP, Stack_Top
                LD A, %00000110
                OUT 254, A

Loop:           HALT
                JR Loop

Code_Length:	EQU $-Code_Start+1

                SAVESNA "test.sna", Code_Start

Stack_Bottom:   ; 100 bytes of stack
    defs    100, 0
Stack_Top:

launch.json:

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "Z80 Debugger",
			"type": "dezog",
			"request": "launch",
			"remoteType": "zrcp",
			"zrcp": {
				"hostname": "localhost",
				"port": 10000
			},
			"topOfStack": "Stack_Top",
			"rootFolder": "${fileDirname}",
			"disassemblerArgs": {
				"esxdosRst": true
			},
			"load": "${fileDirname}/${fileBasenameNoExtension}.sna",
			"skipInterrupt": false,
			"startAutomatically": true,
			"preLaunchTask": "sjasmplus"
		}
	]
}

Message:
изображение

I trying with 'Stack_Top: EQU 0xFFF0'. Same effect

DeZog v2.4.3
SjASMPlus Z80 Cross-Assembler v1.18.3

Use with Busraider question

I'm working with your code to provide debug for a 'real' retro computer add-on called BusRaider for RC2014 https://github.com/robdobsn/PiBusRaider which I designed. I have a few questions and would like to ask a few questions if possible but can't see another means to contact you. My questions are mainly around listing files and breakpoint support.

openmsx: TypeError: Cannot read property at 'charAt'

Bildschirmfoto 2020-08-31 um 19 08 44

Branch: openmsx
OS: macOS

I found a problem in the openmsx implementation.
I tried to setup the system first time after some time, i.e. I did it wrong and the result was this error.

Here are the steps to reproduce:

  1. Start OpenMSX
  2. By default it starts on my mac as "C-BIOS NSX2+" see here
    Bildschirmfoto 2020-08-31 um 19 25 53
  3. Use your debug sample program and start DeZog.

Results is the screenshot at the top.

[Feature Request] Zsim: add support for custom IO bindings

While using dezog and zsim to develop and debug programs for native Z80, one feature that comes to mind is support for custom IO bindings. Custom IO bindings would allow users to somehow handle input or output to different ports using their own custom logic. Basically, this interface lets the emulator interact with real or emulated IO devices that the user provides.

I thought about this for a while, and it seems to me that the most fitting tool for this would be to utilize sockets.
Here is one way this could be implemented:

  1. User sets useCustomIO field to true in order to enable custom IO functionality
  2. User assigns the inputSockets field as follows:
"inputSockets": [
    {
        "inPort":  "desired_input_port",
        "ipAddress": "desired_ip_address",
        "TCPPort": "desired_tcp_port"
    },
],

A similar object is defined for outputSockets. The terminology is a bit confusing, but inPort or outPort represent the port specified in the in reg, (*) or out (*), reg Z80 assembly instructions, while TCPPort corresponds to a TCP port which uniquely identifies an application on an end device.
In case of input, the emulator sends a request upon execution of the "in" command. It then tries to read from the socket and blocks until the response has been received.
In case of output, the emulator simply writes the output information to the corresponding socket and continues execution.
It is up to the user to implement the correct interface on the other side.

What do you think? I'm willing to help you with this if you wish, although I'm not very familiar with the source code yet. I can also provide a simple client side program for testing purposes.

PS: I am the same person who opened the issue with the ld instruction not being executed properly

c.lis file never being used, always auto disasm.asm

Anytime i try to debug a code, compiled on z88dk, and running, the disassemble not use the c.lis generated, some early versions it worked, but not anymore

image

  • DeZog 1.1.0:
  • OS: windows 7 64 , 8gb ram
  • Remote: zrcp (ZEsarUX): 8.1-B2

follows my launch options, early versions, if i change
asm: option

it worked, and no change in files or sources do the slight difference.

i put the complete launch, but the one with the issue is;

DeZog raiz

{
// Verwendet IntelliSense zum Ermitteln möglicher Attribute.
// Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

    {
        "type": "dezog",
        "request": "launch",
        "name": "DeZog raiz",
        "remoteType": "zrcp",
        "zrcp": {
            "hostname": "localhost",
            "port": 12000
        },
        "zsim": {
            "machine": "48k"
        },
        "serial": {
            "baudrate": 230400,
            "port": "/dev/tty.usbserial"
        },
        // "topOfStack": "stack_top",
        "listFiles": [
            {
                "sources": "efd.c.lis",
                "useFiles": true,
                "asm": "z88dk",
                "srcDirs": [],
                "path": "efd.c.lis",
            }
        ],
        "disassemblerArgs": {
            "esxdosRst": true
        },
        "load": "efd.tap",
        "skipInterrupt": true
    },

    {
        "type": "dezog",
        "request": "launch",
        "name": "Speccy Tron",
        "remoteType": "zrcp",
        "zrcp": {
            "hostname": "localhost",
            "port": 12000
        },            
        "listFiles": [
            {
                "path": "speccytron.c.lis",
                "sources": "speccytron.c.lis",
                "useFiles": true,
                "asm": "z88dk",
                "mainFile": "speccytron.c",
                "srcDirs": [],
                "addOffset": 32768
            }
        ],
        "startAutomatically": false,
        "skipInterrupt": true,
        "commandsAfterLaunch": [
            //"-sprites",
            //"-patterns"
        ],
        "disassemblerArgs": {
            "esxdosRst": true
        },
        "rootFolder": "${workspaceFolder}",
        "load": "speccytron5.tap",
        // "load": "4.Z80",
        "smallValuesMaximum": 512,
        "tmpDir": ".tmp"
   },
   {
    "type": "dezog",
    "request": "launch",
    "name": "efd",
    "remoteType": "zrcp",
    "zrcp": {
        "hostname": "localhost",
        "port": 12000
    },            
    "listFiles": [
        {
            "path": "efd.c.lis",
            // "sources": "efd.c",
            "useFiles": true,
            "asm": "z80asm",
            // "listfiles": "efd.c.lis, dbalib.c.lis",
            "mainFile": "efd.c.lis",
            // "srcDirs": [],
            "addOffset": 25124
        }
    ],
    "startAutomatically": false,
    "skipInterrupt": true,
    "commandsAfterLaunch": [
        //"-sprites",
        //"-patterns"
    ],
    "disassemblerArgs": {
        "esxdosRst": true
    },
    "rootFolder": "${workspaceFolder}",
    "load": "efd.tap",
    "smallValuesMaximum": 512,
    "tmpDir": ".tmp"
}
]

}

zsim/sna file. SP 2 bytes too low.

If the SNA file contains e.g. 0x8FFB as address this is put in SP and the program is started at the location SP points to.
However before starting the program the SP needs to be adjusted by adding 2.
I.e. a RETN instruction should be simulated.
(Additionally copy IFF2 to IFF1).

Step-by-step instruction

Could you make the documentation more detailed? I know z80, but I don’t know how to combine everything into a single whole to make it work?
Please create a "step by step".

(ctrl+shift+B) I have:
sjasmplus --lst=z80-sample-program.list --sym=z80-sample-program.labels --fullpath main.asm
make: sjasmplus: Command not found
Makefile:31: recipe for target 'z80-sample-program.sna' failed
make: *** [z80-sample-program.sna] Error 127
The terminal process terminated with exit code: 2

rootFolder seems to be ignored

Describe the bug
DeZog can't seem to resolve workspace folder paths

To Reproduce

I have multiple projects in my VSCode workspace, one of them is a Z80 projects.

Here is my entire zx/.vscode/launch.json:

{
    "configurations": [
        {
            "rootFolder": "${workspaceFolder}",
            "type": "dezog",
            "request": "launch",
            "name": "DeZog",
            "remoteType": "zsim",
            "zsim": {
                "loadZxRom": true
            },
            "sjasmplus": [
                {
                    "path": "bin/out.list"
                }
            ],
            "startAutomatically": false,
            "history": {
                "reverseDebugInstructionCount": 10000,
                "codeCoverageEnabled": true
            },
            "commandsAfterLaunch": [
                //"-sprites",
                //"-patterns"
            ],
            "disassemblerArgs": {
                "numberOfLines": 20,
                "esxdosRst": true
            },
            "topOfStack": "0xffff",
            "loadObjs": [
                {
                    "path": "bin/out.bin",
                    "start": "0x6000"
                },
                {
                    "path": "bin/resources.bin",
                    "start": "0x8000"
                }
            ],
            "execAddress": "0x6000",
            "smallValuesMaximum": 513,
            "tmpDir": ".tmp"
        }
    ]
}

When I try running the project, the error message is like

'path': File /home/bereal/ws/other-folder/bin/out.list does not exist.

So it tries to find it in a wrong workspace folder.
If I add prefix ${workspaceFolder}/ to all the paths, it launches, but immediately fails to find the source path, still looking for it in another project.

Version etc. (please complete the following information):

VSCode: 1.53.2
OS: Linux x64 5.10.7-3-MANJARO
DeZog SW Version: v2.1.7
Remote: zsim

Watch doesn't support byte group above 2

Describe the bug

If you try to watch a value grouped by 4 bytes (for 32bit) the result is wrong/corrupted.

To Reproduce

Steps to reproduce the behavior:

Add a watch for an address with 4 as the argument:

Screenshot 2021-04-25 at 10 07 46

Expected behavior

32bit groupings to be parsed. I would also expect 64bit - but I'm not sure what grouping by 3 bytes would do (or just a 24bit value?).

Version etc. (please complete the following information):

  • DeZog SW Version: 2.2.3
  • OS: macOS Big Sur
  • Remote: n/a

List files structure documentation

I was trying to setup this very promising debugger for my ZX80/ZX81 development, but trying to setup the launch.json file I stumped on the list files.

I'm using the very powerful fasmg with EZ80 includes and some other custom scripts (you can see it in the "Extreme 1k programs for ZX80 and ZX81: starter kit" at https://sinclairzxworld.com/viewtopic.php?f=6&t=2349).

This setup currently produces a sigle listing with "address" and "sourcefile,line") as you can see below as an example:

00000000 (pippo.asm,1):  00                      nop
00000001 (pippo.asm,2):  C3 0C 00                jp test
00000004 (pippo.asm,4):  00                      nop
00000005 (pippo.asm,5):  18 05                   jr test
00000007 (test.inc,1):   00                      nop
00000008 (test.inc,2):   3A 0C 00                ld a,(test)
0000000B (pippo.asm,8):  00                      nop
0000000C (pippo.asm,9):  00                      test: nop
0000000D (pippo.asm,10): 00                      nop 

(discussed here: https://sinclairzxworld.com/viewtopic.php?t=2289&p=23674#p23674)

I can adapt the file to a new format, but I didn't find any description of the format accepted.

PS: I've also a simple symbols file with a list labels and addresses (the only help in debuggers until now I was not able to get to see the full listing with my comments)...

Debugging with ZEsarUX does not work on DeZog 0.12.0

Describe the bug
Remote debugging does not work at all with ZEsarUX and DeZog 0.12.0. It works as expected on DeZog 0.11.0. As per instruction in 0.12.0 release I've added "remoteType": "zrcp" to launch.json

To Reproduce
Start ZEsarUX
Launch debugging from VSC
Nothing happens i.e. no error, no output in debug console

dezog

Version etc. (please complete the following information):

  • DeZog 0.12.0
  • ZEsarUX SW Version: 8.1 B2

Additional context
Please attach your launch.json file.

"version": "0.2.0",
"configurations": [
	{
		"type": "dezog",
		"request": "launch",
		"name": "ZEsarUX",
		"zhostname": "localhost",
		"remoteType": "zrcp",
		"zport": 10000,
		"listFiles": [
			{
				"path": "zxnext.list",
				"useFiles": true,
				"asm": "sjasmplus",
				"mainFile": "zxnext.asm"
			}
		],
		"startAutomatically": false,
		"skipInterrupt": true,
		"commandsAfterLaunch": [
			//"-sprites",
			//"-patterns"
		],
		"disassemblerArgs": {
			"esxdosRst": true
		},
		"rootFolder": "${workspaceFolder}",
		"topOfStack": "stackTop",
		//"load": "../../EMULATORS/ZESARUX/zxnext.sna",
		"load": "../../EMULATORS/ZESARUX/zxnext.nex",
		"smallValuesMaximum": 513,
		"tmpDir": ".tmp",
		"preLaunchTask": "zesarux"
	}

remoteType=cspect: watchpoints, unit tests

DeZog/CSpect (v2.12.22):

  • Watchpoints work unreliable. Under unknown circumstances a watchpoint (aka CSpect read-breakpoint) might prevent simple stepping. In that case do not enable watchpoints (do not use "-wpmem enable".
  • Z80 unit tests do not work. Most probably because of the Watchpoints issue as, even if wpmem is not used, the unit tests use watchpoints internally.

DeZog not found in marketplace

Describe the bug
When I type "DeZog" on VSCode 1.43.0: "No extensions found"

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Extension"
  2. Type on seach box DeZog
  3. Result: "No extensions found"

Expected behavior
The extension DeZog to install

Screenshots
image

Version etc. (please complete the following information):

  • SW Version: VS Code v1.43.0
  • OS: Windows 10
  • ZEsarUX SW Version: 8.1

Additional context
none

v2.0.2 - Breakpoints do not work if the file name is separated from the path by a backslash in the SLD file.

This is how it works:

|SLD.data.version|1
||K|KEYWORDS|WPMEM,LOGPOINT,ASSERTION
D:\Spectrum\projects\project1\src/borders.asm|8||0|-1|-1|Z|pages.size:8192,pages.count:224,slots.count:8,slots.adr:0,8192,16384,24576,32768,40960,49152,57344
D:\Spectrum\projects\project1\src/borders.asm|11||0|4|32768|F|StackEnd

But this does not work ("Unverified breakpoint..." message into debug console):

|SLD.data.version|1
||K|KEYWORDS|WPMEM,LOGPOINT,ASSERTION
D:\Spectrum\projects\project1\src\borders.asm|8||0|-1|-1|Z|pages.size:8192,pages.count:224,slots.count:8,slots.adr:0,8192,16384,24576,32768,40960,49152,57344
D:\Spectrum\projects\project1\src\borders.asm|11||0|4|32768|F|StackEnd

Unit Tests: "Code for tests is not present" error instead of tests being run (v2.3.2)

Describe the bug
When using the Unit Test feature, I get the error "Code for tests is not present" when attempting to run a test.

To Reproduce
See example in this repository which mirrors my typical project set up and how I am trying to use the testing system.

It has two NEX files, one for the "game" and one for the "tests".

  • I build the tests using the "Build tests" task
  • I then refresh the test explorer
  • Run all tests in suite

Expected behavior
Expected the unit tests to run correctly

Screenshots
image

image

Version etc. (please complete the following information):

  • DeZog SW Version: v2.3.2
  • OS: Windows 10 (latest build)
  • Remote: zsim for the tests, cspect for the main game test

Additional context
Project is in the repo https://github.com/evolutional/dzut

Breakpoint on multi-instruction line

DeZog v2.1 (probably also earlier)

  1. Set a breakpoint to a multi instruction line.
  2. Run.
  3. Breakpoint hit

Bildschirmfoto 2021-01-05 um 14 05 27

Breakpoint is hit at the last instruction of the line.
Should be on the first instruction.

Testing the beta-13.3

Tried to start the debugger, but the .tap not load, so i did the instructions, and the debugger paused, but this happened

image

Version etc. (please complete the following information):

  • SW 13.3:
  • OS: windows 7 8 gb mem
  • ZEsarUX 8.1 Version:

Additional context
.launch.json
{
// Verwendet IntelliSense zum Ermitteln möglicher Attribute.
// Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
// Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "dezog",
"request": "launch",
"name": "Speccy Tron",
"remoteType": "zrcp",
"zrcp": {
"hostname": "localhost",
"port": 12000
},
"listFiles": [
{
"path": "speccytron.c.lis",
"sources": "speccytron.c.lis",
"useFiles": true,
"asm": "z88dk",
"mainFile": "speccytron.c",
"srcDirs": [],
"addOffset": 32768
}
],
"startAutomatically": false,
"skipInterrupt": true,
"commandsAfterLaunch": [
//"-sprites",
//"-patterns"
],
"disassemblerArgs": {
"esxdosRst": true
},
"rootFolder": "${workspaceFolder}",
"load": "speccytron5.tap",
// "load": "4.Z80",
"smallValuesMaximum": 512,
"tmpDir": ".tmp"
},
{
"type": "dezog",
"request": "launch",
"name": "efd",
"remoteType": "zrcp",
"zrcp": {
"hostname": "localhost",
"port": 12000
},
"listFiles": [
{
"path": "efd.c.lis",
"sources": "efd.c.lis",
"useFiles": true,
"asm": "z88dk",
"mainFile": "efd.c",
"srcDirs": [],
"addOffset": 32768
}
],
"startAutomatically": false,
"skipInterrupt": true,
"commandsAfterLaunch": [
//"-sprites",
//"-patterns"
],
"disassemblerArgs": {
"esxdosRst": true
},
"rootFolder": "${workspaceFolder}",
"load": "efd.tap",
"smallValuesMaximum": 512,
"tmpDir": ".tmp"
},
]
}

cspect: Get Sprite Patterns during debugged program being run

Note: In the develop branch the program lives the running state if some DZRP command is sent so this cannot happen here anymore.

Nevertheless it is still unclear why this is a problem:

If the debugged program is being run and one presses the sprite patterns reload button a few times then the debugged program starts to behave strange.
The z80-sample-program e.g. is still running but the output to the screen does not happen anymore.

I tested a bit: when I move the GetSpritePatterns function into the Tick() routine the strange effect is gone. So this is most probably a threading issues.
Unfortunately I cannot simply move all message responses in the Tick routine as it would require 20 ms per message which is too much.

Need to find another clever way.
(Asked Mike for a faster Tick() method)

DZRP versions do not match

Hi There,

I keep getting this error:

DZRP versions do not match. Required version is 1.6. But this remote (Unknown) supports only version 1.0. Try updating the DeZog (CSpect) Plugin (https://github.com/maziac/DeZogPlugin/releases).

Although the latest version available is 1.5.4.

Can you help me please?

Thank you!
Regards,
Gorlock

Duplicate memory window

When i restart the debugging session DeLog creates a new memory window "Memory Dump @hl @de......" producing two or more versions of the same window.

Steps to reproduce the behavior:

1 Enter a debugging session
2 Step into your code
3 Click restart the debugging session

Repeat many times,creates and you get many windows

Expected behavior
I would expect it to either close or reuse the same window

All version of DeZog
Windows 10
CSpect and SpecNext Hardware

launch.json
{
// Use IntelliSense to learn about possible attributes. //cspect
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations":
[
{
//"preLaunchTask": "prelaunch",
"type": "dezog",
"request": "launch",
"name": "Z80 Debugger",
"remoteType": "zxnext",//"cspect",// "zxnext","zsim",
"zsim":
{
"Z80N": true,
"loadZxRom": true,
"zxKeyboard": true,
"visualMemory": "true",
"ulaScreen": true,
"memoryPagingControl": true,
"tbblueMemoryManagementSlots": true,
"cpuLoadInterruptRange": 1,
"vsyncInterrupt": true
},
"zrcp":
{
"hostname": "localhost",
"port": 11000
},
"cspect":
{
"hostname": "localhost",
"port": 11000
},
"zxnext":
{
"baudrate": 921600, //115200,
"port": 12000, //"/dev/tty.usbserial"
},
// "topOfStack": "Stack_Top",
"rootFolder": "${fileDirname}",
"listFiles":
[
{
"useFiles": true,
"asm": "sjasmplus",
"path": "${relativeFileDirname}/main.list",
"mainFile": "${relativeFileDirname}/main.asm",
"cwd": "${workspaceFolder}",
}
],
"disassemblerArgs":
{
"esxdosRst": true
},
"load": "f:\SpectrumNext\Projects\Komodo\Build\main.nex",
"skipInterrupt": false,
"startAutomatically": false,
"commandsAfterLaunch": [
"-LOGPOINT enable",
]
}
]
}

Can't see values of memory view in light theme

Describe the bug

Can't see values of memory view in light theme. Specifically the values are made bold and white - see screenshot (further in the issue).

To Reproduce

Steps to reproduce the behavior:

  1. Select a "light" theme i.e. "Light+ (default light)"
  2. Memory view from the console: -mv $c000 100
  3. The 100 highlighted bytes are white on a light background.

Expected behavior

Bold on the default font colour is used rather than white (or white hard coded).

Screenshots

Screenshot 2021-01-04 at 18 00 19

Version etc. (please complete the following information):

  • DeZog SW Version: 2.0.3
  • OS: macOS - Big Sur (do not recommend!)
  • Remote: zsim

Unverified breakpoints in version 1.5.3. Windows 10

Since upgrading from Version 1.4.8 to 1.5.3 breakpoints no longer work.
Repro project attached hello-specnext.zip
Using sjasmplus v1.17.0 with CSpect 2.12.36 (binaries in attached repro case)

I have edited launch.json and removed:

        "listFiles": [
            {
                "path": "bin/${workspaceFolderBasename}.lst",
                "useFiles": true,
                "asm": "sjasmplus",
                "mainFile": "src/main.asm"
            }
        ],

and added

        // This is for DeZog 1.5, but I can't set breakpoints using this...
        "sjasmplus": [{
            "path": "bin/${workspaceFolderBasename}.lst" // relative to root folder
        }],

Steps to reproduce the behavior:

  1. Unzip attached file hello-specnext.zip
  2. Open folder hello-specnext/games/invaders in Visual Studio Code
  3. Ctrl+Shift+B to build
  4. Ctrl+P task CSpect
  5. Open src/main.asm and set a breakpoint on line 70
  6. Press F5 to launch
  7. The PC does not stop at the breakpoint and the DEBUG CONSOLE displays: 'DeZogPlugin v1.5.0.23723' initialized.
    Unverified breakpoint:{"verified":false,"line":70,"column":0,"source":{"name":"main.asm","path":"c:/temp/hello-specnext/hello-specnext/hello-specnext/games/invaders/src/main.asm","sourceReference":0},"message":"00-1h"}
    Continue

Prior to upgrading to this version and making the change to launch.json breakpoints worked perfectly. I have had to downgrade to 1.4.8 and revert launch.json to work around this issue.

Version etc. (please complete the following information):

  • DeZog SW Version: 1.5.3 (with v1.5.0 DLL - see attached zip)
  • OS: Windows 10 2004 (OS Build 19041.572)
  • Visual Studio Code About:
    Version: 1.50.1 (user setup)
    Commit: d2e414d9e4239a252d1ab117bd7067f125afd80a
    Date: 2020-10-13T15:06:15.712Z
    Electron: 9.2.1
    Chrome: 83.0.4103.122
    Node.js: 12.14.1
    V8: 8.3.110.13-electron.0
    OS: Windows_NT x64 10.0.19041

Many thanks for any advice.

Code coverage decoration not working in Windows

In Windows the code coverage decoration which is normally dark green background of the covered line is not shown.

Reason for this are the unified paths (linux style) which are compared to windows paths.

[Question] Is ROM debugging possible?

Let's say I had a stock or a custom ROM file e.g. 48.rom with corresponding list file and I wanted to debug it (set breakpoints etc.); how would I go about it? Preferably with CSpect as I can write plugins for it, too.

A bit of context. I'm thinking of building an FPGA-based Z80 machine with custom peripherals. It would also have custom ROM so for example it can load programs from an SD card. My idea is to emulate peripherals with CSpect plugins and use DeZog to debug the ROM. Would it work?

disassembly missing

Describe the bug

Basically all the debug information is lost/empty. Not quite sure how to replicate perfectly, but having found the devtools error, I suspect it's an interpolation bug - though I thought that vscode did this for you (as the extension author), but I'm not 100% certain.

The error in devtools when I hit pause is:

Error: cannot open file:///%24%7BworkspceFolder%7D/%24%7BworkspceFolder%7D/%24%7BworkspceFolder%7D/disasm.asm. 
Detail: Unable to read file '/${workspceFolder}/${workspceFolder}/${workspceFolder}/disasm.asm' 

So it looks like the encoding isn't working for the vscode system variables.

This is my launch config for dezog:

{
      "type": "dezog",
      "request": "launch",
      "name": "Internal (sna)",
      "remoteType": "zsim",
      "zsim": {
        "zxKeyboard": true,
        "ulaScreen": true,
        "visualMemory": true,
        "vsyncInterrupt": true,
        "memoryModel": "ZX48K"
      },
      "rootFolder": "${workspceFolder}",
      "tmpDir": "${workspceFolder}",
      "sjasmplus": [
        {
          "path": "${fileDirname}/${fileBasenameNoExtension}.sld",
          "useFiles": true,
          "asm": "sjasmplus",
          "mainFile": "${file}"
        }
      ],
      "disassemblerArgs": {
        "esxdosRst": true
      },
      "commandsAfterLaunch": ["-assertion enable"],
      "load": "${fileDirname}/${fileBasenameNoExtension}.sna",
      "startAutomatically": true,
      "preLaunchTask": "snabuild"
    }

Version etc. (please complete the following information):

  • DeZog SW Version: 2.2.3
  • OS: macos
  • Remote: zsim

ZRCP smartload command does not work with paths that contain path separators or whitespace

Describe the bug
If I put a path in the load key of the launch.json file, I get an error message like this:

ZEsarUX: smartload h:\My Code\Spectrum\Z80\Demo/area_51.sna => Error. Unknown file format

To Reproduce
Steps to reproduce the behavior:

  1. Use a path in load rather than a filename, or one that contains whitespace
  2. See error returned to VSCode
    -or-
  3. Open ZEsarUX with ZRCP enabled on port 10000
  4. Open Telnet "telnet 127.0.0.1 10000"
  5. Enter the same path (with whitespace and/or separators), i.e. smartload h:\My Code\Spectrum\Z80\Demo/area_51.sna (change to a path on your system)
  6. See the returned error in Telnet

Expected behavior
Expect to be able to use paths and whitespace in the load key

NB:
Confirmed with ZEsarUX on Twitter that the smartload parameter accepts quotes
Suggest wrapping the argument in quotes like this:
smartload "h:\My Code\Spectrum\Z80\Demo/area_51.sna"

Screenshots
N/A

Version etc. (please complete the following information):

  • DeZog 1.4.7
  • OS: Windows 10 and OSX
  • Remote: ZRCP (ZEsarUX):

Additional context
Please attach your launch.json file.

{
"version": "0.2.0",
"configurations": [
{
"name": "Z80 Debugger",
"type": "dezog",
"request": "launch",
"remoteType": "zrcp",
"zrcp": {
"hostname": "localhost",
"port": 10000
},
"topOfStack": "Stack_Top",
"rootFolder": "${workspaceFolder}",
"listFiles": [
{
"path": "${fileDirname}/${fileBasenameNoExtension}.lst",
"asm": "sjasmplus",
"useFiles": true,
"mainFile": "${fileDirname}/${fileBasenameNoExtension}.z80",
"srcDirs": [ "lib" ]
}
],
"disassemblerArgs": {
"esxdosRst": true
},
"load": "${fileDirname}/${fileBasenameNoExtension}.sna",
"skipInterrupt": false,
"startAutomatically": true,
"preLaunchTask": "sjasmplus"
}
]
}

Regression: can't use $00 syntax on breakpoints or console

Describe the bug

Using $ as a hex prefix value does not work, i.e. I can't refer to 255 as $ff anymore.

To Reproduce
Steps to reproduce the behavior:

  1. Start debugging
  2. In the debug console type: -mv $c000 $ff
  3. See error (screenshot below)

Expected behavior

This was/is working in 2.0.3

Screenshots

Screenshot 2021-01-05 at 17 42 27

Version etc. (please complete the following information):

  • DeZog SW Version: 2.1.0 (pre-release)
  • OS: macOS Big Sur
  • Remote: zsim

Side note, I'm looking through the diff on the develop branch to see if I can see where the change is but thus far can't see it. I wonder if it's somewhere in src/misc/utility.ts file as the error in the debug console refers to a eval fail and I suspect this line which suggests the replaceVarsWithValues has a regression in it - but again, I can't see this in the diff…

Debugging with source files is impossible when there are ORGs with non-increasing addresses

Describe the bug
If z80 code has several ORGs with non-increasing addresses (i.e. low memory, then high memory, then low memory back, see https://github.com/ruguevara/z80-sample-program/blob/master/main.asm#L31), DeZog can not debug such project within the .asm source files, only disasm.asm appears instead.

To Reproduce
Steps to reproduce the behavior:

  1. Checkout modified z80-sample-program repository 'https://github.com/ruguevara/z80-sample-program/'
  2. Build as usual.
  3. Start debugging.
  4. See disasm.asm opened instead of main.asm

Expected behavior
Opened main.asm with current instruction being executed at line 50: https://github.com/ruguevara/z80-sample-program/blob/master/main.asm#L50

Version etc. :

  • SjASMPlus Z80 Cross-Assembler v1.14.5 (https://github.com/z00m128/sjasmplus)
  • DeZog Version: 0.11.0
  • OS: Mac OS 10.14.6
  • ZEsarUX SW Version: ZEsarUX V.8.1-B2 - The Great Escape edition. 16 December 2019

Additional context
Please attach your launch.json file: see 'https://github.com/ruguevara/z80-sample-program/blob/master/.vscode/launch.json'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.