Enterprise Forever

:UK => Programming => Topic started by: gflorez on 2016.February.26. 11:38:38

Title: EnterMice option on EDCW?
Post by: gflorez on 2016.February.26. 11:38:38
I've  been snooping on the EDCW Rom-program. It is a front-end like the EGI, more integrated on EXOS but less graphical.

Also it is well documented, and can have extensions.

It is a perfect candidate to have an Entermice option. All the necessary things are there.

But, is the developer(EXOSWORM) still active to include in it a little mouse reading routine?
Title: Re: EnterMice option on EDCW?
Post by: Zozosoft on 2016.February.26. 11:52:52
He is not active, but I have the sources.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.February.26. 12:04:36
Great!. You dare...?
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.February.27. 10:03:52
What is needed for old programs or games is a simple EnterMice movement routine with only one button. All at hand on rows 0 to 4 on K column. It is not necessary to implement the whole driver.


The internal or external joystick movement mixed with the EnterMice mouse movement, just like the Hsoft mouse driver did.
Title: Re: EnterMice option on EDCW?
Post by: Zozosoft on 2016.February.27. 22:05:52
Source converted for compile with Sjasm 0.39
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.February.27. 23:15:59
This is the most simple EnterMice reading routine, only 118 bytes. It only reads the two first bytes, strictly MSX protocol, but has the possibility of  a secondary "wired" button.

It must be driven by a 50 Hz interrupt, embedded on the internal joystick reading routine of the target program or game.

Sorry for the badly formatted comments.

Code: [Select]
EnterMice simple reading routine:

ld hl, X_REL           ;first byte, X displacement since last lecture
ld a, 2                   ;RTS low
out (0B7h), a
ld b, 3                     ;long delay
call WAIT
call READ_4BIT             ; read four higher bits
rld                              ;push them in (HL)
xor a                            ;RTS high
out (0B7h), a
ld b, 2                          ;short delay
call WAIT
call READ_4BIT                   ;read four lower bits
rld                              ;push them in (HL)
ld hl, Y_REL               ;second byte, Y displacement since last lecture
ld a, 2                          ;RTS low
out (0B7h), a
ld b, 2                          ;short delay
call WAIT
call READ_4BIT             ;read four higher bits
rld                              ;push them in (HL)
xor a                            ;RTS high
out (0B7h), a
ld b, 2                          ;short delay
call WAIT
call READ_4BIT               ;read four lower bits
rld                                 ;push them in (HL)
xor a
ld c, a
out (0B5h), a
in a, (0B6h)
and 6                            
srl a ; here the status of J column is on carry, but is discarded
srl a
rl c ; K column is saved on c
xor 1
ld (SECBUTT_STATUS), a ; L column is the Right Mouse Button
ld a, c
xor 1
ld (MAINBUTT_STATUS), a ; K column is the Left Mouse Button
ld a, (X_REL)
ld c, a
ld a, (Y_REL)
or c ;If a=0, no movement
ret

WAIT:
nop
nop
nop
dec b
jr nz, WAIT
ret

READ_4BIT:
ld b, 4
ld d, 0

READ_LOOP:
ld a, b
out (0B5h), a
in a, (0B6h)
rra ;data is read from K column
rra
rl d
djnz READ_LOOP

ld a, d
ret
Title: Re: EnterMice option on EDCW?
Post by: Zozosoft on 2016.February.27. 23:26:02
This is the most simple EnterMice reading routine, only 118 bytes.
But now only 36 free bytes in the EDCW :oops:
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.February.27. 23:50:22
Ok, lets see if can be made some space in EDCW.....


But the routine  can be used easily inside other programs.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.February.27. 23:58:21
Seems that it searches for the Mouse driver...

Code: [Select]
nomodrv db 13,"Mouse driver not found,mouse ignored",0
yemodrv db 13,"Mouse driver found,control device redirected",0

I have to test it, tomorrow.

Edit: How much more programs work with the Driver and we don't know?
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.February.28. 00:59:26
It searches for the Hsoft own created mouse driver, not the Boxoft mouse driver modified by Hsoft:

Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.February.28. 10:31:13
I think I can inject the EnterMice routine on the Hsoft driver if you arrange a disassembly of it for me...

On the big Hsoft download packet there is a Mouse directory with an extension and a Rom version in it. Only 2kb.



