Image Map Image Map
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: Fast line drawing and RGB in 8 BPP

  1. #11

    Default

    Quote Originally Posted by Trixter View Post
    There is a simple fix for that: Allocate two pages in main memory. Whenever there is a pageflip, copy to CGA RAM to display the new visible page, and then swap your "hidden" and "visible" pointers to your main memory pages.
    Indeed, but that is a lot of memory copying for relatively little benefit. Easier to just be aware of the "feature".

  2. #12

    Default

    There are many places where you have code looking like this;
    Code:
            mov     reg,reg        ; Or 'mov     reg,[mem]'
            and     reg,imm
    This can often, but not always*, be made shorter by changing it into this;
    Code:
            mov     reg,imm
            and     reg,reg        ; Or 'and     reg,[mem]'
    For example, this;
    Code:
            mov     bl,dl
            and     bl,07h
    should be replaced with this;
    Code:
            mov     bl,07h
            and     bl,dl
    This;
    Code:
            mov     bl,dl
            shr     bl,1
            shr     bl,1
            shr     bl,1
            and     bl,07h
    with this;
    Code:
            mov     bl,38h
            and     bl,dl
            shr     bl,1
            shr     bl,1
            shr     bl,1
    Yeah, you get the idea.

    *When the destination register is the accumulator (AX or AL) then there's no benefit, it's the same size.
    Looking for a cache card for the "ICL ErgoPRO C4/66d V"

  3. #13

    Default

    Thanks Krille! The nuances of 8086 assembly are slowly returning. Your pointers are greatly appreciated.

  4. #14

    Default

    Quote Originally Posted by Trixter View Post
    There is a simple fix for that: Allocate two pages in main memory. Whenever there is a pageflip, copy to CGA RAM to display the new visible page, and then swap your "hidden" and "visible" pointers to your main memory pages.
    Ah, I just re-read your post (hopefully with comprehension this time). So, yes, I see what you are saying. In the case of rendering to the front buffer, it would just need to copy that back to the off-screen buffer should a page flip occur.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •