Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Arcade source code

This thread is locked; no one can reply to it. rss feed Print
Arcade source code
KaBlammyman
Member #455
June 2000
avatar

I dont know if such a thing exists outside of company walls, but I would love to see the soruce to arcade games. If I had a choice, I would like to see the asm for SFII (it was written entierly in ASM)or any of the capcom games. Or maybe the soruce to metal slug. But I am not picky, I'll take the soruce to any arcade game, even the soruce for pong! Auctally that would be cool to see. ;) Is there a place where I can get arcade source anywhere???

->Insert clever quote here<-
http:my website

DanielH
Member #934
January 2001
avatar

Find the rom. Open the file in a hex editor. There's the source code. Now all you have to do is get ahold of that cpu's code book to translate all that machine code. Sounds like fun.

KaBlammyman
Member #455
June 2000
avatar

Wow, its that easy? And this will be in soruce code format(i,e a buch of if staments and stuff)? Not just a bunch of hex vales that confuse the hell out of me?

->Insert clever quote here<-
http:my website

Blade Nick
Member #1,597
October 2001
avatar

Unfortunantly it is in hex. Not the natural language it was in. SO if u like hex u'll like a hex editor. However u can get some programs to convert over the code however these raerly ever work.

Bad Website Of Mine
We, will survive.

Johnny13
Member #805
October 2000
avatar

hmm,have a look at the MAME arcade emulator,
or a better one:Kawaks(CPS1/CPS2/MVS)
[url http://kawaks.retrogames.com];)

Alg3D Praise my Games!!<code>#define SPAMMER (post>=666&&postperday>=6)</code><Mr.spellcaster>What post? <Mr.spellcaster>A useful post by me.

Greyer
Member #1,509
September 2001
avatar

Well, depending on the CPU(s) that a game was developed for, you MIGHT be able to find a disasmbler that can take those hex values and rebuild the ASM code from that. However, you won’t have any intuitively named variables or comments in the output.

The closest thing I have done like this is examine a NES opcode output, so YMMV.

------------------------------------------------
And they say goldfish have no memory, I guess their lives are much like mine.
And their little plastic castle, its a surprise everytime.

gomez
Member #2,800
October 2002

What you'll need is a "disassembler". Do they exist for arcade roms? I don't know.

Thomas Harte
Member #33
April 2000
avatar

Arcade machines use the same cpus as most other machines, so you can use the same disassemblers. In fact it is usually even easier than disassembling a regular home computer game since the memory maps tend to be much more strictly defined making it easy to determine what is code and what is graphics.

E.g. Space Invaders uses an 8080 (like a z80 with only the first instruction page, and not even a fully populated one at that), all of the Atari/Williams machines use a 6809, although the vector ones have a custom maths processor which you'll want to be aware of, later 16bit machines are almost universally Motorola 68000 devices, its only in the 32bit era when things become a little more complicated and you start encountering sh2s and so on. Which I think are in the Sega Saturn, but not much else.

DanielH
Member #934
January 2001
avatar

And weren't most of the arcades written in assembly anyways?

Motoroloa68000 asm is pretty easy to learn and alot of arcade used that processor. And the 68000 is still used today. Check out motorola for a copy of the asm codes. And there is a lot of stuff at www.programmersheaven.com for the 68000.

Marcello
Member #1,860
January 2002
avatar

Keep in mind most of these will only disassemble to Assembly! There still will be no if statements or whatever, and you'll have to know the opcodes and architecture of the chip to understand it all...

If you want the source code, contact the developers...

Marcello

Thomas Harte
Member #33
April 2000
avatar

Don't bother contacting too hard though. I (indirectly) approached the people behind Hard Drivin' about getting hold of the original data set for use in a remake, and was told that the original arcade machine data set no longer exists and that even if I was able to derive it I may not distribute it. And that's just the data set - something which definitely isn't still an active concern when you allow for the simplistic low polygon models - not any clever algorithms they want to keep secret or anything.

As DanielH says, anything 8bit and most things 16bit were probably originally assembly anyway, so I don't know exactly what more you are expecting. Its usually very easy to read assembly though, because arcade machines depend quite heavily on external hardware so you don't have to worry about what is, e.g. sprite blitting, and as a result you can instantly derive things like whereabouts the input handling is situated and whereabouts the graphics output is situated by simply searching out for the locations where the relevant external pieces of hardware are accessed. An emulator with a debugger might be particularly helpful here.

I once reverse engineered parts of z80 Elite using a Spectrum emulator I had cobbled together, being able to run a trap on where the screen memory was written to allowed me to locate the line drawing code and as a result implement an emulator trap which went to Allegro's line drawer. Hence I could play ZX Spectrum Elite in high resolution! But Elite:TNK instantly blew my little project out of the water, so that was a large waste of time.

DanielH
Member #934
January 2001
avatar

You can also go to www.motorola.com to get information on their chips.

68000 family programming reference manual

KaBlammyman
Member #455
June 2000
avatar

ASM is what I am looking for, but I was also hoping to see some goold ole C. I just want to see how "good" these pioneers are with thier coding, or are they no different than your accomplished allegro coder.

->Insert clever quote here<-
http:my website

Mars
Member #971
February 2001
avatar

You'd expect those pioneers to work quite closely to the hardware, which distinguishes them from the great majority of Allegro users.

--
This posting is a natural product. The slight variations in spelling and grammar enhance its individual character and beauty and in no way are to be considered flaws or defects.

Blade Nick
Member #1,597
October 2001
avatar

Ehhhhh hmmm Ever heard of Soft-Ice a crackers most loved program. It is a program that traps all memory used and gives the locations for it. Also allows for intant editing of the binary and conversoin of the binary to it's native code. Eg a proggie written in c++ can be converted to c++. I did this to some stupid n00bish virus i caught, modifyed it and then sent it to a good friend. I'm dumb! he was really suprised at the fact that this harmfull virus had turned into a weird virus that made ure Icons jump arround.

Bad Website Of Mine
We, will survive.

nonnus29
Member #2,606
August 2002
avatar

So BladeNick == Vegeta and Kablammyman == Goku ? Or is it the other way around? Or are they both Goku? Or are they both Vegeta? Its so hard to tell the difference between the two in super sayan...

The real crazy stuff was the Atari 2600 were the programmers had to interrupt the raster scan line to get pixels in about 1k. How the heck do you make a game like that? Even space invaders, sheesh. Defender was the first game to use bit blits.

Blade Nick
Member #1,597
October 2001
avatar

Yeah tell me about it hey nonnus29 u should of seen the older versions. Man those guys must of had to of learnt a billion+1 things.. Oh yeah I'm Gohan at Super Sayian lvl 2 when he was a kid, Kablammyman is Goku at what appears to be lvl 3.

Bad Website Of Mine
We, will survive.

Marcello
Member #1,860
January 2002
avatar

dbz is soo lame. :)

