I'm about to develop (just for fun) a retro DOS game with Turbo C 2.01. Currently I'm wirting directly all the pixel information to 0xA0000000 + [y * 320 + x] which is very slow. My vision is to build a game which scrolls very smoothly over the tile map - just like this one (to name one example): http://www.doshaven.eu/game/dark-quest/.

I researched a bit online and found out that there is a attribute controller register where you can write to 13h a 4-bit pixel offset value.

outp(0x3c0, 0x13 | 0x20);
outp(0x3c0, offset_in_x);

But it scrolls my screen only about 16 pixels and I read that this number is limited by the graphics mode (which I confirmed in some tests).

So how is this properly done?

  • \$\begingroup\$ Could you add an animated gif of the effect you'd like to have? \$\endgroup\$
    – Vaillancourt
    Dec 3 '17 at 18:37
  • 1
    \$\begingroup\$ It sounds like you might be looking for Adaptive Tile Refresh - I don't know the implementation details myself, but maybe someone else can jump in? :) \$\endgroup\$
    – DMGregory
    Dec 3 '17 at 18:43
  • 1
    \$\begingroup\$ Very few people are going to go through the trouble of installing a random game just to answer your question. \$\endgroup\$
    – Pikalek
    Dec 3 '17 at 18:54
  • \$\begingroup\$ Also, are you writing the pixels with individual calls? \$\endgroup\$
    – Pikalek
    Dec 3 '17 at 19:19

I may have to see if I can use the port call. As of now, I do it via software which is a lot of loop de doo. First I pre string 4 320x200 images together while slicing them into 10x200 segments, creating a 1280x200 buffer array. I can scroll the 10x200 slices, back and fourth. It works fine for the most part but struggles a little on slow machines. I am struggling to write it in assembly, as it is a bit complicated. In the mean time I am looking at other alternatives myself.

void makesigbuff(char *dest,int width,int height,int dir,int map ) {
register unsigned  long count=0,l=0,k=0;
register unsigned  long i=0,j=0,frames=0;

register long endsig=10;
register long startsig=0;
register long imgs=0;
register long startplace = dir;
 do {

    count = 0;


    for(j=0;j < height + startplace;j++) {

       for(i=0;i < endsig;i++) {

         if(i >= startsig) {  // i > ... to see it in sigments.

             if(j >= startplace) {

                  dest[count+i]=splicearray[frames + map][k];    //+map



     if(j>=startplace) {
          count += 320;    bitwidth;  //SCREEN_WIDTH;

   startsig +=10;

 }while(frames < 32 ); //128


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.