Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: My Mame Frontend...  (Read 2491 times)

0 Members and 1 Guest are viewing this topic.

Nightmare03

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:August 18, 2007, 07:20:34 am
  • Stupid llama!
My Mame Frontend...
« on: January 17, 2004, 10:24:09 am »
Help me!

I code the games into it like this :

If GetAsyncKeyState(vbKeyQ) Then
If List1.Text = " Arlington Horse Racing" Then
Shell ("mame arlingtn")
Timer1.Enabled = False
Timer2.Enabled = False
Else
If GetAsyncKeyState(vbKeyQ) Then
If List1.Text = " Arm Wrestling" Then
Shell ("mame armwrest")
Timer1.Enabled = False
Timer2.Enabled = False
Else

Etc.. I know its a mess and theres better ways but it works, but you should see the amount of "End If's" Ive put in all the A, B, C, D Games but now i get Procedure Too Long!! Can anyone help?!?!

Thanks,

-Nightmare

Nightmare03

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:August 18, 2007, 07:20:34 am
  • Stupid llama!
Re:My Mame Frontend...
« Reply #1 on: January 17, 2004, 10:57:33 am »
Ok nevermind, i should use my brain before i go asking people lol.

I just put each Letter group in its own sub.

-Nightmare

PacManFan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 858
  • Last login:December 06, 2005, 12:18:56 pm
    • Kymaera Home Page
Re:My Mame Frontend...
« Reply #2 on: January 17, 2004, 01:01:14 pm »
Well, one suggestion, is to keep 2 lists, 1 list can contain the description, and one can contain the rom name. If they are added in the same order, this will work. When the user selects a game out of one list, Find the index of that item, and use the index to get the rom name out of the other list. Then, use that string to launch the game. I hope this helps.



-Steve (PMF)
All Hail Smezznar! The Giant purple centipede of Omnicron 5. Regail him with your odiferous offerings of onion powder!

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:June 20, 2025, 12:57:54 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:My Mame Frontend...
« Reply #3 on: January 17, 2004, 07:55:46 pm »
Another tip.... I wouldn't reccomend using getasynckeystate unless you really have too.  One of the odd features (read bugs) of using that function in vb is that it gets the keys regardless of weather the app has focus or not.  This can be very bad.  Good ole form keyup/keydown should work just fine if you have keypreview turned on.  

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:My Mame Frontend...
« Reply #4 on: January 18, 2004, 10:17:33 am »
Another tip.... I wouldn't reccomend using getasynckeystate unless you really have too.  One of the odd features (read bugs) of using that function in vb is that it gets the keys regardless of weather the app has focus or not.  This can be very bad.  Good ole form keyup/keydown should work just fine if you have keypreview turned on.  

Yep, that's the way I do it - simple but effective :)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:June 20, 2025, 12:57:54 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:My Mame Frontend...
« Reply #5 on: January 18, 2004, 11:13:34 pm »
It's actually how I still do it too.  Even directinput isn't super reliable when it's linked to vb.  Go figure.  

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8187
  • Last login:Yesterday at 10:39:10 am
  • The Bears Still Suck!
Re:My Mame Frontend...
« Reply #6 on: January 18, 2004, 11:57:35 pm »
mame -listinfo



make a lookup table with that :)
BTW, goto http://fe.donkeyfly.com  register, and pm me to add you to the programmers areas :)
« Last Edit: January 20, 2004, 03:33:54 am by SirPoonga »

Nightmare03

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:August 18, 2007, 07:20:34 am
  • Stupid llama!
Re:My Mame Frontend...
« Reply #7 on: January 19, 2004, 07:44:36 pm »
Hey thanks for all the replies, i havent checked this topic for a while...

So i did use

If GetAsyncKeyState(vbKeyQ)

BUT, i was wondering, how can i disable timers if the form loses focus ( when mame loads... ) if i cant do it this way is there any other way?

i did it like this

Private Sub Form_GotFocus()
timer1.Enabled = True
Timer2.Enabled = True

but it doesnt work

I also used the gamelist on mames site for the info on what filenames go with which title...

-Nightmare

Nightmare03

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:August 18, 2007, 07:20:34 am
  • Stupid llama!
Re:My Mame Frontend...
« Reply #8 on: January 19, 2004, 07:55:08 pm »
htpps://fe.donkeyfly.com .. you mean http://www.fe.donkeyfly.com/? :)

Ill register,

Nightmare

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8187
  • Last login:Yesterday at 10:39:10 am
  • The Bears Still Suck!
Re:My Mame Frontend...
« Reply #9 on: January 20, 2004, 03:33:32 am »
htpps://fe.donkeyfly.com .. you mean http://www.fe.donkeyfly.com/? :)

Ill register,

Nightmare

Both work if you don't make typos :)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:June 20, 2025, 12:57:54 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:My Mame Frontend...
« Reply #10 on: January 20, 2004, 03:37:35 am »
Hey thanks for all the replies, i havent checked this topic for a while...

So i did use

If GetAsyncKeyState(vbKeyQ)

BUT, i was wondering, how can i disable timers if the form loses focus ( when mame loads... ) if i cant do it this way is there any other way?

i did it like this

Private Sub Form_GotFocus()
timer1.Enabled = True
Timer2.Enabled = True

but it doesnt work

I also used the gamelist on mames site for the info on what filenames go with which title...

-Nightmare

Like I said, don't ue taht function, it'll interfere with mame's input.  :)  Also your timers shouldn't work if you are launching the games properly.  A simple shell won't do you need to shellandwait.  Check the net for more info.  

Nightmare03

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:August 18, 2007, 07:20:34 am
  • Stupid llama!
Re:My Mame Frontend...
« Reply #11 on: January 20, 2004, 06:07:30 am »
Hey,

How would If GetAsyncKeyState(vbKeyQ) Interfere with mames controls if the code is in a timer and the timer is disabled?

-Nightmare

Nightmare03

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:August 18, 2007, 07:20:34 am
  • Stupid llama!
Re:My Mame Frontend...
« Reply #12 on: January 20, 2004, 11:57:56 am »
How do i use form keyup/keydown  ?? and how do i turn keypreview on :-[

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:My Mame Frontend...
« Reply #13 on: January 20, 2004, 02:28:07 pm »
How do i use form keyup/keydown  ?? and how do i turn keypreview on :-[

Go into your forms properties and turn KeyPreview to True.

Double click your object (ListBox?) and use the event dropdown to find KeyDown and KeyUp.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:June 20, 2025, 12:57:54 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:My Mame Frontend...
« Reply #14 on: January 20, 2004, 11:32:30 pm »
These questions really need to be asked over at fe.mamehost.  Also no offense but you are lacking some basic coding skills based upon a few of your questions.  There's no shame in that, I'm just thinking maybe you need to look over some vb tutorials, check out some vb specific developers forums and maybe pick up a coding book or two.  Stumbling through a coding language, figuring out stuff by your own mistakes is definately do-able, but some more formal instruction before you begin a daunting project such as this would give you a huge head start on things.

Nightmare03

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 195
  • Last login:August 18, 2007, 07:20:34 am
  • Stupid llama!
Re:My Mame Frontend...
« Reply #15 on: January 21, 2004, 03:09:11 am »
Yeah ok, www.pscode.com has good examples ::) VB is just a language i use but not one i want to spend too much time learning, i dont see it as a proper language...

-Nightmare

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:My Mame Frontend...
« Reply #16 on: January 21, 2004, 05:40:15 am »
Yeah ok, www.pscode.com has good examples ::) VB is just a language i use but not one i want to spend too much time learning, i dont see it as a proper language...

What DO you see as a proper language?  OK VB is not the most powerful language around, but you can do a million things in it - heck people even write emulators in it now.

Unless you have experience in other languages then you could do a lot worse than start with VB :)

paigeoliver

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 10994
  • Last login:July 06, 2024, 08:43:49 pm
  • Awesome face!
Re:My Mame Frontend...
« Reply #17 on: January 21, 2004, 07:45:30 am »
- heck people even write emulators in it now.

Good lord, which ones?  ;D

Wait let me guess, Mame is going to a VB core starting with the next version!  ;)
Acceptance of Zen philosophy is marred slightly by the nagging thought that if all things are interconnected, then all things must be in some way involved with Pauly Shore.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:June 20, 2025, 12:57:54 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:My Mame Frontend...
« Reply #18 on: January 21, 2004, 08:50:03 am »
Daphne and most of the laser disc emulators started in vb.  The daphne launcher is still in vb.  

The only difference between vb and c++ and I mean the only difference is the native support of multi-threading.  Vb can do everything and I mean everything that c++ can do.  Visual Basic was designed by m$ to remove the unnecessary crap of c++ (read headers and multiple files, ect)  and come up with a powerful and easy to use coding language for beginners and professionals alike.  The reason vb isn't used as much as it should is because of poor attitudes towards the language by old school programmers that don't know any better.  I'm suprised you are so biased.

PacManFan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 858
  • Last login:December 06, 2005, 12:18:56 pm
    • Kymaera Home Page
Re:My Mame Frontend...
« Reply #19 on: January 21, 2004, 11:31:41 am »
Daphne and most of the laser disc emulators started in vb.  The daphne launcher is still in vb.  

The only difference between vb and c++ and I mean the only difference is the native support of multi-threading.  Vb can do everything and I mean everything that c++ can do.  Visual Basic was designed by m$ to remove the unnecessary crap of c++ (read headers and multiple files, ect)  and come up with a powerful and easy to use coding language for beginners and professionals alike.  The reason vb isn't used as much as it should is because of poor attitudes towards the language by old school programmers that don't know any better.  I'm suprised you are so biased.

For the record HC,  there are a multitude of differences between vb and c++, Just off the top of my head, I'd say that one of the biggest differences is the lack of pointers and pointer arithmetic in VB, Not to mention deriving sub-classes (And I'm not talking about window subclassing).
More things VB is lacking are:

