Closed h1romas4 closed 1 year ago
Hi, do you know why there are now 6 hex digits in z88dk? For the address they would require only 4, are the additional ones maybe used for the bank?
OK. This seems to be used for PHASE/DEPHASE support: https://github.com/z88dk/z88dk/issues/429 Problem is: I can't find the spec for this. I.e. how is the 6 digit code encoded. If someone could help I could implement support for DeZog.
Thank you for response!
I am sorry. I do not know where the 6-digit encoding is being used in z88dk.
In the test case PHASE/DEPHASE, Addressing more than 4 digits seems to generate an error.
https://github.com/z88dk/z88dk/blob/v2.2/src/z80asm/t/PHASE.t#L14-L19
z80asm_nok("", "", <<END_ASM, <<END_ERR);
phase 65536
END_ASM
$test.asm:1: error: integer range: 0x10000
^---- phase 65536
END_ERR
Isn't there any documentation? Then I think it will be rather difficult to implement a parser for it.
I could not find anything in it about the .lis format or about the maximum address value. The document I am referring to is as follows.
Tool z80asm: https://github.com/z88dk/z88dk/wiki/Tool---z80asm
Tool z80asm directives - PHASE expression ... DEPHASE: https://github.com/z88dk/z88dk/wiki/Tool---z80asm---directives#phase-expression--dephase
Then I think it will be rather difficult to implement a parser for it.
I understand. Please close this ticket.
DeZog is a great software. I am so grateful to you.
I'm in contact with the author of z88dk-z80asm. Maybe I can support that file format in the upcoming DeZog 3.0.
Thank you very much!!
I have confirmed that the format of the .lis file in the master branch of the z88dk is 4 digits.
Hi, could you maybe also try out this alternative: https://github.com/z88dk/z88dk/issues/2126#issuecomment-1311010597 If that works as suggested, I could drop the support of z88dk in DeZog. I'e there would be other means to debug z88dk-z80asm code.
Hello.
I have confirmed that I can do a debug break on the Z88DK (clang) with the following combination.
-debug
compile flagWhile very useful for debugging clang programs, but there are some problems when debugging Assembly.
.asm
code.(It works fine with .c
)More than anything, I also wanted to use DeZog's excellent "memory view" and "memory layouts" features.
Oh, good. I was trying this myself but without success. Could you share your project (i.e. attach a zip of your project with .vscode folder, the sources and the map/lis files)?
I have extracted the minimum number of files needed for a debug break from my vscode project. I am trying this out using MSX.
dist/noborunoca.map
and dist/noborunoca.rom
(compile with Z88DK -debug
flag. This makes the program a little slower.)src/asm/*.lis
(compile with Z88DK --list
flag) - Since the Z88DK master branch is used, the address is four digits.mics/mame/roms/msx1_cart/noborunoca.zip
- ROM file packaged for MAME.This is the same as dist/noborunoca.rom
..lis
and .map
file paths with absolute paths.Extract noborunoca-debug.tar.gz and start MAME's gdbserver with the following command.(Please change the path accordingly)
mame [your MSX name] noborunoca -rompath ${workspaceFolder}/mics/mame/roms -hashpath ${workspaceFolder}/mics/mame/hash -debugger gdbstub -debug
and, Set breakpoints in VS Code. The first setting should be right after the main program starts (src/c/noborunoca.c:999
).
Execute "Attach to MAME gdbserver" from VS Code Debug. The debug break will probably work.
If it doesn't work, please let me know.
Thanks.
What would be the [your MSX name]
in
mame [your MSX name] noborunoca -rompath ${workspaceFolder}/mics/mame/roms -hashpath ${workspaceFolder}/mics/mame/hash -debugger gdbstub -debug
?
Hello.
Sorry for the lack of clarity.
[your MSX name]
is [machine]
name in MAME. Note that noborunoca
corresponds to [software]
.
This command line option allows the software to be launched directly in MAME.
$ ./mame -showusage
Usage: mame [machine] [media] [software] [options]
You can get the [machine]
name from the following source NAME
.
mame/src/mame/msx/msx1.cpp mame/src/mame/msx/msx2.cpp
I think it works by storing machine's ROM ([machine].zip
) with the same name as the machine name in mics/mame/roms/
.
Sorry for my lack of clarity. I know that it is the machine name, but which machine name should I use / have you used.
Sorry, I made a mistake in my understanding.
I am using MSX2 (hbf1
) setup.
I think noborunoca
will work on any MSX1 or higher machine with 64KB RAM.
Still it doesn't find noborunoca. Probably some missing path:
./mame hbf1 noborunoca -rompath .../dezog_issues/h1romas4/noborunoca/mics/mame/roms -hashpath .../dezog_issues/h1romas4/noborunoca/mics/mame/hash -debugger gdbstub -debug
"noborunoca" approximately matches the following
supported software items (best match first):
* Software list "msx2_cass" (MSX2 cassettes) matches:
leonardo Leonardo (Jpn)
redlighta Red Lights of Amsterdam (Euro, 2 Sides)
chess2 The Chess Game 2 (Euro)
redlight Red Lights of Amsterdam (Euro)
* Compatible software list "msx1_cass" (MSX1 cassettes) matches:
robocopa Robocop (Euro, Alt)
untoucha The Untouchables (Spa, Alt)
enruta En Ruta (Spa)
ormuza Ormuz (Spa, Alt)
I'm starting MAME in the mame directory. Do I have to start it somewhere else?
Hello.
The -hashpath
argument specifying a list of software does not seem to be working. noborunoca
is appropriate in mics/mame/hash/msx1_cart.xml
.
If MAME is the current directory:
$ pwd
/home/hiromasa/devel/amd64/mame
$ ls -laF mame
-rwxrwxr-x 1 hiromasa hiromasa 72106552 11月 17 11:55 mame*
$ ls -laF ../../msx/noborunoca/mics/mame/roms
-rw-rw-r-- 1 hiromasa hiromasa 71779 8月 5 2015 hbf1.zip
drwxrwxr-x 2 hiromasa hiromasa 4096 11月 15 12:36 msx1_cart/
$ ls -laF ../../msx/noborunoca/mics/mame/roms/msx1_cart/
-rw-rw-r-- 1 hiromasa hiromasa 8089 11月 15 12:12 noborunoca.zip
$ ls -laF ../../msx/noborunoca/mics/mame/hash/
-rw-rw-r-- 1 hiromasa hiromasa 600 11月 2 18:56 msx1_cart.xml
$ ./mame hbf1 noborunoca -rompath ../../msx/noborunoca/mics/mame/roms -hashpath ../../msx/noborunoca/mics/mame/hash
You may also copy the MAME executable to the noborunoca/mics/mame
directory and run it. In this case, the -rompath
and -hashpath
arguments are not needed.
$ pwd
/home/hiromasa/devel/amd64/mame
$ ls -laF mame
-rwxrwxr-x 1 hiromasa hiromasa 72106552 11月 17 11:55 mame*
$ cp -p mame ../../msx/noborunoca/mics/mame
$ cd ../../msx/noborunoca/mics/mame
$ ./mame hbf1 noborunoca
It would probably anyhow not work as the map file contains absolute paths:
DEFINED_startup = $0001 ; const, local, , msx_crt0, , /tmp/tmpzccXXc4iOHo/zcc_opt.def:3
startup = $0003 ; const, local, , msx_crt0, , /tmp/tmpzccXXc4iOHo/zcc_opt.def:4
TAR__clib_exit_stack_size = $0000 ; const, local, , msx_crt0, , /home/hiromasa/devel/msx/z88dk/lib/config/../../lib/target/msx/classic/rom.asm:15
TAR__register_sp = $FFFFFFFFFFFF03B6 ; const, local, , msx_crt0, , /home/hiromasa/devel/msx/z88dk/lib/config/../../lib/target/msx/classic/rom.asm:16
CRT_INITIALIZE_BSS = $0001 ; const, local, , msx_crt0, , /home/hiromasa/devel/msx/z88dk/lib/config/../../lib/crt/classic/crt_rules.inc:6
__register_sp = $FFFFFFFFFFFF03B6 ; const, local, , msx_crt0, , /home/hiromasa/devel/msx/z88dk/lib/config/../../lib/crt/classic/crt_rules.inc:16
TAR__crt_enable_rst = $0000 ; const, local, , msx_crt0, , /home/hiromasa/devel/msx/z88dk/lib/config/../../lib/crt/classic/crt_rules.inc:24
As I have understood so far, even if this works, it would only allow C debugging, not asm sources. And the -debug option also slows down the compiled binaries, I think it is better to adopt the DeZog parser.
I will add here a new DeZog version soon for you to try out. (And thanks for all the help.)
Please try this new parser: dezog-3.0.0-rc11.vsix from here
You also need a new config (note the "...v2"). Remove the "z88dk" config.
"z88dkv2": [{
"path": "currah_uspeech_tests.lis",
"srcDirs": [""],
"mapFile": "currah_uspeech_tests.map",
"excludeFiles": [ "some_folder/*" ]
}]
(You don't need 'mainFile' anymore.)
Please let me know if it works for you.
I really appreciate your support.
The dezog-3.0.0-rc11.vsix
seems to cause an error because file.mapFile
is not set.
{
"type": "dezog",
"request": "launch",
"name": "DeZog",
"remoteType": "mame",
"mame": {
"port": 23946
},
"z88dkv2": [
{
"path": "src/asm/psgdriver.asm.lis",
"mapFile": "dist/noborunoca.map",
"srcDirs": [""] // Sources mode
}
],
"rootFolder": "${workspaceFolder}",
"commandsAfterLaunch": [
"-rmv",
// "-mv 0xc000 0x100"
],
}
I tried the following patch and confirmed that I can debug!
git diff
diff --git a/src/settings/settings.ts b/src/settings/settings.ts
index 106bf564..f904e31f 100644
--- a/src/settings/settings.ts
+++ b/src/settings/settings.ts
@@ -651,6 +651,7 @@ export class Settings {
// ListFile structure
const fpPath = UnifiedPath.getUnifiedPath(fp.path);
const fpSrcDirs = UnifiedPath.getUnifiedPathArray(fp.srcDirs);
+ const fpMapFile = UnifiedPath.getUnifiedPath(fp.mapFile);
const fpExclFiles = UnifiedPath.getUnifiedPathArray(fp.excludeFiles);
const file = {
path: undefined as any,
@@ -660,6 +661,8 @@ export class Settings {
};
if (fpPath)
file.path = Utility.getAbsFilePath(fpPath, rootFolder);
+ if (fpMapFile)
+ file.mapFile = Utility.getAbsFilePath(fpMapFile, rootFolder);
return file;
});
}
I apologize if my understanding is incorrect.
Thanks. Yes, that was missing. (I'm always surprised when I see that someone else is understanding my code to make that kind of fixes.)
Nice to hear it is working.
If you like you can also try the Flowchart, Callgraph and the Smart Disassembly features of 3.0 and tell me if they are working for you.
I verified on the develop branch(741af2a14b7c4b363f4a85f7cbaa8f570e21bfb6) to make sure everything is working well.
and Release 3.0 is very impressive! The program is completely analyzed.
I really appreciate your support. I look forward to the release of 3.0.
Many Thanks!
Thanks for your tests. It's always nice to see it working in other projects.
And thanks for verification on develop branch.
Is it OK to close this issue (for 3.0)?
Yes, please close this ticket.
Thank you very much!
Hello.
The format of .lis files output by Z88DK
v2.2
has changed sincev2.1
, and it seems thatsrc/labels/z88dklabelparser.ts
can no longer parse them.I found the commit of this change.
Effect on
z88dklabelparser.ts
:I did not know how to handle the backward compatibility and could not handle it myself. 😢
Best regards.