Starting a SpecNext emulator for development?

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
Post Reply
shred
Drutt
Posts: 6
Joined: Sat May 02, 2020 4:42 pm
Location: Cologne, Germany
Contact:

Starting a SpecNext emulator for development?

Post by shred »

Hi everyone!

I am currently working on a SpecNext development environment on Linux (but basically for any OS). My plan is to use Microsoft Visual Studio Code as editor (there is a Z80 assembler extension!), SjASMPlus as assembler, and ant as build tool. The final piece of the puzzle is the emulator. I want to be able to run the assembled .nex file straight from command line.

I took an old demo that I wrote for the Speccy 48k in 1987, and changed it so it is saved as a .nex file now. The .nex file is running fine on a real SpecNext, so it should be a suitable testing candidate. :)

I first tried #CSpect, and my .nex file is running there, too. However, I found no way to start my demo straight from command line. I need to use the browser and manually select the .nex file. Also, #CSpect is booting up the Next every time, which takes way too long for my purpose.

ZEsarUX is the only available alternative. According to the ZEsarUX FAQ, I should be able to just run my .nex file with this command line:

Code: Select all

  zesarux --noconfigfile --zoom 1 --machine tbblue --realvideo \
    --enabletimexvideo --tbblue-fast-boot-mode --quickexit \
    --nowelcomemessage --enable-esxdos-handler \
    --esxdos-root-dir mydemodir mydemodir/mydemo.nex
ZEsarUX is starting up fine, but is then showing a black screen with white border. With a similar command line, I could run the Scrollnutter demo, so it seems to be working in general.

My question is: How can I start my .nex file in ZEsarUX? Or how can I run it in #CSpect without booting up and manual interactions? (I would prefer ZEsarUX because it's open source.)

Thank you for your help! :)
User avatar
PeterJ
Site Admin
Posts: 6878
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Starting a SpecNext emulator for development?

Post by PeterJ »

Welcome to the forum [mention]shred[/mention].

[mention]chernandezba[/mention] is the author of ZEsarUX and a regular here, so hopefully he will be able to assist.

[mention]Seven.FFF[/mention] may be able to help with Cspect.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Starting a SpecNext emulator for development?

Post by Seven.FFF »

CSpect accepts many command line args, including those for starting in Next mode and supplying a NEX file. Have a read of the readme, as it explains them in detail.

There’s also a few same batch files supplied for launching various demos. These would be very similar in linux, except that you start .NET executables with mono CSpect.exe and your file separators are forward slashes. Have a look at NXtel.bat for example, which runs NXtel.nex.

Running CSpect with a SD image file allows you to boot into NextZXOS, which gives you much greater ROM and API compatibility compared the opening a NEX file with the standard 48K or 128K ROMs. The same is true of ZESarUX, which can also boot into full NextZXOS or open a NEX file directly.

When you run either emulator with a SD image, you can make your build script inject your .NEX into the image file, along with an autoexec.bas that will automatically launch it on boot.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
chernandezba
Microbot
Posts: 168
Joined: Tue Nov 28, 2017 7:39 am

Re: Starting a SpecNext emulator for development?

Post by chernandezba »

shred wrote: Sat May 02, 2020 6:51 pm
ZEsarUX is the only available alternative. According to the ZEsarUX FAQ, I should be able to just run my .nex file with this command line:

Code: Select all

  zesarux --noconfigfile --zoom 1 --machine tbblue --realvideo \
    --enabletimexvideo --tbblue-fast-boot-mode --quickexit \
    --nowelcomemessage --enable-esxdos-handler \
    --esxdos-root-dir mydemodir mydemodir/mydemo.nex
ZEsarUX is starting up fine, but is then showing a black screen with white border. With a similar command line, I could run the Scrollnutter demo, so it seems to be working in general.

My question is: How can I start my .nex file in ZEsarUX? Or how can I run it in #CSpect without booting up and manual interactions? (I would prefer ZEsarUX because it's open source.)

