Parma Ham wrote:Where do you recommend someone should go to start learning if they don't know any 68k or z80 assembly? (I know a VERY SMALL amount of NASM-syntax x86 code, and I've only tried it out under DOS. ) What assembler software is needed, and is it free? And where's a good place to learn about the Megadrive/Genesis hardware?.
Here's a good place to learn 68k assembly:
http://mrjester.hapisan.com/04_MC68/It starts explaining the basics of computer memory, bits, bytes, hex, etc. It's very linear and easy to follow. Then there's the reference manual which is a technical explanation of M68000 family. I won't provide a link here, but if you Google something like Motorola M68000 family reference manual you should find a PDF about this document. It's kinda complicated for a beginner and you don't have to learn everything from it to program in 68k.
For z80 here's a good website:
http://sgate.emt.bme.hu/patai/publications/z80guide/It should be detailed enough to cover a lot of information. Of course the official documentation for z80 is always good to have. If you search by using keywords "Z80 User Manual", you should be able to grab a PDF document easily
Actually if you search around, a good number of tutorials can be found.
Here are some free assemblers for m68k:
- ASM68K = Good for beginners and works also on Windows 64-bit
- SNASM68K = Similar to ASM68K but won't work on Windows 64-bit
- ASMX - Never used it, but I heard it has some bugs so I'd stay away from this one
- AS = Powerful assembler which supports many processors (including m68k and z80) and has tons of useful features, but not easy to set up specifically for Megadrive and it's not recommended for beginners
I switched from ASM68K to AS for PS2 and I'll do the same for 3 and 4 since it's much better in my opinion. For the PS disassemblies AS is already set up to work perfectly for PS2 so you shouldn't have any problems.
I didn't work much with z80 assembly, but I used Pasmo when learning some of it. It's similar to ASM68K, so it shouldn't be too complicated to set up. If you look at tutorials specifically for Megadrive and SMS, you should find downloadable examples so you can already take a look at how to set up a batch file to assemble your files.
Unfortunately there's no website that deals specifically with Megadrive programming. So you should look around and learn on your own. My disassemblies can also be used to learn, but you need to keep a reference for the basic stuff. Here's someone's blog that may come in handy:
http://bigevilcorporation.co.uk/This guy was learning, but he explained things in great detail. Again you can find the official documentation (still in PDF format) for Megadrive if you search around using words such as Genesis Software Manual. A great forum to ask questions is this:
http://gendev.spritesmind.net/forum/I think the best source for Megadrive programming is the Sonic Retro website:
http://info.sonicretro.orgIt deals with Sonic for the most part, but it can be a good spot for learning Megadrive in general and you can find disassemblies for the classic Sonic games as well. If you like Sonic you can start looking at those since they spent many years on them.
Even if you didn't ask for SMS, I can link you to a good website:
http://www.smspower.org/You can find and download many documents, tutorials and stuff for SMS and z80, so it's good to know for the first Phantasy Star at least.
Parma Ham wrote:My foremost interest is in cleaning up the games' scripts (fixing typos, etc.), so could you elaborate on this point, as well:
lorenzo wrote:- The game script can be edited at will...Some things require some code tweaking, but most of it can be changed freely.
Everything was labelled in the game script section so, when you change the data inside that section, everything will still work correctly, so it's very flexible. Through AS assembler you can type your text normally as a string, and the assembler will remap them to character-encoding of PS2. You'll see it more clearly in the disassembly. There are some control bytes which govern how to handle text, like newline, new box, etc. Here are some basic ones:
- C1 = new line
- C3 = scroll down
- C4 = close window
For example there can only be 24 characters per line before it starts spilling over, so to avoid this you need to put a C1 or C3.
Another thing to keep in mind is that the game introduction section which shows up after the title screen has text which closes windows automatically, so if you want to extend text, you need to handle logic for having the text scroll automatically, but I won't explain everything now, otherwise it'll be too confusing, especially if you don't see it. So it's relatively easy to edit text provided that you pay attention to the max number of character per line and put those control codes when needed.
Let me know if you have other questions or need clarifications.