Example #1
0
 private void triggerAsyncCallback(
     int cbid,
     int listId,
     int listPc,
     int behavior,
     int signalId,
     HashMap<Integer, SceKernelCallbackInfo> callbacks) {
   SceKernelCallbackInfo callback = callbacks.get(cbid);
   if (callback != null && callback.callback_addr != 0) {
     if (log.isDebugEnabled()) {
       log.debug(
           String.format(
               "Scheduling Async Callback %s, listId=0x%X, listPc=0x%08X, behavior=%d, signalId=0x%X",
               callback.toString(), listId, listPc, behavior, signalId));
     }
     GeCallbackInterruptHandler geCallbackInterruptHandler =
         new GeCallbackInterruptHandler(
             callback.callback_addr, callback.callback_arg_addr, listPc);
     GeInterruptHandler geInterruptHandler =
         new GeInterruptHandler(geCallbackInterruptHandler, listId, behavior, signalId);
     Emulator.getScheduler().addAction(geInterruptHandler);
   } else {
     hleGeOnAfterCallback(listId, behavior, false);
   }
 }
Example #2
0
  public void setMemorySize(int memorySize) {
    if (MemoryMap.SIZE_RAM != memorySize) {
      int previousMemorySize = MemoryMap.SIZE_RAM;
      MemoryMap.END_RAM = MemoryMap.START_RAM + memorySize - 1;
      MemoryMap.END_USERSPACE = MemoryMap.END_RAM;
      MemoryMap.SIZE_RAM = MemoryMap.END_RAM - MemoryMap.START_RAM + 1;

      if (!Memory.getInstance().allocate()) {
        log.error(
            String.format(
                "Failed to resize the PSP memory from 0x%X to 0x%X",
                previousMemorySize, memorySize));
        Emulator.PauseEmuWithStatus(Emulator.EMU_STATUS_MEM_ANY);
      }

      reset();
    }
  }