newline / memset

This is a discussion on newline / memset within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Someone in gamedev.com chat told me that in 13h, you can clear the screen using newline. What is the command ...

  1. #1
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552

    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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
    peter_kimberley@hotmail.com

  4. #4
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 04:48 AM
  2. Possible circular definition with singleton objects
    By techrolla in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2004, 09:46 AM
  3. Simple Question on Correct Usage of memset
    By deadpoet in forum C++ Programming
    Replies: 2
    Last Post: 03-16-2004, 07:58 AM
  4. memset has conflicting declaration
    By mangoMan in forum C++ Programming
    Replies: 2
    Last Post: 03-02-2004, 09:08 AM
  5. memset() or ZeroMemory()
    By jdinger in forum C++ Programming
    Replies: 2
    Last Post: 05-10-2002, 09:38 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21