🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: maus.lang.c
Article #3

Re: PutPixel

#3
From: Lars Troen
Date: Mon, 11 Sep 1995 13:20
35 lines
1815 bytes
Dominik Deobald (MAGICIAN@m-night.domino.de) wrote:
: Hi...

: Ich suche die schnellste Moeglichkeit in Turbo C++ 3.0 mit einer  
: aufzurufenden Funktion einen Punkt auf den Bildschirm zu bringen.

: (VGA-Modus 13h, also 320x200x256)

: Diese darf auch gerne Inline-ASM benutzen. Sie sollte nur schneller sein  
: als alle anderen.

: a) Bitte keine Mails, dass ich im falschen Brett bin (PC, ANSI, ...)
: b) Antworten bitte als PM. Falls es gewuenscht wird, kann ich da dann das   
:    entgueltige Ergebnis bekanntgeben, also welche Routine die schnellste    
:    ist.

: Die schnellste, die ich bisher habe ist die folgende:

: char *ScreenAddr = (char*)0xA0000000;

: // Schreibt einen Punkt der Farbe 'color' an die stelle 'x/y'
: void drawxy(int x,int y,char color)
: {
:   *(ScreenAddr+320*y+x) = color;

Es ist schneller mit 
    *(ScreenAddr+y<<8+y<<6+x) = color;
: }

--
(***************************************************************************)
(*   Lars Trøen på Høgskolen i Sør-Trøndelag                               *)
(* "The key, the whole key, and nothing but the key. So help me Codd."     *)
(* Who is General Failure and why is he reading my C: drive?               *)
(***************************************************************************)
Technical Details
Message-ID: <431d3a$6ev@astfgl.idb.hist.no>
Path: arc1-ca.pugleaf.net!astfgl.idb.hist.no!larstr
References: <5tQJ7Qt71rB@mpware.m-night.domino.de>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!astfgl.idb.hist.no!larstr
From: larstr@stud.idb.hist.no (Lars Troen)
Newsgroups: maus.lang.c,de.comp.lang.c++,de.comp.lang.c,comp.lang.asm.x86
Subject: Re: PutPixel
Followup-To: maus.lang.c,de.comp.lang.c++,de.comp.lang.c,comp.lang.asm.x86
Date: 11 Sep 1995 13:20:42 GMT
Organization: Sor-Trondelag College, Norway
Message-ID: <431d3a$6ev@astfgl.idb.hist.no>
References: <5tQJ7Qt71rB@mpware.m-night.domino.de>
NNTP-Posting-Host: oversoul.idb.hist.no
X-Newsreader: TIN [version 1.2 PL2+l]