Game Boy Zelda Comes With Source, Sort Of 200
Jamie found a fun story about a 90s Zelda Game Boy ROM that shipped with the source code- not so much on purpose, but more because the linker padded out the last meg of ROM with random memory contents, which happened to include game source code.
Avoiding the malloc() (Score:4, Informative)
Re: (Score:3, Insightful)
Re: (Score:3, Funny)
Re: (Score:3, Insightful)
Re:Avoiding the malloc() (Score:5, Informative)
Re: (Score:2)
Of course, I'm quite sure the creators of the compiler just didn't think of the possibility. It's rather negligance than trying to squeeze the last nanosecond of speed out of the compiler. Like I said, compilers are hardly real time applications.
Re: (Score:2)
Re: (Score:2)
These days you would do it properly of course.
Re:Avoiding the malloc() (Score:4, Insightful)
Re:Avoiding the malloc() (Score:5, Informative)
Rather than writing the extra few lines to calculate the padding required, set up a 0-filled buffer and truncate the first (or last) buffer, rounding up the fwrite call to 2mb requires 0 extra lines.
Besides, they don't expect many people to actually look at the ROM code. This emulation craze is fairly recent.
Re:Avoiding the malloc() (Score:5, Insightful)
What? I really mean it what?
I remeber running sonic (megadrive) on a low end pentium (133) back in the day, albeit with no sound.
I also remeber using various earlier emulators on my amiga before that (speccy and such).
Maybe you have a differnet definition of recent than me though.
Re: (Score:2)
Re: (Score:3)
Re:Avoiding the malloc() (Score:5, Informative)
NESticle was also released in 1997. These pretty much sparked a craze, and lead to the creation of the Emulation Community and its Golden Age was pretty much in full swing by the middle of 1998.
It has pretty much died, but Zsnes is still under very active development and the new pSX Emulator has revitalized Playstation emulation since ePSXe hasn't been updated in years and leaves MUCH to be desired.
http://www.romhacking.net/ [romhacking.net] for info on ROM hacking.
http://psxemulator.gazaxian.com/ [gazaxian.com] for pSX Emulator. Try it!
Re: (Score:2)
Thanks for this link - had just yesterday decided to try and get espxe working again, 2 hours of tweaking settings didn't achieve what the new one does with no setup besides the gamepad configuration.
Re: (Score:2)
Even if that's bad for the community (it obviously is).
We give props to those who share their work precisely because they didn't have to be that generous. It's wrong to condemn those who exercise their rights. After all, if you truly are this dedicated
Re: (Score:3)
actually the color-added version was released in 1998 but the original came out in 1993 [wikipedia.org], and since you can play the 1998 version on the old monochrome gameboy methinks it's not truly a title that was entirely redone for the gameboy color and it makes me question whether this left over code could also be found in the 1993 monochrome version of Link's Awakening.
Re: (Score:2)
But yes. for the original GameBoy, a 486 would have been pretty cutting edge. and XTs and 286s were still very common systems.
Re:Avoiding the malloc() (Score:5, Insightful)
No, he just apparently has a different definition of "craze" to you. Being the only person in your state to emulate a megadrive on a low-end Pentium without sound doesn't mean that's when the emulation craze started. That was just you pushing the boundaries of what was available at the time. The average gamer wouldn't have understood you back then if you said the word "emulation" to them.
Only in recent years have so many people been emulating earlier consoles and arcade games on their home PCs, with pretty faithful representation of the original experience.
Re: (Score:3, Insightful)
Re: (Score:2)
PSX emulators - ePSXe in particular - are okay, if a bit slow on my machine; but I've never seen an N64 emulator which wouldn't have been alpha quality (meaning very slow and crashes. Is there a useful one fro Linux there; I'd really like to play OoT ?
Re: (Score:2)
Re: (Score:2)
Seriously, in recent years emulation has reached the masses by way of officially licensed collections of ROMs for PS2, Gamecube, etc - but in terms of running an emulator o
Re: (Score:2)
Re:Avoiding the malloc() (Score:4, Interesting)
Re: (Score:2)
The game boy color hit the market in 1998 and modern video game emulation was just starting to take off about then.
When the developers were working on the Zelda DX they weren't concerned with emulation. Their code has gone unnoticed for 9 years now. Emulation has been around for decades. The emulation "craze" is far more recent.
Re: (Score:2)
Re: (Score:2)
Not a programmer are you? (Score:3)
Re: (Score:2)
Re: (Score:3, Informative)
Re: (Score:2)
How about:
- Using calloc() instead of malloc()
- calling memset() after malloc()
- Using a good ol' for loop
You make it sound like writing (zeros) to memory wasn't invented at that time!
Re: (Score:2)
It was, but presumably not writing the zeros was faster, and a faster linker meant faster development time, so compiler/linker developers learned to favour speed over trivial-seeming things like clearing memory.
If the game developers wanted to zero that memory, they could probably have done it after the linking step was done.
Re: (Score:2)
Reboot to link
ha ha very punny :-)
Re: (Score:2, Funny)
He spent about 30 minutes loading the (BBC micro) computer and flicking the power switch to try to see under the hood.
"If you do it really fast it comes up and shows you the code"
Incidentally he was also the teacher who taught us about the wankel engine, I am not sure which caused a bigger laugh.
Re: (Score:2)
Re: (Score:3, Funny)
Deja Vu (Score:5, Funny)
Whoops... (Score:3, Funny)
Re:Whoops... (Score:5, Funny)
Re:Whoops... (Score:4, Funny)
Windows ME is why they say not to code the entire project smashed though.
Air Fortress (NES) had exact same issue! (Score:5, Informative)
Re:Air Fortress (NES) had exact same issue! (Score:4, Informative)
There was also a chunk of code discovered in Secret of Evermore. [datacrystal.org]
Not true (Score:5, Informative)
Now the site is Wordpressed (like Slashdotting, only the other way around) and you can't get to it, but one of the last posts before it died pointed out that this was from a trainered version. That's where someone adds cheat code to a ROM. As it turns out, the original doesn't have any of the code in question. Dissassembling for the purpose of adding cheats is a completely sensible explanation of the code that was found.
The moral of the story? Start with a known clean dump (look for the "[!]" tag) before assuming that the introns were in the original game.
Re:Not true (Score:5, Funny)
Re:Not true (Score:5, Interesting)
How do php accelerators such as eaccelerator affect it, and what level of hardware would you need to handle a significant load of wordpress hits?
Re: (Score:2)
Re: (Score:3, Interesting)
Re:Not true (Score:5, Funny)
Partially Not Not true (Score:5, Insightful)
"X-Men - Wolverine's Rage" (MD5: b1729716baaea01d4baa795db31800b0), which contains Windows 9x registry keys and INF files, "Mortal Kombat 4 (MD5: 7311f937a542baadf113e9115158cde3), in which you can find some small source fragments, "Gift" (MD5: e6a51088c8fea7980649064bd3a9f9ff), which will tell you that the developers had some Game Boy emulators installed on their system, or the "BIT-MANAGERS" games "Spirou" (MD5:5aa012cf540a5267d6adea6659764441, Turbo C, MAP file, source) and "TinTin in Tibet" (Game Boy Color version, MD5: 8150a3978211939d367f48ffcd49f979), which, amongst other things, contains references to Nintendo's Game Boy Advance (!) SDK ("C:\Cygnus\thumbelf-000512\H-i686-cygwin32\lib\gcc-lib\thumb-elf\2.9-arm-000512, "/tantor/build/nintendo/arm-000512/i686-cygwin32/src/newlib/libc/stdio/stdio.c").
Re: (Score:3, Insightful)
Re: (Score:2)
Re:Partially Not Not true (Score:5, Funny)
When slashdot brings down a site running Apache, we call it slashdotting, not Apache-ing. When slashdot brings down a site running wordpress, we call it slashdotting, not wordpressing.
Except Wordpress comes pre-Slashdotted for your convenience.
Re: (Score:3, Informative)
The 'disassembled' routines are simply a filling routine with register D and a copy routine.
As a Z80 developer, you really don't need to disassemble this kind of routines.
I guess the source code parts come from the intro, and its coder was not very good either. For example: CALL/RET instead of JP or disassembling a copy routine, and keeping it called L_B000_2914.
This is a non-story (Score:5, Informative)
It happens (Score:5, Funny)
Re:It happens (Score:4, Funny)
Re: (Score:2, Interesting)
Re: (Score:2)
Re:It happens (Score:5, Funny)
About four days after we received this particular build (and I had noticed its interesting attributes) I got a call from Adobe:
Adobe: There are problems with the latest build of Illustrator. We need to recall those CD-ROMs immediately.
Me: Gosh
Adobe: Yes. We will be sending you a prepaid FedEx return envelope. It's extremely important that you return those discs to us right away.
Me: I see. Oh, my. Look
Adobe: I can't really say. It's a technical issue. But if you've installed Build 378468434 on any of your equipment, you should un-install it right away.
Me: Oh, dear. Oh, dear oh dear. I will do so, ma'am, immediately. It
Adobe: Um... you should be OK. But, just to be on the safe side you should be sure to uninstall it from any of your machines and make sure you send those CDs back to us right away.
Me: Yes ma'am, will do.
Adobe: Thanks, have a nice day.
Me: (pushes eject button on CD-R burner, grabs a Sharpie)
Re: (Score:2)
Re: (Score:2)
Haha, no. And, given that this was probably around 1997, I doubt that the code would be of much use to you anyway. If I remember right, what I got was neatly organized into CodeWarrior projects, but it wasn't complete, i.e. it wouldn't actually build a binary.
Re:It happens (Score:5, Interesting)
It was obvious they knew they were writing a pirate product, because they went through the code and swapped arithmetic and logical shift instructions wherever they were certain to produce identical results, presumably in order to get the fraction of identical bytes down.
rj
Re: (Score:2)
Re: (Score:2)
1112-1111111111
1113-1111111111
1114-1111111111
(etc)
Re: (Score:2)
Re: (Score:2)
Re: (Score:2, Funny)
To convert the Win95 upgrade CD to the full version, just type:
C:\>dir > NTLDR
Now, install your "full" version of Win95 as usual. I got this little tip from Microsoft support.
Re: (Score:3, Interesting)
Not too uncommon (Score:5, Interesting)
From what I remember the installer copied the swap file to the hard disk, but the first patch either deleted it or zeroed it
Re: (Score:2, Interesting)
Re:Not too uncommon (Score:5, Interesting)
Having reminded me, I may have to dig it out sometime soon and see what else it's got going.
Re: (Score:3, Funny)
It was two guys sending text back and forth talking about the legs on a woman who'd just entered the office. It was pretty well buried. I'm guessing they just forgot they'd been clowning around and it got left in when the BBC was put into production. I did write it down at the time, but this was in the eighties
Re: (Score:2)
This was a long time ago, I might be wrong about exactly where it was, but it was a standard bbc model b with no software running, and the text was there. You should dig about more.
Wish I still had it, probably wouldn't take me long to find where the text was.
Re: (Score:2)
Re: (Score:2)
Malloc clears? (Score:2)
While modern operating systems will always clear all malloc()ed memory, so that you cannot get to other processes' data
What do they mean by clear the memory? Because when I malloc() (and not calloc()) I seem to get whatever was there before..
Re:Malloc clears? (Score:5, Informative)
But you don't get anything from another process. When malloc() runs out of memory and asks for a new chunk from the operating system, a modern system will usually zero the block that it returns, whereas some older operating systems (e.g. MS-DOS, I think?) would just give a pointer to a chunk of free memory which could still contain any data that the previous user had left in it; that could be any program which had previously run on the machine.
When you free something and call malloc() again afterwards, you may well get a block with old data from your program. But in most cases you won't get a block with old data from a different program.
The same applies to disk files; with some operating systems in the past you could open a file, write a byte a megabyte into the file and then read a megabyte of old data preceding it in free blocks which had been allocated to you and not cleared. That was obviously a big potential security hole, so most modern operating systems will zero all the data in the file instead (more precisely, they'll probably allocate a sparse file which will return zeros from areas which haven't been written to).
Re: (Score:2)
Re:Malloc clears? (Score:5, Insightful)
I think you're giving MS-DOS too much credit when it comes to memory management. Basically, it was single-tasking so you could just use whatever memory you wanted to.
/Mikael
Re:Malloc clears? (Score:4, Insightful)
When you first malloc memory you get a page of memory that's set copy on write and backed from a special page in memory with nothing but zeroes in it. It's only when you first use the memory that physical memory is actually allocated.
Re: (Score:2)
The rest probably got distracted looking at the dirty pages.
There's more (Score:5, Interesting)
And the PAL version of ICO (PS2) had an objdump of the entire ELF on the disc, which is basically a disassembly with full symbol information.
PC-Engine CD-ROM (Score:2)
In 1978, on cassette tape (Score:3, Interesting)
Does anyone else... (Score:5, Funny)
I can't be the only one...
Can I?
I'll get me coat.
FoxPro (Score:5, Interesting)
FoxPro, I discovered after shipping our product for 2 years, didn't really compile anything when you made an
Re: (Score:3, Interesting)
Beatmania Best Hits (Score:4, Interesting)
Anyway, A Japanese PlayStation game named "Beatmania Best Hits" came with the complete source code to "Beatmania 5th Mix", another PlayStation game in the same series. Supposedly, it was complete enough to actually compile and run.
PlayStation games of the era had to have a ~30 meg file of zeros on them at the outer edge due to a problem with the drive. These were known as "DUMMY" files. Some unknown sneaky programmer at Konami put an LZH archive containing 5th Mix's source code as the DUMMY file. (The contents of the file didn't technically matter, it just had to be at the outer edge.)
opensource (Score:5, Funny)
Reminds me of Weitek (Score:5, Interesting)
An administrator decided that, to save money, those darned resource-wasting engineers would be limited to one new floppy disk per week.
So floppies got reused a lot. And of course eventually somebody got sloppy.
The master for one of their graphics driver distributions was built on a recycled floppy disk. Of course the old files were deleted, rather than the disk being reformatted with a surface-analysis (and data wiping) pass. And of course this master was sector-cloned for production.
Turns out the entire source code for the drivers had previously lived on that disk - and many of the algorithms that made the product cutting-edge were either in the driver or had enough info in the driver source about what the chip was up to that it made reverse-engineering a snap.
So just apply any of several "undelete the lost files" tools to any copy of the distribution disks and you could recover pretty much the whole source code, comments and all.
Shortly after this, the best of Weitek's cutting-edge algorithms became industry standards.
That's one of the characteristics of Trade Secrets. Once it's no longer a secret (especially if the owner managed to leak it himself), it's public domain.
So did... (Score:2)
Yar's Revenge! [digitpress.com]
Hard to read it, though.
Re: (Score:2)
That isn't source code though, it's machine code. It's not surprising when a game cartridge includes the machine code. In fact, it's pretty much expected. ;-) Yars' Revenge isn't even unique with regards to repurposing machine code as graphics patterns. Intellivision's B-17 Bomber does something similar for its "flak."
Re:Giving up. (Score:5, Funny)
Actually, I've noticed that lately it says something about going outside. Also sarcastic.
Re: (Score:2)
Re: (Score:3, Informative)
Re: (Score:2, Funny)
Re:The Bible (Score:4, Funny)
Re: (Score:2)
Re: (Score:2)
If we assum that the universe is infinite we can also probably read a hard disk image of a fully working Windows Vista Ultimate installation along with all greatest hits of several RIAA-owned artists from the background radiation somewhere. We can even do that today, from locally-available