Thank you for your help! :)
The tbblue fast mode in ZEsarUX tries to initialise some tbblue registers as the nextos does but in some cases it may fail. As you said, scroll nutter demo runs fine so it seems you are using the right command line settings.
If you want send your program to me and I’ll test it

Cheers
shred
Drutt
Posts: 6
Joined: Sat May 02, 2020 4:42 pm
Location: Cologne, Germany
Contact:

Re: Starting a SpecNext emulator for development?

Post by shred »

Thanks for the welcome and your help! :D With some rest and a fresh head, I have resumed my experiments.

For ZEsarUX, I have found out that my old demo is actually starting just fine. But as soon as I am making a CALL into the 48K ROM, it freezes. There is some content at the ROM address, so it's probably the wrong ROM that is mapped into the slot?

About CSpect, I am trying to avoid having to use image files. There would be an easy way to copy the assembled .nex file into the image with mtools, but that is working on Linux only, and images require a more complex setup of the development environment. I am a big fan of the KISS principle. ;)

[mention]chernandezba[/mention] Just a small feature request for ZEsarUX: I think it is too difficult to quit the emulator. The window close button is inoperable, at least on my machine. So I either press F5 and F10 to exit, or use Ctrl-C on the command line. I would prefer if just hitting F10 would exit the emulator, at least with the quickexit option set.
shred
Drutt
Posts: 6
Joined: Sat May 02, 2020 4:42 pm
Location: Cologne, Germany
Contact:

Re: Starting a SpecNext emulator for development?

Post by shred »

I could create a simple Hello World example: https://gist.github.com/shred/66fd59b2d ... acefa0c46a

Use sjasmplus as assembler. It runs fine in CSpect. In ZEsarUX, it crashes the emulated machine immediately when run with the command line of my first post.
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Starting a SpecNext emulator for development?

Post by Seven.FFF »

To copy files or folders into an image you can use hdfmonkey. This builds for win/Mac/Linux. I use hdfmonkey command lines in my windows build scripts.

I agree about KISS, but there are different kinds of simplicity. Already you are using a ZEsarUX nex loader which doesn’t match the one used to load nex files on real Nexts. By switching to an image you would be using exactly the same loader, so you’ve introduced a complication.
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
shred
Drutt
Posts: 6
Joined: Sat May 02, 2020 4:42 pm
Location: Cologne, Germany
Contact:

Re: Starting a SpecNext emulator for development?

Post by shred »

I agree about KISS, but there are different kinds of simplicity. Already you are using a ZEsarUX nex loader which doesn’t match the one used to load nex files on real Nexts. By switching to an image you would be using exactly the same loader, so you’ve introduced a complication.
That's a good point, actually.

I did what you proposed: used an image, and copied the nex file and a autoexec.bas on it. It is starting very quickly. Yay! :D

I can put all the parts together now, document it and make a skeleton project from it. When I'm done, I will publish the GitHub link here.

Thank you all for your help, again!
User avatar
Seven.FFF
Manic Miner
Posts: 744
Joined: Sat Nov 25, 2017 10:50 pm
Location: USA

Re: Starting a SpecNext emulator for development?

Post by Seven.FFF »

Excellent! I Look forward to checking out the skeleton project on github.

You can define your own F keys in ZEsarUX. Either through the menus or, as I prefer to do for build script consistency, on the command line. I have this in mine:

Code: Select all

--quickexit --def-f-function F10 "ExitEmulator"
Robin Verhagen-Guest
SevenFFF / Threetwosevensixseven / colonel32
NXtel NXTP ESP Update ESP Reset CSpect Plugins
shred
Drutt
Posts: 6
Joined: Sat May 02, 2020 4:42 pm
Location: Cologne, Germany
Contact:

Re: Starting a SpecNext emulator for development?

Post by shred »

Here it is...

The first version of the Next Skeleton: https://github.com/shred/nextskeleton
Post Reply