Advertisement
Guest User

Untitled

a guest
Nov 8th, 2014
174
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void vm_initForPart(struct VirtualMachine* m, uint16_t partId) {
  2.  
  3. player_stop(m->player);
  4. mixer_stopAll(m->mixer);
  5.  
  6. //WTF is that ?
  7. m->vmVariables[0xE4] = 0x14;
  8.  
  9. res_setupPart(m->res, partId);
  10.  
  11. //Set all thread to inactive (pc at 0xFFFF or 0xFFFE )
  12. //rb->memset((uint8_t *)m->threadsData, 0xFF, sizeof(m->threadsData));
  13. for(int i=0;i<NUM_DATA_FIELDS;++i)
  14. {
  15. for(int j=0;j<VM_NUM_THREADS;++j)
  16. {
  17. m->threadsData[i][j]=0xFFFF;
  18. }
  19. }
  20.  
  21. // rb->memset((uint8_t *)m->vmIsChannelActive, 0, sizeof(m->vmIsChannelActive));
  22.  
  23. // int firstThreadId = 0;
  24. // m->threadsData[PC_OFFSET][firstThreadId] = 0;
  25. }
Advertisement
RAW Paste Data Copied
Advertisement