{"id":2410,"date":"2025-03-18T01:03:58","date_gmt":"2025-03-17T23:03:58","guid":{"rendered":"https:\/\/www.julien-nevo.com\/arkostracker\/?page_id=2410"},"modified":"2025-08-22T12:10:26","modified_gmt":"2025-08-22T10:10:26","slug":"source-conversion-with-disark","status":"publish","type":"page","link":"https:\/\/www.julien-nevo.com\/arkostracker\/index.php\/source-conversion-with-disark\/","title":{"rendered":"Source conversion with Disark"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>This page is a stand-alone explanation of what is explained <a href=\"https:\/\/www.julien-nevo.com\/arkostracker\/index.php\/using-a-song-in-production-using-any-assembler\/\" data-type=\"page\" data-id=\"2324\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n<\/blockquote>\n\n\n\n<p>You don&#8217;t use Rasm because you already have an assembler you like, but your assembler does not understand Rasm mnemonics and macros. One possibility is to convert the player and music sources manually&#8230; But they are very complicated, as many macros\/conditions are used. So are you stuck in including a non-relocatable binary of the player and music?<\/p>\n\n\n\n<p>Well, no! A new command line tool has appeared:&nbsp;<strong>Disark<\/strong>. You can&nbsp;<a href=\"http:\/\/julien-nevo.com\/disark\/\" target=\"_blank\" rel=\"noreferrer noopener\">check its web-page<\/a>&nbsp;to download it.<\/p>\n\n\n\n<p>Disark is a disassembler, but can be used to&nbsp;<strong>convert sources<\/strong>. You can convert&nbsp;<strong>any<\/strong>&nbsp;source into your assembler, such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SDCC \/ SDASZ80<\/li>\n\n\n\n<li>Winape \/ Maxam<\/li>\n\n\n\n<li>Pasmo<\/li>\n\n\n\n<li>Vasm<\/li>\n\n\n\n<li>Orgams<\/li>\n\n\n\n<li>Or use the default profile, which should work for many assemblers.<\/li>\n\n\n\n<li>If you want something specific, simply ask!<\/li>\n<\/ul>\n\n\n\n<p>Once you have chosen your player and the music is ready, you only need to make&nbsp;<strong>the conversion once<\/strong>.<\/p>\n\n\n\n<p>This is a 2-step process:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Assemble the sources with Rasm<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Download the Rasm for Windows, Linux and MacOsX&nbsp;<a href=\"https:\/\/github.com\/EdouardBERGE\/rasm\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/li>\n\n\n\n<li>Create a small source to include the player and the music. For example:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>;No need to put a ORG or anything.\n\n;Declare the hardware (check the player source for the flag to declare.\n;CPC'ers don't need to add anything, CPC is default).\nPLY_AKG_HARDWARE_MSX = 1&nbsp;&nbsp; ;MSX is used here, for example.\n\n;If sound effects, declares the SFX flag. Once again,\n;check the player source to know what flag to declare.\nPLY_AKG_MANAGE_SOUND_EFFECTS = 1&nbsp;&nbsp;&nbsp;&nbsp; ;Remove the line if no SFX!\n\ninclude \"PlayerAkg.asm\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;This is the AKG player.\ninclude \"MySuperSong.asm\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;This is the music.\ninclude \"SoundEffects.asm\"&nbsp;&nbsp;&nbsp;&nbsp; ;SFX, if you have some.<\/code><\/pre>\n\n\n\n<p><em>Note (1): if you use the&nbsp;<a href=\"https:\/\/www.julien-nevo.com\/arkostracker\/index.php\/player-configuration\/\" data-type=\"page\" data-id=\"1302\" target=\"_blank\" rel=\"noreferrer noopener\">Player Configuration<\/a>&nbsp;feature, you must include the configuration file(s)<strong>&nbsp;before&nbsp;<\/strong>the player.<\/em><\/p>\n\n\n\n<p><em>Note (2): if you use the ROM players, the ROM flag\/buffer location must be included too (check the player once again to know the flags).<\/em><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Assemble this source with Rasm like this:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>rasm PlayerAndMusic.asm -o PlayerAndMusic -s -sl -sq<\/code><\/pre>\n\n\n\n<p><em>PlayerAndMusic.asm<\/em>&nbsp;is the source above. The &#8220;<em>-o PlayerAndMusic<\/em>&#8221; indicates the base filename for the generated files (<em>PlayerAndMusic.bin<\/em>&nbsp;and&nbsp;<em>PlayerAndMusic.sym<\/em>&nbsp;(the symbol file)).<\/p>\n\n\n\n<p>The<em>&nbsp;&#8220;-s -sl -sq&#8221;&nbsp;<\/em>options are<strong>&nbsp;very important<\/strong>, they ask to generate a&nbsp;<em>.sym<\/em>&nbsp;(symbol file) that Disark can use to recreate a faithful source.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Generate a source for your assembler, from the binary<\/h2>\n\n\n\n<p>Let the magic happen. Use Disark (in the&nbsp;<em>tools&nbsp;<\/em>folder) to convert the binary+symbol file into a new source file your assembler will like!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Disark.exe PlayerAndMusic.bin Final.asm --symbolFile PlayerAndMusic.sym --sourceProfile sdcc<\/code><\/pre>\n\n\n\n<p><strong>That&#8217;s it!<\/strong>&nbsp;A&nbsp;<em>Final.asm<\/em>&nbsp;source has been generated for SDCC. You can include it directly in your SDCC sources, it compiles and is&nbsp;<strong>relocatable<\/strong>!<\/p>\n\n\n\n<p>Of course the &#8220;source profile&#8221; parameter accept other values:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>winape, maxam, pasmo, vasm, sdcc, orgams.<\/li>\n<\/ul>\n\n\n\n<p>You can also omit the&nbsp;<em>sourceProfile<\/em>, in which case Disark produces a source with no specificity at all, which is fine for many many assemblers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Notes<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SDCC external labels are generated for the init\/stop\/play labels (if you use SDCC profile of course).<\/li>\n\n\n\n<li>One thing you should not do is mess with the generated source: for example, if you want to split the music and player into two sources, do not split the &#8220;disarked&#8221; source file: one part may reference the other (This is only a re-generated source after all). If you want to do that, do it right from the start, using two sources instead of one (one source will have the player, the other the music, and you will Disark them separately).<\/li>\n\n\n\n<li>Disark is a generic-purpose disassembler\/source converter, so check out its&nbsp;<a href=\"http:\/\/julien-nevo.com\/disark\/\">web-page<\/a>&nbsp;if you want to have your sources to be&nbsp;<em>Disarkable&nbsp;<\/em>(this is a new word I have just invented).<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This page is a stand-alone explanation of what is explained here. You don&#8217;t use Rasm because you already have an assembler you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":203,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_vp_format_video_url":"","_vp_image_focal_point":[],"footnotes":""},"class_list":["post-2410","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.julien-nevo.com\/arkostracker\/index.php\/wp-json\/wp\/v2\/pages\/2410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.julien-nevo.com\/arkostracker\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.julien-nevo.com\/arkostracker\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.julien-nevo.com\/arkostracker\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.julien-nevo.com\/arkostracker\/index.php\/wp-json\/wp\/v2\/comments?post=2410"}],"version-history":[{"count":2,"href":"https:\/\/www.julien-nevo.com\/arkostracker\/index.php\/wp-json\/wp\/v2\/pages\/2410\/revisions"}],"predecessor-version":[{"id":2659,"href":"https:\/\/www.julien-nevo.com\/arkostracker\/index.php\/wp-json\/wp\/v2\/pages\/2410\/revisions\/2659"}],"wp:attachment":[{"href":"https:\/\/www.julien-nevo.com\/arkostracker\/index.php\/wp-json\/wp\/v2\/media?parent=2410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}