
{"id":920,"date":"2013-10-27T15:58:23","date_gmt":"2013-10-27T14:58:23","guid":{"rendered":"http:\/\/matosimi.websupport.sk\/atari\/?p=920"},"modified":"2021-03-14T22:20:59","modified_gmt":"2021-03-14T21:20:59","slug":"xirius-defect-v1-1","status":"publish","type":"post","link":"http:\/\/matosimi.websupport.sk\/atari\/2013\/10\/xirius-defect-v1-1\/","title":{"rendered":"Xirius Defect v1.1"},"content":{"rendered":"<p>Fakt sa mi to nechce preklada\u0165 do Sloven\u010diny&#8230;<\/p>\n<p>Another year, another Abbuc Software Contest entry. This time it is logical game called Xirius Defect which development was described in my <a title=\"Abbuc SW Contest 2013 Challenge\" href=\"http:\/\/matosimi.websupport.sk\/atari\/2013\/09\/abbuc-sw-contest-2013-challenge\/\" target=\"_blank\" rel=\"noopener noreferrer\">previous post<\/a>. Game took <a title=\"Abbuc SWC 2013 results\" href=\"http:\/\/www.abbuc.de\/atari\/software-ressort\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color: #3366ff;\"><strong>potato medal (4th place) at Abbuc Software Contest 2013<\/strong><\/span><\/a>. Quite surprising result, it really made my day :).<\/p>\n<p><!--more-->I received feedback from Irgendwer that game is great candidate for mouse support so I decided to add this quick fix. I checked Irgendwer&#8217;s routine which he used in his game <a title=\"ECKN+\" href=\"http:\/\/www.youtube.com\/watch?v=KnwpMZAuxZo\" target=\"_blank\" rel=\"noopener noreferrer\">ECKN+<\/a> and it took me about an hour or two to make it work&#8230; at least in emulator.<br \/>\nGameplay video:<br \/>\n<iframe loading=\"lazy\" src=\"\/\/www.youtube.com\/embed\/dNqPA9llz7k?feature=player_detailpage\" height=\"360\" width=\"480\" allowfullscreen=\"\" frameborder=\"0\"><\/iframe><\/p>\n<p>I don&#8217;t know any controller other than joystick, I believe I have not seen paddle in real not even mouse nor touch tablet connected to Atari, so basically I had no clue how it works.<\/p>\n<p>Mouse interface I use is called CMI8 and it is also fully compatible with Atari Touch Tablet. Irgendwer told me that it just uses Paddle0 and Paddle1 for horizontal and vertical coordinates, so I read POT0($D200) and POT1($D201) and wrote respective values to addresses which hold X and Y positions of cursor.<\/p>\n<p>Sounds pretty simple, actually it was quite simple&#8230; but it also required to setup input in <a title=\"Altirra\" href=\"http:\/\/www.virtualdub.org\/altirra.html\" target=\"_blank\" rel=\"noopener noreferrer\">Altirra emulator<\/a> which was not something I do often, so it took some time to make it work.<\/p>\n<p>Mouse click is read from 1 bit of $D300 (PORTA) so it required simple masking (AND #%00000100) to get state of mouseclick (Paddle0 trigger). Everything worked just fine until Irgendwer tried it on real hardware. Result was (as you might guess) that game was not responding to mouse movement at all.<\/p>\n<p>Irgendwer told me I cannot simply read POTx values, because they require kind of initialization. His game <a title=\"ECKN+\" href=\"http:\/\/a8.fandal.cz\/detail.php?files_id=5917\" target=\"_blank\" rel=\"noopener noreferrer\">ECKN+<\/a>&nbsp;uses OsRom and he read those values from shadow registers (which should make it work). Thing is that Xirius Defect does not use OsRom so I have no shadow registers to use. So I ran Altirra debugger and traced OsRom code where POT0 value is written to shadow register and found out that there is one more instruction which I was missing. After successful read of POTx registers there is need to write any value to POTGO ($D20B)&nbsp;which will reset reading of potentiometer values. I checked <a title=\"memory map\" href=\"http:\/\/www.atariarchives.org\/mapping\/memorymap.php\" target=\"_blank\" rel=\"noopener noreferrer\">memory map<\/a> in <a title=\"Mapping The Atari\" href=\"http:\/\/www.atariarchives.org\/mapping\/\" target=\"_blank\" rel=\"noopener noreferrer\">Mapping The Atari<\/a> and saw that this information is there, but I read it too swiftly that I did not noticed that, especially when game was working in emulator without such reset.<\/p>\n<p>Potentiometers can return values from 0-228 ($E4) which is quite ok when using mouse, but it has specific behavior when Atari Touch Tablet is used. It returns $E4 when you lift your pen from tablet so cursor then jump to right edge of playfield&#8230; this could be ignored, but atari touch technology from &#8217;80 was not that good as touch panels these days so sometimes it does not detect pen on tablet when moving which results in cursor flicker\/jump between current position and right edge of playfield. This glitch was removed simply by not updating cursor position when POTx returns value $E4.<\/p>\n<p>Irgendwer reported this behavior to Phaeron (author of <a title=\"Altirra\" href=\"http:\/\/www.virtualdub.org\/altirra.html\" target=\"_blank\" rel=\"noopener noreferrer\">Altirra emulator<\/a>) so upcoming version of Altirra will work same as real hardware (btw <a href=\"https:\/\/github.com\/Jaskier\/Atari800Win-PLus\" target=\"_blank\" rel=\"noopener noreferrer\">Atari800win plus 4.1<\/a>&nbsp;has same issue) and it will require potentiometer reset by POTGO&nbsp;in order to receive updated POTx values.<\/p>\n<p>It took 2 weeks to make this &#8220;quick&#8221; fix working. It was really torture because of bug in both emulators.<\/p>\n<p>Controller selection has been added to title screen (press Select key to change between joystick and CMI08\/Atari Touch Tablet). Game starts after pressing Start key (it was joystick fire button in Abbuc version). Also delay between title screen and info screen has been added so no more info screen skipping.<\/p>\n<p>I also experimented with ST\/Amiga mouse driver, but it sucked a lot (movement was too quirky and it feels like mouse being operated by drunken monkey) so I removed it from game.<\/p>\n<p>Those are changes made to Abbuc version of game, so now it carries version number 1.1.<\/p>\n<p>Enjoy!<\/p>\n<div style=\"background: #fff8f0;border-radius: 5px;border: solid 2px #f92;margin-bottom: 1px;\">\r\n <div class=\"wpfilebase-fileicon\"><a href=\"http:\/\/matosimi.websupport.sk\/atari\/download\/my_games\/xirius_defect_v1_1.xex\" title=\"Download Xirius Defect v1.1\"><img align=\"middle\" src=\"http:\/\/matosimi.websupport.sk\/atari\/wp-includes\/images\/crystal\/xex.png\" alt=\"Xirius Defect v1.1\" \/><\/a><\/div>\r\n <div class=\"wpfilebase-rightcol\">\r\n  <div class=\"wpfilebase-filetitle\">\r\n   <a href=\"http:\/\/matosimi.websupport.sk\/atari\/download\/my_games\/xirius_defect_v1_1.xex\" title=\"Download Xirius Defect v1.1\" style=\"font-weight:bold;\">Xirius Defect v1.1<\/a><br \/>\r\n   xirius_defect_v1_1.xex<br \/>\r\n   Version: 1.1<br \/>\r\n   \r\n  <\/div>\r\n  <div class=\"wpfilebase-filedetails\" id=\"wpfilebase-filedetails1\" style=\"display: none;\">\r\n  <p>Abbuc SW Contest 2013 entry<\/p>\r\n  <table border=\"0\">\r\n   \r\n   <tr><td><strong>Author:<\/strong><\/td><td>Martin \u0160ime\u010dek<\/td><\/tr>\r\n   \r\n   \r\n   <tr><td><strong>Category:<\/strong><\/td><td>My Games<\/td><\/tr>\r\n   \r\n   <tr><td><strong>Date:<\/strong><\/td><td>October 26, 2013<\/td><\/tr>\r\n   \n  <\/table>\r\n  <\/div>\r\n <\/div>\r\n <div class=\"wpfilebase-fileinfo\">\r\n  14.4 KiB<br \/>\r\n  2164 Downloads<br \/>\r\n  <a href=\"#\" onclick=\"return wpfilebase_filedetails(1);\">Details...<\/a>\r\n <\/div>\r\n <div style=\"clear: both;\"><\/div>\r\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Fakt sa mi to nechce preklada\u0165 do Sloven\u010diny&#8230; Another year, another Abbuc Software Contest entry. This time it is logical [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1177,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,4],"tags":[8,9,22,93],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Xirius Defect v1.1 - MatoSimi<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/matosimi.websupport.sk\/atari\/2013\/10\/xirius-defect-v1-1\/\" \/>\n<meta property=\"og:locale\" content=\"sk_SK\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Xirius Defect v1.1 - MatoSimi\" \/>\n<meta property=\"og:description\" content=\"Fakt sa mi to nechce preklada\u0165 do Sloven\u010diny&#8230; Another year, another Abbuc Software Contest entry. This time it is logical [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/matosimi.websupport.sk\/atari\/2013\/10\/xirius-defect-v1-1\/\" \/>\n<meta property=\"og:site_name\" content=\"MatoSimi\" \/>\n<meta property=\"article:published_time\" content=\"2013-10-27T14:58:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-14T21:20:59+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/matosimi.websupport.sk\/atari\/wp-content\/uploads\/2015\/09\/xd2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"336\" \/>\n\t<meta property=\"og:image:height\" content=\"240\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"MatoSimi\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"MatoSimi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/matosimi.websupport.sk\/atari\/2013\/10\/xirius-defect-v1-1\/\",\"url\":\"http:\/\/matosimi.websupport.sk\/atari\/2013\/10\/xirius-defect-v1-1\/\",\"name\":\"Xirius Defect v1.1 - MatoSimi\",\"isPartOf\":{\"@id\":\"http:\/\/matosimi.websupport.sk\/atari\/#website\"},\"datePublished\":\"2013-10-27T14:58:23+00:00\",\"dateModified\":\"2021-03-14T21:20:59+00:00\",\"author\":{\"@id\":\"http:\/\/matosimi.websupport.sk\/atari\/#\/schema\/person\/2ff9bfa973a868c31914b5b1b659b697\"},\"inLanguage\":\"sk\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/matosimi.websupport.sk\/atari\/2013\/10\/xirius-defect-v1-1\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/matosimi.websupport.sk\/atari\/#website\",\"url\":\"http:\/\/matosimi.websupport.sk\/atari\/\",\"name\":\"MatoSimi\",\"description\":\"8-bit Atari and other stuff\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/matosimi.websupport.sk\/atari\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"sk\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/matosimi.websupport.sk\/atari\/#\/schema\/person\/2ff9bfa973a868c31914b5b1b659b697\",\"name\":\"MatoSimi\",\"url\":\"http:\/\/matosimi.websupport.sk\/atari\/author\/matosimi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Xirius Defect v1.1 - MatoSimi","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/matosimi.websupport.sk\/atari\/2013\/10\/xirius-defect-v1-1\/","og_locale":"sk_SK","og_type":"article","og_title":"Xirius Defect v1.1 - MatoSimi","og_description":"Fakt sa mi to nechce preklada\u0165 do Sloven\u010diny&#8230; Another year, another Abbuc Software Contest entry. This time it is logical [&hellip;]","og_url":"http:\/\/matosimi.websupport.sk\/atari\/2013\/10\/xirius-defect-v1-1\/","og_site_name":"MatoSimi","article_published_time":"2013-10-27T14:58:23+00:00","article_modified_time":"2021-03-14T21:20:59+00:00","og_image":[{"width":336,"height":240,"url":"http:\/\/matosimi.websupport.sk\/atari\/wp-content\/uploads\/2015\/09\/xd2.png","type":"image\/png"}],"author":"MatoSimi","twitter_misc":{"Written by":"MatoSimi","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/matosimi.websupport.sk\/atari\/2013\/10\/xirius-defect-v1-1\/","url":"http:\/\/matosimi.websupport.sk\/atari\/2013\/10\/xirius-defect-v1-1\/","name":"Xirius Defect v1.1 - MatoSimi","isPartOf":{"@id":"http:\/\/matosimi.websupport.sk\/atari\/#website"},"datePublished":"2013-10-27T14:58:23+00:00","dateModified":"2021-03-14T21:20:59+00:00","author":{"@id":"http:\/\/matosimi.websupport.sk\/atari\/#\/schema\/person\/2ff9bfa973a868c31914b5b1b659b697"},"inLanguage":"sk","potentialAction":[{"@type":"ReadAction","target":["http:\/\/matosimi.websupport.sk\/atari\/2013\/10\/xirius-defect-v1-1\/"]}]},{"@type":"WebSite","@id":"http:\/\/matosimi.websupport.sk\/atari\/#website","url":"http:\/\/matosimi.websupport.sk\/atari\/","name":"MatoSimi","description":"8-bit Atari and other stuff","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/matosimi.websupport.sk\/atari\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"sk"},{"@type":"Person","@id":"http:\/\/matosimi.websupport.sk\/atari\/#\/schema\/person\/2ff9bfa973a868c31914b5b1b659b697","name":"MatoSimi","url":"http:\/\/matosimi.websupport.sk\/atari\/author\/matosimi\/"}]}},"_links":{"self":[{"href":"http:\/\/matosimi.websupport.sk\/atari\/wp-json\/wp\/v2\/posts\/920"}],"collection":[{"href":"http:\/\/matosimi.websupport.sk\/atari\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/matosimi.websupport.sk\/atari\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/matosimi.websupport.sk\/atari\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/matosimi.websupport.sk\/atari\/wp-json\/wp\/v2\/comments?post=920"}],"version-history":[{"count":21,"href":"http:\/\/matosimi.websupport.sk\/atari\/wp-json\/wp\/v2\/posts\/920\/revisions"}],"predecessor-version":[{"id":1690,"href":"http:\/\/matosimi.websupport.sk\/atari\/wp-json\/wp\/v2\/posts\/920\/revisions\/1690"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/matosimi.websupport.sk\/atari\/wp-json\/wp\/v2\/media\/1177"}],"wp:attachment":[{"href":"http:\/\/matosimi.websupport.sk\/atari\/wp-json\/wp\/v2\/media?parent=920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/matosimi.websupport.sk\/atari\/wp-json\/wp\/v2\/categories?post=920"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/matosimi.websupport.sk\/atari\/wp-json\/wp\/v2\/tags?post=920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}