Welcome, Guest. Please login or register.


Author Topic: EnterMice option on EDCW? (Read 32149 times)

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice option on EDCW?
« Reply #30 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.... 

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice option on EDCW?
« Reply #31 on: 2016.April.09. 19:56:43 »
Here you have the EDCW extension 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.

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....
« Last Edit: 2016.April.09. 20:17:46 by gflorez »

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14723
  • Country: hu
    • http://enterprise.iko.hu/
Re: EnterMice option on EDCW?
« Reply #32 on: 2016.April.09. 20:00:19 »
ROM version possible of the modified version?

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice option on EDCW?
« Reply #33 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.
« Last Edit: 2016.April.09. 20:12:39 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice option on EDCW?
« Reply #34 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.
« Last Edit: 2016.April.09. 20:19:37 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice option on EDCW?
« Reply #35 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.

Offline lgb

  • EP addict
  • *
  • Posts: 3563
  • Country: hu
  • æðsta yfirmaður
    • http://lgb.hu/
Re: EnterMice option on EDCW?
« Reply #36 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 ...

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice option on EDCW?
« Reply #37 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.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice option on EDCW?
« Reply #38 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.
« Last Edit: 2016.April.10. 22:58:16 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice option on EDCW?
« Reply #39 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.
« Last Edit: 2016.April.11. 10:46:07 by gflorez »

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14723
  • Country: hu
    • http://enterprise.iko.hu/
Re: EnterMice option on EDCW?
« Reply #40 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.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice option on EDCW?
« Reply #41 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.

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14723
  • Country: hu
    • http://enterprise.iko.hu/
Re: EnterMice option on EDCW?
« Reply #42 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.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice option on EDCW?
« Reply #43 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.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice option on EDCW?
« Reply #44 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.