{"id":1411,"date":"2023-05-18T22:43:05","date_gmt":"2023-05-18T20:43:05","guid":{"rendered":"http:\/\/www.thelins.se\/johan\/blog\/?p=1411"},"modified":"2023-05-18T22:43:39","modified_gmt":"2023-05-18T20:43:39","slug":"tosemu-and-gen-ttp","status":"publish","type":"post","link":"https:\/\/www.thelins.se\/johan\/blog\/2023\/05\/tosemu-and-gen-ttp\/","title":{"rendered":"tosemu and gen.ttp"},"content":{"rendered":"\n<p>This being a long weekend in Sweden, I decided to see if I could make some progress with the <a href=\"https:\/\/github.com\/e8johan\/tosemu\">tosemu<\/a> project.<\/p>\n\n\n\n<p>First a quick recap. Tosemu is what Wine is for Windows, but for TOS from the Atari ST series of computers. I.e. not an emulator, but rather, a translation layer re-implementing the OS APIs. There is of course a bit of emulation going on, as the binaries are made for the glorius Motorola 680&#215;0 series of CPUs, but I digress.<\/p>\n\n\n\n<p>So, I decided to take the let&#8217;s make <em>something<\/em> work approach, so pulled out good old DevPac 3.1 and tried the command line interface to the assembler called <code>gen.ttp<\/code>. After having implemented <a href=\"https:\/\/freemint.github.io\/tos.hyp\/en\/xbios_keyboard.html#Keytbl\">Keytbl<\/a>, <a href=\"https:\/\/freemint.github.io\/tos.hyp\/en\/gemdos_chrinout.html#Cconrs\">Cconrs<\/a>, <a href=\"https:\/\/freemint.github.io\/tos.hyp\/en\/gemdos_chrinout.html#Crawcin\">Crawcin<\/a> and <a href=\"https:\/\/freemint.github.io\/tos.hyp\/en\/gemdos_chrinout.html#Crawio\">Crawio<\/a>, I got this far:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>e8johan@xps13iv:~\/projects\/atari\/tosemu$ make &amp;&amp; .\/bin\/tosemu ..\/inst\/devpac31\/bin\/gen.ttp\nmake: Nothing to be done for 'all'.\nEnter command line:\ndemo\n\nGen Macro Assembler Copyright \ufffd HiSoft 1985-93\nAll Rights Reserved - version 3.10\n\nError: invalid pre-assembled file in assembly options\n\n1 error found\n65535 lines assembled into 0 bytes, Atari executable position-independent code\n42 bytes used out of 16273361, took 0.0 seconds<\/code><\/pre>\n\n\n\n<p>This is where it turns interesting. I did a small fix to the <a href=\"https:\/\/freemint.github.io\/tos.hyp\/en\/gemdos_file.html#Fseek\">Fseek<\/a> function, treating the offset as a signed 32 bit integer instead of an unsigned one, but that didn&#8217;t get me much further. This is where the work becomes interesting, as the next step is to start following the machine code of the program being run, to figure out what is going wrong. Let&#8217;s see when I dare to dive down that rabbit hole.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This being a long weekend in Sweden, I decided to see if I could make some progress with the tosemu project. First a quick recap. Tosemu is what Wine is for Windows, but for TOS from the Atari ST series of computers. I.e. not an emulator, but rather, a translation layer re-implementing the OS APIs. &hellip; <a href=\"https:\/\/www.thelins.se\/johan\/blog\/2023\/05\/tosemu-and-gen-ttp\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">tosemu and gen.ttp<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-1411","post","type-post","status-publish","format-standard","hentry","category-tosemu"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/1411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/comments?post=1411"}],"version-history":[{"count":2,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/1411\/revisions"}],"predecessor-version":[{"id":1413,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/1411\/revisions\/1413"}],"wp:attachment":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/media?parent=1411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/categories?post=1411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/tags?post=1411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}