Welcome, Guest. Please login or register.


Author Topic: EnterMice (Joy & PS/2 mouse interface) (Read 176991 times)

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #480 on: 2018.March.05. 09:55:59 »
Just check if the connector pins have not been shortened ?
If yes, you need new connectors too.
Let me know.

Offline Tutus

  • EP lover
  • *
  • Posts: 679
  • Country: hu
    • Enterprise 128
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #481 on: 2018.March.05. 09:59:21 »
Pear, you can add Zozo to my order. I'll give it to her :)

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #482 on: 2018.March.05. 10:03:36 »
No problem :)

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #483 on: 2018.April.20. 11:34:26 »
Hello

If I want to put mouse control in an old game (eg Ledmmings), what should I watch for?

Suppose you have the original jpy reader routine, see where it is going to jump, to the left, to where, to the right, etc.

Now, I get a relative movement at the mouse. So what do you need to pay attention to working well? Here I am thinking that if I make things a little simpler, it will work at the same time on joy mode and EnterMice mode (1.2 DIP OFF)


You must search the keyboard-joystick reading routine, near it you will find the movement routine, usually with -+1 coordinate additions. Usually the inputs are checked every 1/50 second, perfect to add the EnterMice reading routine by a CALL on some place of the code(probably altering a JP command).

You must first search for a place where to inject the mouse reading routine. There are some variations in complexity and length, according to the number of buttons you want to read, but for a game the best is the basic movement and two main buttons.

You will save some process time if you read the joystick bits at the same time as the EnterMice bit on the same B6h Z80 port. But the mouse has to be read 4 times, not only one.

You can read the descriptions of my strugglings modifying programs:

 https://enterpriseforever.com/programming/entermice-option-on-edcw/

https://enterpriseforever.com/programming/pasziansz-solitaire-from-hsoft-need-entermice-support/

Remember, the mouse can add movement from -+1 to -+128 coordinate units

Offline Povi

  • EP addict
  • *
  • Posts: 2296
  • Country: hu
    • http://povi.fw.hu
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #484 on: 2018.April.20. 14:08:20 »
Remember, the mouse can add movement from -+1 to -+128 coordinate units
What kind of unit is it? I assume they are needed to convert to pixel coordinates based on experimental way?
*** Speicherplatz zu klein

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #485 on: 2018.April.20. 14:45:04 »
EnterMice returns two bytes for the movement, on two's complements for the Z80 processor. You can add them directly to the actual position, checking what happens to the flags to correct the coordinates if the addition is lower or  higher than your playing zone.

Two's complements is a convention to represent a whole signed number. The Z80 works with sign when the appropriate operant is selected. Bit 7 set indicates a negative bit, but you can't take the rest of the bits as the data, only in positive numbers happens this, because negative numbers start from 255(1111 1111) as -1  backwards up to 128(1000 0000) as -128.

But the magic is that adding a pair of two's complement numbers works...  if the result don't exceeds the +127 -128 range...

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #486 on: 2018.April.20. 18:13:10 »
I forgot to say, the Z80 also manages 16bit signed numbers, and in that case the range is form +32767  to -32768 on operations with register pairs.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #487 on: 2018.April.23. 15:47:12 »
Probably the program maintains the pointer coordinates on word variables(16 bits). To add the 8 bit increment to the 16 bit coordinate you must expand it to 16 bit. If the bit 7 is 0 then the high byte will be 0, but if it is set all the bits on the high byte have to be set, so it will have  a 255. The value remains the same.


Code: [Select]
                         High     Low

+23 = 00010111   ----> 00000000 00010111 still +23

-10 = 11110110   ----> 11111111 11110110 still -10

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #488 on: 2018.October.14. 12:43:46 »
I did cleanup my garage and found some more parts, from which I can put together about 20 EnterMices.
I ordered PCBs.
This will be the last chance for an assembled interface.
The price not changed.

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #489 on: 2018.November.11. 14:06:16 »
Available now.
There are 22 pieces.
Half of them is already assembled, tested and ready for shipment.

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #490 on: 2018.November.11. 18:03:35 »
Great!

I have made an announce on the Spanish RetroWiki page.

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #491 on: 2018.November.11. 18:09:40 »
Thanks :)

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #492 on: 2018.December.06. 18:37:20 »
It happened that one of the interfaces lost its memory :oops:  Exactly CPLD.
I attach JEDEC files to the CPLD chips in all versions that appear in Entermice.

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14723
  • Country: hu
    • http://enterprise.iko.hu/
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #493 on: 2018.December.06. 18:43:17 »
It happened that one of the interfaces lost its memory :oops:
This is at the user who are report problem in EP Facebook group?
Quote
I attach JEDEC files to the CPLD chips in all versions that appear in Entermice.
Thanks! I can reprogram it, if anyone need it in Hungary.

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #494 on: 2018.December.06. 18:46:20 »
Yes, this one. Today arrived.
I accidentally have a CPLD programmer at home and checked the chip right away.
I will full test the entire interface on the weekend.