Daily using/supporting

Get Firefox browser!
Get Thunderbird!
Get Opera browser!
Get The Gimp!
Get Inkscape!
Get LibreOffice!
Get Videolan!
Get Linux!
Get Mandriva!
Get Joomla!
Hacker Emblem

Archives

Which topics would you like us to cover more?

Latest comments

Latest tweets

about 1 day ago Using REDIPS.drag to add drag and drop to your .Net webapplication #li #dib0 http://t.co/n8zY3s7d
about 7 days ago http://t.co/cknQcDbo #Kindle
about 15 days ago Freedom isn't the ability to choose what to do or say, but the ability to choose what not to do or say #freedom
about 29 days ago http://t.co/61KTQknI #Kindle
12 Apr 2012 Force the use of a networking adapter using C# #li #dib0 http://t.co/ZTJOPzOz
9 Apr 2012 Mandriva 2010.2 and USB devices in Virtualbox http://t.co/fwq9gbHB
9 Apr 2012 Execute a http request to you own site with PHP http://t.co/DIvWPrpd
Ansi C: Nostalgia
Written by Division by Zero   
Saturday, 21 November 2009 12:30

I was looking for some code examples I want to put here. While looking I came across an old application I wrote about 11 years ago. Ansi C nostalgia... I missed you text video memory address B800! Here are some code snippets for nostalgic reasons. It was a console application with multiple layers to draw on.

void initTextMode()
{
 // Create a pointer to the text memory address
 
screen = (char *) MK_FP(0xB800, 0);
}

void cursor_on()
{
 asm mov AH, 3
 asm xor BX, BX
 asm int 10h
 asm and CH, 1Fh
 asm mov AH, 1
 asm int 10h
}

void cursor_off()
{
 asm mov AH, 3
 asm xor BX, BX
 asm int 10h
 asm or  CH, 20h
 asm mov AH, 1
 asm int 10h
}

void drawBuffer()
{
 for (char i=0; i <= currentLayer; i++)
 for (int y=0; y < BufferSize; y++)
 if (layers[i][y] != 0)
 screen[y] = layers[i][y];
}

Yeah... I know... there are probably better ways of doing this, but I was about 17 years at the time.

 

Add comment


Security code
Refresh

Computer science is no more about computers than astronomy is about telescopes. - Edsger Dijkstra


© 2009 - 2012, Division by Zero

Template based on the empire template by joomlashack 

Valid XHTML 1.0 Strict  Valid CSS!  Creative Commons License
This work by Division by Zero is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Netherlands License.