remove whitespaces
This commit is contained in:
parent
28adbd583a
commit
39ad3a268a
4 changed files with 29 additions and 29 deletions
|
@ -38,7 +38,7 @@ btn_map = {
|
|||
}
|
||||
|
||||
device = {
|
||||
# EV_ABS is for Absolute movement with static values,
|
||||
# EV_ABS is for Absolute movement with static values,
|
||||
# like the sticks and the volume
|
||||
e.EV_ABS: [
|
||||
(e.ABS_X, AbsInfo(0, -159, 159, 0, 10, 0)),
|
||||
|
@ -134,7 +134,7 @@ keys.CDown = 1<<31 # circle pad
|
|||
def press_key(key):
|
||||
ui.write(e.EV_KEY, key, 1)
|
||||
ui.syn()
|
||||
|
||||
|
||||
def release_key(key):
|
||||
ui.write(e.EV_KEY,key, 0)
|
||||
ui.syn()
|
||||
|
@ -152,11 +152,11 @@ while True:
|
|||
rawdata, addr = sock.recvfrom(4092)
|
||||
rawdata = bytearray(rawdata)
|
||||
# print("Received message", rawdata)
|
||||
|
||||
|
||||
if rawdata[0]==command.CONNECT:
|
||||
print("Connected with 3DS at address", addr)
|
||||
pass # CONNECT packets are empty
|
||||
|
||||
|
||||
if rawdata[0]==command.KEYS:
|
||||
# Just to explain this fuckery of struct.unpack:
|
||||
# <bbxxIhhHHhhBxxxhhhxx:
|
||||
|
@ -165,7 +165,7 @@ while True:
|
|||
# xx: Just 2 padding bytes, they are bytes without any data so with `xx` we skip them
|
||||
# I: A signed integer of 4 bytes, the `keys` pressed data is here
|
||||
# hh: 2 shorts which they are 2 bytes each one, 4 bytes on total, the X and Y data of the Circle Pad is here
|
||||
# HH: 2 shorts which they are 2 bytes each one, 4 bytes on total, the X and Y data of the Touch Pad is here
|
||||
# HH: 2 shorts which they are 2 bytes each one, 4 bytes on total, the X and Y data of the Touch Pad is here
|
||||
# (where are you pressing in the screen, it could be useful somehow I guess.)
|
||||
# hh: 2 shorts which they are 2 bytes each one, 4 bytes on total, the X and Y data of the C Stick Pad is here
|
||||
# B: A unsigned char, just 1 byte and represents the value of the Volume Slider of the 3DS
|
||||
|
@ -175,7 +175,7 @@ while True:
|
|||
# hhh: 3 shorts which they are 2 bytes each one, 6 bytes on total, the X, Y, Z data of the ACCELEROMETER is here
|
||||
# xxx: And another 2 extra bytes of padding from the fucking nowhere
|
||||
fields = struct.unpack("<bbxxIhhHHhhBxxxhhhxxhhhxx", rawdata)
|
||||
|
||||
|
||||
data = {
|
||||
"command": fields[0],
|
||||
"keyboardActive": fields[1],
|
||||
|
@ -194,17 +194,17 @@ while True:
|
|||
"accelY": fields[14],
|
||||
"accelZ": fields[15]
|
||||
}
|
||||
|
||||
|
||||
if (debug):
|
||||
def pprint(obj):
|
||||
import pprint
|
||||
pprint.PrettyPrinter().pprint(obj)
|
||||
pprint(data)
|
||||
|
||||
|
||||
newkeys = data["keys"] & ~prevkeys
|
||||
oldkeys = ~data["keys"] & prevkeys
|
||||
prevkeys = data["keys"]
|
||||
|
||||
|
||||
for btnid in range(16):
|
||||
if newkeys & (1<<btnid):
|
||||
press_key(btn_map[keynames[btnid]])
|
||||
|
@ -214,13 +214,13 @@ while True:
|
|||
press_key(btn_map["Tap"])
|
||||
if oldkeys & keys.Tap:
|
||||
release_key(btn_map["Tap"])
|
||||
|
||||
|
||||
|
||||
ui.write(e.EV_ABS, e.ABS_X, data["circleX"])
|
||||
ui.write(e.EV_ABS, e.ABS_Y, 0-data["circleY"])
|
||||
ui.write(e.EV_ABS, e.ABS_RX, data["cstickX"])
|
||||
ui.write(e.EV_ABS, e.ABS_RY, data["cstickY"])
|
||||
ui.write(e.EV_ABS, e.ABS_VOLUME, data["vol"])
|
||||
ui.write(e.EV_ABS, e.ABS_VOLUME, data["vol"])
|
||||
ui.syn()
|
||||
uiGyro.write(e.EV_ABS, e.ABS_X, data["accelX"])
|
||||
uiGyro.write(e.EV_ABS, e.ABS_Y, data["accelY"])
|
||||
|
|
|
@ -126,7 +126,7 @@ keys.GyroDown = 1<<35 # circle pad
|
|||
|
||||
def press_key(key):
|
||||
device.emit(key, 1)
|
||||
|
||||
|
||||
def release_key(key):
|
||||
device.emit(key,0)
|
||||
|
||||
|
@ -143,14 +143,14 @@ while True:
|
|||
rawdata, addr = sock.recvfrom(4092)
|
||||
rawdata = bytearray(rawdata)
|
||||
print("received message", rawdata, "from", addr)
|
||||
|
||||
|
||||
if rawdata[0]==command.CONNECT:
|
||||
print("Connected with 3DS at address",addr)
|
||||
pass # CONNECT packets are empty
|
||||
|
||||
|
||||
if rawdata[0]==command.KEYS:
|
||||
fields = struct.unpack("<bbxxIhhHHhhBxxxhhhxx", rawdata)
|
||||
|
||||
|
||||
data = {
|
||||
"command": fields[0],
|
||||
"keyboardActive": fields[1],
|
||||
|
@ -166,13 +166,13 @@ while True:
|
|||
"gyroY": fields[11],
|
||||
"gyroZ": fields[12]
|
||||
}
|
||||
|
||||
|
||||
pprint(data)
|
||||
|
||||
|
||||
newkeys = data["keys"] & ~prevkeys
|
||||
oldkeys = ~data["keys"] & prevkeys
|
||||
prevkeys = data["keys"]
|
||||
|
||||
|
||||
for btnid in range(16):
|
||||
if newkeys & (1<<btnid):
|
||||
press_key(btn_map[keynames[btnid]])
|
||||
|
@ -182,7 +182,7 @@ while True:
|
|||
press_key(btn_map["Tap"])
|
||||
if oldkeys & keys.Tap:
|
||||
release_key(btn_map["Tap"])
|
||||
|
||||
|
||||
|
||||
device.emit(uinput.ABS_X, data["circleX"], syn=False)
|
||||
device.emit(uinput.ABS_Y, 0-data["circleY"])
|
||||
|
|
|
@ -31,12 +31,12 @@ while True:
|
|||
rawdata, addr = sock.recvfrom(4092)
|
||||
rawdata = bytearray(rawdata)
|
||||
print("received message", rawdata)
|
||||
|
||||
|
||||
if rawdata[0]==command.CONNECT:
|
||||
print("Connected with 3DS at address",addr)
|
||||
pass # CONNECT packets are empty
|
||||
|
||||
|
||||
#pprint(data)
|
||||
|
||||
|
||||
if rawdata[0]==command.SCREENSHOT:
|
||||
pass # unused by both 3DS and PC applications
|
||||
|
|
|
@ -17,19 +17,19 @@ Option:
|
|||
MediaFootPadding : false # If true CCI files are created with padding
|
||||
EnableCrypt : false # Enables encryption for NCCH and CIA
|
||||
EnableCompress : true # Compresses where applicable (currently only exefs:/.code)
|
||||
|
||||
|
||||
AccessControlInfo:
|
||||
CoreVersion : 2
|
||||
|
||||
# Exheader Format Version
|
||||
DescVersion : 2
|
||||
|
||||
|
||||
# Minimum Required Kernel Version (below is for 4.5.0)
|
||||
ReleaseKernelMajor : "02"
|
||||
ReleaseKernelMinor : "33"
|
||||
ReleaseKernelMinor : "33"
|
||||
|
||||
# ExtData
|
||||
UseExtSaveData : false # enables ExtData
|
||||
UseExtSaveData : false # enables ExtData
|
||||
#ExtSaveDataId : 0x300 # only set this when the ID is different to the UniqueId
|
||||
|
||||
# FS:USER Archive Access Permissions
|
||||
|
@ -84,11 +84,11 @@ AccessControlInfo:
|
|||
# Virtual Address Mappings
|
||||
IORegisterMapping:
|
||||
- 1ff00000-1ff7ffff # DSP memory
|
||||
MemoryMapping:
|
||||
MemoryMapping:
|
||||
- 1f000000-1f5fffff:r # VRAM
|
||||
|
||||
# Accessible SVCs, <Name>:<ID>
|
||||
SystemCallAccess:
|
||||
SystemCallAccess:
|
||||
ArbitrateAddress: 34
|
||||
Backdoor: 123
|
||||
Break: 60
|
||||
|
@ -183,7 +183,7 @@ SystemControlInfo:
|
|||
# Modules that run services listed above should be included below
|
||||
# Maximum 48 dependencies
|
||||
# <module name>:<module titleid>
|
||||
Dependency:
|
||||
Dependency:
|
||||
ac: 0x0004013000002402
|
||||
act: 0x0004013000003802
|
||||
am: 0x0004013000001502
|
||||
|
|
Loading…
Add table
Reference in a new issue