Welcome, Guest. Please login or register.


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

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #315 on: 2015.November.15. 13:47:21 »
Before sending a PM you'll check the "Save a copy in my outbox" under a message.

Offline Jolaes76

  • Newbie
  • Posts: 19
  • Country: hu
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #316 on: 2015.November.15. 14:04:12 »
Thanks again.  Amateur mistake :)
"Ita in vita ut in lusu alae iactura arte corrigenda est."

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #317 on: 2015.November.15. 15:17:12 »
Or you can add your nick-name in the " Add BCC (?)" box
« Last Edit: 2015.November.15. 15:21:45 by gflorez »

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #318 on: 2015.November.18. 18:44:52 »
Now I ordered two Sega controllers on eBay.
When arrived will be test it :)
Material for the study successfully reached its destination.
Tests over the weekend.

Offline Jolaes76

  • Newbie
  • Posts: 19
  • Country: hu
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #319 on: 2015.November.19. 13:32:22 »
I really hope for the best it will work out... I also bought a new original and two new old stock, better quality replicas...
The prices are crazy over ebay :(

Now there is no turning back, I am determined to dissect them and rewire if necessary.
"Ita in vita ut in lusu alae iactura arte corrigenda est."

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #320 on: 2015.November.19. 14:03:46 »
I will be test the EnterMice for ability read all pad buttons.
For $ 6 I did not expect to get great, original pad, but I hope that at least it works.
I checked for the moment that inside pad is not empty :) Variously could be ...

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #321 on: 2015.November.19. 15:10:12 »
Once loaded the mouse driver, we will be able to see Entermice information only executing the ":mouse" command.

This is a recreation:

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #322 on: 2015.November.19. 15:42:24 »
Wow! It looks great :) Thanks

Offline Zozosoft

  • Global Moderator
  • EP addict
  • *
  • Posts: 14723
  • Country: hu
    • http://enterprise.iko.hu/
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #323 on: 2015.November.19. 15:57:12 »
Can you upload this updated MOUSE.XR? Anyway I think it's version number need a upgrade :-)

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #324 on: 2015.November.19. 16:01:28 »
Is only a recreation, I am sloooow...

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #325 on: 2015.November.20. 09:58:55 »
Below there are procedure to read all the buttons of the pad.
Perhaps that has some mistakes, but I wanted to show the idea.
The need to generate four pulses, similar to those which are generated to read data from the mouse.
It may be some way be read mouse and pads at one time ?
Code: [Select]
The period of these signals for MK3 was about 27.6 microseconds.  That
is the high or low time for the pulses was 13.8 microseconds.  In my
interfacing experiments I successfully used a signal with a 200
microsecond period, 100 microsecond high or low time.  I suspect that
there is some maximum period length associated with a time-out in the
custom chip, but I have not investigated what that is.
 
Serial DataOut line
       1 0 1 0 1 0 1 0
12V --+ +-+ +-+ +-+ +-----------------------------------
      |1|1|2|2|3|3|4|4
0V    |_| |_| |_| |_|

Pad SELECT line      
             H L P
5V ---+ +-+ +-+ +-+ +-----------------------------------
      | | | | | | | |
0V    |_| |_| |_| |_|

X button pressed:
5V ---+ +-+ +-+   +-------------------------------------
      | | | | |   |
0V    |_| |_| |___|

X button NOT pressed:
5V ---+ +-+ +-+ +---------------------------------------
      | | | | | |
0V    |_| |_| |_|
Code: ASM
  1. ; Input HL=0 joystick port 1, HL<>0 joystick port 2
  2. ; Output HL H = 1111 1ZYX, L = ASBC UDLR, bit=0 button is pressed
  3.         DI                                              ; F3            
  4.         PUSH    BC                                      ; C5
  5.         PUSH    DE                                      ; D5
  6.         LD      A,L                                     ; 7D
  7.         OR      H       ; 0=port 1, other=port 2        ; B4
  8.         LD      A,0                                     ; 3E 00
  9.         JR      Z,ReadPort1                             ; 28 02
  10.         LD      A,5                                     ; 3E 05
  11. ReadPort1:
  12.         LD      D,A     ; KBin offset                   ; 57
  13.         LD      HL,65535                                ; 21 FF FF
  14. ; two full pulses
  15.         LD      E,2                                     ; 1E 02
  16.         XOR     A                                       ; AF
  17. ; set DataOut high (0V) - set SELECT low (0V)
  18. PulseLoop:
  19.         INC     A                                       ; 3C
  20.         OUT     (183),A                                 ; D3 B7
  21.         LD      B,10                                    ; 06 0A
  22.         DJNZ    $       ; wait 30 us @ 4 MHz clock      ; 10 FE
  23. ; set DataOut low (+12V) - set SELECT high (5V)
  24.         DEC     A                                       ; 3D
  25.         OUT     (183),A                                 ; D3 B7
  26.         LD      B,10                                    ; 06 0A
  27.         DJNZ    $                                       ; 10 FE
  28.         DEC     E                                       ; 1D
  29.         JR      NZ,PulseLoop                            ; 20 EF
  30. ; at third pulse read high row of buttons        
  31. ; read btn A & Start
  32.         LD      A,D     ; load offset                   ; 7A
  33.         OUT     (181),A ; set KBout                     ; D3 B5
  34.         IN      A,(182) ; read KBin                     ; DB B6
  35.         AND     3       ; leave only bit 0 & 1          ; E6 03
  36.         RRA             ; shift bit 0 to CY             ; 1F
  37.         RL      L       ; shift CY to L                 ; CB 15
  38.         RRA             ; shift bit 1 to CY             ; 1F
  39.         RL      L       ; shift CY to L                 ; CB 15
  40. ; read low row of buttons          
  41.         LD      A,1                                     ; 3E 01
  42.         OUT     (183),A ; DataOut=1=0V, SELECT=0= 0V    ; D3 B7
  43.         LD      B,5     ; loop counter                  ; 06 05
  44.         LD      E,D                                     ; 5A
  45. ; read btn B & C
  46.         LD      A,E     ; load offset                   ; 7B
  47.         OUT     (181),A ; set KBout                     ; D3 B5
  48.         IN      A,(182) ; read KBin                     ; DB B6
  49.         AND     3       ; leave only bit 0 & 1          ; E6 03
  50.         RRA             ; shift bit 0 to CY (button B)  ; 1F
  51.         RL      L       ; shift CY to L                 ; CB 15
  52.         RRA             ; shift bit 1 to CY (button C)  ; 1F
  53.         RL      L       ; shift CY to L                 ; CB 15
  54.         INC     E                                       ; 1C
  55.         DEC     B                                       ; 05
  56. ; read directions
  57. ReadHighLoop:
  58.         LD      A,E     ; load offset                   ; 7B
  59.         OUT     (181),A ; set KBout                     ; D3 B5
  60.         IN      A,(182) ; read KBin                     ; DB B6
  61.         AND     1       ; leave only bit 0              ; E6 01
  62.         RRA             ; shift bit 0 to CY             ; 1F
  63.         RL      L       ; shift CY to L                 ; CB 15
  64.         INC     E                                       ; 1C
  65.         DJNZ    ReadHighLoop                            ; 10 F3
  66. ; L = ASBC UDLR
  67. ; start fourth pulse, read third row of buttons        
  68.         XOR     A                                       ; AF
  69.         OUT     (183),A ; DataOut=0=+12V, SELECT=1=+5V  ; D3 B7
  70.         LD      B,3     ; loop counter                  ; 06 03
  71.         LD      E,D                                     ; 5A
  72.         INC     E                                       ; 1C
  73. ; read X, Y, Z
  74. ReadLowLoop:
  75.         LD      A,E     ; load offset                   ; 7B
  76.         OUT     (181),A ; set KBout                     ; D3 B5
  77.         IN      A,(182) ; read KBin                     ; DB B6
  78.         AND     1       ; leave only bit 0              ; E6 01
  79.         RRA             ; shift bit 0 to CY             ; 1F
  80.         RL      H       ; shift CY to H                 ; CB 14
  81.         INC     E                                       ; 1C
  82.         DJNZ    ReadLowLoop                             ; 10 F3
  83. ; H = 1111 1ZYX
  84. ; set SELECT low - last pulse reset pad counter                                    
  85.         LD      A,1                                     ; 3E 01
  86.         OUT     (183),A                                 ; D3 B7
  87.         LD      B,10                                    ; 06 0A
  88.         DJNZ    $                                       ; 10 FE
  89. ; set SELECT high
  90.         DEC     A                                       ; 3D
  91.         OUT     (183),A                                 ; D3 B7
  92.        
  93.         POP     DE                                      ; D1
  94.         POP     BC                                      ; C1
  95.         EI                                              ; FB
  96.         RET                                             ; C9
« Last Edit: 2015.November.20. 11:24:23 by pear »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #326 on: 2015.November.20. 15:02:41 »
The code to read the mouse is easy and short, as is your code to read the pads, and can be included on the assembly of a game. It  must have a type of interrupt routine to read them in time.

But I don´t see the point of reading game pads inside the mouse driver other than for controlling the pointer. For that you don´t need six buttons.

On the other hand it is perfectly possible. I can give you the last assembler if you want to try. I am actually putting  "other" things in it.

I think is better for a game-pad demo if you do a hook on the EXOS interrupt. This can be easily injected from Basic. I did once a program that worked hooked. It maintained a clock on the status line between soft resets. Here is the listing, I have the program on tape somewhere...
« Last Edit: 2015.November.20. 16:22:38 by gflorez »

Offline gflorez

  • EP addict
  • *
  • Posts: 3607
  • Country: es
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #327 on: 2015.November.20. 17:58:15 »
The Basic program looks for the status line address, but you can know it directly if you know where is the Line Parameter Table.

I made this program without or few information...

Offline pear

  • EP lover
  • *
  • Posts: 825
  • Country: pl
  • Z80 only
    • Támogató Támogató
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #328 on: 2015.November.20. 19:56:42 »
SEGA pad adapter is ready.
Scheme a little changed.
By default, after power on DataOut output is + 12V. SEGA pad by default has a line SELECT set to 5V.
Compared to the previous scheme adapter, now I turned SELECT signal, so that after power on is the default state.
Without additional program to control SELECT line, you can read directions and buttons B and C as Fire1 and Fire2.
The control program I will check tomorrow.

Offline Z80System

  • EP addict
  • *
  • Posts: 3848
  • Country: hu
Re: EnterMice (Joy & PS/2 mouse interface)
« Reply #329 on: 2015.November.20. 20:03:55 »
Will be cool.

Can we order these converters alongside the EnterMice, or will that not be the case ?
Z80 System