Dirt-cheap Vaus paddle clone for MSX

Página 4/5
1 | 2 | 3 | | 5

Por Danjovic

Master (216)

Imagen del Danjovic

25-04-2020, 20:19

K72itNET wrote:

Thanks.... Very Great Job....
This is my first version of Arkanoid Reply Case....

Hi K72itNET, that's fantastic! Thanks for sharing! Smile

Por K72itNET

Rookie (19)

Imagen del K72itNET

27-04-2020, 12:23

Quote:

Hi K72itNET, that's fantastic! Thanks for sharing!

thank you... This is The Final Version....

soon I will share everything ...

I tested the pad with arkanoid on all three of my MSX (Sony HB-75P, Sony HB-F700P and Panasonic FS-A1WX) and it works great ... Like the original ...

It does not work with Arkanoid 2 .... The original works perfectly ... This is positioned either on the right or all on the left ...

Same problem with both Digi: Arka circuit and with Digi: Arka-> Pad ...

Por Danjovic

Master (216)

Imagen del Danjovic

27-04-2020, 14:29

Maybe the game do not support the paddle (like some versions of first game) or it uses a different protocol.
Second game is "revenge of doh" isn't? I can take a look.

Por K72itNET

Rookie (19)

Imagen del K72itNET

27-04-2020, 17:10

Yes ... Arkanoid II revenge of doh (MSX2) ...

I have the original version with controller (Red).

The original controller also works great with the first Arkanoid for MSX ...

Por Danjovic

Master (216)

Imagen del Danjovic

27-04-2020, 19:36

Quoting Mr Spock: Fascinating!

The fact that it works with the original controller takes down the hypothesis of a keyboard only version. Nevertheless I have found two versions of the game here and compared. One of the main differences is right on a block that reads the vaus paddle.
I will disassemble the code to investigate it further.

Por Danjovic

Master (216)

Imagen del Danjovic

28-04-2020, 07:09

I have just disassembled and studied the code from Arkanoid 2 and haven't seen any difference in the code that read paddles from the first tittle (Arkanoid 1).
The main difference is that the game checks if a paddle is connected on joystick port B.
It is worth to mention that in first game if you start the game with the space bar the game will assume you don't have a paddle and will not read the paddle anymore. Can you check this possibility @K72itNET?

ReadPaddles:
        ld      a,0fh           ;  43db 3e0f   ;  Select Register 15                            
        out     (0a0h),a        ;  43dd d3a0   ;   
        
        ld      a,3eh           ;  43df 3e3e   ;   Kana Jsel pls2 pls1 trb2 tra2 trb1 tra1
        out     (0a1h),a        ;  43e1 d3a1   ;     0    0    1    1    1    1    1    0
                                ;                         |    |    |                   +--clock = low
                                ;                         |    |    +---------------------- Pulse A = high
                                ;                         |    +--------------------------- Pulse B = low
                                ;                         +-------------------------------- Joystick A selected
                                ;
                                ;
        ld      a,0eh           ;  43e3 3e0e   ;  Select Register 14  
        out     (0a0h),a        ;  43e5 d3a0   ;     CasI KbdM TrgB TrgA Righ Left Down Up
        

        in      a,(0a2h)        ;  43e7 dba2   ;  Sample Most significant bit
        ld      h,a             ;  43e9 67     ;  Store in H
        ld      b,08h           ;  43ea 0608   ;  init loop counter: 8 times
        ld      c,00h           ;  43ec 0e00   ;  init shift register (C)
        ld      e,00h           ;  43ee 1e00   ;  no purpose
