memset(freezeWorkRAM, false, 0x40000); memset(freezeInternalRAM, false, 0x8000); printf("Cleared all break on write\n");
if(n == 3) { u32 address = 0; sscanf(args[1], "%x", &address); int n = 0; sscanf(args[2], "%d", &n);  if(address < 0x2000000 || address > 0x3007fff) { printf("Invalid address: %08x\n", address); return; }  if(address > 0x203ffff && address < 0x3000000) { printf("Invalid address: %08x\n", address); return; }  u32 final = address + n; switch(address >> 24) { case 2: { address &= 0x3ffff; final &= 0x3ffff; for(int i = address; i < final; i++) if(freezeWorkRAM[i] == 1) freezeWorkRAM[i] = 0; printf("Cleared break on write from %08x to %08x\n", 0x2000000+address, 0x2000000+final); } break; case 3: { address &= 0x7fff; final &= 0x7fff; for(int i = address; i < final; i++) if(freezeInternalRAM[i] == 1) freezeInternalRAM[i] = 0; printf("Cleared break on write from %08x to %08x\n", 0x3000000+address, 0x3000000+final); } break; } } else if(n == 1) { int i; for(i = 0; i < 0x40000; i++) if(freezeWorkRAM[i] == 1) freezeWorkRAM[i] = 0; for(i = 0; i < 0x8000; i++) if(freezeInternalRAM[i] == 1) freezeInternalRAM[i] = 0;  printf("Cleared all break on write\n"); } else debuggerUsage("bpwc");
void debuggerBreakWriteClear(int n, char **args){  memset(freezeWorkRAM, false, 0x40000);  memset(freezeInternalRAM, false, 0x8000);  printf("Cleared all break on write\n");}