delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/30/18:31:50

From: "Damian Yerrick" <web DOT poison AT pineight DOT 8m DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Creating Allegro Bitmap from Binary Data
Date: Thu, 30 Sep 1999 13:14:25 -0500
Organization: Rose-Hulman Institute of Technology
Lines: 51
Message-ID: <7t09dk$i7l$1@solomon.cs.rose-hulman.edu>
References: <37f39fd3 DOT 0 AT energise DOT enta DOT net>
NNTP-Posting-Host: 137.112.103.81
X-Trace: solomon.cs.rose-hulman.edu 938715380 18677 137.112.103.81 (30 Sep 1999 18:16:20 GMT)
X-Complaints-To: news AT cs DOT rose-hulman DOT edu
NNTP-Posting-Date: 30 Sep 1999 18:16:20 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Tony Friery <tony AT basoft DOT enta DOT net> wrote in message
news:37f39fd3 DOT 0 AT energise DOT enta DOT net...
> Hi there,
>
> I am currently writing an Emulator for the (now near-vintage) Sharp MZ-80B
> and have a question regarding the Screen-Generator Code.
>
> The Graphical Resolution is 2 simultaneous mono-planes of 320x200, and
text
> normally 40x25 using 8x8 font (Conveniently :) ) There is also an
80-column
> mode which means an effective resolution of 640x400 which is what I have
> chosen as the graphics mode.

Sounds like it uses a CGA-ish system.

> At the moment, I use 5 bitmaps (eg FONTRAM, TEXTRAM, VID1RAM, VID2RAM,
> TEMPRAM) in various resolutions and use a combination of stretch_blit,
blit
> and masked_blit to get them onto the screen.
>
> With the text, this is normally OK (I pre-stretch into a temporary bitmap
> beforehand as it will always be y*2 stretched anyway in order to save
> overhead) but I need an efficient way of writing an 8-bit value

I don't know about video RAM, but I know that normal memory bitmaps
created with create_bitmap() can be accessed thus:


BITMAP *foo;
char *pixelLine;
int x, y;

for(y = 0; y < height; y++)
{
  pixelLine = foo->line[y];
  for(x = 0; x < width; x++)
  {
    pixelLine[x] = 69;
  }
}


Once you have your pixels in a bitmap, you can blit() it to the screen.


Damian Yerrick
http://come.to/yerrick


- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019