Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
RishiRecon
GitHub Repository: RishiRecon/exploits
Path: blob/main/misc/emulator/xnes/snes9x/fxdbg.cpp
28515 views
1
/***********************************************************************************
2
Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
3
4
(c) Copyright 1996 - 2002 Gary Henderson ([email protected]),
5
Jerremy Koot ([email protected])
6
7
(c) Copyright 2002 - 2004 Matthew Kendora
8
9
(c) Copyright 2002 - 2005 Peter Bortas ([email protected])
10
11
(c) Copyright 2004 - 2005 Joel Yliluoma (http://iki.fi/bisqwit/)
12
13
(c) Copyright 2001 - 2006 John Weidman ([email protected])
14
15
(c) Copyright 2002 - 2006 funkyass ([email protected]),
16
Kris Bleakley ([email protected])
17
18
(c) Copyright 2002 - 2010 Brad Jorsch ([email protected]),
19
Nach ([email protected]),
20
21
(c) Copyright 2002 - 2011 zones ([email protected])
22
23
(c) Copyright 2006 - 2007 nitsuja
24
25
(c) Copyright 2009 - 2011 BearOso,
26
OV2
27
28
29
BS-X C emulator code
30
(c) Copyright 2005 - 2006 Dreamer Nom,
31
zones
32
33
C4 x86 assembler and some C emulation code
34
(c) Copyright 2000 - 2003 _Demo_ ([email protected]),
35
Nach,
36
zsKnight ([email protected])
37
38
C4 C++ code
39
(c) Copyright 2003 - 2006 Brad Jorsch,
40
Nach
41
42
DSP-1 emulator code
43
(c) Copyright 1998 - 2006 _Demo_,
44
Andreas Naive ([email protected]),
45
Gary Henderson,
46
Ivar ([email protected]),
47
John Weidman,
48
Kris Bleakley,
49
Matthew Kendora,
50
Nach,
51
neviksti ([email protected])
52
53
DSP-2 emulator code
54
(c) Copyright 2003 John Weidman,
55
Kris Bleakley,
56
Lord Nightmare ([email protected]),
57
Matthew Kendora,
58
neviksti
59
60
DSP-3 emulator code
61
(c) Copyright 2003 - 2006 John Weidman,
62
Kris Bleakley,
63
Lancer,
64
z80 gaiden
65
66
DSP-4 emulator code
67
(c) Copyright 2004 - 2006 Dreamer Nom,
68
John Weidman,
69
Kris Bleakley,
70
Nach,
71
z80 gaiden
72
73
OBC1 emulator code
74
(c) Copyright 2001 - 2004 zsKnight,
75
pagefault ([email protected]),
76
Kris Bleakley
77
Ported from x86 assembler to C by sanmaiwashi
78
79
SPC7110 and RTC C++ emulator code used in 1.39-1.51
80
(c) Copyright 2002 Matthew Kendora with research by
81
zsKnight,
82
John Weidman,
83
Dark Force
84
85
SPC7110 and RTC C++ emulator code used in 1.52+
86
(c) Copyright 2009 byuu,
87
neviksti
88
89
S-DD1 C emulator code
90
(c) Copyright 2003 Brad Jorsch with research by
91
Andreas Naive,
92
John Weidman
93
94
S-RTC C emulator code
95
(c) Copyright 2001 - 2006 byuu,
96
John Weidman
97
98
ST010 C++ emulator code
99
(c) Copyright 2003 Feather,
100
John Weidman,
101
Kris Bleakley,
102
Matthew Kendora
103
104
Super FX x86 assembler emulator code
105
(c) Copyright 1998 - 2003 _Demo_,
106
pagefault,
107
zsKnight
108
109
Super FX C emulator code
110
(c) Copyright 1997 - 1999 Ivar,
111
Gary Henderson,
112
John Weidman
113
114
Sound emulator code used in 1.5-1.51
115
(c) Copyright 1998 - 2003 Brad Martin
116
(c) Copyright 1998 - 2006 Charles Bilyue'
117
118
Sound emulator code used in 1.52+
119
(c) Copyright 2004 - 2007 Shay Green ([email protected])
120
121
SH assembler code partly based on x86 assembler code
122
(c) Copyright 2002 - 2004 Marcus Comstedt ([email protected])
123
124
2xSaI filter
125
(c) Copyright 1999 - 2001 Derek Liauw Kie Fa
126
127
HQ2x, HQ3x, HQ4x filters
128
(c) Copyright 2003 Maxim Stepin ([email protected])
129
130
NTSC filter
131
(c) Copyright 2006 - 2007 Shay Green
132
133
GTK+ GUI code
134
(c) Copyright 2004 - 2011 BearOso
135
136
Win32 GUI code
137
(c) Copyright 2003 - 2006 blip,
138
funkyass,
139
Matthew Kendora,
140
Nach,
141
nitsuja
142
(c) Copyright 2009 - 2011 OV2
143
144
Mac OS GUI code
145
(c) Copyright 1998 - 2001 John Stiles
146
(c) Copyright 2001 - 2011 zones
147
148
149
Specific ports contains the works of other authors. See headers in
150
individual files.
151
152
153
Snes9x homepage: http://www.snes9x.com/
154
155
Permission to use, copy, modify and/or distribute Snes9x in both binary
156
and source form, for non-commercial purposes, is hereby granted without
157
fee, providing that this license information and copyright notice appear
158
with all copies and any derived work.
159
160
This software is provided 'as-is', without any express or implied
161
warranty. In no event shall the authors be held liable for any damages
162
arising from the use of this software or it's derivatives.
163
164
Snes9x is freeware for PERSONAL USE only. Commercial users should
165
seek permission of the copyright holders first. Commercial use includes,
166
but is not limited to, charging money for Snes9x or software derived from
167
Snes9x, including Snes9x or derivatives in commercial game bundles, and/or
168
using Snes9x as a promotion for your commercial product.
169
170
The copyright holders request that bug fixes and improvements to the code
171
should be forwarded to them so everyone can benefit from the modifications
172
in future versions.
173
174
Super NES and Super Nintendo Entertainment System are trademarks of
175
Nintendo Co., Limited and its subsidiary companies.
176
***********************************************************************************/
177
178
179
#ifdef DEBUGGER
180
181
#include "snes9x.h"
182
#include "fxinst.h"
183
#include "fxemu.h"
184
185
/*
186
When printing a line from the pipe, it could look like this:
187
188
01:8006 f4 fb 86 iwt r4, #$86fb
189
190
The values are:
191
program bank : 01
192
adress : 8006
193
values at memory address 8006 : f4 fb 86
194
instruction in the pipe : iwt r4, #$86fb
195
196
Note! If the instruction has more than one byte (like in 'iwt') and the instruction is in a delay slot,
197
the second and third byte displayed will not be the same as those used.
198
Since the instrction is in a delay slot,
199
the first byte of the instruction will be taken from the pipe at the address after the branch instruction,
200
and the next one or two bytes will be taken from the address that the branch points to.
201
This is a bit complicated, but I've taken this into account, in this debug function.
202
(See the diffrence of how the values vPipe1 and vPipe2 are read, compared to the values vByte1 and vByte2)
203
*/
204
205
/*
206
static const char *fx_apvMnemonicTable[] =
207
{
208
// ALT0 Table
209
210
// 00 - 0f
211
"stop",
212
"nop",
213
"cache",
214
"lsr",
215
"rol",
216
"bra $%04x",
217
"blt $%04x",
218
"bge $%04x",
219
"bne $%04x",
220
"beq $%04x",
221
"bpl $%04x",
222
"bmi $%04x",
223
"bcc $%04x",
224
"bcs $%04x",
225
"bvc $%04x",
226
"bvs $%04x",
227
228
// 10 - 1f
229
"to r0",
230
"to r1",
231
"to r2",
232
"to r3",
233
"to r4",
234
"to r5",
235
"to r6",
236
"to r7",
237
"to r8",
238
"to r9",
239
"to r10",
240
"to r11",
241
"to r12",
242
"to r13",
243
"to r14",
244
"to r15",
245
246
// 20 - 2f
247
"with r0",
248
"with r1",
249
"with r2",
250
"with r3",
251
"with r4",
252
"with r5",
253
"with r6",
254
"with r7",
255
"with r8",
256
"with r9",
257
"with r10",
258
"with r11",
259
"with r12",
260
"with r13",
261
"with r14",
262
"with r15",
263
264
// 30 - 3f
265
"stw (r0)",
266
"stw (r1)",
267
"stw (r2)",
268
"stw (r3)",
269
"stw (r4)",
270
"stw (r5)",
271
"stw (r6)",
272
"stw (r7)",
273
"stw (r8)",
274
"stw (r9)",
275
"stw (r10)",
276
"stw (r11)",
277
"loop",
278
"alt1",
279
"alt2",
280
"alt3",
281
282
// 40 - 4f
283
"ldw (r0)",
284
"ldw (r1)",
285
"ldw (r2)",
286
"ldw (r3)",
287
"ldw (r4)",
288
"ldw (r5)",
289
"ldw (r6)",
290
"ldw (r7)",
291
"ldw (r8)",
292
"ldw (r9)",
293
"ldw (r10)",
294
"ldw (r11)",
295
"plot",
296
"swap",
297
"color",
298
"not",
299
300
// 50 - 5f
301
"add r0",
302
"add r1",
303
"add r2",
304
"add r3",
305
"add r4",
306
"add r5",
307
"add r6",
308
"add r7",
309
"add r8",
310
"add r9",
311
"add r10",
312
"add r11",
313
"add r12",
314
"add r13",
315
"add r14",
316
"add r15",
317
318
// 60 - 6f
319
"sub r0",
320
"sub r1",
321
"sub r2",
322
"sub r3",
323
"sub r4",
324
"sub r5",
325
"sub r6",
326
"sub r7",
327
"sub r8",
328
"sub r9",
329
"sub r10",
330
"sub r11",
331
"sub r12",
332
"sub r13",
333
"sub r14",
334
"sub r15",
335
336
// 70 - 7f
337
"merge",
338
"and r1",
339
"and r2",
340
"and r3",
341
"and r4",
342
"and r5",
343
"and r6",
344
"and r7",
345
"and r8",
346
"and r9",
347
"and r10",
348
"and r11",
349
"and r12",
350
"and r13",
351
"and r14",
352
"and r15",
353
354
// 80 - 8f
355
"mult r0",
356
"mult r1",
357
"mult r2",
358
"mult r3",
359
"mult r4",
360
"mult r5",
361
"mult r6",
362
"mult r7",
363
"mult r8",
364
"mult r9",
365
"mult r10",
366
"mult r11",
367
"mult r12",
368
"mult r13",
369
"mult r14",
370
"mult r15",
371
372
// 90 - 9f
373
"sbk",
374
"link #1",
375
"link #2",
376
"link #3",
377
"link #4",
378
"sex",
379
"asr",
380
"ror",
381
"jmp (r8)",
382
"jmp (r9)",
383
"jmp (r10)",
384
"jmp (r11)",
385
"jmp (r12)",
386
"jmp (r13)",
387
"lob",
388
"fmult",
389
390
// a0 - af
391
"ibt r0, #$%02x",
392
"ibt r1, #$%02x",
393
"ibt r2, #$%02x",
394
"ibt r3, #$%02x",
395
"ibt r4, #$%02x",
396
"ibt r5, #$%02x",
397
"ibt r6, #$%02x",
398
"ibt r7, #$%02x",
399
"ibt r8, #$%02x",
400
"ibt r9, #$%02x",
401
"ibt r10, #$%02x",
402
"ibt r11, #$%02x",
403
"ibt r12, #$%02x",
404
"ibt r13, #$%02x",
405
"ibt r14, #$%02x",
406
"ibt r15, #$%02x",
407
408
// b0 - bf
409
"from r0",
410
"from r1",
411
"from r2",
412
"from r3",
413
"from r4",
414
"from r5",
415
"from r6",
416
"from r7",
417
"from r8",
418
"from r9",
419
"from r10",
420
"from r11",
421
"from r12",
422
"from r13",
423
"from r14",
424
"from r15",
425
426
// c0 - cf
427
"hib",
428
"or r1",
429
"or r2",
430
"or r3",
431
"or r4",
432
"or r5",
433
"or r6",
434
"or r7",
435
"or r8",
436
"or r9",
437
"or r10",
438
"or r11",
439
"or r12",
440
"or r13",
441
"or r14",
442
"or r15",
443
444
// d0 - df
445
"inc r0",
446
"inc r1",
447
"inc r2",
448
"inc r3",
449
"inc r4",
450
"inc r5",
451
"inc r6",
452
"inc r7",
453
"inc r8",
454
"inc r9",
455
"inc r10",
456
"inc r11",
457
"inc r12",
458
"inc r13",
459
"inc r14",
460
"getc",
461
462
// e0 - ef
463
"dec r0",
464
"dec r1",
465
"dec r2",
466
"dec r3",
467
"dec r4",
468
"dec r5",
469
"dec r6",
470
"dec r7",
471
"dec r8",
472
"dec r9",
473
"dec r10",
474
"dec r11",
475
"dec r12",
476
"dec r13",
477
"dec r14",
478
"getb",
479
480
// f0 - ff
481
"iwt r0, #$%04x",
482
"iwt r1, #$%04x",
483
"iwt r2, #$%04x",
484
"iwt r3, #$%04x",
485
"iwt r4, #$%04x",
486
"iwt r5, #$%04x",
487
"iwt r6, #$%04x",
488
"iwt r7, #$%04x",
489
"iwt r8, #$%04x",
490
"iwt r9, #$%04x",
491
"iwt r10, #$%04x",
492
"iwt r11, #$%04x",
493
"iwt r12, #$%04x",
494
"iwt r13, #$%04x",
495
"iwt r14, #$%04x",
496
"iwt r15, #$%04x",
497
498
// ALT1 Table
499
500
// 00 - 0f
501
"stop",
502
"nop",
503
"cache",
504
"lsr",
505
"rol",
506
"bra $%04x",
507
"blt $%04x",
508
"bge $%04x",
509
"bne $%04x",
510
"beq $%04x",
511
"bpl $%04x",
512
"bmi $%04x",
513
"bcc $%04x",
514
"bcs $%04x",
515
"bvc $%04x",
516
"bvs $%04x",
517
518
// 10 - 1f
519
"to r0",
520
"to r1",
521
"to r2",
522
"to r3",
523
"to r4",
524
"to r5",
525
"to r6",
526
"to r7",
527
"to r8",
528
"to r9",
529
"to r10",
530
"to r11",
531
"to r12",
532
"to r13",
533
"to r14",
534
"to r15",
535
536
// 20 - 2f
537
"with r0",
538
"with r1",
539
"with r2",
540
"with r3",
541
"with r4",
542
"with r5",
543
"with r6",
544
"with r7",
545
"with r8",
546
"with r9",
547
"with r10",
548
"with r11",
549
"with r12",
550
"with r13",
551
"with r14",
552
"with r15",
553
554
// 30 - 3f
555
"stb (r0)",
556
"stb (r1)",
557
"stb (r2)",
558
"stb (r3)",
559
"stb (r4)",
560
"stb (r5)",
561
"stb (r6)",
562
"stb (r7)",
563
"stb (r8)",
564
"stb (r9)",
565
"stb (r10)",
566
"stb (r11)",
567
"loop",
568
"alt1",
569
"alt2",
570
"alt3",
571
572
// 40 - 4f
573
"ldb (r0)",
574
"ldb (r1)",
575
"ldb (r2)",
576
"ldb (r3)",
577
"ldb (r4)",
578
"ldb (r5)",
579
"ldb (r6)",
580
"ldb (r7)",
581
"ldb (r8)",
582
"ldb (r9)",
583
"ldb (r10)",
584
"ldb (r11)",
585
"rpix",
586
"swap",
587
"cmode",
588
"not",
589
590
// 50 - 5f
591
"adc r0",
592
"adc r1",
593
"adc r2",
594
"adc r3",
595
"adc r4",
596
"adc r5",
597
"adc r6",
598
"adc r7",
599
"adc r8",
600
"adc r9",
601
"adc r10",
602
"adc r11",
603
"adc r12",
604
"adc r13",
605
"adc r14",
606
"adc r15",
607
608
// 60 - 6f
609
"sbc r0",
610
"sbc r1",
611
"sbc r2",
612
"sbc r3",
613
"sbc r4",
614
"sbc r5",
615
"sbc r6",
616
"sbc r7",
617
"sbc r8",
618
"sbc r9",
619
"sbc r10",
620
"sbc r11",
621
"sbc r12",
622
"sbc r13",
623
"sbc r14",
624
"sbc r15",
625
626
// 70 - 7f
627
"merge",
628
"bic r1",
629
"bic r2",
630
"bic r3",
631
"bic r4",
632
"bic r5",
633
"bic r6",
634
"bic r7",
635
"bic r8",
636
"bic r9",
637
"bic r10",
638
"bic r11",
639
"bic r12",
640
"bic r13",
641
"bic r14",
642
"bic r15",
643
644
// 80 - 8f
645
"umult r0",
646
"umult r1",
647
"umult r2",
648
"umult r3",
649
"umult r4",
650
"umult r5",
651
"umult r6",
652
"umult r7",
653
"umult r8",
654
"umult r9",
655
"umult r10",
656
"umult r11",
657
"umult r12",
658
"umult r13",
659
"umult r14",
660
"umult r15",
661
662
// 90 - 9f
663
"sbk",
664
"link #1",
665
"link #2",
666
"link #3",
667
"link #4",
668
"sex",
669
"div2",
670
"ror",
671
"ljmp (r8)",
672
"ljmp (r9)",
673
"ljmp (r10)",
674
"ljmp (r11)",
675
"ljmp (r12)",
676
"ljmp (r13)",
677
"lob",
678
"lmult",
679
680
// a0 - af
681
"lms r0, ($%04x)",
682
"lms r1, ($%04x)",
683
"lms r2, ($%04x)",
684
"lms r3, ($%04x)",
685
"lms r4, ($%04x)",
686
"lms r5, ($%04x)",
687
"lms r6, ($%04x)",
688
"lms r7, ($%04x)",
689
"lms r8, ($%04x)",
690
"lms r9, ($%04x)",
691
"lms r10, ($%04x)",
692
"lms r11, ($%04x)",
693
"lms r12, ($%04x)",
694
"lms r13, ($%04x)",
695
"lms r14, ($%04x)",
696
"lms r15, ($%04x)",
697
698
// b0 - bf
699
"from r0",
700
"from r1",
701
"from r2",
702
"from r3",
703
"from r4",
704
"from r5",
705
"from r6",
706
"from r7",
707
"from r8",
708
"from r9",
709
"from r10",
710
"from r11",
711
"from r12",
712
"from r13",
713
"from r14",
714
"from r15",
715
716
// c0 - cf
717
"hib",
718
"xor r1",
719
"xor r2",
720
"xor r3",
721
"xor r4",
722
"xor r5",
723
"xor r6",
724
"xor r7",
725
"xor r8",
726
"xor r9",
727
"xor r10",
728
"xor r11",
729
"xor r12",
730
"xor r13",
731
"xor r14",
732
"xor r15",
733
734
// d0 - df
735
"inc r0",
736
"inc r1",
737
"inc r2",
738
"inc r3",
739
"inc r4",
740
"inc r5",
741
"inc r6",
742
"inc r7",
743
"inc r8",
744
"inc r9",
745
"inc r10",
746
"inc r11",
747
"inc r12",
748
"inc r13",
749
"inc r14",
750
"getc",
751
752
// e0 - ef
753
"dec r0",
754
"dec r1",
755
"dec r2",
756
"dec r3",
757
"dec r4",
758
"dec r5",
759
"dec r6",
760
"dec r7",
761
"dec r8",
762
"dec r9",
763
"dec r10",
764
"dec r11",
765
"dec r12",
766
"dec r13",
767
"dec r14",
768
"getbh",
769
770
// f0 - ff
771
"lm r0, ($%04x)",
772
"lm r1, ($%04x)",
773
"lm r2, ($%04x)",
774
"lm r3, ($%04x)",
775
"lm r4, ($%04x)",
776
"lm r5, ($%04x)",
777
"lm r6, ($%04x)",
778
"lm r7, ($%04x)",
779
"lm r8, ($%04x)",
780
"lm r9, ($%04x)",
781
"lm r10, ($%04x)",
782
"lm r11, ($%04x)",
783
"lm r12, ($%04x)",
784
"lm r13, ($%04x)",
785
"lm r14, ($%04x)",
786
"lm r15, ($%04x)",
787
788
// ALT2 Table
789
790
// 00 - 0f
791
"stop",
792
"nop",
793
"cache",
794
"lsr",
795
"rol",
796
"bra $%04x",
797
"blt $%04x",
798
"bge $%04x",
799
"bne $%04x",
800
"beq $%04x",
801
"bpl $%04x",
802
"bmi $%04x",
803
"bcc $%04x",
804
"bcs $%04x",
805
"bvc $%04x",
806
"bvs $%04x",
807
808
// 10 - 1f
809
"to r0",
810
"to r1",
811
"to r2",
812
"to r3",
813
"to r4",
814
"to r5",
815
"to r6",
816
"to r7",
817
"to r8",
818
"to r9",
819
"to r10",
820
"to r11",
821
"to r12",
822
"to r13",
823
"to r14",
824
"to r15",
825
826
// 20 - 2f
827
"with r0",
828
"with r1",
829
"with r2",
830
"with r3",
831
"with r4",
832
"with r5",
833
"with r6",
834
"with r7",
835
"with r8",
836
"with r9",
837
"with r10",
838
"with r11",
839
"with r12",
840
"with r13",
841
"with r14",
842
"with r15",
843
844
// 30 - 3f
845
"stw (r0)",
846
"stw (r1)",
847
"stw (r2)",
848
"stw (r3)",
849
"stw (r4)",
850
"stw (r5)",
851
"stw (r6)",
852
"stw (r7)",
853
"stw (r8)",
854
"stw (r9)",
855
"stw (r10)",
856
"stw (r11)",
857
"loop",
858
"alt1",
859
"alt2",
860
"alt3",
861
862
// 40 - 4f
863
"ldw (r0)",
864
"ldw (r1)",
865
"ldw (r2)",
866
"ldw (r3)",
867
"ldw (r4)",
868
"ldw (r5)",
869
"ldw (r6)",
870
"ldw (r7)",
871
"ldw (r8)",
872
"ldw (r9)",
873
"ldw (r10)",
874
"ldw (r11)",
875
"plot",
876
"swap",
877
"color",
878
"not",
879
880
// 50 - 5f
881
"add #0",
882
"add #1",
883
"add #2",
884
"add #3",
885
"add #4",
886
"add #5",
887
"add #6",
888
"add #7",
889
"add #8",
890
"add #9",
891
"add #10",
892
"add #11",
893
"add #12",
894
"add #13",
895
"add #14",
896
"add #15",
897
898
// 60 - 6f
899
"sub #0",
900
"sub #1",
901
"sub #2",
902
"sub #3",
903
"sub #4",
904
"sub #5",
905
"sub #6",
906
"sub #7",
907
"sub #8",
908
"sub #9",
909
"sub #10",
910
"sub #11",
911
"sub #12",
912
"sub #13",
913
"sub #14",
914
"sub #15",
915
916
// 70 - 7f
917
"merge",
918
"and #1",
919
"and #2",
920
"and #3",
921
"and #4",
922
"and #5",
923
"and #6",
924
"and #7",
925
"and #8",
926
"and #9",
927
"and #10",
928
"and #11",
929
"and #12",
930
"and #13",
931
"and #14",
932
"and #15",
933
934
// 80 - 8f
935
"mult #0",
936
"mult #1",
937
"mult #2",
938
"mult #3",
939
"mult #4",
940
"mult #5",
941
"mult #6",
942
"mult #7",
943
"mult #8",
944
"mult #9",
945
"mult #10",
946
"mult #11",
947
"mult #12",
948
"mult #13",
949
"mult #14",
950
"mult #15",
951
952
// 90 - 9f
953
"sbk",
954
"link #1",
955
"link #2",
956
"link #3",
957
"link #4",
958
"sex",
959
"asr",
960
"ror",
961
"jmp (r8)",
962
"jmp (r9)",
963
"jmp (r10)",
964
"jmp (r11)",
965
"jmp (r12)",
966
"jmp (r13)",
967
"lob",
968
"fmult",
969
970
// a0 - af
971
"sms ($%04x), r0",
972
"sms ($%04x), r1",
973
"sms ($%04x), r2",
974
"sms ($%04x), r3",
975
"sms ($%04x), r4",
976
"sms ($%04x), r5",
977
"sms ($%04x), r6",
978
"sms ($%04x), r7",
979
"sms ($%04x), r8",
980
"sms ($%04x), r9",
981
"sms ($%04x), r10",
982
"sms ($%04x), r11",
983
"sms ($%04x), r12",
984
"sms ($%04x), r13",
985
"sms ($%04x), r14",
986
"sms ($%04x), r15",
987
988
// b0 - bf
989
"from r0",
990
"from r1",
991
"from r2",
992
"from r3",
993
"from r4",
994
"from r5",
995
"from r6",
996
"from r7",
997
"from r8",
998
"from r9",
999
"from r10",
1000
"from r11",
1001
"from r12",
1002
"from r13",
1003
"from r14",
1004
"from r15",
1005
1006
// c0 - cf
1007
"hib",
1008
"or #1",
1009
"or #2",
1010
"or #3",
1011
"or #4",
1012
"or #5",
1013
"or #6",
1014
"or #7",
1015
"or #8",
1016
"or #9",
1017
"or #10",
1018
"or #11",
1019
"or #12",
1020
"or #13",
1021
"or #14",
1022
"or #15",
1023
1024
// d0 - df
1025
"inc r0",
1026
"inc r1",
1027
"inc r2",
1028
"inc r3",
1029
"inc r4",
1030
"inc r5",
1031
"inc r6",
1032
"inc r7",
1033
"inc r8",
1034
"inc r9",
1035
"inc r10",
1036
"inc r11",
1037
"inc r12",
1038
"inc r13",
1039
"inc r14",
1040
"ramb",
1041
1042
// e0 - ef
1043
"dec r0",
1044
"dec r1",
1045
"dec r2",
1046
"dec r3",
1047
"dec r4",
1048
"dec r5",
1049
"dec r6",
1050
"dec r7",
1051
"dec r8",
1052
"dec r9",
1053
"dec r10",
1054
"dec r11",
1055
"dec r12",
1056
"dec r13",
1057
"dec r14",
1058
"getbl",
1059
1060
// f0 - ff
1061
"sm ($%04x), r0",
1062
"sm ($%04x), r1",
1063
"sm ($%04x), r2",
1064
"sm ($%04x), r3",
1065
"sm ($%04x), r4",
1066
"sm ($%04x), r5",
1067
"sm ($%04x), r6",
1068
"sm ($%04x), r7",
1069
"sm ($%04x), r8",
1070
"sm ($%04x), r9",
1071
"sm ($%04x), r10",
1072
"sm ($%04x), r11",
1073
"sm ($%04x), r12",
1074
"sm ($%04x), r13",
1075
"sm ($%04x), r14",
1076
"sm ($%04x), r15",
1077
1078
// ALT3 Table
1079
1080
// 00 - 0f
1081
"stop",
1082
"nop",
1083
"cache",
1084
"lsr",
1085
"rol",
1086
"bra $%04x",
1087
"blt $%04x",
1088
"bge $%04x",
1089
"bne $%04x",
1090
"beq $%04x",
1091
"bpl $%04x",
1092
"bmi $%04x",
1093
"bcc $%04x",
1094
"bcs $%04x",
1095
"bvc $%04x",
1096
"bvs $%04x",
1097
1098
// 10 - 1f
1099
"to r0",
1100
"to r1",
1101
"to r2",
1102
"to r3",
1103
"to r4",
1104
"to r5",
1105
"to r6",
1106
"to r7",
1107
"to r8",
1108
"to r9",
1109
"to r10",
1110
"to r11",
1111
"to r12",
1112
"to r13",
1113
"to r14",
1114
"to r15",
1115
1116
// 20 - 2f
1117
"with r0",
1118
"with r1",
1119
"with r2",
1120
"with r3",
1121
"with r4",
1122
"with r5",
1123
"with r6",
1124
"with r7",
1125
"with r8",
1126
"with r9",
1127
"with r10",
1128
"with r11",
1129
"with r12",
1130
"with r13",
1131
"with r14",
1132
"with r15",
1133
1134
// 30 - 3f
1135
"stb (r0)",
1136
"stb (r1)",
1137
"stb (r2)",
1138
"stb (r3)",
1139
"stb (r4)",
1140
"stb (r5)",
1141
"stb (r6)",
1142
"stb (r7)",
1143
"stb (r8)",
1144
"stb (r9)",
1145
"stb (r10)",
1146
"stb (r11)",
1147
"loop",
1148
"alt1",
1149
"alt2",
1150
"alt3",
1151
1152
// 40 - 4f
1153
"ldb (r0)",
1154
"ldb (r1)",
1155
"ldb (r2)",
1156
"ldb (r3)",
1157
"ldb (r4)",
1158
"ldb (r5)",
1159
"ldb (r6)",
1160
"ldb (r7)",
1161
"ldb (r8)",
1162
"ldb (r9)",
1163
"ldb (r10)",
1164
"ldb (r11)",
1165
"rpix",
1166
"swap",
1167
"cmode",
1168
"not",
1169
1170
// 50 - 5f
1171
"adc #0",
1172
"adc #1",
1173
"adc #2",
1174
"adc #3",
1175
"adc #4",
1176
"adc #5",
1177
"adc #6",
1178
"adc #7",
1179
"adc #8",
1180
"adc #9",
1181
"adc #10",
1182
"adc #11",
1183
"adc #12",
1184
"adc #13",
1185
"adc #14",
1186
"adc #15",
1187
1188
// 60 - 6f
1189
"cmp r0",
1190
"cmp r1",
1191
"cmp r2",
1192
"cmp r3",
1193
"cmp r4",
1194
"cmp r5",
1195
"cmp r6",
1196
"cmp r7",
1197
"cmp r8",
1198
"cmp r9",
1199
"cmp r10",
1200
"cmp r11",
1201
"cmp r12",
1202
"cmp r13",
1203
"cmp r14",
1204
"cmp r15",
1205
1206
// 70 - 7f
1207
"merge",
1208
"bic #1",
1209
"bic #2",
1210
"bic #3",
1211
"bic #4",
1212
"bic #5",
1213
"bic #6",
1214
"bic #7",
1215
"bic #8",
1216
"bic #9",
1217
"bic #10",
1218
"bic #11",
1219
"bic #12",
1220
"bic #13",
1221
"bic #14",
1222
"bic #15",
1223
1224
// 80 - 8f
1225
"umult #0",
1226
"umult #1",
1227
"umult #2",
1228
"umult #3",
1229
"umult #4",
1230
"umult #5",
1231
"umult #6",
1232
"umult #7",
1233
"umult #8",
1234
"umult #9",
1235
"umult #10",
1236
"umult #11",
1237
"umult #12",
1238
"umult #13",
1239
"umult #14",
1240
"umult #15",
1241
1242
// 90 - 9f
1243
"sbk",
1244
"link #1",
1245
"link #2",
1246
"link #3",
1247
"link #4",
1248
"sex",
1249
"div2",
1250
"ror",
1251
"ljmp (r8)",
1252
"ljmp (r9)",
1253
"ljmp (r10)",
1254
"ljmp (r11)",
1255
"ljmp (r12)",
1256
"ljmp (r13)",
1257
"lob",
1258
"lmult",
1259
1260
// a0 - af
1261
"lms r0, ($%04x)",
1262
"lms r1, ($%04x)",
1263
"lms r2, ($%04x)",
1264
"lms r3, ($%04x)",
1265
"lms r4, ($%04x)",
1266
"lms r5, ($%04x)",
1267
"lms r6, ($%04x)",
1268
"lms r7, ($%04x)",
1269
"lms r8, ($%04x)",
1270
"lms r9, ($%04x)",
1271
"lms r10, ($%04x)",
1272
"lms r11, ($%04x)",
1273
"lms r12, ($%04x)",
1274
"lms r13, ($%04x)",
1275
"lms r14, ($%04x)",
1276
"lms r15, ($%04x)",
1277
1278
// b0 - bf
1279
"from r0",
1280
"from r1",
1281
"from r2",
1282
"from r3",
1283
"from r4",
1284
"from r5",
1285
"from r6",
1286
"from r7",
1287
"from r8",
1288
"from r9",
1289
"from r10",
1290
"from r11",
1291
"from r12",
1292
"from r13",
1293
"from r14",
1294
"from r15",
1295
1296
// c0 - cf
1297
"hib",
1298
"xor #1",
1299
"xor #2",
1300
"xor #3",
1301
"xor #4",
1302
"xor #5",
1303
"xor #6",
1304
"xor #7",
1305
"xor #8",
1306
"xor #9",
1307
"xor #10",
1308
"xor #11",
1309
"xor #12",
1310
"xor #13",
1311
"xor #14",
1312
"xor #15",
1313
1314
// d0 - df
1315
"inc r0",
1316
"inc r1",
1317
"inc r2",
1318
"inc r3",
1319
"inc r4",
1320
"inc r5",
1321
"inc r6",
1322
"inc r7",
1323
"inc r8",
1324
"inc r9",
1325
"inc r10",
1326
"inc r11",
1327
"inc r12",
1328
"inc r13",
1329
"inc r14",
1330
"romb",
1331
1332
// e0 - ef
1333
"dec r0",
1334
"dec r1",
1335
"dec r2",
1336
"dec r3",
1337
"dec r4",
1338
"dec r5",
1339
"dec r6",
1340
"dec r7",
1341
"dec r8",
1342
"dec r9",
1343
"dec r10",
1344
"dec r11",
1345
"dec r12",
1346
"dec r13",
1347
"dec r14",
1348
"getbs",
1349
1350
// f0 - ff
1351
"lm r0, ($%04x)",
1352
"lm r1, ($%04x)",
1353
"lm r2, ($%04x)",
1354
"lm r3, ($%04x)",
1355
"lm r4, ($%04x)",
1356
"lm r5, ($%04x)",
1357
"lm r6, ($%04x)",
1358
"lm r7, ($%04x)",
1359
"lm r8, ($%04x)",
1360
"lm r9, ($%04x)",
1361
"lm r10, ($%04x)",
1362
"lm r11, ($%04x)",
1363
"lm r12, ($%04x)",
1364
"lm r13, ($%04x)",
1365
"lm r14, ($%04x)",
1366
"lm r15, ($%04x)"
1367
};
1368
*/
1369
1370
/*
1371
static void FxPipeString (char *pvString)
1372
{
1373
uint32 vOpcode = (GSU.vStatusReg & 0x300) | ((uint32) PIPE);
1374
const char *m = fx_apvMnemonicTable[vOpcode];
1375
uint8 vPipe1, vPipe2, vByte1, vByte2;
1376
uint8 vPipeBank = GSU.vPipeAdr >> 16;
1377
char *p;
1378
1379
// The next two bytes after the pipe's address
1380
vPipe1 = GSU.apvRomBank[vPipeBank][USEX16(GSU.vPipeAdr + 1)];
1381
vPipe2 = GSU.apvRomBank[vPipeBank][USEX16(GSU.vPipeAdr + 2)];
1382
1383
// The actual next two bytes to be read
1384
vByte1 = PRGBANK(USEX16(R15));
1385
vByte2 = PRGBANK(USEX16(R15 + 1));
1386
1387
// Print ROM address of the pipe
1388
sprintf(pvString, "%02x:%04x %02x ", USEX8(vPipeBank), USEX16(GSU.vPipeAdr), USEX8(PIPE));
1389
p = &pvString[strlen(pvString)];
1390
1391
if (PIPE >= 0x05 && PIPE <= 0x0f) // Check if it's a branch instruction
1392
{
1393
sprintf(&pvString[11], "%02x ", USEX8(vPipe1));
1394
#ifdef BRANCH_DELAY_RELATIVE
1395
sprintf(p, m, USEX16(R15 + SEX8(vByte1) + 1));
1396
#else
1397
sprintf(p, m, USEX16(R15 + SEX8(vByte1) - 1));
1398
#endif
1399
}
1400
else
1401
if (PIPE >= 0x10 && PIPE <= 0x1f && TF(B)) // Check for 'move' instruction
1402
sprintf(p, "move r%d, r%d", USEX8(PIPE & 0x0f), (uint32) (GSU.pvSreg - GSU.avReg));
1403
else
1404
if (PIPE >= 0xa0 && PIPE <= 0xaf) // Check for 'ibt', 'lms' or 'sms'
1405
{
1406
sprintf(&pvString[11], "%02x ", USEX8(vPipe1));
1407
if ((GSU.vStatusReg & 0x300) == 0x100 || (GSU.vStatusReg & 0x300) == 0x200)
1408
sprintf(p, m, USEX16(vByte1) << 1);
1409
else
1410
sprintf(p, m, USEX16(vByte1));
1411
}
1412
else
1413
if (PIPE >= 0xb0 && PIPE <= 0xbf && TF(B)) // Check for 'moves'
1414
sprintf(p, "moves r%d, r%d", (uint32) (GSU.pvDreg - GSU.avReg), USEX8(PIPE & 0x0f));
1415
else
1416
if (PIPE >= 0xf0) // Check for 'iwt', 'lm' or 'sm'
1417
{
1418
sprintf(&pvString[11], "%02x %02x ", USEX8(vPipe1), USEX8(vPipe2));
1419
sprintf(p, m, USEX8(vByte1) | (USEX16(vByte2) << 8));
1420
}
1421
else // Normal instruction
1422
strcpy(p, m);
1423
}
1424
*/
1425
1426
#endif
1427
1428