{"id":25,"date":"2012-04-19T23:45:44","date_gmt":"2012-04-19T23:45:44","guid":{"rendered":"http:\/\/retroramblings.net\/?p=25"},"modified":"2012-05-26T09:45:40","modified_gmt":"2012-05-26T09:45:40","slug":"tricks-with-ham-images","status":"publish","type":"post","link":"http:\/\/retroramblings.net\/?p=25","title":{"rendered":"Tricks with HAM images"},"content":{"rendered":"<p>Back in 1985 when the Amiga was first released, the HAM (Hold And Modify) screenmode was revolutionary. It allowed 4096 colours to be displayed simultaneously, meaning near true-colour images could be displayed while only using the amount of memory that a normal 64-colour screen would use.<\/p>\n<p>HAM does have its disadvantages, though &#8211; while a regular bitplane image can be faded out very easily by simply fading the palette, this trick doesn&#8217;t work for HAM images.<\/p>\n<p>Fading out a HAM image can be done, however, using the Blitter.<\/p>\n<p>This AMOSPro program uses some &#8220;evil&#8221; trickery to fade a HAM image to black, using the Screen Copy command with blitter modes, peeks and pokes to shuffle bitplanes around between screens, and what amounts to a ShadeBOB routine over the entire screen.<\/p>\n<p>Step by step, the theory of operation is something like this:<\/p>\n<ul>\n<li>Logical OR the two control planes together to make a mask plane.\u00a0 This mask plane is &#8220;0&#8221; wherever pixels use the base palette, and &#8220;1&#8221; wherever a direct R, G or B level is being specified.<\/li>\n<li>Use the mask plane to perform binary subtraction on the four data planes, using another spare plane to hold carry data.<\/li>\n<li>Check for overflow, and zero the image wherever overflow has occurred.<\/li>\n<\/ul>\n<p>This is done simultaneously with fading out the palette, and the end result is quite a nice fade-out of a HAM image.<\/p>\n<p><a title=\"HAM Fading demo, includes AMOSPro source\" href=\"http:\/\/retroramblings.net\/downloads\/HAMFade.lha\">Download: Compiled HAM fading slideshow, including AMOSPro source code<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back in 1985 when the Amiga was first released, the HAM (Hold And Modify) screenmode was revolutionary. It allowed 4096 colours to be displayed simultaneously, meaning near true-colour images could be displayed while only using the amount of memory that &hellip; <a href=\"http:\/\/retroramblings.net\/?p=25\">Continue reading <span class=\"meta-nav\">&rarr;<\/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":[3,5],"tags":[],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-amiga","category-amospro"],"_links":{"self":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25"}],"version-history":[{"count":7,"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions"}],"predecessor-version":[{"id":31,"href":"http:\/\/retroramblings.net\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions\/31"}],"wp:attachment":[{"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/retroramblings.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}