## VISUAL PINMAME COM OBJECT PROPERTY/METHOD REFERENCE
#### Version 0.99 Beta 2
The following is a list of all properties and methods made accessible by VPinMAME's COM interface, with details below.

Summary

Properties | Methods
--- | ---
GameName | Running
Pause | Dip
HandleMechanics | WPCNumbering
Lamp | Solenoid
Switch | GIString
ChangedLamps | ChangedSolenoids
ChangedGI | DoubleSize
SplashInfoLine | ShowFrame
BorderSizeX | BorderSizeY
WindowPosX | WindowPosY
ShowTitle | HandleKeyboard
ShowDMDOnly | SampleRate
Antialias | LockDisplay
Version |
Run | Stop
ShowOptsDialog | ShowAboutDialog
ShowPathesDialog | CheckROMS
SetDisplayPosition |

Details

Visual PinMAME Control |
--- | ---
Properties
GameName | Read/Write
Initializes VPinMAME for game "gameName". gameName: PinMAME short name (e.g. "tz_94h") (See gamelist.txt for all gamenames supported in PinMAME!) Example: Controller.GameName = "tz_94h" If Controller.GameName = "tz_94h" Then ...
Running | Read Only
Returns True if the emulation is running, False otherwise. Example: If Controller.Running Then ...
Pause | Read/Write
Setting this property to True will "Pause" the current emulation. Setting it to false will "Resume" a paused emulation. Example: Controller.Pause = True If Controller.Pause Then ...
Version | Read Only
Returns the version number of Visual PinMAME as an 8-digit string "vvmmbbrr": vv = Major version mm = Minor version bb = Beta version rr = Revision Example: A result of "00990201" signifies "Version 0.99 Beta 2 Rev A If (Controller.Version<"00990201") Then MsgBox "You need a newer version of VPinMAME." : Exit Sub
Methods
Run(parentWindow, minVersion)
Starts Visual PinMAME emulation of game specified with .GameName property parentWindow: handler of window to put outputin. (Default= 0 -> no parent window) minVersion: Minimum version of Visual PinMAME (e.g. 100 for 1.00) required to run this game! (Default=any version) Example: Controller.Run 0,110 ' VPinMAME 1.1 or higher required
Stop
Stops Visual PinMAME emulation. Example: Controller.Stop

Game Settings |
--- | ---
Properties
Dip (Dip Bank Number) | Read/Write
Sets/Gets the Dip switch settings for the current game. Dip Bank Number: dip 1-8 = bank 0, dip 9-16 = bank 1 ... value: binary value to set the dips 1=On, 0=Off Example: Controller.Dip(0) = &H55 Controller.Dip(1) = &Haa
HandleMechanics | Read/Write
If the game has a PinMAME simulator it can be used to simulate hardware "toys". value: # of which Mechanics VPinMAME should handle. Look at the PinMAME simulator source for each specific game to determine the #. Example: ' For TZ: 1=Clock, 2=Gumball Machine Controller.HandleMechanics = 1+2 ' Handle both Clock and gumball machine
WPCNumbering | Read Only
Determine if game uses WPC Numbering of Switches and Lamps WPCNumbering = Column*10 + Row (11,12,13,14,15,16,17,18,21,22...) non WPCnumbering = 1,2,3,4,... Example: If WPCNumbering Then firstSwitch = 1 Else firstSwitch = 11
SampleRate | Read/Write
Sets/Gets the sample rate Example: Controller.SampleRate = 22050
Methods
None

Customization |
--- | ---
Properties
SplashInfoLine | Read/Write
Game credits to display in startup splash screen. Example: Controller.SplashInfoLine = "Game design by ..."
ShowFrame | Read/Write
Enabled/Disables the window border Only works if ShowTitle is set to False! Example: Controller.ShowFrame = True 'Show a frame around the VPinMAME window
DoubleSize | Read/Write
Sets Visual PinMAME window to Double Size or Normal Size. Returns whether Window is Double Size or not. Example: Controller.DoubleSize = True 'Make Visual PinMAME Window Double Sized!
Antialias | Read/Write
Enables/disables scan lines/coumns between the dots of the DMD. Default value is True. Returns whether the scanlines are enabled or not. Set this property before the emulation starts. Example: Controller.Antialias = True 'Enable the scanlines
BorderSizeX BorderSizeY | Read/Write
Sets & Gets the size of an empty area around the DMD Display Default value is 4 Pixels Example: Controller.BorderSizeX = 20 '20 Pixels of space On Left & Right sides of DMD Controller.BorderSizeY = 20 '20 Pixels of space On Top & Bottom sides of DMD
WindowPosX WindowPosY | Read/Write
Sets & Gets the position of the Display Window Example: Controller.WindowPosX = 100 'Set X Position of Window to 100 Controller.WindowPosY = 100 'Set Y Position of Window to 100
LockDisplay | Read/Write
Sets/Gets the lock state of the display If the display is locked no keyboard events are handled and the display can't be the active window! Example: Controller.LockDisplay = True
Methods
SetDisplayPosition(x,y,hWnd)
Sets the position of the display to x and y; if hWnd is a valid window handle, x and y are assumed to be relative to the window, so this function calculates the proper screen position of the display Example: Controller.SetDisplayPosition(100,100,hWnd) 'hWnd = Handle of a Window.
ShowOptsDialog(hWnd)
Shows the options dialog for the current game or set default options if no game name is set. The hWnd is the handle of the parent window, default is 0 (no parent window). Example:< BR > Controller.ShowOptsDialog
ShowPathesDialog(hWnd)
Shows the pathes dialog where the user can set the diffrent pathes (ROMS, Cfg, Screenshots). The hWnd is the handle of the parent window, default is 0 (no parent window). Example:< BR > Controller.ShowPathesDialog
ShowAboutDialog(hWnd)
Displays the About dialog of Visual PinMAME. The hWnd is the handle of the parent window, default is 0 (no parent window). Example:< BR > Controller.ShowAboutDialog
CheckROMS(nShowOptions,hWnd)
Checks the rom set for the current game and displays the results. nShowOptions: 0 = Allways displays the results 1 = Only displays the results if there are errors found 2 = Never displays the results Return value is true if the roms are good. The hWnd is the handle for the parent window, default is 0 (no parent window) Example: Controller.CheckROMS(0,hWnd) : Displays the results of the ROM check (hWnd = Handle of a Window)
Aggregate Polling Functions |
--- | ---
These properties return a matrix with everything that has changed since the last call. The array contains the following info Matrix(0,0) Number of first changed item Matrix(0,1) New status of first item Matrix(1,0) Number of second changed item
Properties
ChangedLamps | Read Only
Returns which lamps have changed since last call to this property! Example: chg = Controller.ChangedLamps count = UBound(chg) If count > 0 Then For ii = 0 To count Text = "Lamp " & chg(ii,0) & "=" & chg(ii,1) Next End if
ChangedSolenoids | Read Only
Same as ChangedLamps but for solenoids
ChangedGI | Read Only
Same as ChangedLamps but for GI strings
Methods
None
Game Input/Output |
--- | ---
Properties
Lamp(number) | Read Only
Get status of a single lamp number: lamp # return: True = Lamp on, False = Lamp off Example: If Controller.Lamp(32) = True Then 'Light #32 is on.. Else 'Light #32 is off.. End If
Solenoid(number) | Read Only
Get status of a single solenoid number: solenoid # return: True = Solenoid on, False = Solenoid off Example: If Controller.Solenoid(5) = True Then 'Solenoid #5 is on.. Else 'Solenoid #5 is off.. End If
GIString(number) | Read Only
Get status of a single GI String (Note: Works only for WPC Game!) number: GI String # return: True = GI String on, False = GI String off Example: If Controller.GIString(5) = True Then 'GI String #5 is on.. > Else 'GI String #5 is off.. End If
Switch(number) | Read/Write
Get Or Set the status of a single switch number: Switch # setting/returning: True = Switch On, False = Switch Off Example: (SETTING) Controller.Switch(25) = True 'Turn Switch 25 on.. (GETTING) If Controller.Switch(25) = True Then 'Switch #25 is on.. Else 'Switch #25 is off.. End If
Methods
None
Debugging |
--- | ---
Properties
ShowDMDOnly | Read/Write
Enable/disable VPinMAME status matrices. Set this property before the emulation starts. Example: Controller.ShowDMDOnly = False 'Do NOT Display lamp,switch and solenoid matrix
HandleKeyboard | Read/Write
If set to True, VPinMAME will process the keyboard. Standard MAME keys can be used in VPinMAME output window. Also the internal ball simulator is enabled. If set to False, the scripting language will process the keyboard. Set this property before the emulation starts. Example: Controller.HandleKeyboard = True 'Let VPinMAME handle Keyboard input
ShowTitle | Read/Write
Show title bar on VPinMAME output window (to move it around) Example: Controller.ShowTitle = True 'Display the Title Bar
Methods
None
Events |
--- | ---
May not be supported in all scripting environments!
OnSolenoid(solenoidNo, isActive)
Called whenever a solenoid changes state
OnStateChange(newState)
Called whenever the emulation is started or stopped (not called on Pause)