Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- //this is so I can start coding logic without having to build a cross-compiler
- //the only s_* method that should access by external code is s_put_char(char,int)
- //all methods beginning with s_* are referring to the screen output
- #define s_rows 25
- #define s_columns 80
- #define s_buffer_size 2000 //80x25 = 2000
- char flags = 0;
- //first bit is if the screen is inited or not.
- char s_buffer[s_buffer_size]; //80x25
- void s_update()
- {
- system("cls");
- printf(s_buffer);
- }
- void s_init()
- {
- int index = 0;
- while(index < s_buffer_size)
- {
- //s_buffer[index] = ' ';
- index++;
- }
- flags += 128; //flip first bit
- s_update;
- }
- void s_put_char(char c, unsigned int index)
- {
- if(flags < 128){ s_init(); }
- //checks to see if the first bit is flipped or not.
- //if first bit not flipped, then screen needs to be inited
- s_buffer[index] = c;
- s_update();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement