ZX 81 development on Linux. What tools?

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
sboisvert
Posts: 40
Joined: Mon Nov 02, 2009 3:43 pm

Re: ZX 81 development on Linux. What tools?

Post by sboisvert »

sl07h1 wrote: Sun Mar 21, 2021 10:35 pm Hi, I'm a Linux user, I would like if there's a tool setup for do the following:

1. Write Assembler code (or BASIC code) in a reasonable way and export the code to an emulator to test.
2. Export stuff from the emulator to a .tgz file (or a .p file) in order to get the stuff working in the ZX 81

Thanks.
I posted my findings here earlier today - have only begun looking into this stuff though, but there's some ideas.
sl07h1
Posts: 34
Joined: Mon Feb 22, 2021 7:16 pm

Re: ZX 81 development on Linux. What tools?

Post by sl07h1 »

sboisvert wrote: Mon May 03, 2021 5:36 am
sl07h1 wrote: Sun Mar 21, 2021 10:35 pm Hi, I'm a Linux user, I would like if there's a tool setup for do the following:

1. Write Assembler code (or BASIC code) in a reasonable way and export the code to an emulator to test.
2. Export stuff from the emulator to a .tgz file (or a .p file) in order to get the stuff working in the ZX 81

Thanks.
I posted my findings here earlier today - have only begun looking into this stuff though, but there's some ideas.
Awesome, I'm using ZesarUX for BASIC stuff, it works very well with ZX81 Tape Convert and my Zeedy. I will give it a try and tell the story later!!

Thanks!
Neurogate
Posts: 24
Joined: Tue Aug 31, 2021 6:46 pm

Re: ZX 81 development on Linux. What tools?

Post by Neurogate »

My own experience in Linux environment for ZX81 assembler development:

1. Visual Studio Code with DeZog
2. z88dk development kit
3. ZEsarUX

VS Code configuration files:

In tasks.json:

Code: Select all

        {
            "label": "z88dk",
            "type": "shell",
            "command": "z88dk.z88dk-z80asm", 
            "args": [
                "-mz80",
                "+zx81",
                "-l",
                "-m",
                "${file}"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
In launch.json:

Code: Select all

        {
            "type": "dezog",
            "request": "launch",
            "name": "ZEsarUX",
            "remoteType": "zrcp",
            "rootFolder": "${fileDirname}",
            "zrcp": {
                "hostname": "localhost",
                "port": 10000
            },
            "z88dk": [{
                "path": "${fileDirname}/${fileBasenameNoExtension}.lis",
                "srcDirs": [""],
                "mapFile": "${fileDirname}/${fileBasenameNoExtension}.map",
                "mainFile": "${fileDirname}/${fileBasenameNoExtension}.asm",
                "excludeFiles": [ "${fileDirname}" ]
            }], 
            "disassemblerArgs": {
                "numberOfLines": 24,
                "esxdosRst": true
            },
            "preLaunchTask": "z88dk",
            "load": "${fileDirname}/${fileBasenameNoExtension}.P"
        }
I found that there is problem with communication between VS Code and ZEsarUX - after compilation of assembler code to .P file VS Code can't send it to ZEsarUX. To fix this bug you can download source code of ZEsarUX and in the file utils.c change function insert_tape_cmdline to:

Code: Select all

void insert_tape_cmdline(char *s)
{
        tapefile = malloc(strlen(s)+1);
	strcpy(tapefile,s);
}
It is not ideal decision, because there also possible some memory leak, but it's work.
Sinclair ZX81, Sinclair QL, Sinclair ZX Spectrum +2, Atari 130XE, Commodore 64C, Commodore C128, Yamaha YIS503IIIR MSX2 & etc
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: ZX 81 development on Linux. What tools?

Post by marste »

Neurogate wrote: Sun Oct 17, 2021 8:30 pm I found that there is problem with communication between VS Code and ZEsarUX - after compilation of assembler code to .P file VS Code can't send it to ZEsarUX. To fix this bug you can download source code of ZEsarUX and in the file utils.c change function ...
ZesarUX should be on github, you can contribute making a pull request and discuss a proper fix in case!
Neurogate
Posts: 24
Joined: Tue Aug 31, 2021 6:46 pm

Re: ZX 81 development on Linux. What tools?

Post by Neurogate »

My solution is not ideal, only a temporary one. It's like fixing a hole in a water pipe with a chewing gum - it works, but no more. As an engineer, I understand that this is an ugly solution of the problem.
Sinclair ZX81, Sinclair QL, Sinclair ZX Spectrum +2, Atari 130XE, Commodore 64C, Commodore C128, Yamaha YIS503IIIR MSX2 & etc
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: ZX 81 development on Linux. What tools?

Post by marste »

Today I tested the last ZesarUX communicating with the last DeZog and the latter was perfectly able to send the program to debug. Or it has been corrected or maybe there is some configuration to adjust.
And I'm using Linux versions of both.
Neurogate
Posts: 24
Joined: Tue Aug 31, 2021 6:46 pm

Re: ZX 81 development on Linux. What tools?

Post by Neurogate »

If it works - don't touch it :)
I'm having a problem, and I've changed the source code to fix it, maybe it's a feature of my computer's configuration.
Sinclair ZX81, Sinclair QL, Sinclair ZX Spectrum +2, Atari 130XE, Commodore 64C, Commodore C128, Yamaha YIS503IIIR MSX2 & etc
User avatar
marste
Posts: 250
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: ZX 81 development on Linux. What tools?

Post by marste »

I got the answer: "load" works only for ZX Spectrum program (eg SNA) not for ZX81 ones (.p)!
Neurogate
Posts: 24
Joined: Tue Aug 31, 2021 6:46 pm

Re: ZX 81 development on Linux. What tools?

Post by Neurogate »

marste wrote: Sun Feb 20, 2022 11:56 pm I got the answer: "load" works only for ZX Spectrum program (eg SNA) not for ZX81 ones (.p)!
So... by this it's not a feature of my computer's configuration but a bug of work with ZX81. By this my solution with modification of the source code can be useful, because at me all work fine now and for ZX81 (.p) code.
Sinclair ZX81, Sinclair QL, Sinclair ZX Spectrum +2, Atari 130XE, Commodore 64C, Commodore C128, Yamaha YIS503IIIR MSX2 & etc
User avatar
chernandezba
Posts: 205
Joined: Tue Mar 11, 2014 4:30 pm

Re: ZX 81 development on Linux. What tools?

Post by chernandezba »


I found that there is problem with communication between VS Code and ZEsarUX - after compilation of assembler code to .P file VS Code can't send it to ZEsarUX. To fix this bug you can download source code of ZEsarUX and in the file utils.c change function insert_tape_cmdline to:

Code: Select all

void insert_tape_cmdline(char *s)
{
        tapefile = malloc(strlen(s)+1);
	strcpy(tapefile,s);
}
It is not ideal decision, because there also possible some memory leak, but it's work.
Thanks for reporting it. Your code change was good enough to fix it, however the real bug was on the ZRCP layer (the protocol that comunicates VS Code and ZEsarUX). I've just fixed it! :)

https://github.com/chernandezba/zesarux ... 0b6f012545


Cheers
----

ZEsarUX
ZX Second-Emulator And Released for UniX
https://github.com/chernandezba/zesarux
Post Reply