Enterprise Forever

:UK => Programming => Topic started by: gflorez on 2016.September.05. 15:47:36

Title: How can I inject an Escape sequence to a channel while on interrupt?
Post by: gflorez on 2016.September.05. 15:47:36
I have achieved into creating a mouse pointer onto a text page, but now I plan to use the mouse driver on Editor pages.

It could serve to move the keyboard cursor to the click zone just like is done on a PC, or scroll the page moving the wheel.

But the mouse driver works inside interrupts, so Exdos calls are forbidden.

What can I do? I have thought using Escape sequences, but I don't know if the keyboard or the video drivers can suit.
Title: Re: How can I inject an Escape sequence to the keyboard driver?
Post by: geco on 2016.September.05. 16:16:32
If I remember well Escape sequence is written also by EXOS call, EXOS 8.
Possibly you should try to emulate EXOS 8, put the sequence, where EXOS 8 would do, and make the necessary updates.
Title: Re: How can I inject an Escape sequence to the keyboard or video driver?
Post by: gflorez on 2016.September.05. 23:49:52
But... then I must follow the Exos disassembly, isn't it?

I was thinking of an easy hack, some buffer at a fixed position and alike...

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

The Editor only admits the cursor positioning Escape sequence, so I've been thinking about putting it on the left mouse button and positioning+Enter on the Right button. Scroll is very difficult to implement, as it works differently on the PC and the Enterprise.
Title: Re: How can I inject an Escape sequence to the keyboard or video driver?
Post by: Zozosoft on 2016.September.06. 08:53:43
Hsoft made a new keyboard driver, the mouse movement translated to internal joy movement. If I remember right I uploaded the sources somewhere.
Title: Re: How can I inject an Escape sequence to the keyboard or video driver?
Post by: geco on 2016.September.06. 09:02:08
But... then I must follow the Exos disassembly, isn't it?

I was thinking of an easy hack, some buffer at a fixed position and alike...
I think so.
I have 2 ideas what are ugly:
1st (I do not know if it works) disable the interrupt by DAVE (00h to port 0b4h) in your routine and write the escape sequence when it is done then enable the interrupt again (writing the value of address BFC5 to port 0b4h)
2nd create a small code which would run outside of interrupt and just write the escape sequence, in the mouse routine in interrupt you should get the stack position of returning address of interrupt, just insert your code address to that place and one place later the returning address, in this case when interrupt ends it will jump to your small ESC writer code, and if it is done then will continue where the code was interrupted

I think if there is a good solution not a hack like above to do this our EXOS experts Zozo and Bruce know it :)
Title: How can I inject an Escape sequence to a channel while on interrupt?
Post by: gflorez on 2016.September.06. 10:33:16
Hsoft made a new keyboard driver, the mouse movement translated to internal joy movement. If I remember right I uploaded the sources somewhere.

Thanks, I don't want to add another driver to make work this..... but if you mean to study how it is done inside the code, I will search it.

I think so.
I have 2 ideas what are ugly...

First one is attractive but with unknown consequences, as an Exos call can potentially destroy the return way, you know better...

Second one, the serial side of the driver already uses that way to read the serial port and I don't want to modify it now that it works more or less...
Title: How can I inject an Escape sequence to a channel while on interrupt?
Post by: gflorez on 2016.September.15. 00:53:20
I have 2 ideas what are ugly:
1st (I do not know if it works) disable the interrupt by DAVE (00h to port 0b4h) in your routine and write the escape sequence when it is done then enable the interrupt again (writing the value of address BFC5 to port 0b4h)

I have tested your first idea, it is not harmful but doesn't work. Even with the Dave port put to zero, Exos knows it is inside an interrupt and returns the FEh error, "EXOS function call not allowed".
Title: Re: How can I inject an Escape sequence to a channel while on interrupt?
Post by: geco on 2016.September.15. 08:33:09
:(
Title: Re: How can I inject an Escape sequence to a channel while on interrupt?
Post by: ergoGnomik on 2016.September.15. 09:31:38
Just some wild guessing. Maybe there's a way to make geco (https://enterpriseforever.com/profile/?u=9)'s first idea work. You should try to save EXOS variables 0  and 2 and clear them, after disabling the interrupt. Then, after your operation, restore them as they were and re-enable the interrupts. But this is really just wild guessing without actual knowledge.
Title: Re: How can I inject an Escape sequence to a channel while on interrupt?
Post by: gflorez on 2016.September.15. 11:18:36
Ok thanks, I will try it this night.

Title: Re: How can I inject an Escape sequence to a channel while on interrupt?
Post by: gflorez on 2016.September.15. 23:13:25
Still not working...

I think that disabling interrupts is not the right way, because the driver is working inside Z80 hardware interrupt.

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

The Hsoft driver creates a serial Mouse driver and a new Keyboard driver as a way to inject the mouse movements. I will return to it if I don't find a better way.

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

I have access to all the hardware, so first I better will look for a way to move the Editor coordinates directly.