Computer Engineering II
Kalbarczyk, Fall 2000

Machine Problem 4: High Quality Graphics

Assigned Thursday, October 26, 2000
Purpose Protected Mode, Great Graphics, Mouse
Points 75
Due Date Tuesday Nov 14 5:00pm
This MP is under construction


Ever looked at something like Adobe Photoshop and wondered how they did it? Or even Windows Paint? In MP4 we are going to create a program somewhere inbetween the previous two. You now have the amazing tool of Protected Mode Programming available to you. It's time to start really using it.

Problem Description

We're going to implement some features that you might expect in a paint program:

Only it won't be the plain vanilla way of doing things. We're doing a full alpha-blit for stamping images. This way we can stamp images that have a drop shadow, and have it look good. We're writing in an anti-aliased font, which again makes the text look rather good. We're drawing anti-aliased lines--none of the stairstep jagginess of plain lines for us!

Take a look at the pages we've linked above for full information on how to implement them. You probably need to learn it before you start coding.

We're also using the brand new High Resolution Graphics library written by our very own Pete Johnson, to let you do these amazing tasks. Read up on it--as it alone tells you of some known problems when trying to use it, especially in conjunction with cv32. Check back if you start running into issues you really don't understand, and let us know so we can add it to the page.

The Procedures

You are required to code 9 functions. These functions are described in C notation whenever you see the parenthesis, or assembly notation if you see register names. Don't forget the leading underscore that goes unwritten in the C notation!

Note: I've tried to list these in something approaching order of difficulty. You can certainly approach them in any order you feel appropriate, but we strongly suggest understanding and/or implementing AlphaBlit() before AALine().

void ClearImage(int color)

bool InstallMouse(void)

void RemoveMouse(void)

void MouseCallback(DPMI_REGS *DPMIRegsPtr)

void DrawChar(short DestSel, int *Dest, short Char, int CharPos, int Color)

void AlphaBlit(short DestSel, int *Dest, int DestWidth, short DestX, short DestY, short SrcSel, int *Src, int SrcWidth, int SrcHeight)


void AALine(short x0, short y0, short x1, short y1, int Color)

void DrawPixelD(char *addr, int Color)

Preliminary Procedure

Monitor the newsgroup and this on-line section for revisions to the MP or to the write-up

Final Steps

  1. Verify that your program meets all requirements for handin.
  2. Print a copy of the MP4 grading sheet.
  3. Demonstrate MP4.EXE to a TA or to the instructor.
  4. Be prepared to answer questions about any aspect of the operation of your program. The TAs will not accept an MP if you cannot fully explain all operations of your code.
  5. Handin in your program with the TA on the Web Page
  6. Print your MP4.ASM 4 pages per page and double sided. If you don't know how to do this ask a TA for assistance.
  7. Staple the MP4 grading sheet to the front of your MP4.ASM file and give both to the same TA that approved your demonstration.