151 (edited by david_ps 2017-11-06 13:37:23)

Re: New NMI handler / .commands

z is a dot command that lists detected drives and waits for a keypress, it must be copied into /bin folder. It use 64 columns mode because I use it from NMI.sys. It's usable from BASIC too. It's for testing purpouses only, it will not be in final release.

I will review the keyboard and joystick input functions again :'(

I will definitely use a single key to change the active unit. At the beginning, it will cicle available units with each press, and later it could be a menu wink I will use U (unit) key.

I probed NMI.sys on ZXSpin 0.7, ZEsarUX 5.0-5.1-6.0, FUSE 1.4.1 and a real 48+ and 128k speccy and drive assignment was ok in all cases I tested. I tested single partitioned and multiple partitioned SD cards/image files.

I also have in mind to develop some new commands like a hexadecimal / text viewer in 64 column format. The deltree command would be a good candidate, as well as a copy command between different units cool

152 (edited by david_ps 2017-11-06 13:54:10)

Re: New NMI handler / .commands

Luzie wrote:

One question I have for "View": Most files are loaded into Screen-Memory (up from 16384) with Length 6912 Bytes. But some files are loaded as "Viewing Text"? Or am I wrong? Can we trigger View to view as Screen or View as Text (First 704 Chars with 32 Chars/Line or 2x704 Chars with 64 Chrs/Line)?

Luzie, V (view) works as follows:
If the file has a .SNA extension, it shows the snapshoot screen.
Otherwise, it treats the file as if it were a screen dump (.SCR), loading the first 6192 bytes from address 16384.
Never load as "Viewing Text", that's something I plan to change when I create the hexadecimal / text viewer dot command.

153 (edited by david_ps 2017-11-09 06:55:21)

Re: New NMI handler / .commands

Hi Velesoft, Spezzi63,
I have modified the code following your instructions and I believe that the mouse and the keyboard now work as they should. Please check it, thanks.
https://www.dropbox.com/s/jziba837bgs9d … 1.zip?dl=0
https://www.dropbox.com/s/g0mh9i230gmrh … m.zip?dl=0
https://www.dropbox.com/s/1ae5aphm5y9wvj9/z.zip?dl=0
Luzie,
I have not modified the unit change, it continues to be done with the keys 0 to 3, nor the problem with the .TRDs in hd1, I'm still working on it.

Fastload/fastcfg also don't work on hd1 :'(

Help don't work when hd1 selected!

154

Re: New NMI handler / .commands

.TRD problem solved!
Overwrite /sys/nmi/enter with new one:
https://www.dropbox.com/s/0i7fwufpl22fh … r.zip?dl=0

155 (edited by Luzie 2017-11-08 18:52:49)

Re: New NMI handler / .commands

david_ps wrote:

.TRD problem solved!
Overwrite /sys/nmi/enter with new one:
https://www.dropbox.com/s/0i7fwufpl22fh … r.zip?dl=0

Looking Good in v0.0.11-1 - TRD now load OK from hd1: :-)
(However I don´t really understand to exchange "enter" as the only changed file in the new downloads is "reload"?)
(Binary compare of all files).
Anyway ... Thanks!

156 (edited by Spezzi63 2017-11-08 19:04:56)

Re: New NMI handler / .commands

Hello David,
the handling is as usual.
The keyboard responds is fine.
From hd1 start TRD-files.
The orientation is missing something, because it is no longer displayed on which hd you are wink
HD change with GO TO hdx
The .z Command works as usual.
Where was the problem again cool
Bye for now,
Günter

157

Re: New NMI handler / .commands

Spezzi63 wrote:

The orientation is missing something, because it is no longer displayed on which hd you are wink
Günter

Hello Günter,

hd0: or hd1: is shown here by me = I don´t miss display of it?!

I discovered the following: When hd1: content is listed, then I select not attached drive e.g. hd3: than "INVALID DRIVE, PRESS ANY KEY..." is shown and when I press a key, I get to hd0: instead of hd1:

158

Re: New NMI handler / .commands

Spezzi63 wrote:

