<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><base href="http://www.atari-forum.com/viewtopic.php?f=1&t=23461"><style id="print">
        @media print {
            body {
                margin: 2mm 9mm;
            }

            .original-url {
                display: none;
            }

            #article .float.left {
                float: left !important;
            }

            #article .float.right {
                float: right !important;
            }

            #article .float {
                margin-top: 0 !important;
                margin-bottom: 0 !important;
            }
        }
    </style><title>STE 16 Pixel Trick - Atari-Forum</title><div class="original-url">Pero el STe tiene modos de 304 y de 336 pixels horizontales muy facilitos :)</div><div class="original-url"><br></div><div class="original-url"><br><a href="http://www.atari-forum.com/viewtopic.php?f=1&t=23461">http://www.atari-forum.com/viewtopic.php?f=1&t=23461</a><br><br></div><div id="article" role="article" style="text-rendering: optimizeLegibility; font-family: -apple-system-font; font-size: 1.2em; line-height: 1.5em; margin: 0px; padding: 0px;" class="system exported">
        <!-- This node will contain a number of div.page. -->
    <div class="page" style="text-align: start; word-wrap: break-word; max-width: 100%;"><h1 class="title" style="font-weight: bold; font-size: 1.95552em; line-height: 1.2141em; margin-top: 0px; margin-bottom: 0.5em; text-align: start; -webkit-hyphens: manual; display: block; max-width: 100%;">STE 16 Pixel Trick</h1>/*-----------------------------------------------------------------------*/<br style="max-width: 100%;">/**<br style="max-width: 100%;"> * Handle horizontal scrolling to the left.<br style="max-width: 100%;"> * On STE, there're 2 registers that can scroll the line :<br style="max-width: 100%;"> *  - $ff8264 : scroll without prefetch<br style="max-width: 100%;"> *  - $ff8265 : scroll with prefetch<br style="max-width: 100%;"> * Both registers will scroll the line to the left by skipping the amount<br style="max-width: 100%;"> * of pixels in $ff8264 or $ff8265 (from 0 to 15).<br style="max-width: 100%;"> * As some pixels will be skipped, this means the shifter needs to read<br style="max-width: 100%;"> * 16 other pixels in advance in some internal registers to have an uninterrupted flow of pixels.<br style="max-width: 100%;"> *<br style="max-width: 100%;"> * These 16 pixels can be prefetched before the display starts (on cycle 56 for example) when using<br style="max-width: 100%;"> * $ff8265 to scroll the line. In that case 8 more bytes per line (low res) will be read. Most programs<br style="max-width: 100%;"> * are using $ff8265 to scroll the line.<br style="max-width: 100%;"> *<br style="max-width: 100%;"> * When using $ff8264, the next 16 pixels will not be prefetched before the display<br style="max-width: 100%;"> * starts, they will be read when the display normally starts (cycle 56). While<br style="max-width: 100%;"> * reading these 16 pixels, the shifter won't be able to display anything, which will<br style="max-width: 100%;"> * result in 16 pixels having the color 0. So, reading the 16 pixels will in fact delay<br style="max-width: 100%;"> * the real start of the line, which will look as if it started 16 pixels later. As the<br style="max-width: 100%;"> * shifter will stop the display at cycle 56+320 anyway, this means the last 16 pixels<br style="max-width: 100%;"> * of each line won't be displayed and you get the equivalent of a shorter 304 pixels line.<br style="max-width: 100%;"> * As a consequence, this register is rarely used to scroll the line.<br style="max-width: 100%;"> *<br style="max-width: 100%;"> * By writing a value > 0 in $ff8265 (to start prefetching) and immediatly after a value of 0<br style="max-width: 100%;"> * in $ff8264 (no scroll and no prefetch), it's possible to fill the internal registers used<br style="max-width: 100%;"> * for the scrolling even if scrolling is set to 0. In that case, the shifter will start displaying<br style="max-width: 100%;"> * each line 16 pixels earlier (as the data are already available in the internal registers).<br style="max-width: 100%;"> * This allows to have 336 pixels per line (instead of 320) for all the remaining lines on the screen.<br style="max-width: 100%;"> *<br style="max-width: 100%;"> * Although some programs are using this sequence :<br style="max-width: 100%;"> *        move.w  #1,$ffff8264            ; Word access!<br style="max-width: 100%;"> *   clr.b   $ffff8264               ; Byte access!<br style="max-width: 100%;"> * It is also possible to add 16 pixels by doing :<br style="max-width: 100%;"> *    move.b  #X,$ff8265              ; with X > 0<br style="max-width: 100%;"> *  move.b  #0,$ff8264<br style="max-width: 100%;"> * Some games (Obsession, Skulls) and demos (Pacemaker by Paradox) use this<br style="max-width: 100%;"> * feature to increase the resolution, so we have to emulate this bug, too!<br style="max-width: 100%;"> *<br style="max-width: 100%;"> * So considering a low res line of 320 pixels (160 bytes) :<br style="max-width: 100%;"> *       - if both $ff8264/65 are 0, no scrolling happens, the shifter reads 160 bytes and displays 320 pixels (same as STF)<br style="max-width: 100%;"> *      - if $ff8265 > 0, line is scrolled, the shifter reads 168 bytes and displays 320 pixels.<br style="max-width: 100%;"> *      - if $ff8264 > 0, line is scrolled, the shifter reads 160 bytes and displays 304 pixels,<br style="max-width: 100%;"> *              the display starts 16 pixels later.<br style="max-width: 100%;"> *      - if $ff8265 > 0 and then $ff8264 = 0, there's no scrolling, the shifter reads 168 bytes and displays 336 pixels,<br style="max-width: 100%;"> *             the display starts 16 pixels earlier.<br style="max-width: 100%;"> */</div></div></div><br><br><div id="AppleMailSignature">Enviado desde mi iPhone</div></body></html>