whartung wrote:
fschuhi wrote:
There is 6502 source code available for the Williams coin-op system
That's a real trick, being as Williams uses the 6809.
Just checked again, and of course you are right, that doesn't look like 6502 at all. The Atari code does, though, so at least that one might come handy. I wouldn't be surprised if it doesn't. The Apple II port was obviously done by Atari (at least it says so in the intro), so I might get something out of it when I try to understand certain parts of the Apple code.
Quote:
Personally, I learn a language by writing code, not reading it.
Yes, me too. Still, I like the idea of combining learning Python and learning about the 6502, plus learning about game design, using one of my favorite games from ages ago.
Quote:
What are your overall goals from this project? What are you trying to learn, and what are you expecting this to teach you?
I chose the "Nostalgia" board for a reason. It's a bit about revisiting the past and doing something I did not do then. The overall goal is therefore a bit fuzzy, and that's ok for now. At the same time I am really at awe when I see what developers are able to cram into, well, about 13k in the case of Robotron. There are a lot of lessons to learn, I'm sure.
Quote:
Doesn't White Flame have a tracing disassembler on the web? That might be a start.
I checked that out today, did also some reading in the WFDis thread on this board (thanks to White Flame pointing this out to me). That's for sure a great piece of software.
I'm working from a different position, though. WFDis is doing static analysis of the code, guided by manually hinting to where the code might be. I have it easier: I run the code with an emulator, so I know with certainty where the opcodes and their operands are. I am also able to resolve a lot of cases which are difficult (if not impossible) to infer from the code alone, e.g. detecting RTS jump tables and other stack-based wizardry. Because I know everything about the execution flow it is easy to annotate the assembly listing.
From one post from White Flame I have gleaned a nice idea, though. WFDis uses a "flooding" algorithm to try to detect the instructions to disassemble. This idea can be used to detect relocatable code, or what I called "compact subroutines" in the OP. Those are important building blocks and it's good to pinpoint them as early as possible.
I will have to dive deeper into WFDis, though, thanks for bringing this up.
Quote:
Before understanding the robotron code, you best understand the architecture of the Apple II. Notably things like the video hardware, the hows and whys of VBLANK, and screen syncing.
Great feedback! I have already downloaded a number of books on Apple II hardware and software. Particularly the display is a bit messy, due to weird addressing schemes of the colored hires pixels. Operating on sprite data directly in the display memory would be an algorithmic nightmare. But for the purpose of reverse engineering that's actually quite nice - - It's a certainly a bet, but I think the odds are in my favour that the developer of Robotron stored the sprite data somewhere else, in a more legible format. I already know the parts of the code which are responsible to throwing the stuff onto the screen, by watching which parts of the code STA to pages $20 and following. I don't know but I would guess that I'll find the LDA to the sprite tables in the vicinity.
It is certainly not the normal way to understand a target platform, you are right, but it might turn out to be a fun excercise. And don't get me wrong, it's certainly going to be much harder than I just outlined!
At least it looks like Robotron doesn't make use of VBLANK info, as it doesn't access the byte which indicates that the Apple II is in the vertical retrace region. Maybe I don't have to count cycles then.
Quote:
But Robotron won't be simple.
Yeah, thanks for reminding me