How do I read MAME source code?

rmcelwee

Member
Joined
Oct 25, 2015
Messages
523
Reaction score
5
Location
Moncks Corner, South Carolina
I built my MAME machines back in 1999. At that time I messed around with the source code a bit and made some changes. Here it is 18 years later and I cannot remember how I did this. So, how do I look at the code? I downloaded one of the windows source code packs and unzipped it into about a million files and directories. I have no idea where to go from here.

Why do I want to look at it? I have a Blasteroids with a few bad sprites. I think the source code will tell me which eproms contain the sprites so I want to look at those specific roms instead of shotgunning everything. Which files contains the info I need and what program do I use to look at it.

Thanks in advance for any help you can give me!
 
Hmmm, I was hoping I would see something that said "this rom contains the sprites". Definitely doesn't say anything like that. Ugh...

I looked in the game manual as well since Atari usually has pretty good info but it didn't help either (or at least I could not see where it did).

I'll keep researching. I do appreciate the help!
 
Hmmm, I was hoping I would see something that said "this rom contains the sprites". Definitely doesn't say anything like that. Ugh...

I looked in the game manual as well since Atari usually has pretty good info but it didn't help either (or at least I could not see where it did).

I'll keep researching. I do appreciate the help!

The gfx1 region is the background graphics.
gfx2 is the sprite roms... there's 16 of them.
 
MAME source is honestly a bit hard to parse sometimes...

As a generic way to find out what you want - press F4 in MAME to go to the in-game graphics viewer - find the sprites and note the 'region'. That maps to the table describing the graphics layout for each region:

static GFXDECODE_START( blstroid )

GFXDECODE_ENTRY( "gfx1", 0, pflayout, 256, 16 )

GFXDECODE_ENTRY( "gfx2", 0, molayout, 0, 16 )

GFXDECODE_END

In this case you would have noticed the sprites are in gfx2. So then just look at the rom defs for gfx 2. (molayout stands for motion object layout in this case anyway).

ROM_REGION( 0x100000, "gfx2", 0 )

ROM_LOAD( "136057-1105.5m", 0x000000, 0x010000, CRC(50e0823f) SHA1(f638becad83307ed43d138d452199e4c6725512f) )

ROM_LOAD( "136057-1107.67m", 0x010000, 0x010000, CRC(729de7a9) SHA1(526b08e6d54cd0b991c4207c23119d2940a34009) )

ROM_LOAD( "136057-1109.8m", 0x020000, 0x010000, CRC(090e42ab) SHA1(903aa99e6e39407319f6e90102b24604884ee047) )

ROM_LOAD( "136057-1111.10m", 0x030000, 0x010000, CRC(1ff79e67) SHA1(12d408184f814bab411f567e8b29914a289e3fb8) )

ROM_LOAD( "136057-1113.11m", 0x040000, 0x010000, CRC(4be1d504) SHA1(f41ff2d31e2e0e5b6d89fbbf014ba767c7b9f299) )

ROM_LOAD( "136057-1115.13m", 0x050000, 0x010000, CRC(e4409310) SHA1(09180f1ab2ac8465b6641e94271c72bf566b2597) )

ROM_LOAD( "136057-1117.14m", 0x060000, 0x010000, CRC(7aaca15e) SHA1(4014d60f2b6590c96796dbb2a538f1976194f3e7) )

ROM_LOAD( "136057-1119.16m", 0x070000, 0x010000, CRC(33690379) SHA1(09ddfd18ccab1c639837171a763a981c867af0b1) )

ROM_LOAD( "136057-1106.5n", 0x080000, 0x010000, CRC(2720ee71) SHA1(ebfd58effebadab361dfb4bd77d626911da4409a) )

ROM_LOAD( "136057-1108.67n", 0x090000, 0x010000, CRC(2faecd15) SHA1(7fe9535b9bc72fd5527dbd1079f559ac16f2a31e) )

ROM_LOAD( "136057-1110.8n", 0x0a0000, 0x010000, CRC(a15e79e1) SHA1(3fc8c33f438fd304b566a62bbe0f6e17a696edbc) )

ROM_LOAD( "136057-1112.10n", 0x0b0000, 0x010000, CRC(4d5fc284) SHA1(c66f95af700828225a62f46437ca83453900f7fc) )

ROM_LOAD( "136057-1114.11n", 0x0c0000, 0x010000, CRC(a70fc6e6) SHA1(fbf469b8f5c6e69540743748ad994a6490ad7745) )

ROM_LOAD( "136057-1116.13n", 0x0d0000, 0x010000, CRC(f423b4f8) SHA1(a431686233b104074728a81cf41604deea0fbb56) )

ROM_LOAD( "136057-1118.14n", 0x0e0000, 0x010000, CRC(56fa3d16) SHA1(9d9c1fb7912774954224d8f0220047324122ab23) )

ROM_LOAD( "136057-1120.16n", 0x0f0000, 0x010000, CRC(f257f738) SHA1(a5904ec25d2190f11708c2e1e41832fd66332428) )


But you really you could just have found the sprites on the board by pulling a few ROMs and powering on and seeing what was broken :)
 
How do I know this? Is there always more sprite roms than background so it can just be deduced?

Thanks!

You can look in the vidhdwr directory to see how the video generator is coded, but in general gfx1 is always background, and other background planes and sprite planes are higher numbers.... in this case there's only 2 planes.
 
But you really you could just have found the sprites on the board by pulling a few ROMs and powering on and seeing what was broken :)


I wanted to try to do it the "smart" way for a change. I just wasn't smart enough to figure it out. In the end I guess it just narrowed it down from 20 roms to 16. But at least I learned something. Thanks guys!
 
I ended up fixing the problem with the same brute stupidity that I always use. I pulled the fourteen 27512 sprite eproms (not the 16 that MAME indicated - 2 sockets were empty) and found pin #15 (data output) was broken and stuck in the socket. I managed to wrangle it out and soldered a new leg on it. As I was pulling the chips it looked like they were in pairs with each pair sending odd/even lines for the sprites. There were only a few sprites that were having problems and I think all of them were on that pair but I won't really know for sure because I cleaned all legs so there could have been another problem that was fixed from that.

If I would have been smarter I would have tried to use my logic probe on the eproms but I think that would have been in vain because the broken pin would have still given me an output. I doubt I would have seen the broken pin.

Thanks again for all the help guys. Reputation has been added!
 
If only 14 27c512 sprite ROMs then either you have some missing graphics or likely you have an early version (prototype?) not in MAME.

Out of interest, what numbers are on the program rom stickers?
 
No missing graphics. The program rom stickers say:
1988 Atari - 8809 - 136057 - 2121

1988 Atari - 8809 - 136057 - 2122

1988 Atari - 8809 - 136057 - 2123

1988 Atari - 8809 - 136057 - 2124
 
Back
Top Bottom