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

Function addr_block

core/mem.c:76–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76static uint32_t addr_block(uint32_t *addr, int32_t size, void **block, uint32_t *block_size) {
77 if (*addr < 0xD00000) {
78 *addr &= asic.serFlash ? flash.mask : flash.mappedBytes - 1;
79 *block = mem.flash.block;
80 *block_size = SIZE_FLASH;
81 } else if (*addr < 0xE00000) {
82 *addr &= 0x07FFFF;
83 *block = mem.ram.block;
84 *block_size = SIZE_RAM;
85 } else if (*addr < 0xE30800) {
86 *addr -= 0xE30200;
87 *block = lcd.paletteBytes;
88 *block_size = sizeof lcd.paletteBytes;
89 } else {
90 *addr -= 0xE30800;
91 *block = lcd.crsrImageBytes;
92 *block_size = sizeof lcd.crsrImageBytes;
93 }
94 return *addr + (unsigned int)size;
95}
96
97void *phys_mem_ptr(uint32_t addr, int32_t size) {
98 void *block;

Callers 2

phys_mem_ptrFunction · 0.85
virt_mem_cpyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected