home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / acorn / tech / 8 < prev    next >
Encoding:
Text File  |  1992-07-30  |  5.0 KB  |  152 lines

  1. Newsgroups: comp.sys.acorn.tech
  2. Path: sparky!uunet!mcsun!ieunet!tcdcs!maths.tcd.ie!merlin
  3. From: merlin@maths.tcd.ie (Merlin Hughes)
  4. Subject: Re: Manipulation of screenmodes
  5. Message-ID: <1992Jul31.013404.25604@maths.tcd.ie>
  6. Organization: Dept. of Maths, Trinity College, Dublin, Ireland.
  7. References: <1928@dutiws.tudelft.nl>
  8. Date: Fri, 31 Jul 1992 01:34:04 GMT
  9. Lines: 141
  10.  
  11. roozemaa@dutiws.tudelft.nl (Peter.Roozemaal.IS-assistent) writes:
  12.  
  13. >Or asked in a different manner:
  14. >  What do I have to poke where (and preferebly why) to change to a different
  15. >  screenmode bypassing the usual VDU-calls.
  16.  
  17. To program the VIDC, you need to be in supervisor mode, and you poke
  18. the new data into location $3400000. There are 4 words there mapped
  19. to the VIDC (I think), so you can STM up to 4 registers at a go.
  20.  
  21. eg:
  22. SWI"OS_EnterOS"  -- Supervisor mode
  23.  MOV0,#&3400000  -- Address of VIDC
  24.  MOV1,#<data>    -- Data to program VIDC with
  25.  STMIA0,{1}      -- Send it to the VIDC
  26. TEQP15,#0:DCD0   -- User mode
  27.  
  28. The VIDC register you are programming is encoded into the top byte
  29. of the byte you store, the data is in the rest of the word. The
  30. register numbers are separated by 4, ie the first register is &00,
  31. the second &04, etc.
  32.  
  33. ie:
  34.  
  35. --Word--
  36.    High Byte                                          Low Byte
  37. 3 3 2 2 2 2 2 2  2 2 2 2 1 1 1 1  1 1 1 1 1 1
  38. 1 0 9 8 7 6 5 4  3 2 1 0 9 8 7 6  5 4 3 2 1 0 9 8  7 6 5 4 3 2 1 0
  39. x x x x x x 0 0  x x x x x x x x  x x x x x x x x  x x x x x x x x
  40. \_____________/  \_______________________________________________/
  41.   VIDC Address                   VIDC Data
  42.  
  43. VIDC registers are:
  44.  
  45.  00 \
  46.  ..  > Video Palette Logical Colour 0 .. 15
  47.  3C /
  48.  40 Border Colour
  49.  44 \
  50.  ..  > Cursor Palette Logical Colour 1 .. 3
  51.  4C /
  52. -- bit 12=Supremacy, 11..8=Blue, 7..4=Green, 3..0=Red
  53. -- (different slightly in 8BPP modes, but same region)
  54.  
  55.  60 \
  56.  ..  > Stereo Image Register 7 , 0 .. 6
  57.  7C /
  58. -- bit 2..0=Position
  59.  
  60.  80 Horizontal Cycle Register
  61.  84 Horizontal Sync Width Register
  62. -- bit 23..14=Data
  63.  
  64.  88 Horizontal Border Start Register
  65.  8C Horizontal Display Start Register
  66.  90 Horizontal Display End Register
  67.  94 Horizontal Border End Register
  68. -- bit 23..14=Data
  69.  
  70.  98 Horizontal Cursor Start Register
  71. -- bit 23..13=Data, 12..11 must be 0 except in Hi-Res mode
  72.  
  73.  9C Horizontal Interlace Register
  74.  A0 Vertical Cycle Register
  75.  A4 Vertical Sync Width Register
  76. -- bit 23..14=Data
  77.  
  78.  A8 Vertical Border Start Register
  79.  AC Vertical Display Start Register
  80.  B0 Vertical Display End Register
  81.  B4 Vertical Border End Register
  82. -- bit 23..14=Data
  83.  
  84.  B8 Vertical Cursor Start Register
  85.  BC Vertical Cursor End Register
  86. -- bit 23..14=Data
  87.  
  88.  C0 Sound Frequency Register
  89. -- bit 7..0=Data
  90.  
  91.  E0 Control Register
  92. -- bit 15..14= Test Mode; 00=>Normal Operation, 01..11=>Test Mode 0, 1, 2
  93. -- bit 8=Test Mode; 0=>Normal Operation, 1=>Test Mode 3
  94. -- bit 7=Composite Sync; 0=>Vertical, 1=>Composite
  95. -- bit 6=Interlace Sync; 0=>Off, 1=>On
  96. -- bit 5..4=DMA Request; 00..11=>End Of Word 0/4, 1/5, 2/6, 3/7
  97. -- bit 3..2=Bits Per Pixel; 00..11=>BPP 1, 2, 4, 8
  98. -- bit 1..0=Pixel Rate; 00..11=>MHz 8, 12, 16, 24
  99.  
  100. -
  101.  
  102. Ok, those are the registers. If you are already in the type of mode
  103. you want to be in, and you just want to change the dimensions, you
  104. only need to reprogram the H&V Border/Display Start/End Registers.
  105. If not, you'll have to fiddle with the other relevant sounding
  106. ones.
  107.  
  108. (
  109. From mode 13, programming the following registers with the
  110. following data values will get a 384*208 shaped mode..
  111.  
  112. H Disp Start = 40
  113. H Disp End   = 40 + (384/2)
  114. V Disp Start = 63
  115. V Disp End   = 63 + 208
  116.  
  117. You may have to push the borders out a bit.
  118. )
  119.  
  120. You'll probably get somewhere by experimentation... Something to
  121. note is that RISC OS reprograms stuff about the palette and the
  122. pointer quite regularly, so you'll have difficulty doing things
  123. with them.
  124.  
  125. For full information, get the VLSI data book, or if you want me to,
  126. I'll type in the rest of what is said about the relevant registers.
  127. I'm not going to type it in now because I'm tired.
  128.  
  129. I assume you'll assume you have enough screen memory..
  130.  
  131. People may object to your reprogramming VIDC for a few reasons..
  132. Some people will say it isn't future compatible. I'll believe that
  133. one when I see a new video chip in the Arc - I think you can afford
  134. to forget about that.
  135.  
  136. Different types of monitors however, are a valid reason for not
  137. doing the reprogramming yourself. People with multisyncs and VGAs
  138. and so on, sometimes have their own base modes defined. That way,
  139. different shaped modes will still be of the preferred users style
  140. (New modes are defined with a standard base mode, and then a VIDC
  141. list with the list of registers that need to be changed for the new
  142. mode. Normally these will only include new values for the H&V
  143. Border/Display Start/End registers.) People like this will hate your
  144. for changing mode yourself.
  145.  
  146. Anyway, enjoy.
  147.  
  148. --SICK--Merlin Hughes--    /|            This is only the beginning.
  149.   merlin@maths.tcd.ie     //|         We will regroup. We will prepare.
  150.                          //_|   When the time comes, we will emerge and take
  151. Acorn.. Deus et machina. /  | our place as the supreme masters of the universe.
  152.