Image Map Image Map
View RSS Feed

All Blog Entries

  1. CGA Tiny Font (4x4)

    In accordance with yesterday's entry on text rendering, I've now created the routine for a "tiny" font. What this does is take the 8x8 glyphs and compresses them into 4x4 squares by creating a sort of average brightness of each pixel based on the surrounding 4. The four distinct colors of CGA mode 4 (black, magenta, white, cyan) are thus used for brightness and the caller cannot specify the foreground or background colors of the text.

    ...
    Tags: assember, bios, cga, font, x86 Add / Edit Tags
    Categories
    Asm
  2. CGA Text Blit

    I went back and forth over whether or not to write my own text rendering routine in assembler. DOS supplies a decent print string function [1] but it turned out to be insufficient to my needs. My requirements include the ability to change color mid-stream as well as repeat lines of pixel data twice to create a "large" font. Here's a screenshot from a test of the C functions I created back in January:


    There were three functions ...
    Tags: bios, cga, x86 Add / Edit Tags
    Categories
    Asm
  3. PICKUPS 13: Video Games + Stuff | It's a Pixel THING - Ep. 122

    Let's take a look at 20 video games + related stuff that I managed to grab during the last 2 months! There's stuff for the PlayStation 4, PC, PlayStation 3, Xbox 360, PlayStation 2 and the original Xbox!
    Enjoy!

    PICKUPS 13: Video Games + Stuff | It's a Pixel THING - Ep. 122
  4. Variable FPS Animation with DDA

    I just finished writing some code to animate movement and turning. When initially planning to tackled this task I was going to make a lot of assumptions and fix the framerate regardless of the computer speed. This would mean that on fast-enough computers the animation would run as expected but on slower computers it would slow down. Of course, once I started down this path I immediately didn't like it and decided to delve into writing something that would adjust the FPS [1] depending on how much ...
    Tags: bresenham, math Add / Edit Tags
    Categories
    Asm
  5. IDIV and IMUL do not set Sign Flag

    Or more specifically:

    The CF, OF, SF, ZF, AF, and PF flags are undefined.
    What it comes down to is that you cannot safely jump (JS / JNS) based on a signed multiply or divide.

    Code:
    MOV AX, FF00	;
    CWD		; DX:AX = -256
    MOV BX, 0012	; BX = +18
    IDIV	BX	;
    JNS	$+4	; WRONG!
    NEG	AX	; AX = ABS(DX:AX / BX)
    The fix is to re-test the highest byte of the result (DH, AH or AL depending ...):

    Code:
    MOV AX, FF00	;
    ...

    Updated July 11th, 2017 at 07:15 AM by neilobremski (Corrected mistakes identified by Krille)

    Categories
    Asm