diff src/gb/GB.cpp @ 62:4699c7bab77d

added code to retrieve CPU registers
author Robert McIntyre <rlm@mit.edu>
date Wed, 07 Mar 2012 20:10:21 -0600
parents dc8b383ecefa
children d7c38ce83421
line wrap: on
line diff
     1.1 --- a/src/gb/GB.cpp	Wed Mar 07 19:53:39 2012 -0600
     1.2 +++ b/src/gb/GB.cpp	Wed Mar 07 20:10:21 2012 -0600
     1.3 @@ -3899,9 +3899,36 @@
     1.4    }
     1.5  }
     1.6  
     1.7 -
     1.8 -
     1.9 -
    1.10 +void storeRegisters(int32* store){
    1.11 +  store[0] = (int32) PC.W;
    1.12 +  store[1] = (int32) SP.W;
    1.13 +  store[2] = (int32) AF.W;
    1.14 +  store[3] = (int32) BC.W;
    1.15 +  store[4] = (int32) DE.W;
    1.16 +  store[5] = (int32) HL.W;
    1.17 +  store[6] = (int32) register_DIV;
    1.18 +  store[7] = (int32) register_TIMA;
    1.19 +  store[8] = (int32) register_TMA;
    1.20 +  store[9] = (int32) register_TAC;
    1.21 +  store[10] = (int32) register_IF;
    1.22 +  store[11] = (int32) register_LCDC;
    1.23 +  store[12] = (int32) register_STAT;
    1.24 +  store[13] = (int32) register_SCY;
    1.25 +  store[14] = (int32) register_SCX;
    1.26 +  store[15] = (int32) register_LY;
    1.27 +  store[16] = (int32) register_LYC;
    1.28 +  store[17] = (int32) register_DMA;
    1.29 +  store[18] = (int32) register_WY;
    1.30 +  store[19] = (int32) register_WX;
    1.31 +  store[20] = (int32) register_VBK;
    1.32 +  store[21] = (int32) register_HDMA1;
    1.33 +  store[22] = (int32) register_HDMA2;
    1.34 +  store[23] = (int32) register_HDMA3;
    1.35 +  store[24] = (int32) register_HDMA4;
    1.36 +  store[25] = (int32) register_HDMA5;
    1.37 +  store[26] = (int32) register_SVBK;
    1.38 +  store[27] = (int32) register_IE;
    1.39 +}
    1.40  
    1.41  struct EmulatedSystem GBSystem =
    1.42    {