Sign in with
Sign up | Sign in
Your question

Average programmer lost in MAME source code

Last response: in Video Games
Share
Anonymous
February 8, 2005 4:45:36 PM

Archived from groups: alt.games.mame (More info?)

Hi all,

I was wondering if some of you (programmers) know of any links to help
me find my way in the MAME source code (downloaded version91). I am
able to compile it, but I'm having some trouble 'reading' the code.
Besides learning C I would like to add some functionality (e.g. during
a record 'F3' should not only reset the game, but also start with a
fresh recording - so I won't need to quit MAME and restart). My
problem: I'm just an average C# programmer, not a skilled C programmer.
At this moment I'm looking for the handlers of the keycodes, but can't
locate them (e.g. where is being checked if 'F3' was checked). Any help?

Thanks a lot for your time,
Frederik
Anonymous
February 10, 2005 2:13:56 AM

Archived from groups: alt.games.mame (More info?)

Frederik wrote:

> I was wondering if some of you (programmers) know of any links to help
> me find my way in the MAME source code (downloaded version91).

<http://atarihq.com/danb/emulation.shtml&gt;
<http://www.codeproject.com/cpp/vcmame.asp&gt;

The former has a few links to articles on MAME development. Be warned,
they're all quite out of date, and a lot has changed, but at least some of
the concepts should carry over.

> My
> problem: I'm just an average C# programmer, not a skilled C programmer.
> At this moment I'm looking for the handlers of the keycodes, but can't
> locate them (e.g. where is being checked if 'F3' was checked). Any help?

Without trying to discourage you, I'd suggest that MAME isn't the best
project to 'cut your teeth in C' on - for three reasons - (1) Emulation of
hardware is quite technically challenging; you need a deep understanding of
computer architecture for starters, and trying to work out *how* parts of
the code work can be clouded by the very nature of what it's actually doing.
(2) MAME strives to emulate a large number of systems within a standard
framework; there's quite a lot of complicated stuff happening (plenty of
heavy macro usage) like the memory handlers in order to do this, and (3)
MAME strives to be reasonably platform-independent; again, tricky stuff can
make it difficult to follow.

MAME has been under development now for (IIRC) 8 years, all by a bunch of
seasoned programmers with quite unique technical talent - so it's not going
to be a walk in the park by any means.

Having said that, it looks like you're more concerned with the user
interface than getting into the nitty-gritty of driver development?!?

Good luck!
Regards,

--
| Mark McDougall | "Electrical Engineers do it
| <http://members.iinet.net.au/~msmcdoug&gt; | with less resistance!"
Anonymous
February 10, 2005 1:28:38 PM

Archived from groups: alt.games.mame (More info?)

Thanks for your reply Mark.

I had more then a feeling it would not be a pleasant journey. But your
assumption is right. I only want to change a few things in the 'user
interface', I'm not going into driver development (that's probably out
of my reach at this moment - if not forever).

Still I'm finding my way a tiny little bit in the source code. After
some digging I found out that (as for MAME Version 91) "if
(input_ui_pressed(IPT_UI_RESET_MACHINE)) machine_reset();" is the
handler for F3 [file = usrintrf.c]. So for so good :-) Now I'm playing
a bit with closing and opening 'inp' files (mame_fclose/mame_fopen),
but the results are not as hoped at the moment (the emulator crashes
from time to time). I guess I'll keep on digging. Anyhow, I learned
quite a lot of C(++) in the last couple of day and that's a good thing.

Kind regards,
Frederik


Mark McDougall wrote:

:: Frederik wrote:
::
:: :: I was wondering if some of you (programmers) know of any links to
:: :: help me find my way in the MAME source code (downloaded
:: :: version91).
::
:: <http://atarihq.com/danb/emulation.shtml&gt;
:: <http://www.codeproject.com/cpp/vcmame.asp&gt;
::
:: The former has a few links to articles on MAME development. Be
:: warned, they're all quite out of date, and a lot has changed, but at
:: least some of the concepts should carry over.
::
:: :: My
:: :: problem: I'm just an average C# programmer, not a skilled C
:: :: programmer. At this moment I'm looking for the handlers of the
:: :: keycodes, but can't locate them (e.g. where is being checked if
:: :: 'F3' was checked). Any help?
::
:: Without trying to discourage you, I'd suggest that MAME isn't the
:: best project to 'cut your teeth in C' on - for three reasons - (1)
:: Emulation of hardware is quite technically challenging; you need a
:: deep understanding of computer architecture for starters, and trying
:: to work out how parts of the code work can be clouded by the very
:: nature of what it's actually doing. (2) MAME strives to emulate a
:: large number of systems within a standard framework; there's quite a
:: lot of complicated stuff happening (plenty of heavy macro usage) like
:: the memory handlers in order to do this, and (3) MAME strives to be
:: reasonably platform-independent; again, tricky stuff can make it
:: difficult to follow.
::
:: MAME has been under development now for (IIRC) 8 years, all by a
:: bunch of seasoned programmers with quite unique technical talent - so
:: it's not going to be a walk in the park by any means.
::
:: Having said that, it looks like you're more concerned with the user
:: interface than getting into the nitty-gritty of driver development?!?
::
:: Good luck!
:: Regards,
!