Thread: newline / memset

  1. #1

    newline / memset

    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?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    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.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    19
    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
    [email protected]

  4. #4
    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.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    memset is declared in string.h
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. info on memset and recv
    By lolguy in forum Networking/Device Communication
    Replies: 15
    Last Post: 11-12-2009, 05:48 AM
  2. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 10:46 AM
  3. Simple Question on Correct Usage of memset
    By deadpoet in forum C++ Programming
    Replies: 2
    Last Post: 03-16-2004, 08:58 AM
  4. memset has conflicting declaration
    By mangoMan in forum C++ Programming
    Replies: 2
    Last Post: 03-02-2004, 10:08 AM
  5. memset() or ZeroMemory()
    By jdinger in forum C++ Programming
    Replies: 2
    Last Post: 05-10-2002, 09:38 AM