The orientation is missing something, because it is no longer displayed on which hd you are wink

I don't understand, sorry
https://www.dropbox.com/s/k2qkhtptsilqx … 1.jpg?dl=0

159

Re: New NMI handler / .commands

Luzie wrote:

(However I don´t really understand to exchange "enter" as the only changed file in the new downloads is "reload"?)
(Binary compare of all files).

Luzie, the only files there are equal are this:
    custom.asm
    custom.zdsp
    readme.txt
    z
    boot.bas
    fastcfg.txt
    help1.scr
    load.bas
    old080.sys
    old085.sys
    old086.sys
    TRDN.tap

This ones must be deleted, there are not used:
    loader
    nav

Please check it again wink

160

Re: New NMI handler / .commands

david_ps wrote:

I don't understand, sorry
https://www.dropbox.com/s/k2qkhtptsilqx … 1.jpg?dl=0

Maybe I was too tired, because today is visible.

161 (edited by david_ps 2017-11-09 20:00:54)

Re: New NMI handler / .commands

Hi,
I finally finished version 0.0.11 cool:
https://www.dropbox.com/s/bouap2v56agpn … m.zip?dl=0
https://www.dropbox.com/s/4r0l4cg9515w5 … 2.zip?dl=0
Issues corrected:
* Mouse and keyboard handling corrected, thanks to Velesoft
* Now is possible to change working drive: U changes the active unit by cycling through all the available units
* Fastramp config and load now works with diferent drives. Format of fastcfg.txt changed: e.g. hd0:/games/game.trd
* All functions work in different units or when the default unit is different from the system-boot one
Note that unit name must be in lower case letters.

Velesoft, please check kempston joystick stability. Thanks

162

Re: New NMI handler / .commands

A gift: a very very very basic dot command
https://www.dropbox.com/s/5gwq5vrzzz97zo7/drives?dl=0

163 (edited by Spezzi63 2017-11-09 17:35:23)

Re: New NMI handler / .commands

Top notch wink

(I can not show pictures here. Sent email.)

164 (edited by Luzie 2017-11-09 19:58:56)

Re: New NMI handler / .commands

Spezzi63 wrote:

Top notch wink

(I can not show pictures here. Sent email.)

Do you mean this picture of output of .drives command?!:
http://forum.tlienhard.com/phpBB3/download/file.php?id=6936

165 (edited by Luzie 2017-11-09 20:24:53)

Re: New NMI handler / .commands

david_ps wrote:
Luzie wrote:

(However I don´t really understand to exchange "enter" as the only changed file in the new downloads is "reload"?)
(Binary compare of all files).

Luzie, the only files there are equal are this:
... TRDN.tap

This ones must be deleted, there are not used:
    loader
    nav

Please check it again wink

I don´t know, where I get wrong with my files ;-) ... Hope I´m now "inline" with you again :-)
Please (as always) release new versions with new version number and in complete packages :-)
It´s such a lovely set of programs your new NMI.SYS!

btw.: Could you please add display of a version number to your "drives"-command in next version?
This would be easier to include it in my list of .dot-commands: http://board.esxdos.org/viewtopic.php?id=98 :-)

166

Re: New NMI handler / .commands

Hello, does anyone know how to detect when a dot command is called from BASIC? If there are arguments, it is obvious, but what if there are not? Thanks

167 (edited by Luzie 2017-11-17 20:07:31)

Re: New NMI handler / .commands

david_ps wrote:

Hello, does anyone know how to detect when a dot command is called from BASIC? If there are arguments, it is obvious, but what if there are not? Thanks

Hi. Sorry, I don´t know. But just have one idea you my try if you think it maybe sucessfull: Is the complete original ROM "in" when a dot-command is runned from BASIC? Or maybe a slightly changed ROM? You may try by building a dot-Command which just saves Bytes 0,16384 to disk?

Or place a "Call to Miguel" if he can include such an ability in API of esxDOS 0.9?

168

Re: New NMI handler / .commands

Luzie wrote:

Or place a "Call to Miguel" if he can include such an ability in API of esxDOS 0.9?

A little interest from the master would probably be appropriate sometimes.

169 (edited by Alcoholics Anonymous 2017-11-18 15:02:30)

Re: New NMI handler / .commands

david_ps wrote:

Hello, does anyone know how to detect when a dot command is called from BASIC? If there are arguments, it is obvious, but what if there are not? Thanks

Do you mean when a dot command is called from a basic program as opposed to just being typed in?

Maybe a look at the system variables will sort that out.  There are variables there to track currently executing line number and statement.

Or maybe a look at the return address can tell you too but I am not sure about that.

170 (edited by Luzie 2017-11-18 18:51:58)

Re: New NMI handler / .commands

Alcoholics Anonymous wrote:

Maybe a look at the system variables will sort that out.  There are variables there to track currently executing line number and statement.

Or maybe a look at the return address can tell you too but I am not sure about that.

Good approach! Most of this (which is really complicated), is described here:
https://www.worldofspectrum.org/forums/ … ent_924039

171 (edited by Luzie 2017-11-18 22:50:28)

Re: New NMI handler / .commands

Am I wrong or are user-definied keys not correctly stored to disk? Because when I do a Soft Reset in SpecEmu Emulator, than keys persist, but when I issue a Hard Reset defined keys are lost? (I set keys to Sinclair Joystick 6,7,8,9,0).

172

Re: New NMI handler / .commands

Luzie wrote:

Am I wrong or are user-definied keys not correctly stored to disk? Because when I do a Soft Reset in SpecEmu Emulator, than keys persist, but when I issue a Hard Reset defined keys are lost? (I set keys to Sinclair Joystick 6,7,8,9,0).

Keys are lost after a hard reset, I have to save them in a configuration file along with some other things

173

Re: New NMI handler / .commands

Alcoholics Anonymous wrote:

Do you mean when a dot command is called from a basic program as opposed to just being typed in?

Maybe a look at the system variables will sort that out.  There are variables there to track currently executing line number and statement.

Or maybe a look at the return address can tell you too but I am not sure about that.

I mean when a dot command is called from BASIC (whether it is called from a BASIC program or just it is being typed in) or is called from NMI handler. There are functions that not works if there's not a valid BASIC environment, mainly because system variables are altered as for example because a game that uses that area of memory has been loaded.

174 (edited by Alcoholics Anonymous 2017-11-22 05:51:24)

Re: New NMI handler / .commands

david_ps wrote:

I mean when a dot command is called from BASIC (whether it is called from a BASIC program or just it is being typed in) or is called from NMI handler. There are functions that not works if there's not a valid BASIC environment, mainly because system variables are altered as for example because a game that uses that area of memory has been loaded.

If you're writing a dot command that must behave differently if called from the nmi handler or from basic, maybe the best way is to send a command line that indicates the nmi handler is calling it.  I guess the only other way would be to look at the return address inside the dot command because the return address to your nmi handler is surely going to be a very different address from the return address to esxdos that opened the dot command from basic.  You don't want to deal with specific addresses but you should be able to say all return addresses below x will surely mean the nmi handler called the dot command.

175

Re: New NMI handler / .commands

Alcoholics Anonymous wrote:

If you're writing a dot command that must behave differently if called from the nmi handler or from basic, maybe the best way is to send a command line that indicates the nmi handler is calling it.  I guess the only other way would be to look at the return address inside the dot command because the return address to your nmi handler is surely going to be a very different address from the return address to esxdos that opened the dot command from basic.  You don't want to deal with specific addresses but you should be able to say all return addresses below x will surely mean the nmi handler called the dot command.

I have performed tests for the return address method and the results are the following:

esxDOS  call   return
version method address
------- ------ -------
v0.8.0  BASIC  4042
        NMI    4069
v0.8.5  BASIC  3495
        NMI    3522
v0.8.6  BASIC  3503
        NMI    3530

It does not seem like a very orthodox method but it works. In addition, it is an easy way to find out the esxDOS version wink
It would be interesting if in the new version of esxDOS there were two functions in the API: one to find out the version, and another to know where the dot commands are called.