pret / pokegold-spaceworld

Disassembly of the Pokémon Gold and Silver 1997 Space World demo
344 stars 59 forks source link

Simplify the build system #68

Closed Rangi42 closed 4 years ago

Rangi42 commented 4 years ago

When pokered, pokegold, and pokecrystal were disassembled, they simply used INCBIN for pieces of the baserom that weren't disassembled yet, and had relatively few object files. Currently pokegold-spaceworld has a system that puts everything in a build/ directory, with one or more SECTIONs per file, and multiple Python tools for generating linkerscript files that somehow involves ; if DEBUG comments. This seems excessively complicated: I think if the goal is to get the whole ROM disassembled, a simpler system would be better, one that makes it easy to disassemble any arbitrary piece of code or data with as few file edits as possible. (The rgbds overlay feature is an improvement over manual INCBINs, but I don't think that depends on the whole rest of the current build infrastructure.)

mid-kid commented 4 years ago

No linkerscript is being generated during build and ; if DEBUG comments aren't being involved at any point. This build system just has at least one section per file and shim.sym is used to quickly define symbols without adding them to a proper source file.

You don't have to update the linkerscript when adding a new section, as it will be placed at whatever location you specify, and make linkerscript can be used to generate a linkerscript from the final .map file, but realistically, it's mostly useful for inspecting the ROM layout easily.

Rangi42 commented 4 years ago

Cool, in that case the old comments and .py tools will just need deleting.

Rangi42 commented 4 years ago

The tools and Makefile have been cleaned up; the ; if DEBUG comments still need removing.