Dirt-cheap Vaus paddle clone for MSX

Page 4/4
1 | 2 | 3 |

By Danjovic

Master (197)

Danjovic's picture

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

By K72itNET

Rookie (18)

K72itNET's picture

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 ...

By Danjovic

Master (197)

Danjovic's picture

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.

By K72itNET

Rookie (18)

K72itNET's picture

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 ...

By Danjovic

Master (197)

Danjovic's picture

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.

By Danjovic

Master (197)

Danjovic's picture

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     ;   

By K72itNET

Rookie (18)

K72itNET's picture

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 ...

By Danjovic

Master (197)

Danjovic's picture

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?

Page 4/4
1 | 2 | 3 |