From 09b77068ea103c4cc862e5fd3c5d404a40a58000 Mon Sep 17 00:00:00 2001 From: Adam Preble Date: Sun, 7 Jun 2009 14:47:20 -0400 Subject: [PATCH 1/5] Python: Added procgame, various driver and switch calls to pypinproc. --- examples/pinproctest/TZ.yaml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/examples/pinproctest/TZ.yaml b/examples/pinproctest/TZ.yaml index 196c9e1..53178b4 100644 --- a/examples/pinproctest/TZ.yaml +++ b/examples/pinproctest/TZ.yaml @@ -22,6 +22,24 @@ PRSwitches: number: S34 slingR: number: S35 + outhole: + number: S18 + troughFarLeft: + number: S25 + troughLeft: + number: S17 + troughMiddle: + number: S16 + troughRight: + number: S15 + shooterLane: + number: S27 + startButton: + number: S13 + rocketKickout: + number: S28 + slotKickout: + number: S58 PRCoils: flipperLwRMain: number: 32 @@ -52,5 +70,7 @@ PRCoils: ballRelease: number: C09 PRLamps: - doorTheCamera: + startButton: + number: L88 + doorTheCamera: number: L11 \ No newline at end of file From f5a65921c900e35cbc0e8ae6a1b3b5f07a3dc096 Mon Sep 17 00:00:00 2001 From: Adam Preble Date: Sun, 21 Jun 2009 15:36:18 -0400 Subject: [PATCH 2/5] Updated instructions to reflect libusb-1.0. More JD.yaml. --- README.markdown | 11 +++++++- examples/pinproctest/JD.yaml | 50 ++++++++++++++++++++++++++++++------ 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/README.markdown b/README.markdown index 965fd17..348d05c 100644 --- a/README.markdown +++ b/README.markdown @@ -8,7 +8,8 @@ Library for Gerry Stellenberg's [P-ROC](http://pinballcontrollers.com/) (Pinball libpinproc requires: -- [libusb-0.1.12](http://libusb.wiki.sourceforge.net/): Install with the default /usr/local prefix. +- [libusb-0.1.12](http://libusb.wiki.sourceforge.net/): Install with the default /usr/local prefix. Version 0.1.12 has been tested on Mac and Linux. Mac users: If you want to use libpinproc under Cocoa or pygame, you may wish to try libusb 1.0. See below. + - [libftdi-0.16](http://www.intra2net.com/en/developer/libftdi/): Install with the default /usr/local prefix. The pinproctest example requires [yaml-cpp](http://code.google.com/p/yaml-cpp/). Follow the build instructions, creating the build subdirectory. After building, from the main source directory, run the following commands to manually install it: @@ -17,6 +18,14 @@ The pinproctest example requires [yaml-cpp](http://code.google.com/p/yaml-cpp/). sudo mkdir /usr/local/include/yaml-cpp sudo cp include/*.h /usr/local/include/yaml-cpp/ +##### libusb-1.0 and libusb-compat + +Version 1.0.2 does not work out of the box since libftdi is written against libusb-0.1. You can use the libusb-compat-0.1.2 project, however, which creates a library that provides the older libusb interface. Because Macs do not come with pkg-config, you may need to run configure for libusb-compat as follows: + + ./configure LIBUSB_1_0_CFLAGS=-I/usr/local/include/libusb-1.0 LIBUSB_1_0_LIBS="-L/usr/local/lib -lusb-1.0" + +Note that libusb-1.0 must have been built and installed prior to this step. This also assumes that you installed libusb-1.0 with the default /usr/local prefix. + #### Building with CMake Download and install [CMake](http://www.cmake.org/cmake/resources/software.html). Then: diff --git a/examples/pinproctest/JD.yaml b/examples/pinproctest/JD.yaml index 39ca4e5..cfa67d3 100644 --- a/examples/pinproctest/JD.yaml +++ b/examples/pinproctest/JD.yaml @@ -11,17 +11,43 @@ PRBumpers: - slingR PRSwitches: flipperLwR: - number: 1 + number: SF2 flipperLwL: - number: 3 + number: SF4 flipperUpR: - number: 5 + number: SF6 flipperUpL: - number: 7 + number: SF8 + fireL: + number: S11 + fireR: + number: S12 + startButton: + number: S13 + shooterLane: + number: S27 + buyIn: + number: S31 + ballShooter: + number: S41 + superGame: + number: S44 slingL: - number: 96 + number: S51 slingR: - number: 97 + number: S52 + outhole: + number: S18 + trough1: + number: S81 + trough2: + number: S82 + trough3: + number: S83 + trough4: + number: S84 + trough6: + number: S85 PRCoils: flipperLwRMain: number: 32 @@ -40,6 +66,14 @@ PRCoils: flipperUpLHold: number: 39 slingL: - number: 54 + number: C15 slingR: - number: 55 \ No newline at end of file + number: C16 + resetDropTarget: + number: C05 + trough: + number: C13 + shooterR: + number: C08 + shooterL: + number: C09 \ No newline at end of file From b106f44e8ad3941fcbff1ee45be613428ed6eec9 Mon Sep 17 00:00:00 2001 From: Adam Preble Date: Mon, 22 Jun 2009 18:31:38 -0400 Subject: [PATCH 3/5] Python progress. Bugfix in PRDevice.cpp. --- examples/pinproctest/JD.yaml | 57 +++++++++++++++++++++++++++--------- src/PRDevice.cpp | 6 ++-- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/examples/pinproctest/JD.yaml b/examples/pinproctest/JD.yaml index cfa67d3..e474b99 100644 --- a/examples/pinproctest/JD.yaml +++ b/examples/pinproctest/JD.yaml @@ -24,11 +24,13 @@ PRSwitches: number: S12 startButton: number: S13 - shooterLane: - number: S27 + shooterL: + number: S15 + shooterR: + number: S41 buyIn: number: S31 - ballShooter: + ballShooterR: number: S41 superGame: number: S44 @@ -36,8 +38,10 @@ PRSwitches: number: S51 slingR: number: S52 - outhole: - number: S18 + popperL: + number: S73 + popperR: + number: S74 trough1: number: S81 trough2: @@ -46,8 +50,12 @@ PRSwitches: number: S83 trough4: number: S84 - trough6: + trough5: number: S85 + trough6: + number: S86 + troughTop: + number: S87 PRCoils: flipperLwRMain: number: 32 @@ -65,15 +73,36 @@ PRCoils: number: 38 flipperUpLHold: number: 39 + popperL: + number: C02 + popperR: + number: C03 + resetDropTarget: + number: C05 + shooterR: + number: C08 + shooterL: + number: C09 + trough: + number: C13 slingL: number: C15 slingR: number: C16 - resetDropTarget: - number: C05 - trough: - number: C13 - shooterR: - number: C08 - shooterL: - number: C09 \ No newline at end of file +PRLamps: + buyIn: + number: L38 + superGame: + number: L87 + startButton: + number: L88 + gi01: + number: G01 + gi02: + number: G02 + gi03: + number: G03 + gi04: + number: G04 + gi05: + number: G05 \ No newline at end of file diff --git a/src/PRDevice.cpp b/src/PRDevice.cpp index 84fbe0b..f77cf0c 100644 --- a/src/PRDevice.cpp +++ b/src/PRDevice.cpp @@ -726,7 +726,7 @@ PRResult PRDevice::PrepareWriteData(uint32_t * words, int32_t numWords) // words will be too many, flush the currently prepared words to the P-ROC now. if (numPreparedWriteWords + numWords > maxWriteWords) { - if (FlushWriteData() == kPRFailure); + if (FlushWriteData() == kPRFailure) return kPRFailure; } @@ -786,13 +786,15 @@ PRResult PRDevice::WriteData(uint32_t * words, int32_t numWords) PRResult PRDevice::WriteDataRaw(uint32_t moduleSelect, uint32_t startingAddr, int32_t numWriteWords, uint32_t * writeBuffer) { + PRResult res; uint32_t * buffer; buffer = (uint32_t *)malloc((numWriteWords * 4) + 1); buffer[0] = CreateBurstCommand(moduleSelect, startingAddr, numWriteWords); memcpy(buffer+1, writeBuffer, numWriteWords * 4); - WriteData(buffer, numWriteWords + 1); + res = WriteData(buffer, numWriteWords + 1); free (buffer); + return res; } PRResult PRDevice::ReadDataRaw(uint32_t moduleSelect, uint32_t startingAddr, int32_t numReadWords, uint32_t * readBuffer) From 817ff655c1f303f430beed340f2534f6f993b284 Mon Sep 17 00:00:00 2001 From: Adam Preble Date: Tue, 23 Jun 2009 21:50:54 -0400 Subject: [PATCH 4/5] Added BasicDropTargetBank mode. Reorganized procgame module. --- examples/pinproctest/JD.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/examples/pinproctest/JD.yaml b/examples/pinproctest/JD.yaml index e474b99..26e569e 100644 --- a/examples/pinproctest/JD.yaml +++ b/examples/pinproctest/JD.yaml @@ -38,6 +38,18 @@ PRSwitches: number: S51 slingR: number: S52 + captiveBall2: + number: S53 + dropTargetJ: + number: S54 + dropTargetU: + number: S55 + dropTargetD: + number: S56 + dropTargetG: + number: S57 + dropTargetE: + number: S58 popperL: number: S73 popperR: @@ -92,6 +104,16 @@ PRCoils: PRLamps: buyIn: number: L38 + dropTargetJ: + number: L71 + dropTargetU: + number: L72 + dropTargetD: + number: L73 + dropTargetG: + number: L74 + dropTargetE: + number: L75 superGame: number: L87 startButton: From ac902479029a3c5fa7983ac70320972a2bf3a340 Mon Sep 17 00:00:00 2001 From: Adam Preble Date: Thu, 25 Jun 2009 19:47:45 -0400 Subject: [PATCH 5/5] Implemented ProgressiveDropTargetBank. Moved some procgame methods/vars to be private. Added enable_flippers(); load_config() no longer does this automatically. --- examples/pinproctest/JD.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/pinproctest/JD.yaml b/examples/pinproctest/JD.yaml index 26e569e..4a1ad57 100644 --- a/examples/pinproctest/JD.yaml +++ b/examples/pinproctest/JD.yaml @@ -26,6 +26,10 @@ PRSwitches: number: S13 shooterL: number: S15 + subwayEnter1: + number: S37 + subwayEnter2: + number: S38 shooterR: number: S41 buyIn: