File: UcodeFB.h

package info (click to toggle)
mupen64plus-video-glide64 2.0.0+33+g764d9fe-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,840 kB
  • sloc: cpp: 36,059; ansic: 13,163; makefile: 343; sh: 21
file content (1067 lines) | stat: -rw-r--r-- 65,756 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
/*
*   Glide64 - Glide video plugin for Nintendo 64 emulators.
*   Copyright (c) 2002  Dave2001
*
*   This program is free software; you can redistribute it and/or modify
*   it under the terms of the GNU General Public License as published by
*   the Free Software Foundation; either version 2 of the License, or
*   any later version.
*
*   This program is distributed in the hope that it will be useful,
*   but WITHOUT ANY WARRANTY; without even the implied warranty of
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*   GNU General Public License for more details.
*
*   You should have received a copy of the GNU General Public
*   License along with this program; if not, write to the Free
*   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
*   Boston, MA  02110-1301, USA
*/

//****************************************************************
//
// Glide64 - Glide Plugin for Nintendo 64 emulators (tested mostly with Project64)
// Project started on December 29th, 2001
//
// To modify Glide64:
// * Write your name and (optional)email, commented by your work, so I know who did it, and so that you can find which parts you modified when it comes time to send it to me.
// * Do NOT send me the whole project or file that you modified.  Take out your modified code sections, and tell me where to put them.  If people sent the whole thing, I would have many different versions, but no idea how to combine them all.
//
// Official Glide64 development channel: #Glide64 on EFnet
//
// Original author: Dave2001 (Dave2999@hotmail.com)
// Other authors: Gonetz, Gugaman
//
//****************************************************************
//
// Creation 13 August 2003               Gonetz
//
//****************************************************************

#ifndef _WIN32
#include <stdlib.h>
#endif

static void fb_uc0_moveword()
{
  if ((rdp.cmd0 & 0xFF) == 0x06)  // segment
  {
    rdp.segment[(rdp.cmd0 >> 10) & 0x0F] = rdp.cmd1;
  }
}

static void fb_uc2_moveword()
{
  if (((rdp.cmd0 >> 16) & 0xFF) == 0x06)  // segment
  {
    rdp.segment[((rdp.cmd0 & 0xFFFF) >> 2)&0xF] = rdp.cmd1;
  }
}

static void fb_bg_copy ()
{
  if (rdp.main_ci == 0)
    return;
  CI_STATUS status = rdp.frame_buffers[rdp.ci_count-1].status;
  if (status == ci_copy)
    return;
  
  DWORD addr = segoffset(rdp.cmd1) >> 1;
  BYTE imageFmt = ((BYTE *)gfx.RDRAM)[(((addr+11)<<1)+0)^3];
  BYTE imageSiz = ((BYTE *)gfx.RDRAM)[(((addr+11)<<1)+1)^3];    
  DWORD imagePtr    = segoffset(((DWORD*)gfx.RDRAM)[(addr+8)>>1]);  
  FRDP ("fb_bg_copy. fmt: %d, size: %d, imagePtr %08lx, main_ci: %08lx, cur_ci: %08lx \n", imageFmt, imageSiz, imagePtr, rdp.main_ci, rdp.frame_buffers[rdp.ci_count-1].addr);
  
  if (status == ci_main)
  {
    WORD frameW = ((WORD *)gfx.RDRAM)[(addr+3)^1] >> 2; 
    WORD frameH = ((WORD *)gfx.RDRAM)[(addr+7)^1] >> 2; 
    if ( (frameW == rdp.frame_buffers[rdp.ci_count-1].width) && (frameH == rdp.frame_buffers[rdp.ci_count-1].height) )
      rdp.main_ci_bg = imagePtr;
  }
  else if (imagePtr >= rdp.main_ci && imagePtr < rdp.main_ci_end) //addr within main frame buffer
  {
    rdp.copy_ci_index = rdp.ci_count-1;
    rdp.frame_buffers[rdp.copy_ci_index].status = ci_copy;
    FRDP("rdp.frame_buffers[%d].status = ci_copy\n", rdp.copy_ci_index);
    
    if (rdp.frame_buffers[rdp.copy_ci_index].addr != rdp.main_ci_bg)
    {
      rdp.scale_x = 1.0f;
      rdp.scale_y = 1.0f;
    }
    else 
    {
      RDP("motion blur!\n");
      rdp.motionblur = TRUE;
    }
    
    FRDP ("Detect FB usage. texture addr is inside framebuffer: %08lx - %08lx \n", imagePtr, rdp.main_ci);
  }
  else if (imagePtr == rdp.zimg)
  {
    printf("toto !\n");
    if (status == ci_unknown)
    {
      rdp.frame_buffers[rdp.ci_count-1].status = ci_zimg;
      rdp.tmpzimg = rdp.frame_buffers[rdp.ci_count-1].addr;
      FRDP("rdp.frame_buffers[%d].status = ci_zimg\n", rdp.copy_ci_index);
    }
  }
}

static void fb_setscissor()
{
  rdp.scissor_o.lr_y = (((rdp.cmd1 & 0x00000FFF) >> 2));
  if (rdp.ci_count)
  {
    rdp.scissor_o.ul_x = (((rdp.cmd0 & 0x00FFF000) >> 14));
    rdp.scissor_o.lr_x = (((rdp.cmd1 & 0x00FFF000) >> 14));
    COLOR_IMAGE & cur_fb = rdp.frame_buffers[rdp.ci_count-1];
    if (rdp.scissor_o.lr_x - rdp.scissor_o.ul_x > (cur_fb.width >> 1))
    {
      if (cur_fb.height == 0 || (cur_fb.width >= rdp.scissor_o.lr_x-1 && cur_fb.width <= rdp.scissor_o.lr_x+1)) 
        cur_fb.height = rdp.scissor_o.lr_y;
    }
    FRDP("fb_setscissor. lr_x = %d, lr_y = %d, fb_width = %d, fb_height = %d\n", rdp.scissor_o.lr_x, rdp.scissor_o.lr_y, cur_fb.width, cur_fb.height); 
  }
}

static void fb_rect()
{
  if (rdp.frame_buffers[rdp.ci_count-1].width == 32)
    return;
  int ul_x = ((rdp.cmd1 & 0x00FFF000) >> 14);
  int lr_x = ((rdp.cmd0 & 0x00FFF000) >> 14);
  int width = lr_x-ul_x;
  DWORD lr_y = ((rdp.cmd0 & 0x00000FFF) >> 2);
  int diff = abs((int)rdp.frame_buffers[rdp.ci_count-1].width - width);
  if (diff < 4)
    if (rdp.frame_buffers[rdp.ci_count-1].height < lr_y)
    {
      FRDP("fb_rect. ul_x: %d, lr_x: %d, fb_height: %d -> %d\n", ul_x, lr_x, rdp.frame_buffers[rdp.ci_count-1].height, lr_y);
      rdp.frame_buffers[rdp.ci_count-1].height = lr_y;
    }
}

static void fb_settextureimage()
{
  if (rdp.main_ci == 0)
    return;
  COLOR_IMAGE & cur_fb = rdp.frame_buffers[rdp.ci_count-1];
  if ( cur_fb.status >= ci_copy )
    return;
  if (((rdp.cmd0 >> 19) & 0x03) >= 2)  //check that texture is 16/32bit
  {
    int tex_format = ((rdp.cmd0 >> 21) & 0x07);
    DWORD addr = segoffset(rdp.cmd1);
    if ( tex_format == 0 )
    {
    FRDP ("fb_settextureimage. fmt: %d, size: %d, imagePtr %08lx, main_ci: %08lx, cur_ci: %08lx \n", ((rdp.cmd0 >> 21) & 0x07), ((rdp.cmd0 >> 19) & 0x03), addr, rdp.main_ci, rdp.frame_buffers[rdp.ci_count-1].addr);
      if (cur_fb.status == ci_main) 
    {
      rdp.main_ci_last_tex_addr = addr;
        if (cur_fb.height == 0)
        {
          cur_fb.height = rdp.scissor_o.lr_y;
          rdp.main_ci_end = cur_fb.addr + ((cur_fb.width * cur_fb.height) << cur_fb.size >> 1);
        }
    }
    if ((addr >= rdp.main_ci) && (addr < rdp.main_ci_end)) //addr within main frame buffer
    {
        if (cur_fb.status == ci_main)
          {
            rdp.copy_ci_index = rdp.ci_count-1;
          cur_fb.status = ci_copy_self;
          rdp.scale_x = rdp.scale_x_bak;
          rdp.scale_y = rdp.scale_y_bak;
            FRDP("rdp.frame_buffers[%d].status = ci_copy_self\n", rdp.ci_count-1);
          }
          else
          {
          if (cur_fb.width == rdp.frame_buffers[rdp.main_ci_index].width)
          {
            rdp.copy_ci_index = rdp.ci_count-1;
            cur_fb.status = ci_copy;
            FRDP("rdp.frame_buffers[%d].status = ci_copy\n", rdp.copy_ci_index);
            if ((rdp.main_ci_last_tex_addr >= cur_fb.addr) && 
              (rdp.main_ci_last_tex_addr < (cur_fb.addr + cur_fb.width*cur_fb.height*cur_fb.size)))
            {
              RDP("motion blur!\n");
              rdp.motionblur = TRUE;
            }
            else 
            {
              rdp.scale_x = 1.0f;
              rdp.scale_y = 1.0f;
            }
          }
          else if (!settings.fb_ignore_aux_copy && cur_fb.width < rdp.frame_buffers[rdp.main_ci_index].width)
          {
            rdp.copy_ci_index = rdp.ci_count-1;
            cur_fb.status = ci_aux_copy;
            FRDP("rdp.frame_buffers[%d].status = ci_aux_copy\n", rdp.copy_ci_index);
            rdp.scale_x = 1.0f;
            rdp.scale_y = 1.0f;
          }
          else
          {
            cur_fb.status = ci_aux;
            FRDP("rdp.frame_buffers[%d].status = ci_aux\n", rdp.copy_ci_index);
          }
        }
        FRDP ("Detect FB usage. texture addr is inside framebuffer: %08lx - %08lx \n", addr, rdp.main_ci);
    }
///*
      else if ((cur_fb.status != ci_main) && (addr >= rdp.zimg && addr < rdp.zimg_end))
    {
        cur_fb.status = ci_zcopy;
      FRDP("fb_settextureimage. rdp.frame_buffers[%d].status = ci_zcopy\n", rdp.ci_count-1);
    }
//*/
      else if ((addr >= rdp.maincimg[0].addr) && (addr < (rdp.maincimg[0].addr + rdp.maincimg[0].width*rdp.maincimg[0].height*2))) 
    {
        if (cur_fb.status != ci_main)
      {
          cur_fb.status = ci_old_copy;
          FRDP("rdp.frame_buffers[%d].status = ci_old_copy 1, addr:%08lx\n", rdp.ci_count-1, rdp.last_drawn_ci_addr);
      }
      rdp.read_previous_ci = TRUE;
        RDP("read_previous_ci = TRUE\n");
      }
      else if ((addr >= rdp.last_drawn_ci_addr) && (addr < (rdp.last_drawn_ci_addr + rdp.maincimg[0].width*rdp.maincimg[0].height*2))) 
      {
        if (cur_fb.status != ci_main)
        {
          cur_fb.status = ci_old_copy;
          FRDP("rdp.frame_buffers[%d].status = ci_old_copy 2, addr:%08lx\n", rdp.ci_count-1, rdp.last_drawn_ci_addr);
        }
        rdp.read_previous_ci = TRUE;
        RDP("read_previous_ci = TRUE\n");
      }
    }   
    else if (settings.fb_hires && (cur_fb.status == ci_main))
    {
      if ((addr >= rdp.main_ci) && (addr < rdp.main_ci_end)) //addr within main frame buffer
      {
        rdp.copy_ci_index = rdp.ci_count-1;
        rdp.black_ci_index = rdp.ci_count-1;
        cur_fb.status = ci_copy_self;
        FRDP("rdp.frame_buffers[%d].status = ci_copy_self\n", rdp.ci_count-1);
    }
  }
  }
  if (cur_fb.status == ci_unknown)
  {
    cur_fb.status = ci_aux;
      FRDP("fb_settextureimage. rdp.frame_buffers[%d].status = ci_aux\n", rdp.ci_count-1);
  }
}

static void fb_loadtxtr()
{
  if (rdp.frame_buffers[rdp.ci_count-1].status == ci_unknown)
  {
      rdp.frame_buffers[rdp.ci_count-1].status = ci_aux;
      FRDP("rdp.frame_buffers[%d].status = ci_aux\n", rdp.ci_count-1);
  }
}

static void fb_setdepthimage()
{
  rdp.zimg = segoffset(rdp.cmd1) & BMASK;
  rdp.zimg_end = rdp.zimg + rdp.ci_width*rdp.ci_height*2;
  FRDP ("fb_setdepthimage. addr %08lx - %08lx\n", rdp.zimg, rdp.zimg_end);
  if (rdp.zimg == rdp.main_ci)  //strange, but can happen
  {
    rdp.frame_buffers[rdp.main_ci_index].status = ci_unknown;
    if (rdp.main_ci_index < rdp.ci_count)
    {
      rdp.frame_buffers[rdp.main_ci_index].status = ci_zimg;
      FRDP("rdp.frame_buffers[%d].status = ci_zimg\n", rdp.main_ci_index);
      rdp.main_ci_index++;
      rdp.frame_buffers[rdp.main_ci_index].status = ci_main;
      FRDP("rdp.frame_buffers[%d].status = ci_main\n", rdp.main_ci_index);
      rdp.main_ci = rdp.frame_buffers[rdp.main_ci_index].addr;
      rdp.main_ci_end = rdp.main_ci + (rdp.frame_buffers[rdp.main_ci_index].width * rdp.frame_buffers[rdp.main_ci_index].height * rdp.frame_buffers[rdp.main_ci_index].size);
    }
    else
    {
      rdp.main_ci = 0;
    }
  }
  for (int i = 0; i < rdp.ci_count; i++)
  {
    COLOR_IMAGE & fb = rdp.frame_buffers[i];
    if ((fb.addr == rdp.zimg) && (fb.status == ci_aux || fb.status == ci_useless))
    {
      fb.status = ci_zimg;
      FRDP("rdp.frame_buffers[%d].status = ci_zimg\n", i);
    }
  }
}

static void fb_setcolorimage()
{
  rdp.ocimg = rdp.cimg;
  rdp.cimg = segoffset(rdp.cmd1) & BMASK;
  COLOR_IMAGE & cur_fb = rdp.frame_buffers[rdp.ci_count];
  cur_fb.width = (rdp.cmd0 & 0xFFF) + 1;
  if (cur_fb.width == 32 ) 
    cur_fb.height = 32;
  else if (cur_fb.width == 16 ) 
    cur_fb.height = 16;
  else if (rdp.ci_count > 0)
    cur_fb.height = rdp.scissor_o.lr_y;
  else
    cur_fb.height = 0;
  cur_fb.format = (rdp.cmd0 >> 21) & 0x7;
  cur_fb.size = (rdp.cmd0 >> 19) & 0x3;
  cur_fb.addr = rdp.cimg;
  cur_fb.changed = 1;
/*
  if (rdp.ci_count > 0)
    if (rdp.frame_buffers[0].addr == rdp.cimg)
      rdp.frame_buffers[0].height = rdp.scissor_o.lr_y;
*/
  FRDP ("fb_setcolorimage. width: %d,  height: %d,  fmt: %d, size: %d, addr %08lx\n", cur_fb.width, cur_fb.height, cur_fb.format, cur_fb.size, cur_fb.addr);
  if ((rdp.cimg == rdp.zimg) || (rdp.cimg == rdp.tmpzimg))
  {
    cur_fb.status = ci_zimg;
    if (rdp.zimg_end == rdp.zimg)
      rdp.zimg_end = rdp.zimg + cur_fb.width*rdp.scissor_o.lr_y*2;
    FRDP("rdp.frame_buffers[%d].status = ci_zimg\n", rdp.ci_count);
  }
  else if (rdp.main_ci != 0)
  {
    if (rdp.cimg == rdp.main_ci) //switched to main fb again 
    {
            cur_fb.height = maxi(cur_fb.height, rdp.frame_buffers[rdp.main_ci_index].height);
      rdp.main_ci_index = rdp.ci_count;
        rdp.main_ci_end = rdp.cimg + ((cur_fb.width * cur_fb.height) << cur_fb.size >> 1);
        cur_fb.status = ci_main;
      FRDP("rdp.frame_buffers[%d].status = ci_main\n", rdp.ci_count);
    }
    else // status is not known yet
    {
      cur_fb.status = ci_unknown;
    }
  }
  else
  {
    if ((rdp.zimg != rdp.cimg))//&& (rdp.ocimg != rdp.cimg))
    {
      rdp.main_ci = rdp.cimg;
      rdp.main_ci_end = rdp.cimg + ((cur_fb.width * cur_fb.height) << cur_fb.size >> 1);
      rdp.main_ci_index = rdp.ci_count;
      cur_fb.status = ci_main;
      FRDP("rdp.frame_buffers[%d].status = ci_main\n", rdp.ci_count);
    }
    else
    {
      cur_fb.status = ci_unknown;
    }
    
  } 
  if (rdp.frame_buffers[rdp.ci_count-1].status == ci_unknown) //status of previous fb was not changed - it is useless
  {
    if (settings.fb_hires && !settings.PM)
    {
      rdp.frame_buffers[rdp.ci_count-1].status = ci_aux;
      rdp.frame_buffers[rdp.ci_count-1].changed = 0;
      FRDP("rdp.frame_buffers[%d].status = ci_aux\n", rdp.ci_count-1);
    }
    else
    {
      rdp.frame_buffers[rdp.ci_count-1].status = ci_useless;
      /*
      DWORD addr = rdp.frame_buffers[rdp.ci_count-1].addr;
      for (int i = 0; i < rdp.ci_count - 1; i++)
      {
      if (rdp.frame_buffers[i].addr == addr)
      {
      rdp.frame_buffers[rdp.ci_count-1].status = rdp.frame_buffers[i].status;
      break;
      }
      }
      //*/
      FRDP("rdp.frame_buffers[%d].status = %s\n", rdp.ci_count-1, CIStatus[rdp.frame_buffers[rdp.ci_count-1].status]);
    }
  }
  if (cur_fb.status == ci_main)
  {
    BOOL viSwapOK = ((settings.swapmode == 2) && (rdp.vi_org_reg == *gfx.VI_ORIGIN_REG)) ? FALSE : TRUE;
    if ((rdp.maincimg[0].addr != cur_fb.addr) && SwapOK && viSwapOK)
    {
      SwapOK = FALSE;
      rdp.swap_ci_index = rdp.ci_count;
    }
  }
  rdp.ci_count++;
  if (rdp.ci_count > NUMTEXBUF) //overflow
    rdp.halt = 1;
}

// RDP graphic instructions pointer table used in DetectFrameBufferUsage

static rdp_instr gfx_instruction_lite[9][256] =
{
  {
    // uCode 0 - RSP SW 2.0X
    // 00-3f
    // games: Super Mario 64, Tetrisphere, Demos
    0,                     0,             0,              0,
      0,             0,              uc0_displaylist,        0,
      0,              0,           0,                      0,
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      // 40-7f: Unused
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      // 80-bf: Immediate commands
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      uc0_enddl,              0,                        0,                      0,
      fb_uc0_moveword,           0,                     uc0_culldl,             0,
      // c0-ff: RDP commands
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                      0,                      0,                      0,        
      0,                  0,                  0,                  0,    
      0,                  0,                  0,                  0,    
      0,                  0,                  0,                  0,    
      0,                  0,                  0,                  0,    
      0,                  0,                  0,                  0,    
          fb_rect,         fb_rect,               0,                  0,    
          0,                  0,                  0,                  0,    
          0,         fb_setscissor,         0,       0,
          0,                  0,                  0,                  0,    
          0,                  0,                fb_rect,              0,    
          0,                  0,                  0,                  0,    
          0,         fb_settextureimage,    fb_setdepthimage,      fb_setcolorimage
  },
  
  // uCode 1 - F3DEX 1.XX
  // 00-3f
  // games: Mario Kart, Star Fox
  {
      0,                      0,                      0,                      0,        
        0,             0,              uc0_displaylist,        0,
        0,              0,           0,                      0,
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        // 40-7f: unused
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        // 80-bf: Immediate commands
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      uc6_loaducode,        
        uc1_branch_z,           0,               0,        0,
        uc1_rdphalf_1,          0,             0,  0,
        uc0_enddl,              0,     0,     0,
        fb_uc0_moveword,           0,          uc2_culldl,             0,
        // c0-ff: RDP commands
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                  0,                  0,                  0,    
        0,                  0,                  0,                  0,    
        0,                  0,                  0,                  0,    
        0,                  0,                  0,                  0,    
        0,                  0,                  0,                  0,    
          fb_rect,         fb_rect,               0,                  0,    
          0,                  0,                  0,                  0,    
          0,         fb_setscissor,         0,       0,
          0,                  0,                  0,                  0,    
          0,                  0,                fb_rect,              0,    
          0,                  0,                  0,                  0,    
          0,         fb_settextureimage,    fb_setdepthimage,      fb_setcolorimage
      },
      
      // uCode 2 - F3DEX 2.XX
      // games: Zelda 64
      {
        // 00-3f
        0,                  0,              0,          uc2_culldl,
          uc1_branch_z,         0,              0,          0,
          0,                fb_bg_copy,         fb_bg_copy,         0,
          0,                    0,                  0,                  0,
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          
          // 40-7f: unused
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          
          // 80-bf: unused
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          
          // c0-ff: RDP commands mixed with uc2 commands
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,            uc2_dlist_cnt,              0,                  0,
          0,            0,          0,              fb_uc2_moveword,
          0/*fb_uc2_movemem*/,          uc2_load_ucode,         uc0_displaylist,    uc0_enddl,
          0,                    uc1_rdphalf_1,          0,      0,
          fb_rect,         fb_rect,               0,                  0,    
          0,                  0,                  0,                  0,    
          0,         fb_setscissor,         0,       0,
          0,                  0,                  0,                  0,    
          0,                  0,                fb_rect,              0,    
          0,                  0,                  0,                  0,    
          0,         fb_settextureimage,    fb_setdepthimage,      fb_setcolorimage
        },
        
        // uCode 3 - "RSP SW 2.0D", but not really
        // 00-3f
        // games: Wave Race
        // ** Added by Gonetz **
        {
          0,                  0,                  0,                  0,    
            0,                  0,                  0,                  0,    
            0,                  0,                  0,                  0,    
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            // 40-7f: unused
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            // 80-bf: Immediate commands
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                      0,                      0,                      0,        
            0,                  0,                  0,                  0,    
            0,                  0,                  0,                  0,    
            uc0_enddl,              0,     0,     0,
            fb_uc0_moveword,           0,          uc0_culldl,             0,
            // c0-ff: RDP commands
            0,                  0,                  0,                  0,    
            0,                  0,                  0,                  0,    
            0,                  0,                  0,                  0,    
            0,                  0,                  0,                  0,    
            0,                  0,                  0,                  0,    
            0,                  0,                  0,                  0,    
            0,                  0,                  0,                  0,    
            0,                  0,                  0,                  0,    
            0,                  0,                  0,                  0,    
          fb_rect,         fb_rect,               0,                  0,    
          0,                  0,                  0,                  0,    
          0,         fb_setscissor,         0,       0,
          0,                  0,                  0,                  0,    
          0,                  0,                fb_rect,              0,    
          0,                  0,                  0,                  0,    
          0,         fb_settextureimage,    fb_setdepthimage,      fb_setcolorimage
          },
          
          {
            // uCode 4 - RSP SW 2.0D EXT
            // 00-3f
            // games: Star Wars: Shadows of the Empire
            0,                  0,                  0,                  0,    
              0,             0,              uc0_displaylist,        0,
              0,                  0,                  0,                  0,    
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              // 40-7f: Unused
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              // 80-bf: Immediate commands
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                      0,                      0,                      0,        
              0,                  0,                  0,                  0,    
              0,                  0,                  0,                  0,    
              uc0_enddl,              0,     0,     0,
              fb_uc0_moveword,           0,          uc0_culldl,             0,
              // c0-ff: RDP commands
              rdp_noop,               0,                  0,                  0,    
              0,                  0,                  0,                  0,    
              0,                  0,                  0,                  0,    
              0,                  0,                  0,                  0,    
              0,                  0,                  0,                  0,    
              0,                  0,                  0,                  0,    
              0,                  0,                  0,                  0,    
              0,                  0,                  0,                  0,    
              0,                  0,                  0,                  0,    
          fb_rect,         fb_rect,               0,                  0,    
          0,                  0,                  0,                  0,    
          0,         fb_setscissor,         0,       0,
          0,                  0,                  0,                  0,    
          0,                  0,                fb_rect,              0,    
          0,                  0,                  0,                  0,    
          0,         fb_settextureimage,    fb_setdepthimage,      fb_setcolorimage
            },
            
            {
              // uCode 5 - RSP SW 2.0 Diddy
              // 00-3f
              // games: Diddy Kong Racing
                0,                      0,                      0,                      0,
                0,                      0,                 uc0_displaylist,          uc5_dl_in_mem,
                0,                      0,                      0,                      0,
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                // 40-7f: Unused
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                // 80-bf: Immediate commands
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,        
                0,                      0,                      0,                      0,    
                uc0_enddl,              0,                      0,                      0,
                fb_uc0_moveword,        0,                      uc0_culldl,             0,
                // c0-ff: RDP commands
                0,                  0,                  0,                  0,    
                0,                  0,                  0,                  0,    
                0,                  0,                  0,                  0,    
                0,                  0,                  0,                  0,    
                0,                  0,                  0,                  0,    
                0,                  0,                  0,                  0,    
                0,                  0,                  0,                  0,    
                0,                  0,                  0,                  0,    
                0,                  0,                  0,                  0,    
          fb_rect,         fb_rect,               0,                  0,    
          0,                  0,                  0,                  0,    
          0,         fb_setscissor,         0,       0,
          0,                  0,                  0,                  0,    
          0,                  0,                fb_rect,              0,    
          0,                  0,                  0,                  0,    
          0,         fb_settextureimage,    fb_setdepthimage,      fb_setcolorimage
              },
              
              // uCode 6 - S2DEX 1.XX
              // games: Yoshi's Story
              {
                0,                  0,                  0,                  0,    
                  0,             0,         uc0_displaylist,        0,
                  0,                  0,                  0,                  0,    
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  // 40-7f: unused
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  // 80-bf: Immediate commands
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      0,        
                  0,                      0,                      0,                      uc6_loaducode,        
                  uc6_select_dl,          0,         0,     0,
                  0,                  0,                  0,                  0,    
                  uc0_enddl,              0,     0,     0,
                  fb_uc0_moveword,           0,          uc2_culldl,             0,
                  // c0-ff: RDP commands
                  0,               fb_loadtxtr,       fb_loadtxtr,    fb_loadtxtr,
                  fb_loadtxtr,        0,                  0,                  0,
                  0,                  0,                  0,                  0,    
                  0,                  0,                  0,                  0,    
                  0,                  0,                  0,                  0,    
                  0,                  0,                  0,                  0,    
                  0,                  0,                  0,                  0,    
                  0,                  0,                  0,                  0,    
                  0,                  0,                  0,                  0,    
          fb_rect,         fb_rect,               0,                  0,    
          0,                  0,                  0,                  0,    
          0,         fb_setscissor,         0,       0,
          0,                  0,                  0,                  0,    
          0,                  0,                fb_rect,              0,    
          0,                  0,                  0,                  0,    
          0,         fb_settextureimage,    fb_setdepthimage,      fb_setcolorimage
                },
                
  {
        0,                      0,                      0,                      0,        
        0,                      0,                      uc0_displaylist,        0,
        0,                      0,                      0,                      0,
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        // 40-7f: unused
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        // 80-bf: Immediate commands
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,
        0,                      0,                      0,                      0,
        uc0_enddl,              0,                      0,                      0,
        fb_uc0_moveword,        0,                      uc0_culldl,             0,
        // c0-ff: RDP commands
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                      0,                      0,                      0,        
        0,                  0,                  0,                  0,    
        0,                  0,                  0,                  0,    
        0,                  0,                  0,                  0,    
        0,                  0,                  0,                  0,    
        0,                  0,                  0,                  0,    
          fb_rect,         fb_rect,               0,                  0,    
          0,                  0,                  0,                  0,    
          0,         fb_setscissor,         0,       0,
          0,                  0,                  0,                  0,    
          0,                  0,                fb_rect,              0,    
          0,                  0,                  0,                  0,    
          0,         fb_settextureimage,    fb_setdepthimage,      fb_setcolorimage
      },

      {
        // 00-3f
        0,                  0,              0,          uc2_culldl,
          uc1_branch_z,         0,              0,          0,
          0,                fb_bg_copy,         fb_bg_copy,         0,
          0,                    0,                  0,                  0,
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          
          // 40-7f: unused
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          
          // 80-bf: unused
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          0,                    0,                  0,                  0,
          
          // c0-ff: RDP commands mixed with uc2 commands
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,                  0,                  0,                  0,    
          0,            uc2_dlist_cnt,              0,                  0,
          0,            0,          0,              fb_uc2_moveword,
          0,            uc2_load_ucode,         uc0_displaylist,    uc0_enddl,
          0,            uc1_rdphalf_1,            0,                  0,
          fb_rect,         fb_rect,               0,                  0,    
          0,                  0,                  0,                  0,    
          0,         fb_setscissor,         0,       0,
          0,                  0,                  0,                  0,    
          0,                  0,                fb_rect,              0,    
          0,                  0,                  0,                  0,    
          0,         fb_settextureimage,    fb_setdepthimage,      fb_setcolorimage
        }
};