MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / get_addr

Function get_addr

src/cputest.cpp:355–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353
354
355static uae_u8 *get_addr(uaecptr addr, int size, int rwp)
356{
357 // allow debug output to read memory even if oob condition
358 if (rwp >= 0 && out_of_test_space)
359 goto oob;
360 if (!valid_address(addr, 1, rwp))
361 goto oob;
362 if (size > 1) {
363 if (!valid_address(addr + size - 1, 1, rwp))
364 goto oob;
365 }
366 addr &= addressing_mask;
367 size--;
368
369 // if loop mode: loop mode buffer can be only accessed by loop mode store instruction
370 if (feature_loop_mode_jit && testing_active && addr >= test_memory_start && addr + size < test_memory_start + LM_BUFFER && (lm_safe_address1 != regs.pc && lm_safe_address2 != regs.pc)) {
371 goto oob;
372 }
373
374 if (low_memory_size != 0xffffffff && addr + size < low_memory_size) {
375 return low_memory + addr;
376 } else if (high_memory_size != 0xffffffff && addr >= HIGH_MEMORY_START && addr <= HIGH_MEMORY_START + 0x7fff) {
377 return high_memory + (addr - HIGH_MEMORY_START);
378 } else if (addr >= test_memory_start && addr + size < test_memory_end + EXTRA_RESERVED_SPACE) {
379 return test_memory + (addr - test_memory_start);
380 }
381oob:
382 if (rwp >= 0) {
383 if (!out_of_test_space) {
384 out_of_test_space = true;
385 out_of_test_space_addr = addr;
386 }
387 }
388 dummy_memory[0] = 0;
389 dummy_memory[1] = 0;
390 dummy_memory[2] = 0;
391 dummy_memory[3] = 0;
392 return dummy_memory;
393}
394
395static void count_cycles(int cycles)
396{

Callers 13

get_ibyte_testFunction · 0.70
get_iword_testFunction · 0.70
get_ilong_testFunction · 0.70
put_byte_testFunction · 0.70
put_word_testFunction · 0.70
put_long_testFunction · 0.70
get_byte_testFunction · 0.70
get_word_testFunction · 0.70
get_long_testFunction · 0.70
get_byte_debugFunction · 0.70
get_word_debugFunction · 0.70
get_long_debugFunction · 0.70

Calls 1

valid_addressFunction · 0.70

Tested by

no test coverage detected