trunk/src/mame/machine/seicop.c
| r32034 | r32035 | |
| 2739 | 2739 | m_cop_angle += 0x80; |
| 2740 | 2740 | } |
| 2741 | 2741 | |
| 2742 | m_cop_angle-=0x80; |
| 2742 | 2743 | m_r0 = dy; |
| 2743 | 2744 | m_r1 = dx; |
| 2744 | 2745 | |
| r32034 | r32035 | |
| 2911 | 2912 | { |
| 2912 | 2913 | UINT8 offs; |
| 2913 | 2914 | int div; |
| 2915 | INT16 dir_offset; |
| 2914 | 2916 | // INT16 offs_val; |
| 2915 | 2917 | |
| 2916 | 2918 | /* TODO: [4-7] could be mirrors of [0-3] (this is the only command so far that uses 4-7 actually)*/ |
| 2917 | | /* 0 + [4] */ |
| 2918 | | /* 4 + [5] */ |
| 2919 | | /* 8 + [4] */ |
| 2920 | | /* 4 + [6] */ |
| 2919 | /* ? 0 + [4] */ |
| 2920 | /* sub32 4 + [5] */ |
| 2921 | /* write16h 8 + [4] */ |
| 2922 | /* addmem16 4 + [6] */ |
| 2921 | 2923 | |
| 2922 | 2924 | // these two are obvious ... |
| 2923 | 2925 | // 0xf x 16 = 240 |
| 2924 | 2926 | // 0x14 x 16 = 320 |
| 2925 | | // what are these two instead? scale factor? offsets? |
| 2927 | // what are these two instead? scale factor? offsets? (edit: offsets to apply from the initial sprite data) |
| 2926 | 2928 | // 0xfc69 ? |
| 2927 | 2929 | // 0x7f4 ? |
| 2928 | 2930 | //printf("%08x %08x %08x %08x %08x %08x %08x\n",m_cop_register[0],m_cop_register[1],m_cop_register[2],m_cop_register[3],m_cop_register[4],m_cop_register[5],m_cop_register[6]); |
| 2929 | 2931 | |
| 2930 | 2932 | offs = (offset & 3) * 4; |
| 2931 | 2933 | |
| 2932 | | div = space.read_word(m_cop_register[4] + offs) + 1; |
| 2934 | div = space.read_word(m_cop_register[4] + offs); |
| 2935 | dir_offset = space.read_word(m_cop_register[4] + offs + 8); |
| 2933 | 2936 | // offs_val = space.read_word(m_cop_register[3] + offs); |
| 2934 | 2937 | //420 / 180 = 500 : 400 = 30 / 50 = 98 / 18 |
| 2935 | | |
| 2938 | |
| 2939 | /* TODO: this probably trips a cop status flag */ |
| 2936 | 2940 | if(div == 0) { div = 1; } |
| 2937 | | |
| 2938 | | space.write_word((m_cop_register[6] + offs + 4), ((space.read_word(m_cop_register[5] + offs + 4)) / div)); |
| 2941 | |
| 2942 | |
| 2943 | space.write_word((m_cop_register[6] + offs + 4), ((space.read_word(m_cop_register[5] + offs + 4) + dir_offset) / div)); |
| 2939 | 2944 | return; |
| 2940 | 2945 | } |
| 2941 | 2946 | |