OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 1:16 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Register values for VGA mode 320x400 256-color
PostPosted: Wed Apr 24, 2019 3:49 pm 
Offline
Member
Member
User avatar

Joined: Tue Mar 06, 2007 11:17 am
Posts: 1225
Code:
;Version 2019-05-04 (Sat)
;;

align wideword_sz
MCGA_g320x400x256__from13hGen__Regs:

MCGA_g320x400x256__from13hGen__MiscOutputReg:
;General Register, Miscellaneous Output (W; 0x3C2):
;;
;
;  Bits:
;      0 -- I/O Address select
;           Color Emulation  (1) or Monochrome Emulation   (0)
;
;      1 -- Enable RAM
;           Enable video RAM (1) or Disable address decode (0)
;
;    2,3 -- Clock Select - ??? - I currently don't know where is the CS2 bit
;                                so I don't know what configuration is selected here
;           CS2  CS1  CS0  Clock
;           ---  ---  ---  -----
;            0    0    0   25.175 MHz    ;<--this one!!!!!!!
;            0    0    1   28.322 MHz
;         -------------------------------Below this line, consider Oak-specific values
;            0    1    0   65 MHz (external clock per true VGA standard)
;            0    1    1   44.9 MHz (undefined per true VGA standard)
;            1    0    0   14.161 MHz (derived from 28.322 MHz)
;            1    0    1   18 MHz (derived from 36 MHz)
;            1    1    0   40 MHz
;            1    1    1   36 MHz
;
;      4 -- Reserved
;            (0)
;
;      5 -- Page bit for odd/even
;           High 64K         (1) or Low 64K                (0) page of memory
;
;      6 -- Horizontal Sync Polarity
;           Negative         (1) or Posite Vertic. Retrace (0)
;
;      7 -- Vertical Sync Polarity
;           Positive         (0) or Negative Vert. Retrace (0)
;
;      Bits 7-6
;      --------
;            00 -- reserved
;            01 -- 400 lines     ;<-- This one!
;            10 -- 350 lines
;            11 -- 480 lines
;
;
;
;
;
;;
  db 01100011b       ;0x63










MCGA_g320x400x256__from13hGen__FeatureControlReg:
;General Register, Feature Control (RW; 0x3DA color; 0x3BA mono):
;;
;
;
;
;  Bits:
;      3 -- Vertical Sync Select
;           Normal (0) or Logical OR of Vertical Sync End/Vertical Display Enable (1)
;
;      All other bits are Reserved
;
;;
  db 00000000b       ;0x00




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;





MCGA_g320x400x256__from13hSequencerRegs:
;Sequencer Register, Index 0, Reset Register (RW; 0x3C4=0; 0x3C5):
;;
;
;  Bits:
;      0 -- Asynchronous Reset
;           Operating  (1) or Reset   (0)
;
;      1 -- Synchronous Reset
;           Operating  (1) or Reset   (0)
;
;      All other bits are reserved
;;
  db 00000011b       ;0x03










;Sequencer Register, Index 1, Clocking Mode Register (RW; 0x3C4=1; 0x3C5):
;;
;
;  Bits:
;      0 -- 8/9 dot clocks
;           Eight dots (1) or Nine Clocks (0)
;
;      1 -- Reserved
;
;      2 -- Shift Load
;           If bit 4 is 0:
;           Reload serializers each char clock (0) or on every other (1)
;
;      3 -- Dot clock
;           Normal clock (0) or divide clock by 2 (1)
;
;      4 -- Shift 4
;           Reload serializers each char clock (0) or on each fourth (1)
;
;      5 -- Screen off
;           Video screen off and max mem bandwidth to CPU (1) or Normal operation (0)
;
;    6-7 -- Reserved
;;
  db 00000001b       ;0x01










;Sequencer Register, Index 2, Map Mask Register (RW; 0x3C4=2; 0x3C5):
;;
;
;  Bits:
;    0-3 -- Map mask
;           Enable (1) or disable writes (0) to the corresponding map, 0-3, with bits 0-3
;
;    All other bits are reserved.
;;
  db 00001111b       ;0x0F










