Show
Ignore:
Timestamp:
08/11/09 16:20:45 (3 years ago)
Author:
Pierre-Alexandre Meyer <pierre@…>
Children:
9c111b3eb8f35bae1f6268eaa1b5f1808acd7d66
Parents:
77632adf09dbf7d4d72ce3763566f1dade3bb0e2
git-author:
Pierre-Alexandre Meyer <pierre@mouraf.org> / 2009-08-11T08:58:19Z-0700
git-committer:
Pierre-Alexandre Meyer <pierre@mouraf.org> / 2009-08-11T09:20:45Z-0700
Message:

ansicon: allow to pass page # to write functions

Some video modes support up to 8 different pages, the current one being
stored at 0x462.

The display page value is passed in BH when invoking the INT 10h Video
Service routines. This patch changes the interface of ansicon_write_char
and ansicon_set_cursor to allow the caller to specify the page.

Signed-off-by: Pierre-Alexandre Meyer <pierre@…>

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • com32/lib/sys/ansicon_write.c

    r11c6d38 re9b317  
    4545 
    4646static void ansicon_erase(const struct term_state *, int, int, int, int); 
    47 static void ansicon_write_char(int, int, uint8_t, const struct term_state *); 
     47static void ansicon_write_char(int, int, int, uint8_t, const struct term_state *); 
    4848static void ansicon_showcursor(const struct term_state *); 
    4949static void ansicon_scroll_up(const struct term_state *); 
    50 static void ansicon_set_cursor(int, int, int); 
     50static void ansicon_set_cursor(int, int, int, int); 
    5151 
    5252static struct term_state ts; 
     
    6565    .op = &__ansicon_ops 
    6666}; 
    67  
    68 #define BIOS_CURXY ((struct curxy *)0x450)      /* Array for each page */ 
    69 #define BIOS_ROWS (*(uint8_t *)0x484)   /* Minus one; if zero use 24 (= 25 lines) */ 
    70 #define BIOS_COLS (*(uint16_t *)0x44A) 
    71 #define BIOS_PAGE (*(uint8_t *)0x462) 
    7267 
    7368/* Reference counter to the screen, to keep track of if we need 
     
    177172} 
    178173 
    179 static void ansicon_set_cursor(int x, int y, int visible) 
    180 { 
    181     const int page = BIOS_PAGE; 
     174static void ansicon_set_cursor(int x, int y, int page, int visible) 
     175{ 
    182176    struct curxy xy = BIOS_CURXY[page]; 
    183177    static com32sys_t ireg; 
     
    194188} 
    195189 
    196 static void ansicon_write_char(int x, int y, uint8_t ch, 
     190static void ansicon_write_char(int x, int y, int page, uint8_t ch, 
    197191                               const struct term_state *st) 
    198192{ 
    199193    static com32sys_t ireg; 
    200194 
    201     ansicon_set_cursor(x, y, 0); 
     195    ansicon_set_cursor(x, y, 0, page); 
    202196 
    203197    ireg.eax.b[1] = 0x09; 
    204198    ireg.eax.b[0] = ch; 
    205     ireg.ebx.b[1] = BIOS_PAGE; 
     199    ireg.ebx.b[1] = page; 
    206200    ireg.ebx.b[0] = ansicon_attribute(st); 
    207201    ireg.ecx.w[0] = 1;