Difference between revisions of "Tennis Cup 2 (cartridge)"

From CPCWiki - THE Amstrad CPC encyclopedia!
Jump to: navigation, search
(Analog Joystick)
(Analog Joystick)
Line 31: Line 31:
 
 
 
 
 
This games is pehaps the only one on Amstrad GX4000/Plus range to enable the use of an [[Analog Joysticks| Analog Joystick]], for the 2nd player.
 
This games is pehaps the only one on Amstrad GX4000/Plus range to enable the use of an [[Analog Joysticks| Analog Joystick]], for the 2nd player.
 +
* Player 1 can use Digital Joystick #1
 +
* Player 2 can use Digital Joystick #2, or alternately, Analog Joystick #1
 +
The game converts the analog inputs to digital-joystick-style "on/off" signals, so it isn't actually supporting "fast/slow" analog inputs.
  
ld      bc,0f40eh
+
  ld      bc,0f40eh
out    (c),c
+
  out    (c),c
ld      b,0f6h
+
  ld      b,0f6h
in      a,(c)
+
  in      a,(c)
and    30h
+
  and    30h
ld      c,a
+
  ld      c,a
or      0c0h
+
  or      0c0h
out    (c),a
+
  out    (c),a
out    (c),c
+
  out    (c),c
inc    b
+
  inc    b
ld      a,92h
+
  ld      a,92h
out    (c),a
+
  out    (c),a
push    bc
+
  push    bc
set    6,c
+
  set    6,c
ld      a,09h ;; keyboard line for joy 0
+
  ld      a,09h ;; keyboard line for joy 0
or      c
+
  or      c
ld      b,0f6h
+
  ld      b,0f6h
out    (c),a
+
  out    (c),a
ld      b,0f4h
+
  ld      b,0f4h
in      a,(c)
+
  in      a,(c)
cpl    
+
  cpl
ld      (8082h),a ;; joy 0
+
  ld      (8082h),a                     ;; joy 0
push    af
+
  push    af
ld      a,06h ;; keyboard line for joy 1
+
  ld      a,06h ;; keyboard line for joy 1
or      c
+
  or      c
ld      b,0f6h
+
  ld      b,0f6h
out    (c),a
+
  out    (c),a
ld      b,0f4h
+
  ld      b,0f4h
in      a,(c)
+
  in      a,(c)
cpl    
+
  cpl
ld      (8083h),a ;; joy 1
+
  ld      (8083h),a                     ;; joy 1
pop    de
+
  pop    de
or      d
+
  or      d
ld      (8086h),a
+
  ld      (8086h),a
ld      a,03h
+
  ld      a,03h
or      c
+
  or      c
ld      b,0f6h
+
  ld      b,0f6h
out    (c),a
+
  out    (c),a
ld      b,0f4h
+
  ld      b,0f4h
in      a,(c)
+
  in      a,(c)
cpl    
+
  cpl
ld      (8084h),a ;; pause?
+
  ld      (8084h),a                     ;; pause?
pop    bc
+
  pop    bc
ld      a,82h
+
  ld      a,82h
out    (c),a
+
  out    (c),a
dec    b
+
  dec    b
out    (c),c
+
  out    (c),c
ld      bc,7fb8h
+
  ld      bc,7fb8h
out    (c),c
+
  out    (c),c
ld      c,00h
+
  ld      c,00h
ld      a,(6808h) ;; analogue input channel 0
+
  ld      a,(6808h)             ;; analogue input channel 0
sub    1fh
+
  sub    1fh
cp      14h
+
  cp      14h
jp      p,261fh
+
  jp      p,261fh
cp      0ech
+
  cp      0ech
jp      m,2623h
+
  jp      m,2623h
jr      2625h
+
  jr      2625h
  261f set    3,c ;; right
+
  261f:
jr      2625h
+
  set    3,c                           ;; right
  2623 set    2,c ;; left
+
  jr      2625h
  2625 ld      a,(6809h) ;; analogue input channel 1
