PDA

View Full Version : newline / memset



frenchfry164
10-28-2001, 08:28 AM
Someone in gamedev.com chat told me that in 13h, you can clear the screen using newline. What is the command for newline? I tried doing \n but that didn't do anything. Someone also told me to use memset to turn all pixels to 0. How do I do that?

Salem
10-29-2001, 03:08 AM
memset( ptr_to_start_of_screen_memory, 0, number_of_bytes_in_screen_memory);

> you can clear the screen using newline
printf("\n"); probably won't work, but something like
gprintf("\n"); (ie. graphical printf) might

You would need to find out the exact name of this routine, assuming it existed.

kimberleyp
10-29-2001, 05:22 AM
for mode 13h, the video segment address is 0A000h. If you're dealing with 320x200x8, you'll need to set 8000 BYTES after this address (64000 bits).

you can also clear the screen by using inline ASM:

mov ax,13h
int 10h

Peter Kimberley
peter_kimberley@hotmail.com

frenchfry164
10-30-2001, 05:33 PM
Okay. Everytime I try to use memset, it says implicit declaration of memset();

I use brackeen.com's method to using bitmaps here is what I typed:

memset(VGA_256_COLOR_MODE,0,64000);

For some reason DJGPP comes up with a parse error everytime I use in-line assembly, I tried _asm __asm asm asm_ asm__ and all of them do the same thing.

Salem
10-31-2001, 01:21 AM
memset is declared in string.h