www.riscos.com Technical Support: |
|
The Portable module has to convert the users RGB palette settings into a grey-scale value in the range 0 to 14 (since the LCD panel only supports 15 unique grey levels). It does this using the following algorithm:
Luminance = (4 × Green) + (2 × Red) + Blue
Red, Green and Blue are in the range 0 to 255, so the luminance is in the range 0 to 1785 (255 × 7). It is then mapped down onto the range 0 to 14 using the following table:
Luminance | Grey level | Palette values for R, G and B |
---|---|---|
0 - 118 | 0 | &00 |
119 - 237 | 1 | &12 |
238 - 356 | 2 | &24 |
357 - 475 | 3 | &37 |
476 - 594 | 4 | &49 |
595 - 713 | 5 | &5B |
714 - 832 | 6 | &6D |
833 - 952 | 7 | &7F |
953 - 1071 | 8 | &92 |
1072 - 1190 | 9 | &A4 |
1191 - 1309 | 10 | &B6 |
1310 - 1428 | 11 | &C8 |
1429 - 1547 | 12 | &DB |
1548 - 1666 | 13 | &ED |
1667 - 1785 | 14 | &FF |
The mapping table above is provided for information only, and may be subject to change in later versions of the Portable module.
In 256 colour modes the colour mapping is partly determined by the hardware, since the top 4 bits of the pixel value go directly to particular bits of the three guns, and the LCD ASIC only takes input from VIDC's red output. Thus the grey level will not in general map correctly from the luminance of the RGB value which would normally be output.
R1 = reason code (&8A)
R2 = power up or down:
R1 = 0 if R3 = 0, else preserved to pass on
R2 preserved
R3 = bit mask of which ports may be powered down or up (bit set no objection to change of state)
This call is issued before power is removed or after power is reapplied to the following:
If a module wishes to prevent hardware being powered down, it should clear the appropriate bit or bits in R3. In addition, if the resulting value in R3 is now zero, the module should claim the service by setting R1 to zero. (This is to prevent the call being unnecessarily passed round the rest of the modules). Otherwise the service should be passed on by preserving R1.
This call should never be claimed.
R0 = EOR mask
R1 = AND mask
R0 = old speed
R1 = new speed (0 FAST_ 1 slow)
Interrupt status is not defined
Fast interrupts are enabled
Processor is in SVC mode
SWI is not re-entrant
This SWI controls the processor speed, which is reduced when the system is idle in order to save power.
The new speed is calculated as follows:
new speed = (old speed AND R1) EOR R0
Speed settings currently supported are:
0 fast
1 slow
R0 = EOR mask
R1 = AND mask
R0 = old control
R1 = new control
Interrupt status is not defined
Fast interrupts are enabled
Processor is in SVC mode
SWI is not re-entrant
This SWI controls various power control and miscellaneous bits in the portable machine.
The new control is calculated as follows:
new control = (old control AND R1) EOR R0
The bits in control are as follows:
Bit | Meaning |
---|---|
0 | Set power to Econet enabled |
1 | Set power to LCD display enabled |
2 | Set power to external video display enabled |
3 | Set power to serial buffer and oscillator enabled |
4 | Set dual panel mode enabled |
5, 6 | Video clock control |
0 External clock input | |
1 Crystal oscillator, divided by 2 | |
2 Crystal oscillator | |
3 reserved, do not use | |
7 | Set invert video clock |
8 | Set back-light enabled |
9 | Clear 1 extra line on display |
Set 2 extra lines on display | |
10 | Clear 1 DRAM used for dual panel |
Set 2 DRAMs used for dual panel | |
11 - 13 | Reserved |
14 | Set power to FDC oscillator enabled |
15 | Reserved |
16 | Set LCD palette set up for inverse video |
17 - 31 | Reserved |
Reserved bits must not be modified, nor assumed to read any particular value.
Note that the 82C711 has one oscillator which is used by the serial subunit and by the floppy disc controller (FDC). Power to the oscillator is removed only if bits 3 and 14 are both clear.
On some computers the power to the oscillator cannot be removed because the same oscillator drives other parts of the system (eg IOEB).
If this call results in bits 0, 3 or 14 changing (ie power being removed or applied to the serial buffer/oscillator, Econet or FDC oscillator), then Service_Portable is issued (see Service_Portable (Service Call &8A)).
R0 = BMU variable number
R0 preserved
R1 = value of variable
Interrupts enabled except if R0 = 10
Fast interrupts are enabled
Processor is in SVC mode
SWI is not re-entrant
This SWI reads Battery Management Unit variables.
The BMU variable numbers are:
Reading any variable except the flags (variable 10) will enable IRQs (the flags are read from a soft copy).
R0 = BMU variable number
R1 = new value of variable
R0, R1preserved
Interrupts status is not defined
Fast interrupts are enabled
Processor is in SVC mode
SWI is not re-entrant
This SWI writes Battery Management Unit variables.
The variable numbers are as for Portable_ReadBMUVariable on Portable_ReadBMUVariable. Variables not marked with a 'W' should not be written.
R0 = reason code
All registers preserved
Interrupts are not defined
Fast interrupts are enabled
Processor is in SVC mode
SWI is not re-entrant
This SWI issues a command to the Battery Management Unit. The values of variables after a command may not change immediately this command is issued.
None