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

Function gpt_read

core/timers.c:138–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138static uint8_t gpt_read(uint16_t address, bool peek) {
139 uint8_t value = 0;
140 uint8_t index = address >> 2;
141 uint8_t bit_offset = (address & 3) << 3;
142 (void)peek;
143
144 if (index < 0xC && (index & 3) == 0) {
145 value = read8(gpt_peek_counter(index >> 2), bit_offset);
146 } else if (address < 0x40) {
147 value = read8(gpt.regs[index], bit_offset);
148 }
149 return value;
150}
151
152static void gpt_write(uint16_t address, uint8_t value, bool poke) {
153 int timer;

Callers

nothing calls this directly

Calls 1

gpt_peek_counterFunction · 0.85

Tested by

no test coverage detected