View Single Post
  #1  
Old 27th December 2012, 10:25 PM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,236
Lightbulb I'm bored, so I wanted to put this together.

About 11 months ago I wrote a rudimentary RSP disassembler.
Well it wasn't until recently that I wrote an op-codes counter.

It extracts all the necessary info one could need, but, I'd have a lot more use talking to myself on empty space summarizing what it means.

So here is some example output from my executable:

-- Resident Evil 2 -- GBI command lists spanning (MPEG compression ucodes in video intro):
Code:
RSP Iterations Log:  primary R4000 operation codes
--------------------------------------------------
SPECIAL 746448
REGIMM  86375
J       824
JAL     824
BEQ     618
BNE     218543
BGTZ    3374841
ADDI    15040158
ANDI    1236
ORI     411
COP0    598916
        1 # ignore that <-- probably some stupid-ass bug in my use of CRT fread()
COP2    39964773
LW      5356
LWC2    12584320
SWC2    17813018

RSP Iterations Log:  SPECIAL operation codes
--------------------------------------------------
SLL     287965
SRL     12360
JR      87611
BREAK   411
ADD     345789
OR      12312

RSP Iterations Log:  REGIMM operation codes
--------------------------------------------------
BGEZAL  86375

RSP Iterations Log:  COP0 operation codes
--------------------------------------------------
MFC0    211951
MTC0    386965

RSP Iterations Log:  COP2 operation codes
--------------------------------------------------
VECTOP  39964773

RSP Iterations Log:  vector operation codes
--------------------------------------------------
VMUDL   2954651
VMUDM   2966400
VMADM   2954650
VMADN   2954650
VADD    9617302
VSUB    3708618
VADDC   5909302
VLT     4449600
VGE     4449600

RSP Iterations Log:  LWC2 operation codes
--------------------------------------------------
LQV     618
LUV     11100502
LHV     1483200

RSP Iterations Log:  COP0 operation codes
--------------------------------------------------
SQV     1509568
SUV     2954650
SHV     4449600
SFV     8899200
-- Castlevania: Legacy of Darkness -- GBI command lists spanning (resurrection of Count Dracula in Cornell's intro, shit load of triangles slowing the game down here)

Code:
RSP Iterations Log:  primary R4000 operation codes
--------------------------------------------------
SPECIAL 65570082
REGIMM  3945476
J       6289367
JAL     3253744
BEQ     10807773
BNE     15390579
BLEZ    3379149
BGTZ    1887799
ADDI    20758404
ADDIU   6321565
ANDI    13637095
ORI     5971356
XORI    429898
LUI     381700
COP0    20781982
        1
COP2    278518561
LH      705476
LW      27165926
LBU     11756439
LHU     13190711
SB      1767548
SH      7763417
SW      11236192
LWC2    62708738
SWC2    67084498

RSP Iterations Log:  SPECIAL operation codes
--------------------------------------------------
SLL     12845730
SRL     2276901
SRA     7783739
SRLV    381700
SRAV    381700
JR      11620643
BREAK   609
ADD     5746813
SUB     11248438
AND     8251846
OR      4650263
NOR     381700

RSP Iterations Log:  REGIMM operation codes
--------------------------------------------------
BLTZ    1509548
BGEZ    2435319
BGEZAL  609

RSP Iterations Log:  COP0 operation codes
--------------------------------------------------
MFC0    17059593
MTC0    3722389

RSP Iterations Log:  COP2 operation codes
--------------------------------------------------
MFC2    4184830
CFC2    3774378
MTC2    2887464
VECTOP  267671889

RSP Iterations Log:  vector operation codes
--------------------------------------------------
VMULF   2739810
VMULU   3012320
VMUDL   16552584
VMUDM   5416108
VMUDN   13182847
VMUDH   6744291
VMACF   3050012
VMACU   6024640
VMADL   6543211
VMADM   16459860
VMADN   35368347
VMADH   42224277
VADD    6939173
VSUB    13062421
VABS    23668
VADDC   658058
VSUBC   2140097
VSAW    4920326
VLT     3999616
VEQ     185526
VNE     1146439
VGE     9533150
VCL     3774378
VCH     3774378
VCR     705476
VMRG    18312706
VAND    3012320
VOR     3804364
VXOR    6892
VNXOR   7153494
VRCP    2116431
VRCPL   5225290
VRCPH   9974345
VMOV    9039955
VRSQL   281693
VRSQH   563386

RSP Iterations Log:  LWC2 operation codes
--------------------------------------------------
LSV     12528018
LLV     16844389
LDV     12950023
LQV     2315644
LPV     12718130
LUV     5352534

RSP Iterations Log:  COP0 operation codes
--------------------------------------------------
SBV     4223484
SSV     27090434
SLV     11823290
SDV     22119761
SQV     313688
SPV     343734
SUV     1170107
-- Star Wars: Rogue Squadron -- ABI command lists spanning (full intro scene before START screen)
Code:
RSP Iterations Log:  primary R4000 operation codes
--------------------------------------------------
SPECIAL 3190270
REGIMM  189487
J       114275
JAL     548386
BEQ     292304
BNE     2011177
ADDI    3660
ADDIU   7840219
ANDI    577967
ORI     1084452
XORI    219364
COP0    854269
COP2    53999422
LW      443783
LBU     548514
LHU     13243226
SB      67332
SH      32403
SW      2526
LWC2    19632777
SWC2    6835930

RSP Iterations Log:  SPECIAL operation codes
--------------------------------------------------
SLL     1025929
SRL     97243
SRA     453642
SRLV    189487
JR      550911
BREAK   915
ADDU    159938
SUBU    32403
AND     80832
OR      578762
SLT     20208

RSP Iterations Log:  REGIMM operation codes
--------------------------------------------------
BLTZ    189487

RSP Iterations Log:  COP0 operation codes
--------------------------------------------------
MFC0    388655
MTC0    465614

RSP Iterations Log:  COP2 operation codes
--------------------------------------------------
MFC2    32403
MTC2    1770159
VECTOP  52196860

RSP Iterations Log:  vector operation codes
--------------------------------------------------
VMULF   6221376
VMUDL   812601
VMUDM   752944
VMUDN   4078259
VMUDH   1000444
VMADM   2923
VMADN   3903565
VMADH   10718231
VADD    11762289
VSUB    810075
VADDC   4060479
VSAW    1520948
VLT     810075
VMRG    810075
VAND    1515896
VXOR    1900784
VMOV    1515896

RSP Iterations Log:  LWC2 operation codes
--------------------------------------------------
LLV     189487
LDV     12956923
LQV     3833549
LRV     2652818

RSP Iterations Log:  COP0 operation codes
--------------------------------------------------
SSV     1099596
SDV     5052
SQV     5731282
-- Super Mario 64 -- ABI command lists spanning (File Select screen)
Code:
RSP Iterations Log:  primary R4000 operation codes
--------------------------------------------------
SPECIAL 7235499
J       1625295
JAL     264105
BEQ     311855
BNE     761010
BLEZ    1236278
BGTZ    2239800
ADDI    10638246
ANDI    1142846
ORI     87606
LUI     85302
COP0    1780682
COP2    34759954
LH      9076299
LW      959433
LBU     255652
LHU     203820
SH      610376
SW      48055
LWC2    14729933
SWC2    7559964

RSP Iterations Log:  SPECIAL operation codes
--------------------------------------------------
SLL     2741526
SRL     1395704
SRLV    255652
JR      646060
BREAK   1152
ADD     1776351
SUB     333752
AND     85302

RSP Iterations Log:  REGIMM operation codes
--------------------------------------------------

RSP Iterations Log:  COP0 operation codes
--------------------------------------------------
MFC0    762162
MTC0    1018520

RSP Iterations Log:  COP2 operation codes
--------------------------------------------------
MFC2    56834
MTC2    373923
VECTOP  34329197

RSP Iterations Log:  vector operation codes
--------------------------------------------------
VMULF   6151864
VMUDL   1548729
VMUDM   990822
VMUDN   2457464
VMUDH   454378
VMACF   2173488
VMADM   1559945
VMADN   5580636
VMADH   6075309
VADD    3978336
VSUB    68048
VSUBC   11216
VSAW    908756
VGE     267303
VCL     727301
VAND    1022608
VXOR    352994

RSP Iterations Log:  LWC2 operation codes
--------------------------------------------------
LSV     39632
LDV     8809653
LQV     4091084
LRV     1789564

RSP Iterations Log:  COP0 operation codes
--------------------------------------------------
SSV     1347073
SDV     1336701
SQV     4876190
Reply With Quote