/* * SccsID = @(#)egagraph.h 1.13 04/22/93 Copyright Insignia Solutions Ltd. */ #ifdef EGG typedef union { half_word as_byte; struct { #ifdef BIT_ORDER2 unsigned screen_can_wrap : 1; unsigned split_screen_used : 1; unsigned ht_of_200_scan_lines : 1; unsigned double_pix_wid : 1; unsigned graph_shift_reg : 1; unsigned cga_mem_bank : 1; unsigned chained : 1; unsigned text_mode : 1; #else unsigned text_mode : 1; unsigned chained : 1; unsigned cga_mem_bank : 1; unsigned graph_shift_reg : 1; unsigned double_pix_wid : 1; unsigned ht_of_200_scan_lines : 1; unsigned split_screen_used : 1; unsigned screen_can_wrap : 1; #endif } as_bfld; } DISPLAY_STATE; #define EGA_PALETTE_SIZE 16 extern struct EGA_GLOBALS { int actual_offset_per_line; /* in bytes */ #ifdef VGG _10_BITS screen_split; boolean palette_change_required; boolean colour_256; boolean colour_select; /* 16/64 size palette choice (AR10:7) */ half_word DAC_mask; int mid_pixel_pad; /* video bits 4&5 when AR10:7 = 1 */ int top_pixel_pad; /* video bits 7 & 6 unless 256 colour mode */ half_word palette_ind[EGA_PALETTE_SIZE]; boolean multiply_vert_by_two; #else _9_BITS screen_split; #endif int colours_used; PC_palette palette[EGA_PALETTE_SIZE]; byte border[3]; int plane_mask; int intensity; boolean attrib_font_select; int prim_font_index; /* index (0-3) of primary selected font */ int sec_font_index; /* index (0-3) of secondary selected font */ int underline_start; /* scanline to start drawing underline attr */ DISPLAY_STATE display_state; byte *regen_ptr[4]; } EGA_GRAPH; #ifdef VGG extern PC_palette *DAC; /* Size is `VGA_DAC_SIZE' */ #endif #define get_screen_can_wrap() (EGA_GRAPH.display_state.as_bfld.screen_can_wrap) #define get_200_scan_lines() (EGA_GRAPH.display_state.as_bfld.ht_of_200_scan_lines) #define get_split_screen_used() (EGA_GRAPH.display_state.as_bfld.split_screen_used) #define get_actual_offset_per_line() (EGA_GRAPH.actual_offset_per_line) #define get_ptr_offset(ptr,offs) ((ptr) != NULL ? &((ptr)[offs]) : NULL) #define get_regen_ptr1(offs) get_ptr_offset(EGA_GRAPH.regen_ptr[0],offs) #define get_regen_ptr2(offs) get_ptr_offset(EGA_GRAPH.regen_ptr[1],offs) #define get_regen_ptr3(offs) get_ptr_offset(EGA_GRAPH.regen_ptr[2],offs) #define get_regen_ptr4(offs) get_ptr_offset(EGA_GRAPH.regen_ptr[3],offs) #define get_regen_ptr(x,offs) get_ptr_offset(EGA_GRAPH.regen_ptr[x],offs) #define get_plane_mask() (EGA_GRAPH.plane_mask) #define get_intensity() (EGA_GRAPH.intensity) #define plane0_enabled() (get_plane_mask() & 0x1) #define plane01_enabled() (get_plane_mask() & 0x3) #define plane1_enabled() (get_plane_mask() & 0x2) #define plane2_enabled() (get_plane_mask() & 0x4) #define plane23_enabled() (get_plane_mask() & 0xC) #define plane3_enabled() (get_plane_mask() & 0x8) #define all_planes_enabled() (get_plane_mask() & 0xf) #define get_cga_mem_bank() (EGA_GRAPH.display_state.as_bfld.cga_mem_bank) #define get_graph_shift_reg() (EGA_GRAPH.display_state.as_bfld.graph_shift_reg) #define get_memory_chained() (EGA_GRAPH.display_state.as_bfld.chained) #define get_double_pix_wid() (EGA_GRAPH.display_state.as_bfld.double_pix_wid) #define get_munged_index() (EGA_GRAPH.display_state.as_byte) #define is_it_cga() (EGA_GRAPH.display_state.as_byte & 0x60) #define is_it_text() ((EGA_GRAPH.display_state.as_byte & 0x80) == 0x80) #define get_attrib_font_select() (EGA_GRAPH.attrib_font_select) #ifdef V7VGA #define get_screen_split() (((EGA_GRAPH.screen_split.as_word)+1)<