MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / backlight_write

Function backlight_write

core/backlight.c:35–63  ·  view source on GitHub ↗

Write to the 0xBXXX range of ports */

Source from the content-addressed store, hash-verified

33
34/* Write to the 0xBXXX range of ports */
35static void backlight_write(const uint16_t pio, const uint8_t byte, bool poke) {
36 uint8_t index = (uint8_t)pio;
37 (void)poke;
38
39 switch (index) {
40 case 0x01:
41 case 0x02:
42 case 0x03:
43 case 0x0B:
44 break;
45 case 0x21:
46 case 0x22:
47 case 0x25:
48 case 0x26:
49 if (byte) {
50 backlight.brightness = 0;
51 }
52 break;
53 case 0x24:
54 backlight.brightness = byte;
55 break;
56 default:
57 backlight.ports[index] = byte;
58 break;
59 }
60
61 backlight.factor = (310u - backlight.brightness) / 160.0f;
62 panel.gammaDirty = true;
63}
64
65static const eZ80portrange_t device = {
66 .read = backlight_read,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected