#include "lib.h" // -------------------------------------- // Mixed TEXT/HIRES graphics mode. // Sample #2: // This program demonstrates the ability // of the Oric range of computers to put // some HIRES graphics almost anywhere in // a "standard" TEXT display mode. // -------------------------------------- // (c) 1997 Micka‰l Pointier. // This code is provided as-is. // I do not assume any responsability // concerning the fact this is a bug-free // software !!! // Except that, you can use this example // without any limitation ! // If you manage to do something with that // please, contact me :) // -------------------------------------- // -------------------------------------- // For more information, please contact me // on internet: // e-mail: mike@defence-force.org // URL: http://www.defence-force.org // -------------------------------------- // Note: This text was typed with an MS-DOS // editor. So perhaps the text will not be // displayed correctly with other OS. // // For BASIC users: // all the instructions are really simple. // You can convert everything with the following // formulation: // // C=16+1 // FOR I=0 TO 199 // : POKE #A000+I*40,C // : POKE #A000+I*40+19,16 // : POKE #A000+I*40+20,26 // : C=C+1 // : IF C=24 THEN C=17 // NEXT I // // // For C programers: // My objective was not to put some pointer related // stuff in that code, but only to be clear ! // So forget the poke(xxxxx+yyyy*40,zzz)... // Ok, *adr=zzz; adr+=40; will be more efficient, // but as far I'm using poke's, it's understandable // by BASIC programers ! void main() { int i,j; int c; // // Just draw a circle and a line // So we have some HIRES graphixx // to show ! // hires(); curset(60,60,0); circle(60,1); draw(-60,-60,1); // // Restore TEXT mode, and fill // the screen with 'A' characters // text(); for (i=0xbb80;i<0xbfe0;i++) { poke(i,'A'); } // // Now, we patch the screen to // change the color at each line, // then wait 19 characters for // reseting to BLACK paper, // and finaly restores TEXT mode. // c=16+1; for (i=0;i<129;i++) { poke(0xa000+i*40+0 ,c); // Change INK poke(0xa000+i*40+19,16); // Black PAPER poke(0xa000+i*40+20,26); // Text mode c++; if (c==24) c=17; } // // Now, we have to add HIRES attributes // at the end of each TEXT line for making // the HIRES window to appear. We need to // do that for all the HIRES window height ! // for (i=0;i<16;i++) { poke(0xbb80+39+i*40,31); // hires mode } // // This one is used to makes the // HIRES mode starting at the first // scanline. // Without this, the first line will // shows the upper pixels of the 'A's // poke(0xbfdf,31); }