News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Assembly Project Structure and File Types  (Read 1775 times)

RyanfaeScotland

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • My Brill Game Site
Assembly Project Structure and File Types
« on: March 13, 2019, 06:36:16 pm »
Hey folks,

Looking for a little debate, discussion and recommendations on the suggested directory layout and file types for assembly projects in preparation of my Toejam and Earl disassembly project progresses to the full blown project stage.

I've been looking over the GitHub repos of Sonic Retro and they are fairly consistent with their file types: .asm for source files, .bin for binary files and, well that's about it including a few batch files which are obvious .bat. Is this the most common style and is there reasoning behind it? My assembler uses .x68 assembly files so I'm sticking with that but I also have .dat files for any source code files made up mainly of DC.B instructions. Finally I've also got .bin files for raw binary data to fit in with the apparent standard (which I might switch all my .dat files over to in due course).

For directory structure though all bets are off! There is even a debate on it in the issue logs of one of the repos. Single file, multiple files, feature based directories, type based, all sorts of options. I've opted currently for a feature based structure currently as it feels most intuitive but if people know better options I'd rather hear now than when I'm knee deep in source code.

Here is what I like the look of (based loosely on this post from Stack Overflow). In the following 'feature' can be game features (players, NPCs, items and the like) or hardware features (VDP, sound, input and the like):

Root
|____ Source
|     |
|     |____Feature A
|     |    |
|     |    |____ Code
|     |    |____ Data
|     |    |____ Graphics
|     |
|     |____Feature B
|     |    |
|     |    |____ Code
|     |    |____ Data
|     |    |____ Graphics
|     |
|     |____Feature C
|     |    |
|     |    |____ Code
|     |    |____ Data
|     |    |____ Graphics
|     |
|     |
...

What's your thoughts on the matter?
« Last Edit: March 14, 2019, 06:32:58 pm by RyanfaeScotland »

tvtoon

  • Sr. Member
  • ****
  • Posts: 371
    • View Profile
Re: Assembly Project Structure and File Types
« Reply #1 on: March 14, 2019, 03:15:32 pm »
Terrible organization in that topic. People have been suffering from OCD of the worst kind to build hierarchies.

I advise you to not build based on "features", the common way people do games is still "device based": "soundx.asm", "vdpx.asm", "joy.asm"... I have them suggested as files because I only enlarge stuff to directories as needed, not a matter of how many lines.

And data split from code whenever possible. ;)

RyanfaeScotland

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • My Brill Game Site
Re: Assembly Project Structure and File Types
« Reply #2 on: March 14, 2019, 06:50:27 pm »
Cheers tvtoon, "feature" in my head would also include devices, not just the tradition 'game feature' so I'd have a directory for VDP, Sound, Input and so on as well and in them would be the code and data related to processing (however the actual sound/music/graphic files would be in with the game feature they relate to). I've added this clarity to the first post too.

Rest assured I don't want to take the directory thing too far either, so for example there would just be 1 directory for Enemies and then a file per Enemy. File size won't be a factor into it.  :thumbsup:

And yup, data and code in different files! Half the work in the disassembly was splitting them out, I'm not letting them get back together now. :D

Cheers for the thoughts, appreciated.