Edit: It is totally incompatible being running at the same time with the Boxsoft driver, nor the EnterMice nor the serial card can be shared.

May be another driver mix.... but they are very different, and Hsoft has even a Basic commands extension....
Title: Re: EnterMice option on EDCW?
Post by: BruceTanner on 2016.February.28. 13:43:30
This is the most simple EnterMice reading routine, only 118 bytes.

51 bytes (untested!) :mrgreen: (but relies on Y_REL being the byte after X_REL in memory and assumes the value of C on exit does not matter):

Code: [Select]
ld hl, X_REL           ;first byte, X displacement since last lecture
ld b,3 ;long delay
call READ_8BIT
inc hl ;Y_REL
ld b,2 ;short delay
call READ_8BIT ;leaves B=0
xor a
out (0B5h), a
in a, (0B6h)
and 6                            
xor 6
srl a ; here the status of J column is on carry, but is discarded
srl a
rl b ; K column is saved in b
ld (SECBUTT_STATUS), a ; L column is the Right Mouse Button
ld a,b
ld (MAINBUTT_STATUS), a ; K column is the Left Mouse Button
ld a, (HL) ;Y-rel
dec hl ;X-REL
or (hl) ;If a=0, no movement
ret

WAIT:
nop
nop
nop
dec b
jr nz, WAIT
ret
;
READ_8BIT: ld a,2                   ;RTS low
out (0B7h), a
call WAIT_READ_4BIT     ; read four higher bits
xor a                           ;RTS high
out (0B7h), a
ld b, 2                         ;short delay
WAIT_READ_4BIT:call WAIT ;leaves B=0
READ_4BIT:
ld d, b ;d=0
ld b, 4

READ_LOOP:
ld a, b
out (0B5h), a
in a, (0B6h)
rra ;data is read from K column
rra
rl d
djnz READ_LOOP

ld a, d
rld
ret
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.February.28. 15:47:59
Thanks!

Now I see that a little more can be saved if the buttons are stored contiguous to the movement....

C is not important.

Edit: And the buttons phase put at the beggining, then only increasing hl will do, and at the end only a "dec hl" to compare the x and y movement.
Title: Re: EnterMice option on EDCW?
Post by: BruceTanner on 2016.February.28. 16:48:43
I don't know how I got 51 bytes, it's 79 :oops: must have not scrolled down to the bottom when counting!

Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.February.28. 23:50:46
No problem, I think it is short enough. Thanks.

Two mouse drivers, one serial, the other universal but, as only one driver is possible, I choose my dear son.... well, I just adopted it, I'm not its real father....


The Mouse driver interrupt only writes the /RTS pin on the Serial port if a Mouse channel is open. This can only happen inside a program that uses it. Then, a little mouse reading routine is compatible  inside  a stand-alone program, as the Enterprise EXOS does not multi-task....




Then, I must remove the code that interacts with the Hsoft mouse driver interrupt outside, and replace it with this tiny EnterMice reading routine.
Title: Re: EnterMice option on EDCW?
Post by: Zozosoft on 2016.February.29. 21:09:25
It searches for the Hsoft own created mouse driver, not the Boxoft mouse driver modified by Hsoft:

Now I tried it, but don't work. Driver detected, but system crashed after few seconds :-( Probably started development of this function but don't finished?
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.February.29. 22:21:03
There are two versions of the Hsoft driver, 0.0 and 1.1, 2kb and 7Kb

The 1.1 invalidates the keyboard once loaded, but once soft reset the EP it stays resident and obeys the commands.

On the EP/MOUSE/MOUSE1-1 subdirectory.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.February.29. 23:05:54
And the Mkey.ext says "Enterprise Mouse-Keyboard". It weights 4280 bytes.

The disassembly of the Hsoft mouse driver 1.1 is inside "K", but I don't know with what assembler has been made.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.March.09. 23:16:34
I have found  a zone of code in the EDCW assembly that has not labels or entries, this saves about forty bytes more, now about 80 bytes in total. It can be found if search for "without label".

Still insufficient to insert the EnterMice routine, but it is a progress. If the chunk is removed from the code it doesn't affects the program.

I have edited the file for better reading.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.March.12. 23:46:52
I have "bad-translated" with the aid of Google the MOUSE.DOC file. First I had to put all the á, ó and ú in the text, as it was written on  an EP Magyar type font.

It will aid me to know how EDCW interacts with the HSOFT mouse driver.

There is a command "MOUSE" followed by 0FDh that returns in A and BC the segment and address where is the descriptor of the MOUSE device.

At that position  there are some useful internal variables:

-4      SYNC    The byte synchronism of the scan routine
-5      KEY     b0-b1-b2=Mouse buttons status
-6      X1      mouse X1 relative displacement
-7      Y1      mouse Y1 relative displacement
-8      XH      mouse X position
-9      XL
-10     YH      mouse Y position
-11     YL
-12  *  XH      X Upper limit position, little endian type
-13  *  XL
-14  *  YH      Y Upper limit position, little endian type
-15  *  YL
-16  *  XE      X Sensitivity  (0-7)
-17  *  YE      Y Sensitivity  (0-7)
-18  *  XPH     mouse X position little endian type
-19  *  XPL
-20  *  YPH     mouse Y position little endian type
-21  *  YPL
-22  *  SI      software interrupt mode: b3=movement, b2-b1-b0=buttons
-23     KEY2    mouse button to copy the soft-interrupt
-24     XPH     X copy of the soft-interrupt position
-25     XPL
-26     YPH     Y copy of the soft-interrupt position
-27     YPL


--------------

I'm now searching for "not entry" labels to save more space for the EnterMice routine.  At this moment I've found one that will save 4 bytes, not much, but I'm only beginning with the listing.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.March.13. 21:20:22
At last I've found six labels without entries, and now the EDCW.EXT file has 16234 bytes with the same untouched functionality.

You can search the code with "no entry label" to see the removed chunks.

Now it's time to think how can I inject the EnterMice subroutine maintaining the original code.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.March.24. 00:57:08
Slowly I am figuring out how EDCW moves the pointer.

Meantime I find some curious details about how it has been programmed.

-It is plagued of auto modifiable code, for example:

Code: [Select]
wasn    ld a,0
        or a
        jr nz,nonc
 
        ld a,252
        call seize

        ld a,255
        ld (wasn+1),a

-Almost the entire extension is loaded on Z80 Page 0 at 100h address every time it is executed:

Code: [Select]
        push bc
        ld hl,maincde+1
        ld bc,extname-256; end of the code
        ld de,100h
        ldir
        pop bc
        jp 100h

To do it, there is a compiler command that forces the assembly of that chunk to be executed from 100h:

Code: [Select]
maincde ret

        phase 100h;  assembles this chunk on 100h address

And, at the end of the code:

Code: [Select]
extname equ $
        dephase
PEND equ $
END



I think that the Rom version of the EDCW uses the same method, as the author claims the two versions are compatible. It would have cost the rewriting of all the program to remove all that auto-modifiable code.