l43f0h:
        ld      a,0fh           ;  43f0 3e0f   ;  Select Register 15
        out     (0a0h),a        ;  43f2 d3a0   ;

        ld      a,3eh           ;  43f4 3e3e   ;  make clock low
        out     (0a1h),a        ;  43f6 d3a1   ;

        ld      a,3fh           ;  43f8 3e3f   ;  make clock high
        out     (0a1h),a        ;  43fa d3a1   ; 

        ld      a,0eh           ;  43fc 3e0e   ;  Select Register 14
        out     (0a0h),a        ;  43fe d3a0   ; 

        in      a,(0a2h)        ;  4400 dba2   ;  Sample bit
        ld      e,a             ;  4402 5f     ;
        srl     a               ;  4403 cb3f   ;

        rl      c               ;  4405 cb11   ;  Store bit in shift register (C)

        djnz    43f0h           ;  4407 10e7   ;  next bit
        
                                               ; here we have9 bit value
                                               ; H.0 most significant bit 
                                               ; C   least significant bits
        
        ld      a,c             ;  4409 79     ; store least significant bits
        ld      (0c208h),a      ;  440a 3208c2 ;

        ld      a,h             ;  440d 7c     ; isolate most significant bit
        and     01h             ;  440e e601   ;

        ld      (0c209h),a      ;  4410 3209c2 ; store most significant bit

                                               ; Now location 0c208h hold the 9 bit value

        ld      a,0fh           ;  4413 3e0f   ;  Select Register 15
        out     (0a0h),a        ;  4415 d3a0   ;  

        ld      a,3fh           ;  4417 3e3f   ;   make (sure) clock high
        out     (0a1h),a        ;  4419 d3a1   ;

                                               ; Generate a brief low pulse to start new sampling
                                               ;
        ld      a,2fh           ;  441b 3e2f   ;  make Pulse1 low
        out     (0a1h),a        ;  441d d3a1   ;   

        ld      a,3fh           ;  441f 3e3f   ;  make Pulse 1 high again
        out     (0a1h),a        ;  4421 d3a1   ;   


        ld      a,0eh           ;  4423 3e0e   ;  Select Register 14
        out     (0a0h),a        ;  4425 d3a0   ;

        in      a,(0a2h)        ;  4427 dba2   ;  sample joystick (port  A)
        cpl                     ;  4429 2f     ;  invert bits
        ld      e,a             ;  442a 5f     ;  save in e

        ld      hl,0c20bh       ;  442b 210bc2 ;  swap e with contents of 0c20bh
        ld      a,(hl)          ;  442e 7e     ;  e = new value
        ld      (hl),e          ;  442f 73     ;  a = last value

        and     0fh             ;  4430 e60f   ;  mask least significant bits  0 0 0 0 /R /L /D /U
        and     e               ;  4432 a3     ;  a = last & new
        xor     e               ;  4433 ab     ;  a = (last & new) ^ new
        ld      (0c20ch),a      ;  4434 320cc2 ;  save rising edges on 0c20ch

                                               ;  last  new  last&new  (last & new)^new
                                               ;   0     0       0           0
                                               ;   0     1       0           1   -> rising edge
                                               ;   1     0       0           0
                                               ;   1     1       1           0


        ld      a,0fh           ;  4437 3e0f   ;  Select Register 15
        out     (0a0h),a        ;  4439 d3a0   ; 


                                ; Prepare to sample Joystick port B
                                ;
        ld      a,7bh           ;  443b 3e7b   ;   Kana Jsel pls2 pls1 trb2 tra2 trb1 tra1
        out     (0a1h),a        ;  443d d3a1   ;     0    1    1    1    1    1    0    1
                                ;                         |    |    |                   +--clock = low
                                ;                         |    |    +---------------------- Pulse A = high
                                ;                         |    +--------------------------- Pulse B = low
                                ;                         +-------------------------------- Joystick A selected
                                ;



        ld      a,0eh           ;  443f 3e0e   ;  Select Register 14
        out     (0a0h),a        ;  4441 d3a0   ; 

        in      a,(0a2h)        ;  4443 dba2   ;  Sample Most significant bit
        ld      h,a             ;  4445 67     ;  Store in H   
        ld      b,08h           ;  4446 0608   ;  init loop counter: 8 times   
        ld      c,00h           ;  4448 0e00   ;  init shift register (C)   
        ld      e,00h           ;  444a 1e00   ;  no purpose   
l444ch:
        ld      a,0fh           ;  444c 3e0f   ;  Select Register 15   
        out     (0a0h),a        ;  444e d3a0   ;
    
        ld      a,7bh           ;  4450 3e7b   ;  make clock low   
        out     (0a1h),a        ;  4452 d3a1   ; 
    
        ld      a,7fh           ;  4454 3e7f   ;  make clock high   
        out     (0a1h),a        ;  4456 d3a1   ; 
   
        ld      a,0eh           ;  4458 3e0e   ;  Select Register 14   
        out     (0a0h),a        ;  445a d3a0   ; 
    
        in      a,(0a2h)        ;  445c dba2   ;  Sample bit   
        ld      e,a             ;  445e 5f     ;   
        srl     a               ;  445f cb3f   ;
  
        rl      c               ;  4461 cb11   ;  Store bit in shift register (C) 
        
        djnz    444ch           ;  4463 10e7   ;  next bit
 
        ld      a,c             ;  4465 79     ; Store 9 bit value in 0c210h (same as port A above)   
        ld      (0c210h),a      ;  4466 3210c2 ;   
        ld      a,h             ;  4469 7c     ;   
        and     01h             ;  446a e601   ;   
        ld      (0c211h),a      ;  446c 3211c2 ; 
        
        ld      a,0fh           ;  446f 3e0f   ; Issue a low pulse on joystick port B pin 8  
        out     (0a0h),a        ;  4471 d3a0   ;   
        ld      a,7fh           ;  4473 3e7f   ;   
        out     (0a1h),a        ;  4475 d3a1   ;   
        ld      a,5fh           ;  4477 3e5f   ;   
        out     (0a1h),a        ;  4479 d3a1   ;   
        ld      a,7fh           ;  447b 3e7f   ;   
        out     (0a1h),a        ;  447d d3a1   ;   
        
        ld      a,0eh           ;  447f 3e0e   ;  Sample joystick port B and store any rising edge 
        out     (0a0h),a        ;  4481 d3a0   ;  on directionals at address 0c214h 
        in      a,(0a2h)        ;  4483 dba2   ;   
        cpl                     ;  4485 2f     ;   
        ld      e,a             ;  4486 5f     ;   
        ld      hl,0c213h       ;  4487 2113c2 ;   
        ld      a,(hl)          ;  448a 7e     ;   
        ld      (hl),e          ;  448b 73     ;   
        and     0fh             ;  448c e60f   ;   
        and     e               ;  448e a3     ;   
        xor     e               ;  448f ab     ;   
        ld      (0c214h),a      ;  4490 3214c2 ;  
        
                                               ;  This last part of the code tests for the presence of 
                                               ;  a paddle controller on port B and return contents on 
                                               ;  variable at position 0c21ch
                                               ;  0: there is paddle controller on port B
                                               ;  1: there might be a paddle on connector A 
                                               ;
        ld      a,00h           ;  4493 3e00   ;  a=0, store in 0c21ch 
        ld      (0c21ch),a      ;  4495 321cc2 ;   
        
        ld      hl,(0c210h)     ;  4498 2a10c2 ;  point to 9 bit value read from port B 
        ld      de,01ffh        ;  449b 11ff01 ;   
        xor     a               ;  449e af     ;  make a=0 (again) 
        
        sbc     hl,de           ;  449f ed52   ;  if paddle was not connected on port B value read will be 1ffh (512)
        ret     nz              ;  44a1 c0     ;  a valid paddle will return a value inferior (and therefore different) to  512 
                                                

        ld      a,01h           ;  44a2 3e01   ;  Do this as a default, case no controller was detected on 
        ld      (0c21ch),a      ;  44a4 321cc2 ;  joystick port B 
        ret                     ;  44a7 c9     ;   

Por K72itNET

Rookie (19)

Imagen del K72itNET

28-04-2020, 11:31

I did these tests ...

The game even if started with the space bar works with the orginal pad normally ...
The control on port B is for the Vs. mode (2 Players). If the controller is not connected the 2 player uses the keyboard.
Starting to play with the keyboard (Controller disconnected) and plug during the game the original work fine ....

ARKAPAD is also recognized (like the original) ... But it doesn't work properly ....

I sent you an email with a video of the problem ...

Por Danjovic

Master (216)

Imagen del Danjovic

29-04-2020, 00:09

Haven't received the email yet. Did you sent it to hotmail?
Nevertheless maybe the glitch on the pulse line might be kicking in. Is it possible for you to put a 10n capacitor between pin 8 (pulse) and ground?

Por ducasp

Hero (550)

Imagen del ducasp

28-04-2022, 18:57

Danjovic,

Your .ino for the paddle that has both modes probably need some reviewing on standard mode. I've worked with FRS (that is an expert on MSX HID devices) as I've implemented a similar approach like you did and HIDTEST was not detecting it as a MSX Standard Paddle.

Basically, the changes should be quite simple:

- On standard mode, default data line state should be 0, not 1
- Once a pulse comes you start counting time according to the current position, like you are doing, and at the same time, raise the data line to 1
- Once the count finishes, add a extra 12us as the official design will use 12us for 0, 24us for 1, 36us for 2, etc...
- Ok, now you go back to default data line state of 0 and wait next pulse asking for data

While your approach kind of works on Galaga and BASIC, it is not following the official design of the paddle and thus not being detected by HIDTEST. That, on the other hand, means it won't be detected by HIDLIB and if someone decides to implement paddle support on their software using HIDLIB, it won't be recognized.

Hope that info helps, and thanks for sharing your project, it was really useful for me, specially to understand VAUS protocol, text description on the Wiki is way more complicated than it need to be for someone that intends to make a compatible VAUS paddle, and explains a lot of the circuit itself which made me think of it as way more complex than it really is to implement (if you don't bother to implement its imperfection and slowness to read position, your approach is perfect and I've used it to implement a paddle emulation over PS/2 mouse on FPGA MSX)

Por gdx

Enlighted (5503)

Imagen del gdx

29-04-2022, 02:36

K72itNET wrote:

thank you... This is The Final Version....

We can find better adjusting knob for cheap in trade. It would be better than a printed version of the original. I think the original diameter of the knob is too small. It would be better with one a bit wide.

Several examples:
https://www.ebay.com/itm/401153506171
https://www.ebay.com/itm/125149679486
https://www.ebay.com/itm/192895920115
https://www.ebay.com/itm/265172366447
https://www.ebay.com/itm/175247217702
https://www.ebay.com/itm/353912963731
https://www.ebay.com/itm/224055942483

And it would be perfect with the edges of the case a little rounded.

Página 4/5
1 | 2 | 3 | | 5