+
  2623:
sub    1fh
+
  set    2,c                           ;; left
cp      14h
+
  2625:
jp      p,2639h
+
  ld      a,(6809h)             ;; analogue input channel 1
cp      0ech
+
  sub    1fh
jp      p,263bh
+
  cp      14h
  2634 set    0,c ;; up
+
  jp      p,2639h
jp      263bh
+
  cp      0ech
  2639 set    1,c ;; down
+
  jp      p,263bh
  263b ld      a,(8082h) ;; joy 0 fire.
+
  2634:
and    10h
+
  set    0,c                           ;; up
or      c
+
  jp      263bh
ld      (8085h),a
+
  2639:
 +
  set    1,c                           ;; down
 +
  263b:
 +
  ld      a,(8082h)             ;; joy 0 fire.
 +
  and    10h
 +
  or      c
 +
  ld      (8085h),a
  
 
The keyboard is read to determine the state of the digital joysticks and the P button (pause button on gx4000 console).
 
The keyboard is read to determine the state of the digital joysticks and the P button (pause button on gx4000 console).

Revision as of 20:30, 2 February 2010

Cover

Covers from CPCmania

Cartridge

Manual

You can download in PDF from CPCmania ( See the links ).

Game

You can download in CPR for use in emulators and BIN from CPCmania ( See the links ).


Analog Joystick

This games is pehaps the only one on Amstrad GX4000/Plus range to enable the use of an Analog Joystick, for the 2nd player.

  • Player 1 can use Digital Joystick #1
  • Player 2 can use Digital Joystick #2, or alternately, Analog Joystick #1

The game converts the analog inputs to digital-joystick-style "on/off" signals, so it isn't actually supporting "fast/slow" analog inputs.

 ld      bc,0f40eh
 out     (c),c
 ld      b,0f6h
 in      a,(c)
 and     30h
 ld      c,a
 or      0c0h
 out     (c),a
 out     (c),c
 inc     b
 ld      a,92h
 out     (c),a
 push    bc
 set     6,c
 ld      a,09h ;; keyboard line for joy 0
 or      c
 ld      b,0f6h
 out     (c),a
 ld      b,0f4h
 in      a,(c)
 cpl
 ld      (8082h),a                     ;; joy 0
 push    af
 ld      a,06h ;; keyboard line for joy 1
 or      c
 ld      b,0f6h
 out     (c),a
 ld      b,0f4h
 in      a,(c)
 cpl
 ld      (8083h),a                     ;; joy 1
 pop     de
 or      d
 ld      (8086h),a
 ld      a,03h
 or      c
 ld      b,0f6h
 out     (c),a
 ld      b,0f4h
 in      a,(c)
 cpl
 ld      (8084h),a                     ;; pause?
 pop     bc
 ld      a,82h
 out     (c),a
 dec     b
 out     (c),c
 ld      bc,7fb8h
 out     (c),c
 ld      c,00h
 ld      a,(6808h)             ;; analogue input channel 0
 sub     1fh
 cp      14h
 jp      p,261fh
 cp      0ech
 jp      m,2623h
 jr      2625h
261f:
 set     3,c                           ;; right
 jr      2625h
2623:
 set     2,c                           ;; left
2625:
 ld      a,(6809h)             ;; analogue input channel 1
 sub     1fh
 cp      14h
 jp      p,2639h
 cp      0ech
 jp      p,263bh
2634:
 set     0,c                           ;; up
 jp      263bh
2639:
 set     1,c                           ;; down
263b:
 ld      a,(8082h)             ;; joy 0 fire.
 and     10h
 or      c
 ld      (8085h),a

The keyboard is read to determine the state of the digital joysticks and the P button (pause button on gx4000 console).

The routine reads analogue input channel 0 and 1 for the analogue joystick and performs some checking to see the range of the numbers. Based on this it sets the direction pressed.

Links

http://www.cpcmania.com/ ( on the games section : GX4000/CPC+ GAMES )