Build Your Own Arcade Controls Forum
Front End Support => MaLa Frontend => Topic started by: pb_sask on June 29, 2011, 06:05:19 pm
-
I wanted to write a quick plugin to display marquees on a second monitor by modifying the sample project, which I was able to successfully test using the malastub app. However when I want to display and image, I am taking the Marquee folder + rom + '.png' this is where the problem starts, if I dump this to a text field (Actually i used the form caption), the data passed to the type record is garbaged, its in japanese??? I tried opening the sample project and compiled it without any of my changes and I got the same thing the output file looks like this:
*************************************************************
EVENT: MaLa start
*************************************************************
EVENT: Game selected
Name: ?????????????)???C?N
Manufacturer: ???
Genre: ?????????l??
Year: 1993
Clone of: ??@??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Q?????j?u
I dont know if theres some compiler options I need or not or if Mala plugins just aint possible with the later versions of delphi.
I did try Lazarus but way to much effort just to display a png :D
-
Just to Update, I tried Lazarus and this just shuts down MaLaStub or throws an error, for me anyway
-
Yeah You probably can't as beyond Delphi 2007 they introduced 'unicode' support. Possibly that is effecting the message passing? Maybe there is a mode you can set to make code backward compatible?
-
Yeah You probably can't as beyond Delphi 2007 they introduced 'unicode' support. Possibly that is effecting the message passing? Maybe there is a mode you can set to make code backward compatible?
Thats pretty rubbish :( I will look throught the options, but as this would be the first time I have used delphi I aint really sure where I would look. Guess I will look for a 2007 version....
-
Yeah You probably can't as beyond Delphi 2007 they introduced 'unicode' support. Possibly that is effecting the message passing? Maybe there is a mode you can set to make code backward compatible?
Thats pretty rubbish :( I will look throught the options, but as this would be the first time I have used delphi I aint really sure where I would look. Guess I will look for a 2007 version....
It was only a guess. :dunno
I have a copy of Delphi 2010 (which is one version down from XE so I guess I could try it?
Also maybe I could buy the cheap Starter version of Delphi XE version and try and see if I can build plug-ins....?
http://www.embarcadero.com/products/delphi/starter (http://www.embarcadero.com/products/delphi/starter)
OK I just spent AU$194 more of my hard earnt cash at the MaLa project buying the uprgade version of Delphi XE Starter.
I will now see if I can make a plugin work
-
OK I confirm your findings.....
Using the same Plug-in sample code (provided with the MaLa plugin SDK) MaLaEventLogger I can see differences on the messages received by the Plugin build in 2007 compared to the one buile in Deplhi XE.
It receives the event calls OK but the 'string' data passed is rubbish. INtegers looks like they are passed ok.
I will see if there is anything I can do to fix this
Delphi 2007:
*************************************************************
EVENT: MaLa start -
*************************************************************
EVENT: Emulator selected
Name: M.A.M.E. v0.89 (Nov 24 2004)
Executable: C:\mametable\mame\mame89.exe
Command line: %rom%
-------------------- ROMFILES -------------------------------
Rom path: C:\mametable\mame\roms,,
Rom extensions: zip
-------------------- IMAGES ---------------------------------
Snap path: C:\mametable\mame\snaps
Marquee path: C:\Executable\marquee
CPanel path: C:\Executable\cpanel
Video path: C:\mametable\Videos
-------------------- ENCODER PROGRAMMING --------------------
Encoder default config file:
Encoder game based: 0
Encoder config file path:
Encoder config file extension:
*************************************************************
EVENT: Gamelist selected
Name: All Games
Game count: 201
Filter count: 201
*************************************************************
EVENT: Orientation switch
Orientation: 0
*************************************************************
EVENT: Game selected
Name: Paperboy (rev 1)
Manufacturer: Atari Games
Genre: Misc.
Year: 1984
Clone of: paperboy
-------------------- INPUTS ---------------------------------
Coins: 3
Buttons: 2
Players: 2P alt
Control: stick
-------------------- VIDEO ----------------------------------
Screen: raster
Orientation: horizontal
Video size: 512x384
-------------------- DRIVER ---------------------------------
Status: good
-------------------- CONTROLS.INI ---------------------------
Control: Misc
JoyUp:
JoyDown:
JoyLeft:
JoyRight:
Button1: Throw
Button2: Throw
Button3: not used
Button4: not used
Button5: not used
Button6: not used
Button7: not used
Button8: not used
-------------------- ROMFILE --------------------------------
Rom name: paperbr1
Rom path: C:\mametable\mame\roms
Rom extension: zip
-------------------- STATS ----------------------------------
Game played: 0
*************************************************************
EVENT: Game selected
Name: Pac-Man Plus
Manufacturer: [Namco] (Midway license)
Genre: Maze
Year: 1982
Clone of:
-------------------- INPUTS ---------------------------------
Coins: 2
Buttons: 1
Players: 2P alt
Control: joy4way
-------------------- VIDEO ----------------------------------
Screen: raster
Orientation: vertical
Video size: 224x288
-------------------- DRIVER ---------------------------------
Status: good
-------------------- CONTROLS.INI ---------------------------
Control: 4-way Joystick
JoyUp: Up
JoyDown: Down
JoyLeft: Left
JoyRight: Right
Button1: not used
Button2: not used
Button3: not used
Button4: not used
Button5: not used
Button6: not used
Button7: not used
Button8: not used
-------------------- ROMFILE --------------------------------
Rom name: pacplus
Rom path: C:\mametable\mame\roms
Rom extension: zip
-------------------- STATS ----------------------------------
Game played: 0
*************************************************************
EVENT: Game selected
Name: Pac-Man (Midway)
Manufacturer: [Namco] (Midway license)
Genre: Maze
Year: 1980
Clone of: puckman
-------------------- INPUTS ---------------------------------
Coins: 2
Buttons: 1
Players: 2P alt
Control: joy4way
-------------------- VIDEO ----------------------------------
Screen: raster
Orientation: vertical
Video size: 224x288
-------------------- DRIVER ---------------------------------
Status: good
-------------------- CONTROLS.INI ---------------------------
Control: 4-way Joystick
JoyUp: Up
JoyDown: Down
JoyLeft: Left
JoyRight: Right
Button1: not used
Button2: not used
Button3: not used
Button4: not used
Button5: not used
Button6: not used
Button7: not used
Button8: not used
-------------------- ROMFILE --------------------------------
Rom name: pacman
Rom path: C:\mametable\mame\roms
Rom extension: zip
-------------------- STATS ----------------------------------
Game played: 0
*************************************************************
EVENT: MaLa quit
*************************************************************
Delphi XE:
*************************************************************
EVENT: MaLa start
*************************************************************
EVENT: Emulator selected
Name: ?????????6????
Executable: ??????????????
Command line: ??%0
-------------------- ROMFILES -------------------------------
Rom path: ????????????
Rom extensions: ?p????????
-------------------- IMAGES ---------------------------------
Snap path: ???????????s
Marquee path: ??????????e
CPanel path: ??????????
Video path: ?????????s??
-------------------- ENCODER PROGRAMMING --------------------
Encoder default config file: ??@??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Q?????j?u
Encoder game based: 0
Encoder config file path: ??@??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Q?????j?u
Encoder config file extension: ??@??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Q?????j?u
*************************************************************
EVENT: Gamelist selected
Name: ????s
Game count: 201
Filter count: 201
*************************************************************
EVENT: Orientation switch
Orientation: 0
*************************************************************
EVENT: Game selected
Name: ????????
Manufacturer: ????????????
Genre: ??
Year: 1980
Clone of: ???n
-------------------- INPUTS ---------------------------------
Coins: 2
Buttons: 1
Players: ???
Control: ???y
-------------------- VIDEO ----------------------------------
Screen: ???
Orientation: ????
Video size: 224x288
-------------------- DRIVER ---------------------------------
Status: ??
-------------------- CONTROLS.INI ---------------------------
Control: ???????
JoyUp: ?
JoyDown: ??
JoyLeft: ??
JoyRight: ??t
Button1: ?4??
Button2: ?4??
Button3: ?4??
Button4: ?4??
Button5: ?4??
Button6: ?4??
Button7: ?4??
Button8: ?4??
-------------------- ROMFILE --------------------------------
Rom name: ???
Rom path: ???????????
Rom extension: ?p??
-------------------- STATS ----------------------------------
Game played: 0
*************************************************************
EVENT: MaLa quit
-
OK I worked it out ;D :cheers:
You can create Plug_ins using Delphi XE :applaud: :cheers: ;)
The only thing is due to 'Unicode' changes in Delphi 2009+ you need to treat strings differently.
This is easily done and is backward compatible.
Simply search and replace PChar with PAnsiChar in MaLaEventLogger.dll and eventdata.pas
I will change the SDk doc and exple in the next MaLa release..
Have fun :applaud:
-
Thx loadman
I had found this solution as well, the only issue is that this would cause a performance hit, I dont think its an issue with a MaLa plugin as this is pretty low overhead in the main. Sorry you had to purchase the XE version, I didnt have time to post the solution as I had been quite busy over the weekend.
Dont know if this is a noobie thing to say but another thing to note is that PAnsiChar doesnt always work the same as PChar, I dont know why, as i said I am not into Dephi at all. Once I did a find and replace to PAnsiChar, I couldnt compile my app due to a concatenation issue with Form1.Caption:=PAnsiChar + PAnsiChar + 'Some text'; I tried using strcat, but hit another error on compilation, in the end I declared my variable as string and just did String(PAnsiChar).
-
OK I just spent AU$194 more of my hard earnt cash at the MaLa project buying the uprgade version of Delphi XE Starter.
I'm surprised you didn't hit a Delphi forum, first......
-
OK I just spent AU$194 more of my hard earnt cash at the MaLa project buying the uprgade version of Delphi XE Starter.
I'm surprised you didn't hit a Delphi forum, first......
I wanted an excuse to buy to see if I could build MaLa in XE ;)