Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Talith

a tutorial on Mode13 that doesnt work for me

This topic is 5718 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Here is some code that is supposed to work (so i think) but when i compile it gives lots of errors like _AX undeclared and the like. #include <DOS.H> #include <MEM.H> #include <STDLIB.H> #include <STDIO.H> //--[ SETS SCREEN TO MODE 13H ]------------// void setGFXMODE() { _AX = 0x0013; geninterrupt(0x10); } //--[ SETS SCREEN TO TEXT MODE ]----------// void setTXTMODE() { _AX = 0x0003; geninterrupt(0x10); } //--[ PLOTS PIXEL USING BIOS ]------------// void pixelBIOS(int x,int y,char color) { _AH = 0x0C; _AL = color; _CX = x; _DX = y; _BX = 0x01; geninterrupt(0x10); } //--[ PLOTS PIXEL DIRECTLY TO MEMORY ]---// void pixelMEMORY(int x, int y, char color) { memset(MK_FP(0xA000, x+(y*320)), color, 1); } void main() { long ctr; setTXTMODE(); printf("\n\nNOMAD GRAPHICS TUTORIAL - [ PART 1 ]\n"); printf("\n This is a sample code included with GFXTUT1.TXT"); printf("\n to show how to implement the sample codes that"); printf("\n were given in the said tutorial.\n"); printf("\n [ Press Any Key to Begin ]"); (void)getch(); setGFXMODE(); for(ctr=0; ctr<100000; ctr++) pixelBIOS(random(320), random(200), random(256)); setTXTMODE(); printf("\n\nNOMAD GRAPHICS TUTORIAL - [ PART 1 ]\n"); printf("\n That was 100000 random pixels using the BIOS \ method."); printf("\n Press any key again to see 100000 random pixels \ being"); printf("\n plotted using the direct-memory plotting method."); (void)getch(); setGFXMODE(); for(ctr=0; ctr<100000; ctr++) pixelMEMORY(random(320), random(200), random(256)); setTXTMODE(); printf("\n\nNOMAD GRAPHICS TUTORIAL - [ PART 1 ]\n"); printf("\n Now wasn''t that faster? Well, That''s all for"); printf("\n now. See you in GFXTUT2.TXT!...\n"); printf("\n email: [ willietang@hehe.com ]\n"); }

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!