1) Lack of multiple base classes.
2) Memory management tool for stack and heap.
3) operator overloading for classes (including the new operator)
4) Portability to another system.
5) exe's with no external referances to dll's (VB runtime modules)
6) no inline assembly
7) friend classes

VB can be a very powerfull language, but you really need to augment it with linking in external dll's and libraries. (Usually written in c or c++)
My biggest gripe is that you are required to distribute the VB runtime dll's along with your application. The VB runtime DLL's have gotten better with version 6. Version 5 still had some interpreting going on.

VB started off as a "toy" language by MS. It's grown over the years, and it has it's purposes. I code in VB  a lot for smaller projects. A few main advantages that VB has is that:

1) It's easy to learn.
2) You can develop an application usually faster and with less code.
3) You can easily link into other dll's or libraries by declaring import functions
4) Good built-in debugging support.


Quote
Vb can do everything and I mean everything that c++ can do.
The reason vb isn't used as much as it should is because of poor attitudes towards the language by old school programmers that don't know any better.

No, it can't. We've talked before HC, I know that you aren't a C++ guy, and there is no shame in that. I use both VB and C++ in my office, and I can tell you right now, VB is not a good choice for application performance. Even in DK and MameWah, both you and MinWah are calling into external libraries (DX8 and GDI) written in C to do the drawing. I ask, How many image processing applications do you know about that are written in pure VB?

VB does have it's shortcomings, as all languages do, but to assert that it can do everything c++ can do really just shows your ignorance.

-PMF
All Hail Smezznar! The Giant purple centipede of Omnicron 5. Regail him with your odiferous offerings of onion powder!

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
Re:My Mame Frontend...
« Reply #20 on: January 21, 2004, 12:41:25 pm »
btw... not having threads basically removes it from most professional jobs... minus making frontends to real code written in other languages compiled to a .dll file...

 ;D

VB gets a VERY bad wrap because its used by a TON of non-programmers in corporate america who don't really know what recursion is... but can build some pretty screens... So their managers are happy.

It itself isn't a bad language... any more then C++.  I personally have trouble working with c++ (and VB) because of the lack of runtime object controls.



Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re:My Mame Frontend...
« Reply #21 on: January 21, 2004, 12:41:36 pm »
There's an old quote that comes to mind when reading this thread:

"C combines the speed and power of assembly language with the flexibility of assembly language".

 ;D

I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:My Mame Frontend...
« Reply #22 on: January 21, 2004, 07:22:37 pm »
Good lord, which ones?  ;D

http://vb64.emuunlim.com/

OK so it's only one, but it's cool nevertheless.  Also look at the reason the author coded it - because no-one believed it could be done :)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:June 20, 2025, 12:57:54 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:My Mame Frontend...
« Reply #23 on: January 21, 2004, 11:42:23 pm »
pmf just a response


Memory managment isn't necessary at all in a modern os environment.  If you do need it vb is quite capable of doing it via api calls.  And your speed issue is related to this.... Vb is horribly slow if you do everything via the bult in functions, but nobody does that unless it's a very simple app. If it's a simple app then speed isn't an issue as it isn't doing that much.  You are supposed to do everything externally (if you are serious about vb that is), it's vbs response to helper classes and built in classes that you talk about for c++.  


C++ has tons of references to external libraries, it's just as windows uses them too they are always included with the os.  Same goes for linux ect..... the oses are written in c so obviously most linking files are included.  Virtually any non c++ language needs various linking files so I don't see how this is a vailid point.  
And with that aside, since windows 2000 the vb libraries are included with windows.  This is no longer an issue.  


You can overload classes to an extent in vb, it's just that it's not as necessary as it is in c++ due to the two languages aproaching things differently.  


Inline assembly is related to the multithreading issue, I covered that a bit.

Bases classes are replaced by vb modules.... the externalness of these files make them far more powerful, and useful imo.  


I'll be honest, friend classes I'm not familiar with at all.  I don't know what they are useful for so I can't comment on them.  


Mind you I'm only pointing this out because you and lilwolf are again (we've had this conversation before as you know) downplaying vb's status as a legitimate coding language.  It's not better than c++ in any way, it's equal, almost perfectly equal.  It does things differently but it gets the same job done just as well.  



SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8187
  • Last login:Yesterday at 10:39:10 am
  • The Bears Still Suck!
Re:My Mame Frontend...
« Reply #24 on: January 21, 2004, 11:58:39 pm »
VB is a very powerful language, but yes, it is nowhere near as fast as c++, especially in plced like NT services.

But as it was mentioned, each language has it's good points and bad.  You really can't say there is an ultimate langauge (acept assembly since that is as close ot machine language you are going to get).  They were all developed for a specific reason.  Java was developed to make the cross-platform easier, which up to that point wasn;t nearly as good as java has done it.  There have been other VM based langauges but no where near as fast as java is.  COBOL was made so people could pick up programmign inthe mainframe world quickly.  They made it as close to the english language as possible.