| 1019 | // 1 = allocvec |
| 1020 | |
| 1021 | uaecptr debugmem_allocmem(int mode, uae_u32 size, uae_u32 flags, uae_u32 caller) |
| 1022 | { |
| 1023 | if (!debugmem_bank.baseaddr || !size) |
| 1024 | return 0; |
| 1025 | if (flags & 2) // MEMF_CHIP? |
| 1026 | return 0; |
| 1027 | uae_u16 aflags = DEBUGMEM_READ | DEBUGMEM_WRITE; |
| 1028 | if (flags & 0x10000) // MEMF_CLEAR |
| 1029 | aflags |= DEBUGMEM_INITIALIZED; |
| 1030 | if (mode) |
| 1031 | size += 4; |
| 1032 | struct debugmemallocs *dm = debugmem_allocate(size, aflags, 0); |
| 1033 | if (!dm) |
| 1034 | return 0; |
| 1035 | dm->type = mode ? DEBUGALLOC_ALLOCVEC : DEBUGALLOC_ALLOCMEM; |
| 1036 | dm->pc = caller; |
| 1037 | dm->data = flags; |
| 1038 | debugreportalloc(dm); |
| 1039 | uaecptr mem = dm->start + debugmem_bank.start; |
| 1040 | if (mode) { |
| 1041 | put_long(mem, size); |
| 1042 | mem += 4; |
| 1043 | } |
| 1044 | return mem; |
| 1045 | } |
| 1046 | |
| 1047 | uae_u32 debugmem_freemem(int mode, uaecptr addr, uae_u32 size, uae_u32 caller) |
| 1048 | { |
no test coverage detected