;Sequencer Register, Index 3, Character Map Select Register (RW; 0x3C4=3; 0x3C5):
;;
;
;  Bits:
;    4,1,0 -- Character Map Select B
;             000
;             1st 8K of Map 2
;
;    5,3,0 -- Character Map Select A
;             000
;             1st 8K of Map 2
;             NOTE: The value of Character Map Select A == Character Map Select B,
;                   so we will ignore Character Map Select A and use
;                   Character Map Select B configuration.
;
;    All other bits are reserved.
;;
  db 00000000b       ;0x00










;Sequencer Register, Index 4, Memory Mode Register (RW; 0x3C4=4; 0x3C5):
;;
;
;  Bits:
;      0 -- Reserved
;
;      1 -- Extended Memory (1)
;           0 -- No extended memory present (less than 64K)
;           1 -- Extended memory present (more than 64K; use 256K;
;                also enables the Character Map Select feature)
;
;      2 -- Odd/Even (1) turn off, be sequential, for 320x400x256
;           0 -- Direct even addresses to maps 0 and 2 and odd addresses
;                to maps 1 and 3.
;           1 -- If bit 3 is 0: make the CPU access data sequentially
;                within a bit map.
;
;      3 -- Chain-4 (0) turn off for 320x400x256
;           0 -- If bit 2 is 1, make the CPU access data sequentially within
;                a bit map by the Map Mask Register.
;           1 -- Make the two lower address bits to select the map that will
;                be accessed.
;
;
;    4-7 -- Reserved
;;
  db 00000110b       ; -- 320x400x256




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;










MCGA_g320x400x256__from13hCRTCRegs:
;CRTC Controller, Index 0, Horizontal Total (RW; 0x3D4=0 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- Number of horizontal characters MINUS 5
;;
  db 95              ;0x5F










;CRTC Controller, Index 1, Horizontal Display-Enable End (RW; 0x3D4=1 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- Number of total displayed characters MINUS 1
;;
  db 79              ;0x4F










;CRTC Controller, Index 2, Start Horizontal Blanking Register (RW; 0x3D4=2 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- Number of total displayed characters MINUS 1
;;
  db 01010000b       ;0x50










;CRTC Controller, Index 3, End Horizontal Blanking Register (RW; 0x3D4=3 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-4 -- End Horizontal Blanking (2 here)
;
;      5,6 -- Display Enable Skew Control (0 here)
;
;        7 -- Test bit; must be 1
;;
  db 10000010b       ;0x82










;CRTC Controller, Index 4, Start Horizontal Retrace Pulse (RW; 0x3D4=4 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- Start Horizontal Retrace Pulse (84 here)
;;
  db 01010100b       ;0x54










;CRTC Controller, Index 5, End Horizontal Retrace Pulse (RW; 0x3D4=5 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-4 -- End Horizontal Retrace
;      5-6 -- Horizontal Retrace Delay
;        7 -- End Horizontal Blanking, Bit 5
;;
  db 10000000b       ;0x80










;CRTC Controller, Index 6, Vertical Total (RW; 0x3D4=6 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- 8 lower bits of number of horizontal raster scans MINUS 2
;;
  db 10111111b       ;0xBF










;CRTC Controller, Index 7, Overflow (RW; 0x3D4=7 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0 -- bit 8 of vertical total, reg idx 0x06
;      1 -- bit 8 of vertical total, reg idx 0x12
;      2 -- bit 8 of vertical total, reg idx 0x10
;      3 -- bit 8 of vertical total, reg idx 0x15
;      4 -- bit 8 of vertical total, reg idx 0x18
;      5 -- bit 9 of vertical total, reg idx 0x06
;      6 -- bit 9 of vertical total, reg idx 0x12
;      7 -- bit 9 of vertical total, reg idx 0x10
;;
  db 00011111b       ;0x1F










;CRTC Controller, Index 8, Preset Row Scan (RW; 0x3D4=8 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-4 -- preset row scan
;      5-6 -- byte panning control
;      7 -- reserved
;;
  db 00000000b       ;0x00










;CRTC Controller, Index 9, Maximum Scan Line (RW; 0x3D4=9 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-4 -- maximum scan line
;        5 -- start vertical blank
;        6 -- line compare
;        7 -- 200 to 400 line conversion
;;
  db 01000000b       ;  bit 7 should be 0 to display 400 vertical lines, for 320x400x256
;db 01000001b       ;0x41
;db 11100000b       ;0x41
;db 00011111b       ;0x41











;CRTC Controller, Index 10, Cursor Start (RW; 0x3D4=0x0A color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-4 -- cursor start
;        5 -- cursor off
;      6-7 -- reserved
;;
  db 00000000b       ;0x00










;CRTC Controller, Index 11, Cursor End (RW; 0x3D4=0x0B color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-4 -- cursor end
;      5-6 -- cursor skew
;        7 -- reserved
;;
  db 00000000b       ;0x00










;CRTC Controller, Index 12, Start Address High (RW; 0x3D4=0x0C color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- start address high
;;
  db 00000000b       ;0x00










;CRTC Controller, Index 13, Start Address Low (RW; 0x3D4=0x0D color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- start address low
;;
  db 00000000b       ;0x00










;CRTC Controller, Index 14, Cursor Location High (RW; 0x3D4=0x0E color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- cursor high
;;
  db 00000011b       ;0x03










;CRTC Controller, Index 15, Cursor Location Low (RW; 0x3D4=0x0F color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- cursor low
;;
  db 11000000b       ;0xC0










;CRTC Controller, Index 16, Vertical Retrace Start (W; 0x3D4=0x10 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 - lower 8 bits of vertical retrace pulse start position
;;
  db 156             ;0x9C










;CRTC Controller, Index 17, Vertical Retrace End (W; 0x3D4=0x11 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-3 -- vertical retrace end
;        4 -- clear vertical interrupt
;        5 -- enable vertical interrupt
;        6 -- select 5 refresh cycles
;        7 -- protect registers 0 to 7 enabled (0) or disabled (1)
;;
  db 10001110b       ;0x8E










;CRTC Controller, Index 18, Vertical Display Enable End (RW; 0x3D4=0x12 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- vertical display enable end
;;
  db 143             ;0x8F










;CRTC Controller, Index 19, Offset (RW; 0x3D4=0x13 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- offset
;;
  db 40              ;0x28










;CRTC Controller, Index 20, Underline Location (RW; 0x3D4=0x14 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-4 -- underline location
;        5 -- count by 4
;        6 -- double word mode, turn of for 320x400x256
;        7 -- reserved
;;
  ;db 01000000b       ;0x40
  db 00000000b      ;0x00 -- disable double word mode for 320x400x256










;CRTC Controller, Index 21, Start Vertical Blanking (RW; 0x3D4=0x15 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- start vertical blank -- lower 8 bits of 10-bit register
;;
  db 150             ;0x96










;CRTC Controller, Index 22, End Vertical Blanking (RW; 0x3D4=0x16 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- end vertical blank
;;
  db 185             ;0xB9










;CRTC Controller, Index 23, CRTC Mode Control (RW; 0x3D4=0x17 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0 -- compatibility mode support
;      1 -- select row scan counter
;      2 -- horizontal retrace select
;      3 -- count by two
;      4 -- reserved
;      5 -- address wrap
;      6 -- byte mode (1) or word mode (0), for 320x400x256 must be 1
;      7 -- hardware reset
;;
;db 10100011b       ;0xA3
  db 11100011b       ;enable byte mode for 320x400x256










;CRTC Controller, Index 24, Line Compare (RW; 0x3D4=0x18 color; 0x3B4 mono; 0x3D5 color; 0x3B5 mono):
;;
;
;
;
;  Bits:
;      0-7 -- lower 8 bits of compare target.
;             Bit 8 is in Overflow register index 7.
;             Bit 9 is in Maximum Scan Line register index 9.
;;
  db 11111111b       ;0xFF




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;





MCGA_g320x400x256__from13hGraphicsRegs:
;Graphics Controller Register, Index 0, Set/Reset (RW; 0x3CE=0; 0x3CF):
;;
;
;  Bits:
;      0-3 -- Set/Reset
;
;      All other bits are reserved. Set to 0; undefined on read.
;;
  db 00000000b       ;0x00










;Graphics Controller Register, Index 1, Enable Set/Reset (RW; 0x3CE=1; 0x3CF):
;;
;
;
;
;  Bits:
;      0-3 -- Enable Set/Reset
;             1 -- If write mode is 0, and the bit for the map is 1 here,
;                  write memory address with the value of the Set/Reset register.
;
;             0 -- If write mode is 0, and the bit for the map is 0 here,
;                  write memory address with the value of system CPU.
;
;      All other bits are reserved. Set to 0; undefined on read.
;;
  db 00000000b       ;0x00










;Graphics Controller Register, Index 2, Color Compare (RW; 0x3CE=2; 0x3CF):
;;
;
;
;
;  Bits:
;      0-3 -- Color compare
;             Color Compare Map n, where n is the bit position
;
;      All other bits are reserved. Set to 0; undefined on read.
;;
  db 00000000b       ;0x00










;Graphics Controller Register, Index 3, Data Rotate (RW; 0x3CE=3; 0x3CF):
;;
;
;
;
;  Bits:
;      0-2 -- Data rotate
;             Number of bits to right-rotate CPU data (0 here)
;
;      3,4 -- Function select
;             00 -- unmodified   <-- this one!!!!!!
;             01 -- AND data with latch
;             10 -- OR data with latch
;             11 -- XOR data with latch
;
;      All other bits are reserved. Set to 0; undefined on read.
;;
  db 00000000b       ;0x0










;Graphics Controller Register, Index 4, Read Map Select (RW; 0x3CE=4; 0x3CF):
;;
;
;
;
;  Bits:
;      0-1 -- Read Map Select
;             Select maps 0 to 3 for system read operations (map 0 here)
;
;
;      All other bits are reserved. Set to 0; undefined on read.
;;
  db 00000000b       ;0x00










;Graphics Controller Register, Index 5, Graphics Mode (RW; 0x3CE=5; 0x3CF):
;;
;
;
;
;  Bits:
;      0-1 -- Write Mode
;             Select write mode 0 to 3 (0 here)
;
;        2 -- Reserved, undefined on read
;
;        3 -- Read Type
;
;        4 -- Odd/Even, disable (0), or work as CGA (1), disable for 320x400x256, ALREADY DISABLED!
;
;        5 -- Shift Register
;
;        6 -- 256 Color Mode (1) or ???????
;
;        7 -- Reserved
;;
  db 01000000b       ;










;Graphics Controller Register, Index 6, Miscellaneous (RW; 0x3CE=6; 0x3CF):
;;
;
;
;
;  Bits:
;        0 -- Graphics Mode
;             Graphics Mode (1) or Text Mode (0)
;
;        1 -- Odd/Even (0), disable for 320x400x256, already disabled!
;
;      2,3 -- Memory Map (1 here)
;                    Map 0 -- 0xA0000-0xBFFFF
;                    Map 1 -- 0xA0000-0xAFFFF
;                    Map 2 -- 0xB0000-0xBFFFF
;                    Map 3 -- 0xB8000-0xBFFFF
;
;      4-7 -- Reserved
;;
  db 00000101b       ;shouldn't be map 0 here for more than 64K in 320x400x256










;Graphics Controller Register, Index 7, Color Don't Care (RW; 0x3CE=7; 0x3CF):
;;
;
;
;
;  Bits:
;      0-3 -- For each bit, if 0, don't participate in color
;             compare cycle; if 1 participate in it for that map.
;;
  db 00001111b       ;0x0F










;Graphics Controller Register, Index 8, Bit Mask (RW; 0x3CE=8; 0x3CF):
;;
;
;
;
;  Bits:
;      0-7 -- Bit mask
;;
  db 11111111b       ;0xFF




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;










MCGA_g320x400x256__from13hAttributeRegs:
;Attribute Controller Register, Index 0, Palette 0 (RW; 0x3C0=0; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 0               ;0x00










;Attribute Controller Register, Index 1, Palette 1 (RW; 0x3C0=1; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 1               ;0x01










;Attribute Controller Register, Index 2, Palette 2 (RW; 0x3C0=2; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 2               ;0x02










;Attribute Controller Register, Index 3, Palette 3 (RW; 0x3C0=3; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 3               ;0x03










;Attribute Controller Register, Index 4, Palette 4 (RW; 0x3C0=4; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 4               ;0x04










;Attribute Controller Register, Index 5, Palette 5 (RW; 0x3C0=5; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 5               ;0x05










;Attribute Controller Register, Index 6, Palette 6 (RW; 0x3C0=6; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 6               ;0x06










;Attribute Controller Register, Index 7, Palette 7 (RW; 0x3C0=7; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 7               ;0x07










;Attribute Controller Register, Index 8, Palette 8 (RW; 0x3C0=8; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 8               ;0x08










;Attribute Controller Register, Index 9, Palette 9 (RW; 0x3C0=9; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 9               ;0x09










;Attribute Controller Register, Index 10, Palette 10 (RW; 0x3C0=0x0A; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 10              ;0x0A










;Attribute Controller Register, Index 11, Palette 11 (RW; 0x3C0=0x0B; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 11              ;0x0B










;Attribute Controller Register, Index 12, Palette 12 (RW; 0x3C0=0x0C; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 12              ;0x0C










;Attribute Controller Register, Index 13, Palette 13 (RW; 0x3C0=0x0D; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 13              ;0x0D










;Attribute Controller Register, Index 14, Palette 14 (RW; 0x3C0=0x0E; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 14              ;0x0E










;Attribute Controller Register, Index 15, Palette 15 (RW; 0x3C0=0x0F; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-5 -- 0 to 64 color value
;
;      All other bits are reserved
;;
  db 15              ;0x0F










;Attribute Controller, Index 16, Attribute Mode Control (RW; 0x3C0=0x10; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0 -- graphics/alphanumeric
;      1 -- mono emulation
;      2 -- enable line graphics character codes
;      3 -- enable blink/select background intensity
;      4 -- reserved
;      5 -- PEL panning compatibility
;      6 -- PEL width
;      7 -- P5, P4 select
;
;;
  db 01000001b       ;0x41










;Attribute Controller, Index 17, Overscan Color (RW; 0x3C0=0x11; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-7 -- overscan color
;
;;
  db 00000000b       ;0x00 or black










;Attribute Controller, Index 18, Color Plane Enable (RW; 0x3C0=0x12; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-3 -- enable color plane
;      4-5 -- video status MUX
;      6-7 -- reserved
;
;;
  db 00001111b       ;0x0F










;Attribute Controller, Index 19, Horizontal PEL Panning (RW; 0x3C0=0x13; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-3 -- horizontal PEL panning
;      4-7 -- reserved
;
;;
  db 00000000b       ;0x00










;Attribute Controller, Index 20, Color Select (RW; 0x3C0=0x14; write 0x3C0; read 0x3C1):
;;
;
;
;
;  Bits:
;      0-1 -- SC5,SC4
;      2-3 -- SC6,SC7
;      4-7 -- Reserved
;
;;
  db 00000000b       ;0x00

I need to find the register values for VGA graphics mode 320x400@256 colors.

I already have the values for mode 3h, 4h, 12h and 13h.

I see that values for practically all usable text and graphics modes are found in the file TAURON30.ZIP

_________________
Live PC 1: Image Live PC 2: Image

YouTube:
http://youtube.com/@AltComp126/streams
http://youtube.com/@proyectos/streams

http://master.dl.sourceforge.net/projec ... 7z?viasf=1


Last edited by ~ on Sun May 05, 2019 3:31 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Register values for VGA mode 320x400 256-color
PostPosted: Wed Apr 24, 2019 4:45 pm 
Offline
Member
Member

Joined: Tue Mar 04, 2014 5:27 am
Posts: 1108
~ wrote:
I need to find the register values for VGA graphics mode 320x400@256 colors.


PCGPE tells how to do 320x240 and years ago it worked. Perhaps, some poking around can give you 400 lines.

That page also mentions articles/book by Michael Abrash on the subject (e.g.).


Top
 Profile  
 
 Post subject: Re: Register values for VGA mode 320x400 256-color
PostPosted: Sun Apr 28, 2019 10:30 am 
Offline

Joined: Sun Apr 28, 2019 10:13 am
Posts: 1
If you already have BIOS mode 13h then you can tweak that slightly to get 320x200 planar mode ("Mode-X") and then increase the lines to 400 :
Code:
void vga_set_mode_320x200_planar(void) {
   vga_set_bios_mode(0x13);
   vga_write_seq(0x04, 0x06); // disable chain-4
   vga_write_crtc(0x14, 0x00); // disable double word mode
   vga_write_crtc(0x17, 0xe3); // enable byte mode
}

void vga_set_mode_320x400_planar(void) {
   vga_set_mode_320x200_planar();
   vga_write_crtc(0x09, 0x40); // 400 lines
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 66 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group