Marcello

Karadoc ~~
Member #2,749
September 2002
avatar

I kinda liked dbz before they all became 'super'.
Now I reckon it's gone a bit over the top. Mega-Super-Hyper Sayan Karadoc level 32 would kick all of their arses.

As for source code. I'd like to see the code for some of my old Atari ST favorites... those guys must have been heroes to get such quality games to run with no HD, 1mg ram, and 756kb floppies.
Heroes! and then the hacking crews would crack their copy protection, and put like 3 good games on one disk! How do they all fit? Bloody amazing if you ask me.

-----------

Thomas Harte
Member #33
April 2000
avatar

Quote:

The real crazy stuff was the Atari 2600 were the programmers had to interrupt the raster scan line to get pixels in about 1k. How the heck do you make a game like that? Even space invaders, sheesh.

Well, the Atari 2600 has only a single scanline 'framebuffer', and at that only stores half the scanline with options to repeat it or mirror it. Therefore you have to use interrupts if you want an even slightly complicated display, but this is all only intended to be the background. On top of that are at least a couple of hardware sprites and a couple of hardware 'bullets' (read: small sprites with hardware collision detection on all other sprites). So, for example, combat is only having to negotiate with the freaky framebuffer to draw the map on which your tanks are sitting, the tanks themselves & their shots are handled by the custom sprite hardware. Naturally you can also change sprite details as the display draws to achieve two sprites per scanline rather than per frame.

Of course, Space Invaders would still be a problem with this setup.

Quote:

Defender was the first game to use bit blits.

It was the first game to use hardware for bit blitting, putting it years ahead of all the people who come on here and go on about mode 13h and optimising their sprite drawing via inline asm. But many earlier games used a frame buffer and deposited their sprites in that rather than some sort of restricted tilemap/sprite system. Certainly Space Invaders uses one...

nonnus29
Member #2,606
August 2002
avatar

All that in asm too, what was the 2600, 6502 or a z80 or something?

Cheradenine Zakalwe
Member #2,046
March 2002
avatar

Quote:

what was the 2600, 6502 or a z80 or something?

I think it was a 6507 just over 1Mhz!

Thomas Harte
Member #33
April 2000
avatar

The 2600 had a 6502 with 3 or 4 address lines missing, giving you access to only 4 or 8kb of addressable memory. Which I guess must be also known as a 6507?

But Space Invaders has an 8080 which doesn't even run at 1Mhz, so...

Richard Phipps
Member #1,632
November 2001
avatar

As far as I can remember it was a 6502 at 1mhz. The 2600 was a worse version than the atari 800 series of computers and the the 7600 was a better version.

But the Atari 800 had CTIA and GTIA modes. The CTIA modes provided two 320 x 240 1 bit screenmodes (one character based and one pixel based). It also had four colour modes (of which there were four different combinations). In the character mode you could also draw the character with one bit set which resulted in one of the colours being substituted with a 5th colour.

The GTIA mode introduced two 16 colour modes (one luminance based and the other hue based) which had a resolution of 80 x 240.

The display hardware could hardware scroll as well as do palette changes for every scanline (though this was probably done in software).

It has 4 sprites, each 8 bits wide (with a choice of three horizontal sizes, x1, x2 and x4) However the height can be any size that fits on the display.

These 4 sprites could also be drawn in a special mode which averaged colours with any overlapping sprites.

Finally it could draw 4 Missile sprites which used the same colours as the 4 Sprites but were only two bits wide.

I programmed a fair bit on the Atari.. It was a different kind of programming when you had to work with character sets rather than bitmaps. The good thing was you could switch character sets and have any gfx automatically animate (even if the entire screen was filled with them).

Remember the diagonally scrolling background pattern in the title screen of Boulderdash?

:)

Cheradenine Zakalwe
Member #2,046
March 2002
avatar

Nah! It was a 6507 at 1.19MHz, which was a stripped down 6502 only 8k adressing and no interrupt lines! The video hardware ran at 3.5MHz... the Atari 7800 had a 6502C!

Go to: