Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - SMS build tools

Reply to topic
Author Message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
SMS build tools
Post Posted: Wed Jun 12, 2019 6:03 am
I'm trying to build a package of binaries for use in continuous builds of SMS assembly projects. It could also be useful as a quick setup for new users. I have these so far:

- WLA DX
- My basic batch file wrapper for WLA DX for single file builds
- BMP2Tile plus plugins
- PSGTool.jar

I'm not intending to pull in source code dependencies like decompressors or PSGLib, those should come with the code. Are there some more tools that would be useful to have?
  View user's profile Send private message Visit poster's website
  • Joined: 24 Sep 2013
  • Posts: 129
Reply with quote
Post Posted: Wed Jun 12, 2019 7:17 am
Sample Makefiles (for Linux/Gnuwin) and sample projects to test the environment. And SDCC for C/mixed projects.

Also having a CMake toolchain config file might be overkill but is really convenient for C projects.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Wed Jun 12, 2019 4:35 pm
I'm expecting people to supply their own libraries and build system, because one size definitely does not fit all there. I'm more aiming for the tools themselves. My goal is to have appveyor builds on commit for all my projects, but I'm not planning on going nuts with makefiles, just some command lines to convert assets, compile and zip, bespoke to the project. For example, in some projects I'm using filename or path conventions to determine to parameters (eg. sfx/*_23.vgm will be two channel sound effects). That's not something to enforce on others.

Having SDCC is probably a good idea, I'm just lazy to learn how to use it :) Is it fairly trivial? Can I unzip and invoke it for some example project out there as a test? It seems to have an exe installer, so builds can presumably just install it headless?
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2507
Reply with quote
Post Posted: Thu Jun 13, 2019 2:17 pm
SDCC just needs its path added to the PATH system variable, then it's absolutely trivial. To build example projects you probably need parts of devkitSMS too, as SMSlib for instance, and a crt0 file.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Thu Jun 13, 2019 3:56 pm
It seems SDCC comes with a proprietary installer and I haven't found any guide to headless installs. I'm somewhat minded to find a way to extract it and then zip it up, as then others can just unzip and modify the path as the build setup, along with the other tools I'm packaging. Once I get it working for my projects I'll document what's involved. I tend to use appveyor but I imagine it will work well for similar CI services.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2507
Reply with quote
Post Posted: Thu Jun 13, 2019 4:18 pm
I guess you can just zip the 'bin' and the 'share' folders and it should work...
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Thu Jun 13, 2019 7:38 pm
Yeah, but I'm trying to automate that... I've figured out how to install it headless (/S commandline parameter), I guess I need to follow the steps for devkitSMS next...
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Tue Jun 18, 2019 9:44 am
OK, so SDCC is a little tricky because it's (not unexpectedly) much bigger than everything else and also because it needs to be kept in its directory structure. Furthermore, the archive ends up bigger than the SDCC installer. Downloading and installing it in an appveyor build is relatively easy, though, so I think I'll leave it for now.

I've got a usable package at https://github.com/maxim-zhao/sms-build-tools/releases/download/1.0.48/tools.7z and an example project using it at https://github.com/maxim-zhao/bocks-birthday-2004 . The package dumps a bunch of programs (and some helper batch files) into a directory and then your build adds that to the path and invokes things as it wishes.

I have tried to include licenses and readmes to avoid angering the free software gods; however I'm not an expert in this area so I hope it's not troublesome to be mixing binaries from differently-licensed projects.

My intention is that this allows you to have continuous builds fairly easily, and when developing locally you just need to similarly have the right things on your path and invoke something to build your assets/code. I'm generally too lazy to create proper makefiles, but it would be nice to see some examples from others.
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 468
Reply with quote
Post Posted: Tue Jun 18, 2019 7:02 pm
I just noticed that the license file of PSGTool mentioned KiddEd instead of PSGTool. I've fixed that and updated the zip in the original post.
You might want to update it in your repository. :)
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2507
Reply with quote
Post Posted: Wed Jun 19, 2019 7:41 am
BMP2Tile isn't the last version in your archive...
BTW What about a short text file with links to everything useful? I think mainly something like a link to tools, forum posts, useful pages, github repositories etc and one line of description, under a category as in

Quote
Music & SFX
==========

Deflemask - Create PSG modules/SFXs, export them to VGM
http://deflemask.com/

Mod2PSG2 - Create PSG modules/SFXs, export them to VGM/EPSGMOD
http://www.smspower.org/Music/Mod2PSG2
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Wed Jun 19, 2019 11:48 am
Sounds like one of those "awesome" list repos. I'm not trying to do that - and I'd rather maintain that as a wiki page.

As for BMP2Tile - indeed the submodule is up to date but because appveyor can't build Delphi, I'm instead downloading a zip and that doesn't auto update. I have a plan for that...
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Wed Jul 03, 2019 6:23 pm
Now updated with the new version of BMP2Tile, fixed license for PSGTool, and WLA DX has bumped past 9.8 to 9.9a.

https://github.com/maxim-zhao/sms-build-tools/releases/tag/1.0.57

You can also get a build of WLA DX for all CPUs with the docs generated here: https://ci.appveyor.com/project/maxim-zhao/wla-dx-6yqhq/build/artifacts
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2507
Reply with quote
Post Posted: Thu Jul 04, 2019 10:14 am
Maxim wrote
You can also get a build of WLA DX for all CPUs with the docs generated here: https://ci.appveyor.com/project/maxim-zhao/wla-dx-6yqhq/build/artifacts


For Windows only, unfortunately :|
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Thu Jul 04, 2019 12:49 pm
I haven't been motivated to try to make a Linux version, although it's probably almost identical as it's just cmake.
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2507
Reply with quote
Post Posted: Thu Jul 04, 2019 1:04 pm
cmake -G "Unix Makefiles"

then

make
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Thu Jul 04, 2019 5:36 pm
And where do the files end up? Edit: in ./binaries, as is sensible. I'm working on the rest now...
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Fri Jul 05, 2019 4:48 pm
And it's done - that was hard work :) Is it even sensible to compile on $LINUX_FLAVOUR and offer the binaries for download? Anyway, binaries compiled on Ubuntu 18.04 here: https://ci.appveyor.com/project/maxim-zhao/wla-dx-6yqhq/build/job/pxbabdj0mut3eb... .
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Tue Oct 08, 2019 10:55 pm
Updates!

* Latest WLA DX master - various interesting things going on over there, e.g. "rst MyLabel", ".union" directive, multi-line .dstruct with named parameters, C++ style comments, ... see https://github.com/vhelin/wla-dx/blob/master/CHANGELOG
* Latest BMP2Tile - supports raw tilemap data (*.bin) as inputs
* Added Floating IPS - useful for making IPS patches (and other formats)

Download at https://github.com/maxim-zhao/sms-build-tools/releases/latest
  View user's profile Send private message Visit poster's website
  • Joined: 23 Aug 2009
  • Posts: 68
  • Location: Seattle, WA
Reply with quote
Post Posted: Wed Oct 09, 2019 1:23 am
The new .UNION and .DSTRUCT functionality has been super useful. If only they’d let me pass register names via macros...
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Wed Oct 09, 2019 6:16 am
You can do more with the \1 style parameters than with named parameters, that might work for registers...
  View user's profile Send private message Visit poster's website
  • Joined: 23 Aug 2009
  • Posts: 68
  • Location: Seattle, WA
Reply with quote
Post Posted: Wed Oct 09, 2019 2:02 pm
I feel like I’ve tried everything, to no avail. I’d love to call SET_VRAM_PTR HL (or DE, etc.) but I think the assembler determines opcodes before doing macro substitution. Anybody figured this out?
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12917
  • Location: London
Reply with quote
Post Posted: Wed Oct 09, 2019 3:01 pm
I've always just made more macros... The alternative might be to use a real preprocessor. WLA's macros are not simple text substitutions.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!