-An unknown "External keyboard" hardware is used by the program.  Probably also created by Meszaros, uses Z80 ports 60h and 61h, not present  on LGB list (http://ep.lgb.hu/doc/ports.html).

-Inside the code, some 16 bit input-output port instructions are used. I though they where forbidden due to the paging method of the Enterprise:

Code: [Select]
int     ld bc,0b5h; b=0
        ld e,7; row 7
        out (c),e; Keyboard/Joystick row select
        in d,(c); Keyboard line status
        bit 2,d; right
        jr nz,wo

Here, "out (c),e" is used to save some instructions when scanning the keyboard.

But here it is used to scan for connected hardware in a way that I still don't understand:

Code: [Select]
he?     push bc
        in a,(c); I think it searches for hardware in the ports
        inc a
        jr z,pw

        ld (hl),c
        inc hl
        inc d

pw      pop bc
        inc c
        djnz he?

        ret


















Title: Re: EnterMice option on EDCW?
Post by: lgb on 2016.March.28. 00:09:24
An unknown "External keyboard" hardware is used by the program.  Probably also created by Meszaros, uses Z80 ports 60h and 61h, not present  on LGB list (http://ep.lgb.hu/doc/ports.html).

I am not sure about this, but if I remember correctly, there was an external PC keyboard once, which is not compatible with the original keyboard though, so you must to use custom ports to access it. Maybe this one: http://ep128.hu/Ep_Hardware/Ep_Billentyu.htm

This Hungarian article talks about ports 60h and 61h ...
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.March.28. 00:59:37
Surely it is. Not so complicated like the serial card. There is even a driver for it on the HSOFT big file (https://enterpriseforever.com/downloads?dir=Hsoft_programjai_es_forraskodjai/&?dir=Hsoft_programjai_es_forraskodjai%2F&download=Hsoft_EP.rar).

A pity that serial keyboards are not so common today. I have thrown many to the junk...

I remember a project to modify the ROM inside on a specific maker....
Title: Re: EnterMice option on EDCW?
Post by: lgb on 2016.March.28. 01:24:45
A pity that serial keyboards are not so common today. I have thrown many to the junk...

Well, USB is also serial, did you mean PS/2? :) This project uses even older ones, XT keyboards ... I am not sure about the difference though between PS/2 AT and XT stuffs ...
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.March.28. 02:26:45
I remember to have 5 pin DIN to mini-DIN(PS/2) adapters for that XT keyboards.

I think both use the same protocol. Not the same protocol as PS/2 mice but with the same signals, +5, negative, clock and data.
Title: Re: EnterMice option on EDCW?
Post by: pear on 2016.March.28. 08:00:39
XT keyboards are different from AT at layer 1 of communication protocol (clock signal).
PS/2 and AT keyboards have the same layer 1, but are different at layer 2 (extended but compatible commands, other than mouse).
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.March.31. 14:49:59
EDCW stores the cursor coordinates with three bytes, first the line(IX), 0 to 199, then the column(IX+1), 0 to 74, and at last the pixel(IX+2), 0 to 7.

This way it is very easy to calculate the exact memory address of the position. It is an intermediate stage between the pure coordinate position and the mere memory position. But adding or subtracting from a position involves to perform many calculations.

At the other side, the  Boxsoft approach(mouse driver, EGI and Paintbox) works internally with simple coordinates, and only translates them to memory position when the pointer has to be drawn.

The good news is that EDCW has already the subroutines to add or subtract from a position, so there I can save some valuable memory. I only have to discover how to call them without disturbing the main process. The ideal approach is to merge the EnterMice movement with the joysticks routines. I think it is possible, because they are already prepared for increments grater than 1. If you press a direction on the internal joystick for a while the pointer begins to move faster. There is an acceleration routine that detects that.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.03. 03:18:12
I am struggling against the code..... I've managed to move the pointer with the mouse, a bad movement but it is a promising start.

The problem here is that I only have about 13 bytes free, not enough to do beautiful miracles... 

To my tests I am using superb LGB's Xep128. As it access read only the SD-image it is easy to have it mounted as a virtual unit and copy the newly compiled EDCW extension to try.
Title: Re: EnterMice option on EDCW?
Post by: lgb on 2016.April.03. 13:49:32
The problem here is that I only have about 13 bytes free, not enough to do beautiful miracles...  

640Kbyte should be enough for everyone :) Ok. but 13 bytes? :D

Quote
To my tests I am using superb LGB's Xep128. As it access read only the SD-image it is easy to have it mounted as a virtual unit and copy the newly compiled EDCW extension to try.

"superb LGB" :) Maybe LGB's superb Xep128, but it's even too much :) Sorry, I couldn't resist to react, but thanks for the nice words :)

Acutally - I think - you must be careful with that. What you're doing is nice (even I do this sometimes) just care must be taken, as if image changes, EP won't notice it and maybe things cached FAT etc entries (I am not sure about EXDOS/FISH internals ...) will be invalid. But if you modify that among EP reboots etc, it must be safe ... I think :D

Anyway it's nice that somebody else other than me uses Xep128 too at least :-P Even just myself, I can find bugs if I try to use it eg with Bricky Prise now, the sound problem :) This is because just developing Xep128 may not expose bugs with testing some "fixed stuff", but the every-day usage can point some other bugs out, sometimes :)
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.03. 20:13:15
The EDCW extension has 16kb. If the compiled code exceeds that top the installation gives an "insufficient memory" error. I have found some unused zones on the disassembly that once deleted gave me about 200 extra free bytes, enough to put there the most simple EnterMice routine.

But I am on the middle of implanting it and your emulator is an exceptional tool for me.

Don't be so modest. For me is evident that you put all your essence in what you do.... 
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.09. 19:56:43
Here you have the EDCW extension (http://www.ep128.hu/Ep_Util/Edcw.htm) adapted to EnterMice use.

I have to test it thoroughly, but I think it is completely functional.  

Nothing has been modified on the original code, not counting removing unused parts, shortening the text messages or fixing a flagrant error on the original Hsoft mouse data capture routine.... I assume that now the original Hsoft mouse driver works but I can't test it.

This is the third graphic OS that is made compatible with EnterMice, and it is not one more of them,  as it comes with several interesting loadable modules. The complete pack can be downloaded from here (http://www.ep128.hu/Ep_Util/Prg/EDC_Windows.rar).

Once unpacked and installed on our selected disk drive, the executable(EDCW.EXT) has to be substituted with the one I provide below. To avoid confusions with the original program I have marked it as version 5.6E(for EnterMice), instead of only 5.6.

First it must be loaded with ":LOAD EDCW.EXT", then it can be launched as you call BASIC, EXDOS, or WP, with the EDCW command.

I think it doesn't work on 64k, sorry, and on a 128k EP, EDCW must be the first loaded extension, as it always opens the screen on the same position.

 Please, don't blame me if you find errors, they are not mine. The pointer movement is my only work, and it does what it has to do....
Title: Re: EnterMice option on EDCW?
Post by: Zozosoft on 2016.April.09. 20:00:19
ROM version possible of the modified version?
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.09. 20:05:15
Is possible, I don't have the disassembly of the Rom, you only provided me the extension one....

But surely it will work, because this extension copy itself to the 100h address on execution, and can be the Rom does the same.  I have mid-understood that the Rom version is compatible with the EXT version.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.09. 20:11:11
It has been a loooong time to adapt it, mainly because I am a novice programmer... but it could have been even more if not working with LGB's XEP128 great emulator ....

I highly recommend its use now that it is able to load programs without having to enter them in the SD-image.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.09. 20:56:51
I have updated the EnterMice wiki pages on the list of compatible programs. I have also added a link to the executable and the Hungarian description page.
Title: Re: EnterMice option on EDCW?
Post by: lgb on 2016.April.09. 21:18:43
It has been a loooong time to adapt it, mainly because I am a novice programmer... but it could have been even more if not working with LGB's XEP128 great emulator ....

I highly recommend its use now that it is able to load programs without having to enter them in the SD-image.

Actually ep128emu know that for "ages" and I have the idea from there :) I mean the FILE: stuff. Just it didn't emulate mouse, which is a bigger problem for you, I guess ...
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.10. 10:44:18
Of course, for me one of XEP128's main characteristics is mouse emulation, but as a whole it is really good, and very compatible.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.10. 22:19:19
This is a boring technical explanation of how I have adapted EDCW to work with EnterMice.

I think the process can be replicated on other programs easily.

First I put an entry on the movement acquisition routine like this:

Code: [Select]
vcv     ld a,(mouseg); segment where the driver is installed, default is 0, not installed
        or a
        jp nz,usemou; this is the original Hsoft mouse entry of EDCW
; Modification here
;---------------------------------------------------------------------------------

ld a, (0BFECH); RANDOM_IRQ, 1/50 seg counter as I don't have an interrupt routine
ld hl, interrupt; the same but last time read
cp (hl)
ld (hl), a

jr z, continu; we need to wait up to the next frame for the MSX protocol to work
call  msx
jr z, continu; no movement on mouse or EnterMice, X_REL and Y_REL both equal to 0(0,0)
ld hl,X_REL; X displacement
ld a,(hl)
cp 255
jr nz, enterm
inc hl; Y displacement is contiguous
cp (hl)
jr z, continu; no mouse or EnterMice detected, X_REL and Y_REL both equal to 255(-1,-1)
                ; this avoids the typical Boxsoft annoying diagonal movement and serves to flip  from internal
                ;joystick movement to EnteMice movement automatically

enterm jp entermice


;---------------------------------------------------------------------------------
;end

continu
ld b, 0

call jo1; external joystick 1




This was the hook implanted. Every time the "msx" subroutine is called it returns writing the X_REL, Y_REL and MAINBUTT_STATUS variables, so we need to add the displacements to the actual coordinates. Zero flag is set if no movement(0,0).

What my Entermice routine does is to convert the unusual EDCW's coordinates to standard coordinates on 16 bit format. X can go from 0 to 599, and Y from 0 to 199. You can say that we only need a byte for Y, but take in account that the increments can be positive or negative, from 127 to -128, so we don't have enough with eight bits to do the addition, at least 9 bits are necessary.

Once done the addition, we need to adjust the results to the possible range. First of all we don't need the negative numbers, below zero, then we can cut easily the upper limit.  

In this case we don't need again to convert the coordinates to EDCW format, the original Hsoft routine does that for us, only we must find the appropriate point of re-entry, just where the coordinates have been resolved on the original routine.

But the original Hsoft mouse routine had an error that calculated a bad address where to draw the pointer, sometimes just over the EDCW code...

I have only added an offset to the calculated address to fix it, but it take me long to find that bug, as I always though it was only my error...

I hope this explanation will serve so that "soon" other programs would be adapted to EnterMice use.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.11. 01:09:53
Few last hints:

On loading EDCW modules. They don't load at first, but if you exit to Epdos and re-enter to EDCW they will load without problem, I don't know still why....

Once loaded they will survive even a cold reset. There is an option on Zozo's Memory Check to delete them.

On Xep128 you don't have a save option, but you can copy the EDCW.STP config file from  EP128emu to the SD-image and it will work.


EDIT: I think the problem with the modules is because the lack of floppy drives, but still don't know what EPDOS does.

RE-EDIT: I have found that on other computer I don't have problems loading EDCW modules.... here I put my config file. Place it at the root directory.
Title: Re: EnterMice option on EDCW?
Post by: Zozosoft on 2016.April.19. 21:49:44
Now I tested on real machine.
The mouse movement are very good!

But some problem with the mouse button :oops:
When start new application then it is also got a click.
For example start the File Manager then it is instantly load file. And if you click once on the file then it is loaded twice.

If you use space key instead the mouse button then no problem.

I'm not sure but I think the problem when the EXDOS disable the IRQ for the floppy operation.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.20. 00:39:27
Sorry I've still not tested it on a real EP.... only on XEP.

To inject the movement and button I used part of the serial routine, but I can easily activate the space key when  the left button is pressed.

It wouldn't took much space.

About the movement, it is the same MSX routine as on the Universal Mouse driver, but EDCW has better sprite movement than the EGI.

The EGI doesn't use  the driver pointer, it disables the drawing and uses its own pointer graphics. Is for it that the EGI pointer can be user defined.
Title: Re: EnterMice option on EDCW?
Post by: Zozosoft on 2016.April.20. 07:40:34
To inject the movement and button I used part of the serial routine, but I can easily activate the space key when  the left button is pressed.

Probably need to put the mouse button reading where the space key readed.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.20. 10:11:08
My EP hangs when I click on the File manager inside EDCW. It seems it needs an EXDOS card for the File manager to work.

Curiously EDCW works very well on XEP128.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.21. 15:09:04
Zozo, can you try this version?

Remember, delete the EDCW.STP config file before running the new version.
Title: Re: EnterMice option on EDCW?
Post by: lgb on 2016.April.21. 15:42:47
My EP hangs when I click on the File manager inside EDCW. It seems it needs an EXDOS card for the File manager to work.

Curiously EDCW works very well on XEP128.

But, if I understand this correctly, Xep128 has EXDOS ROM image by default ... So no wonder it works if a real EP hasn't got EXDOS ROM, while Xep128 has. But I am not sure if you mean the card itself, or "only" the software with "EXDOS card" ... On a real EP too, you can have EXDOS (as software) without the EXDOS card actually :)
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.21. 15:54:37
I tried an EP128 + SD-reader, and it has the ISDOS rom inside. I actually have my Microteam card at Zozo's, repairing.

EDCW checks for the ISDOS hardware searching on the Z80 ports, then I think is for this it hangs, at not finding A: or B: units.

It's only a supposition...
Title: Re: EnterMice option on EDCW?
Post by: lgb on 2016.April.21. 17:08:37
I tried an EP128 + SD-reader, and it has the ISDOS rom inside. I actually have my Microteam card at Zozo's, repairing.

EDCW checks for the ISDOS hardware searching on the Z80 ports, then I think is for this it hangs, at not finding A: or B: units.

It's only a supposition...

Ah, I see. Maybe Zozo can told you better, but as far as I remember (and Zozo told once ...) the original EXDOS software tries to use the WD chip and may hang if it cannot be found. At the other hand, the EXDOS software which resides in the SD card cartridge is a bit modified (?) not to hang in case of missing WD (as it can be usable without a real EXDOS card too, with the SD card itself with its own DISKIO SD-related routines).
Title: Re: EnterMice option on EDCW?
Post by: Zozosoft on 2016.April.21. 19:01:25
Mouse button problem still exist :oops:

It is works for me without EXDOS card, running from SD. (Just you can't change drive, because only A-E in the drives menu)
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.21. 21:58:32
Ok. Tomorrow I will test my old EP, with more memory, if EDCW doesn't hang and if I see the error.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.22. 09:44:29
With more memory EDCW  File Manager works for me.

The problem is that the mouse button is processed two times, then you always make double click.

I think this has an easy fix.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.22. 12:02:39
Not so easy, the problem here is that the keyboard parsing is made with calls to the Keyboard device, and the mouse buttons are read directly. If I make a super fast click it is understood like a single click, but a normal click is understood as a double click.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.23. 21:36:03
This has worked for me.  

The problem was a bouncing on the mouse button parsing. Once done a mouse click, another one waited while the action was executed.

I have added some lines to avoid interpreting a new click while the button is pressed.


Another problem is to modernize the program to cope with the new drives. By now the new units can be read like on the EGI, assigning the new  letter to A:, B:, C:, D: or E:.


Remember to delete the EDCW.STP config file, if not done the program hangs.

EDIT: assigning let us to view the content's unit, but not to execute files.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.23. 22:41:40
This another is a fast-fix to work  with SD-readers, with or without EXDOS card.

A:, B:, C: and D: have been replaced by F:, G:, H:,and I: letters. I have left the Ramdisk drive, E:

To use it, first delete the EDCW.STP config file or it wouldn't work as expected.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.April.25. 12:46:33
Now that I have played a little more with EDCW, I have detected an error on it. I have tested also the original program to discard bugs made by my modifications.

The problem is with the File Manager, after a while changing directory or drives  and running applications, it simply refuses to load known files, and gives the error: "Invalid File Header".

Actually the only cure I see for this problem is to enter and exit of EPDOS, or hard reset the EP, as some information seems to survive to soft resets.

----------

On the other side, I'm planning to modify the drive selection on the File Manager to admit all the possible drives. It doesn't seems too difficult for me...

The idea is to open a prompt with only one character input, the letter of the drive. Only upper letters from A to Z will be possible, although lower ones can be converted to upper case form. Other characters will be refused.

Then the space saved from the old method menu can be utilized for the extra lines of code.
Title: Re: EnterMice option on EDCW?
Post by: Zozosoft on 2016.April.25. 21:12:28
EnterMice now working fantastic!
Title: Re: EnterMice option on EDCW?
Post by: Tutus on 2016.April.25. 21:43:00
:smt038 :smt038 :smt038
Title: Re: EnterMice option on EDCW?
Post by: Ep128 on 2016.April.25. 23:34:27
:smt041 :smt026
Title: Re: EnterMice option on EDCW?
Post by: pear on 2016.April.26. 06:20:33
Good for you! :smt041
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.May.15. 15:52:40
One step more. Now you can select the unit letter on the Drive option inside the EDCW File Manager. Simply press the letter key you want,  then press Enter or click on OK.

Only A-Z  or a-z letters are accepted, other characters give an "Invalid drive" message and an empty directory.

A-E drives not present bring you the usual "Not ready -- drive X: Retry or abort(R/A)?" prompt. Other drives not found show an empty directory and "Invalid drive" message.

Please, just before executing the program, delete the EDCW.STP config file or the Enterprise will hang.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2016.September.24. 23:11:24
I have doubled the horizontal pointer displacement as proposed by IstvanV.

Now the horizontal movement is proportional to the vertical one.

The problem was that the resolution is 600x200, so doing the same horizontal mouse gesture the pointer moved half the distance that on lo-res mode.

EnterMice wiki link updated.
Title: Re: EnterMice option on EDCW?
Post by: Zozosoft on 2016.October.10. 10:52:42
ROM version.
Title: Re: EnterMice option on EDCW?
Post by: gflorez on 2017.February.10. 10:18:15
We must change the delays on the MSX mouse reading routine, all must be 4 to serve on a 10Mhz Enterprise.

The same on all conversions...

Sorry, until recently I had no way to test that.