#include "lib.h" // -------------------------------------- // Mixed TEXT/HIRES graphics mode. // Sample #1: // This program demonstrates the ability // of the Oric range of computers to use // different color per scanline, even in // 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=1 // FOR I=0 TO 199 // : POKE #A000+I*40,C // : POKE #A001+I*40,26 // : C=C+1 // : IF C=8 THEN C=1 // 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; cls(); // // Display a stupid TEXT to screen // printf("Cool effect, no ???????\n"); printf("Next time, it will be better !\n\n"); printf("Some letters are destroyed...\n\n"); printf("Colors are hard to read...\n"); printf("I don't know why there is a white"); printf("stripe at the bottom right...\n\n\n"); printf("But it works !!!!!!!\n\n"); printf("And it's TEXT MODE\n\n\n"); printf(" (c) 1997/98 Dbug \n\n"); // // First, we must set the 200 HIRES // scan-lines to the values we want ! // For instance, we want to change the // INK color, and then switch back to // TEXT mode. // c=1; for (i=0;i<200;i++) { poke(0xa000+i*40+0,c); // Raster color (set attribut) poke(0xa000+i*40+1,26); // Text mode c++; if (c==8) c=1; // Just to avoid BLACK color for INK } // // We have to set the 25 displayable // TEXT line, for calling HIRES mode. // for (i=0;i<25;i++) { poke(0xbb80+i*40+39,31); // hires mode } }