Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:20 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PZ Control - my quest for the perfect game controller

     Page 2 of 2    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4040
Posted: 11:04am 20 Dec 2023
Copy link to clipboard 
Print this post

  Mixtel90 said  Unfortunately I don't think I can emulate the WII Classic, but I'm open to putting the bits in any order. :)


I wasnt't asking for emulation, just the bits for the digital controls in the order I gave, which should be the same order as Peter's Wii Classic support on CMM2/PicoMite (and not coincidentally my "ctrl.inc" library). It is the closest to a "standard" that we have.

Best wishes,

Tom
Edited 2023-12-20 21:04 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6792
Posted: 01:19pm 20 Dec 2023
Copy link to clipboard 
Print this post

The bits will be returned as two bytes, I think. I2C under MMBasic seems to be strictly byte-orientated. Apart from that, no prob.  :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3802
Posted: 02:26pm 20 Dec 2023
Copy link to clipboard 
Print this post

Two bytes will be fine if they are like Tom posted, just join them together as 16 bits.

Possibly Windows will be awkward but should be able to map onto something the same or very close to Tom's list - I hope!

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6792
Posted: 09:12pm 21 Dec 2023
Copy link to clipboard 
Print this post

Revised:

J(U,D,L,R) = joystick virtual D0pad directions or LH buttons
JB = Joystick switch or Soft_Reset (always high on the Classic)
LT,RT = "shoulder" buttons
P, Z two buttons below Select & Start (replace ZL and ZR)

Command &h04
Returns two bytes:
Byte 1
JR, JD, LT, Select, Hone, Start, RT, JB
Byte 2
P, B, Y, A, X, Z, JL, JU

Incidentally, Nintendo stopped making the Classic and Classic Pro controllers about ten years ago. They simply dropped them with no official announcement.

.
Edited 2023-12-22 07:25 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 01:46am 22 Dec 2023
Copy link to clipboard 
Print this post

I would try massage those bit patterns somewhat more. The order is mostly right, but the positions are off by one.

From the Wii Classic docs:
  Quote  '     A bit will be set to 1 if the button is pressed.
' The button bitmap is as follows:
' BIT 0: Button R
' BIT 1: Button start
' BIT 2: Button home
' BIT 3: Button select
' BIT 4: Button L
' BIT 5: Button down cursor
' BIT 6: Button right cursor
' BIT 7: Button up cursor
' BIT 8: Button left cursor
' BIT 9: Button ZR
' BIT 10: Button x
' BIT 11: Button a
' BIT 12: Button y
' BIT 13: Button b
' BIT 14: Button ZL

Bit 15 is missing and could presumably be your extra signal.

What order does I2C sent the bits?
Visit Vegipete's *Mite Library for cool programs.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6792
Posted: 08:23am 22 Dec 2023
Copy link to clipboard 
Print this post

On the Classic controller the spare location is actually bit 0 - it's MMBasic that's wrong. :) I realized that this morning. Bit 0 always returns a 1.

Revised again:

J(U,D,L,R) = joystick virtual D0pad directions or LH buttons
JB = Joystick switch or Soft_Reset (always high on the Classic)
LT,RT = "shoulder" buttons
P, Z two buttons below Select & Start (replace ZL and ZR)

Command &h04
Returns two bytes:
Byte 1 (bits 7-0)
JU, JR, JD, LT, Select, Hone, Start, RT
Byte 2 (bits 15-8)
JB, P, B, Y, A, X, Z, JL

No idea about the I2C bit order. You shove a character (or an array in my case) in at one end and it pops out at the other. That's all I'm interested in. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024