home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / assembler / thesource / volume1 / utilities / disassemblers / copdis.lha / copdis.c next >
Encoding:
C/C++ Source or Header  |  1992-01-25  |  16.8 KB  |  444 lines

  1. ;/* Execute me if you want to compile me!
  2. lc -O -v -j73 -cqusf -rr CopDis
  3. blink from CopDis.o to CopDis lib lib:amiga.lib lib:lcr.lib SC SD ND
  4. quit
  5.  
  6. 25 Jan '92
  7.  
  8. This code stems from Karl Lehenbauer's April 1989 code for a Copper
  9. disassembler; I cleaned up the code, fixed a couple of bugs, inserted the
  10. new ECS registers, and made everything much smaller.
  11.  
  12. Just call CopDis from CLI (probably you may want to redirect its output to a
  13. suitable temp file) and the current copperlists of GfxBase will be printed
  14. to stdout. CTRL-C works.
  15.  
  16. This code is released to the public domain.
  17.  
  18.     Sebastiano Vigna
  19.     Via Valparaiso 18
  20.     I-20144 Milano MI
  21.  
  22.     BIX: svigna
  23.     UUCP:seba%sebamiga@cbmita.uucp
  24.          ...{uunet|pyramid|rutgers}!cbmvax!cbmehq!cbmita!sebamiga!seba
  25.     FIDO: 2:331/301.6 (aka 2:21301/6)
  26.  
  27. */
  28. #include <proto/exec.h>
  29. #include <proto/graphics.h>
  30. #include <proto/dos.h>
  31. #include <dos/dos.h>
  32. #include <clib/alib_stdio_protos.h>
  33. #include <graphics/gfxbase.h>
  34. #include <graphics/view.h>
  35. #include <graphics/copper.h>
  36.  
  37. void copdis(struct cprlist *coplist);
  38. long stdout;
  39. struct ExecBase *SysBase;
  40. char EmbeddedVersion[] = "\0$VER: CopDis 34.1 (25.1.92)";
  41.  
  42. int __saveds _main(void)
  43. {
  44.     SysBase = *((void **)4);
  45.     if (DOSBase = (struct DosLibrary *)OpenLibrary("dos.library",0L)) {
  46.         stdout = Output();
  47.         if (GfxBase = (struct GfxBase *)OpenLibrary("graphics.library",0L)) {
  48.  
  49.             printf("\nCurrently active LOF copper list:\n");
  50.             copdis(GfxBase->ActiView->LOFCprList);
  51.  
  52.             if (GfxBase->ActiView->Modes & LACE) {
  53.                 printf("\nCurrently active SHF copper list:\n");
  54.                 copdis(GfxBase->ActiView->SHFCprList);
  55.             }
  56.             CloseLibrary(GfxBase);
  57.         }
  58.         CloseLibrary(DOSBase);
  59.     }
  60.     return(0);
  61. }
  62.  
  63. struct copregstruct
  64. {
  65.     char *regname;
  66.     char *longname;
  67.     unsigned short regid;
  68.     unsigned short flags;
  69. };
  70.  
  71. struct copinstruction
  72. {
  73.     unsigned short ir1;
  74.     unsigned short ir2;
  75. };
  76.  
  77. #define COLOR (1<<0)
  78. #define ECS (1<<1)
  79.  
  80. static struct copregstruct copregisters[] =
  81. {
  82.     {"bltddat","blitter destination early read (dummy address)",0,0},
  83.     {"dmaconr","DMA control (and blitter status) read",0x2,0},
  84.     {"vposr","read vert most signif. bit (and frame flop)",0x4,0},
  85.     {"vhposr","read vert and horiz. position of beam",0x6,0},
  86.     {"dskdatr","disk data early read (dummy address)",0x8,0},
  87.     {"joy0dat","joystick-mouse 0 data (vert,horiz)",0xa,0},
  88.     {"joy1dat","joystick-mouse 1 data (vert,horiz)",0xc,0},
  89.     {"clxdat","collision data (read and clear)",0xe,0},
  90.     {"adkconr","audio, disk control register read",0x10,0},
  91.     {"pot0dat","pot counter pair 0 data (vert,horiz)",0x12,0},
  92.     {"pot1dat","pot counter pair 1 data (vert,horiz)",0x14,0},
  93.     {"potgor","pot port data read",0x16,0},
  94.     {"serdatr","serial port data and status read",0x18,0},
  95.     {"dskbytr","disk data byte and status read",0x1a,0},
  96.     {"intenar","interrupt enable bits read",0x1c,0},
  97.     {"intreqr","interrupt request bits read",0x1e,0},
  98.  
  99.     {"dskpth","disk pointer (high 3 bits, 5 under ECS)",0x20,0},
  100.     {"dskptl","disk pointer (low 15 bits)",0x22,0},
  101.     {"dsklen","disk length",0x24,0},
  102.     {"dskdat","disk DMA data write",0x26,0},
  103.  
  104.     {"refptr","refresh pointer",0x28,0},
  105.     {"vposw","write vert most signif. bit (and frame flop)",0x2a,0},
  106.     {"vhposw","write vert and horiz position of beam",0x2c,0},
  107.     {"copcon","copper control register (CDANG)",0x2e,0},
  108.     {"serdat","serial port data and stop bits write",0x30,0},
  109.     {"serper","serial port period and control",0x32,0},
  110.     {"potgo","pot port data write and start",0x34,0},
  111.     {"joytest","write all four joystick-mouse counters",0x36,0},
  112.     {"strequ","strobe for horiz sync with vertical blank and EQU",0x38,0},
  113.     {"strvbl","strobe for horiz sync with vertical blank",0x3a,0},
  114.     {"strhor","strobe for horizontal sync",0x3c,0},
  115.     {"strlong","strobe for identification of long horiz. line",0x3e,0},
  116.  
  117.     {"bltcon0","blitter control register 0",0x40,0},
  118.     {"bltcon1","blitter control register 1",0x42,0},
  119.     {"bltafwm","blitter first word mask for source A",0x44,0},
  120.     {"bltalwm","blitter last word mask for source A",0x46,0},
  121.     {"bltcpth","blitter pointer to source C (high 3 bits, 5 under ECS)",0x48,0},
  122.     {"bltcptl","blitter pointer to source C (low 15 bits)",0x4a,0},
  123.     {"bltbpth","blitter pointer to source B (high 3 bits, 5 under ECS)",0x4c,0},
  124.     {"bltbptl","blitter pointer to source B (low 15 bits)",0x4e,0},
  125.     {"bltapth","blitter pointer to source A (high 3 bits, 5 under ECS)",0x50,0},
  126.     {"bltaptl","blitter pointer to source A (low 15 bits)",0x52,0},
  127.     {"bltdpth","blitter pointer to source D (high 3 bits, 5 under ECS)",0x54,0},
  128.     {"bltdptl","blitter pointer to source D (low 15 bits)",0x56,0},
  129.     {"bltsize","blitter start and size (window width, height)",0x58,0},
  130.     {"bltcon0l","blitter control 0, lower 8 bits (minterms)",0x5A, ECS },
  131.     {"bltsizv","blitter V size (for 15 bit vertical size)",0x5C, ECS },
  132.     {"bltsizh","blitter H size and start (for 11 bit horizontal size)",0x5E, ECS },
  133.     {"bltcmod","blitter modulo for source C",0x60,0},
  134.     {"bltbmod","blitter modulo for source B",0x62,0},
  135.     {"bltamod","blitter modulo for source A",0x64,0},
  136.     {"bltdmod","blitter modulo for source D",0x66,0},
  137.     {"bltcdat","blitter source C data",0x70,0},
  138.     {"bltbdat","blitter source B data",0x72,0},
  139.     {"bltadat","blitter source A data",0x74,0},
  140.  
  141.     {"sprhdat","ext. logic UHRES sprite pointer and data id",0x78, ECS },
  142.     {"deniseid","chip revision level for Denise",0x7C, ECS },
  143.  
  144.     {"dsksync","disk sync pattern for disk read",0x7e,0},
  145.  
  146.     {"cop1lch","copper first location (high 3 bits, 5 under ECS)",0x80,0},
  147.     {"cop1lcl","copper first location (low 15 bits)",0x82,0},
  148.     {"cop2lch","copper second location (high 3 bits, 5 under ECS)",0x84,0},
  149.     {"cop2lcl","copper second location (low 15 bits)",0x86,0},
  150.     {"copjmp1","restart copper at first location",0x88,0},
  151.     {"copjmp2","restart copper at second location",0x8a,0},
  152.     {"copins","copper instruction fetch identify",0x8c,0},
  153.     {"diwstrt","display window start (upper left vert-horiz position)",0x8e,0},
  154.     {"diwstop","display window stop (lower right vert-horiz position)",0x90,0},
  155.     {"ddfstrt","display bit plane data fetch start (horiz. position)",0x92,0},
  156.     {"ddfstop","display bit plane data fetch stop (horiz. position)",0x94,0},
  157.     {"dmacon","DMA control write (clear or set)",0x96,0},
  158.     {"clxcon","collision control",0x98,0},
  159.     {"intena","interrupt enable bits",0x9a,0},
  160.     {"intreq","interrupt request bits",0x9c,0},
  161.     {"adkcon","audio, disk, UART control",0x9e,0},
  162.  
  163.     {"aud0lch","audio channel 0 location (high 3 bits, 5 under ECS)",0xa0,0},
  164.     {"aud0lcl","audio channel 0 location (low 15 bits)",0xa2,0},
  165.     {"aud0len","audio channel 0 length",0xa4,0},
  166.     {"aud0per","audio channel 0 period",0xa6,0},
  167.     {"aud0vol","audio channel 0 volume",0xa8,0},
  168.     {"aud0dat","audio channel 0 data",0xaa,0},
  169.  
  170.     {"aud1lch","audio channel 1 location (high 3 bits, 5 under ECS)",0xb0,0},
  171.     {"aud1lcl","audio channel 1 location (low 15 bits)",0xb2,0},
  172.     {"aud1len","audio channel 1 length",0xb4,0},
  173.     {"aud1per","audio channel 1 period",0xb6,0},
  174.     {"aud1vol","audio channel 1 volume",0xb8,0},
  175.     {"aud1dat","audio channel 1 data",0xba,0},
  176.  
  177.     {"aud2lch","audio channel 2 location (high 3 bits, 5 under ECS)",0xc0,0},
  178.     {"aud2lcl","audio channel 2 location (low 15 bits)",0xc2,0},
  179.     {"aud2len","audio channel 2 length",0xc4,0},
  180.     {"aud2per","audio channel 2 period",0xc6,0},
  181.     {"aud2vol","audio channel 2 volume",0xc8,0},
  182.     {"aud2dat","audio channel 2 data",0xca,0},
  183.  
  184.     {"aud3lch","audio channel 3 location (high 3 bits, 5 under ECS)",0xd0,0},
  185.     {"aud3lcl","audio channel 3 location (low 15 bits)",0xd2,0},
  186.     {"aud3len","audio channel 3 length",0xd4,0},
  187.     {"aud3per","audio channel 3 period",0xd6,0},
  188.     {"aud3vol","audio channel 3 volume",0xd8,0},
  189.     {"aud3dat","audio channel 3 data",0xda,0},
  190.  
  191.     {"bpl1pth","blitter plane 1 pointer (high 3 bits, 5 under ECS)",0xe0,0},
  192.     {"bpl1ptl","blitter plane 1 pointer (low 15 bits)",0xe2,0},
  193.     {"bpl2pth","blitter plane 2 pointer (high 3 bits, 5 under ECS)",0xe4,0},
  194.     {"bpl2ptl","blitter plane 2 pointer (low 15 bits)",0xe6,0},
  195.     {"bpl3pth","blitter plane 3 pointer (high 3 bits, 5 under ECS)",0xe8,0},
  196.     {"bpl3ptl","blitter plane 3 pointer (low 15 bits)",0xea,0},
  197.     {"bpl4pth","blitter plane 4 pointer (high 3 bits, 5 under ECS)",0xec,0},
  198.     {"bpl4ptl","blitter plane 4 pointer (low 15 bits)",0xee,0},
  199.     {"bpl5pth","blitter plane 5 pointer (high 3 bits, 5 under ECS)",0xf0,0},
  200.     {"bpl5ptl","blitter plane 5 pointer (low 15 bits)",0xf2,0},
  201.     {"bpl6pth","blitter plane 6 pointer (high 3 bits, 5 under ECS)",0xf4,0},
  202.     {"bpl6ptl","blitter plane 6 pointer (low 15 bits)",0xf6,0},
  203.  
  204.     {"bplcon0","bit plane control bits",0x100,0},
  205.     {"bplcon1","bit plane scroll values for PF1 & PF2",0x102,0},
  206.     {"bplcon2","bit plane priority control",0x104,0},
  207.     {"bplcon3","bit plane control (enhanced features)",0x106, ECS },
  208.  
  209.     {"bpl1mod","bit plane modulo for odd planes",0x108,0},
  210.     {"bpl2mod","bit plane modulo for even planes",0x10a,0},
  211.  
  212.     {"bpl1dat","bit plane 1 data (parallel-to-serial convert)",0x110,0},
  213.     {"bpl2dat","bit plane 2 data (parallel-to-serial convert)",0x112,0},
  214.     {"bpl3dat","bit plane 3 data (parallel-to-serial convert)",0x114,0},
  215.     {"bpl4dat","bit plane 4 data (parallel-to-serial convert)",0x116,0},
  216.     {"bpl5dat","bit plane 5 data (parallel-to-serial convert)",0x118,0},
  217.     {"bpl6dat","bit plane 6 data (parallel-to-serial convert)",0x11a,0},
  218.  
  219.     {"spr0pth","sprite 0 pointer (high 3 bits, 5 under ECS)",0x120,0},
  220.     {"spr0ptl","sprite 0 pointer (low 15 bits)",0x122,0},
  221.     {"spr1pth","sprite 1 pointer (high 3 bits, 5 under ECS)",0x124,0},
  222.     {"spr1ptl","sprite 1 pointer (low 15 bits)",0x126,0},
  223.     {"spr2pth","sprite 2 pointer (high 3 bits, 5 under ECS)",0x128,0},
  224.     {"spr2ptl","sprite 2 pointer (low 15 bits)",0x12a,0},
  225.     {"spr3pth","sprite 3 pointer (high 3 bits, 5 under ECS)",0x12c,0},
  226.     {"spr3ptl","sprite 3 pointer (low 15 bits)",0x12e,0},
  227.     {"spr4pth","sprite 4 pointer (high 3 bits, 5 under ECS)",0x130,0},
  228.     {"spr4ptl","sprite 4 pointer (low 15 bits)",0x132,0},
  229.     {"spr5pth","sprite 5 pointer (high 3 bits, 5 under ECS)",0x134,0},
  230.     {"spr5ptl","sprite 5 pointer (low 15 bits)",0x136,0},
  231.     {"spr6pth","sprite 6 pointer (high 3 bits, 5 under ECS)",0x138,0},
  232.     {"spr6ptl","sprite 6 pointer (low 15 bits)",0x13a,0},
  233.     {"spr7pth","sprite 7 pointer (high 3 bits, 5 under ECS)",0x13c,0},
  234.     {"spr7ptl","sprite 7 pointer (low 15 bits)",0x13e,0},
  235.  
  236.     {"spr0pos","sprite 0 vert-horiz start position",0x140,0},
  237.     {"spr0ctl","sprite 0 vert stop position and control data",0x142,0},
  238.     {"spr0data","sprite 0 image data register A",0x144,0},
  239.     {"spr0datb","sprite 0 image data register B",0x146,0},
  240.     {"spr1pos","sprite 1 vert-horiz start position",0x148,0},
  241.     {"spr1ctl","sprite 1 vert stop position and control data",0x14a,0},
  242.     {"spr1data","sprite 1 image data register A",0x14c,0},
  243.     {"spr1datb","sprite 1 image data register B",0x14e,0},
  244.     {"spr2pos","sprite 2 vert-horiz start position",0x150,0},
  245.     {"spr2ctl","sprite 2 vert stop position and control data",0x152,0},
  246.     {"spr2data","sprite 2 image data register A",0x154,0},
  247.     {"spr2datb","sprite 2 image data register B",0x156,0},
  248.     {"spr3pos","sprite 3 vert-horiz start position",0x158,0},
  249.     {"spr3ctl","sprite 3 vert stop position and control data",0x15a,0},
  250.     {"spr3data","sprite 3 image data register A",0x15c,0},
  251.     {"spr3datb","sprite 3 image data register B",0x15e,0},
  252.     {"spr4pos","sprite 4 vert-horiz start position",0x160,0},
  253.     {"spr4ctl","sprite 4 vert stop position and control data",0x162,0},
  254.     {"spr4data","sprite 4 image data register A",0x164,0},
  255.     {"spr4datb","sprite 4 image data register B",0x166,0},
  256.     {"spr5pos","sprite 5 vert-horiz start position",0x168,0},
  257.     {"spr5ctl","sprite 5 vert stop position and control data",0x16a,0},
  258.     {"spr5data","sprite 5 image data register A",0x16c,0},
  259.     {"spr5datb","sprite 5 image data register B",0x16e,0},
  260.     {"spr6pos","sprite 6 vert-horiz start position",0x170,0},
  261.     {"spr6ctl","sprite 6 vert stop position and control data",0x172,0},
  262.     {"spr6data","sprite 6 image data register A",0x174,0},
  263.     {"spr6datb","sprite 6 image data register B",0x176,0},
  264.     {"spr7pos","sprite 7 vert-horiz start position",0x178,0},
  265.     {"spr7ctl","sprite 7 vert stop position and control data",0x17a,0},
  266.     {"spr7data","sprite 7 image data register A",0x17c,0},
  267.     {"spr7datb","sprite 7 image data register B",0x17e,0},
  268.  
  269.     {"color0","",0x180,COLOR},
  270.     {"color1","",0x182,COLOR},
  271.     {"color2","",0x184,COLOR},
  272.     {"color3","",0x186,COLOR},
  273.     {"color4","",0x188,COLOR},
  274.     {"color5","",0x18a,COLOR},
  275.     {"color6","",0x18c,COLOR},
  276.     {"color7","",0x18e,COLOR},
  277.     {"color8","",0x190,COLOR},
  278.     {"color9","",0x192,COLOR},
  279.     {"color10","",0x194,COLOR},
  280.     {"color11","",0x196,COLOR},
  281.     {"color12","",0x198,COLOR},
  282.     {"color13","",0x19a,COLOR},
  283.     {"color14","",0x19c,COLOR},
  284.     {"color15","",0x19e,COLOR},
  285.     {"color16","",0x1a0,COLOR},
  286.     {"color17","",0x1a2,COLOR},
  287.     {"color18","",0x1a4,COLOR},
  288.     {"color19","",0x1a6,COLOR},
  289.     {"color20","",0x1a8,COLOR},
  290.     {"color21","",0x1aa,COLOR},
  291.     {"color22","",0x1ac,COLOR},
  292.     {"color23","",0x1ae,COLOR},
  293.     {"color24","",0x1b0,COLOR},
  294.     {"color25","",0x1b2,COLOR},
  295.     {"color26","",0x1b4,COLOR},
  296.     {"color27","",0x1b6,COLOR},
  297.     {"color28","",0x1b8,COLOR},
  298.     {"color29","",0x1ba,COLOR},
  299.     {"color30","",0x1bc,COLOR},
  300.     {"color31","",0x1be,COLOR},
  301.  
  302.     {"htotal","highest number count, horizontal line (varbeamen = 1)",0x1c0, ECS },
  303.     {"hsstop","horizontal line position for hsync stop",0x1c2, ECS },
  304.     {"hbstrt","horizontal line position for hblank start",0x1c4, ECS },
  305.     {"hbstop","horizontal line position for hblank stop",0x1c6, ECS },
  306.     {"htotal","highest numbered vertical line (varbeamen =1)",0x1c8, ECS },
  307.     {"vsstop","vertical line position for vsync stop",0x1ca, ECS },
  308.     {"vbstrt","vertical line position for vblank start",0x1cc, ECS },
  309.     {"vbstop","vertical line position for vblank stop",0x1ce, ECS },
  310.  
  311.     {"sprhstrt","UHRES sprite vertical start",0x1d0, ECS },
  312.     {"sprhstop","UHRES sprite vertical stop",0x1d2, ECS },
  313.     {"bplhstrt","UHRES bitplane vertical start",0x1d4, ECS },
  314.     {"bplhstop","UHRES bitplane vertical stop",0x1d6, ECS },
  315.     {"hhposw","DUAL mode hires H beam counter write",0x1d8, ECS },
  316.     {"hhposr","DUAL mode hires H beam counter read",0x1da, ECS },
  317.  
  318.     {"beamcon0","beam counter control register (SHRES, UHRES, PAL)",0x1dc, ECS },
  319.     {"hsstrt","horizontal sync start (VARHSY)",0x1de, ECS },
  320.     {"hsstrt","vertical sync start (VARVSY)",0x1e0, ECS },
  321.     {"hcenter","horizontal position for Vsync on interlace",0x1e2, ECS },
  322.     {"diwhigh","display window---upper bits for start, stop",0x1e4, ECS },
  323.     {"bplhmod","UHRES bitplane modulo",0x1e6, ECS },
  324.     {"sprhpth","UHRES sprite pointer (high 5 bits)",0x1e8, ECS },
  325.     {"sprhptl","UHRES sprite pointer (low 15 bits)",0x1ea, ECS },
  326.     {"bplhpth","VRam (UHRES) bitplane pointer (high 5 bits)",0x1ec, ECS },
  327.     {"bplhptl","VRam (UHRES) bitplane pointer (low 15 bits)",0x1ee, ECS },
  328.  
  329.     {"","",-1,0}
  330. };
  331.  
  332. struct copregstruct *find_copper_register_info(int reg)
  333. {
  334.     struct copregstruct *regp;
  335.  
  336.     for (regp = &copregisters[0]; regp->regid != -1; regp++)
  337.     {
  338.         if (regp->regid == reg)
  339.             return(regp);
  340.     }
  341.     return(0);
  342. }
  343.  
  344. void disassemble_copper_instruction(struct copinstruction *ip)
  345. {
  346.     short vp, hp, ve, he, bfd;
  347.     int registerid;
  348.     struct copregstruct *regp;
  349.     char *regtext, *longtext;
  350.  
  351.     /* printf("instruction %x, %x\n",ip->ir1,ip->ir2); */
  352.  
  353.  
  354.     /* true if it's a branch or skip instruction */
  355.     if (ip->ir1 & 1)
  356.     {
  357.         /* branch or skip instruction */
  358.  
  359.         /* calculate vertical and horizontal position */
  360.         vp = (ip->ir1 >> 8) & 0xff;
  361.         hp = (ip->ir1 >> 1) & 0x7f;
  362.  
  363.         /* calculate vertical and horizontal position compare bits
  364.          * and blitter-finished-disable bit */
  365.         ve = (ip->ir2 >> 8) & 0x7f;
  366.         he = (ip->ir2 >> 1) & 0x7f;
  367.         bfd = (ip->ir2 & 0x8000);
  368.  
  369.         /* print the instruction type, check bit 0 of second word */
  370.         if (ip->ir2 & 1)
  371.         {
  372.             /* it's a skip */
  373.             printf("   skip");
  374.         }
  375.         else
  376.         {
  377.             /* it's a wait */
  378.             printf("   wait");
  379.         }
  380.  
  381.         /* reverse sense of blitter finish wait disable to show blitter
  382.          * finish wait -- that way we occasionally say "blitter" instead
  383.          * of almost always saying "no blitter"
  384.          */
  385.         if (!bfd)
  386.             printf("   bf,");
  387.         else
  388.             printf("   ");
  389.  
  390.         /* print vertical and horizontal position */
  391.         printf("vpos=%ld,hpos=%ld; ",vp,hp);
  392.         printf("instruction %lx, %lx",ip->ir1,ip->ir2);
  393.  
  394.         /* if enable masks are not basically "all", print them */
  395.         if ((ve != 0x7f) || (he != 0x7f)) printf("; vcomp=%ld,hcomp=%ld",ve,he);
  396.         printf("\n");
  397.     }
  398.     else
  399.     {
  400.         /* it's a move instruction */
  401.  
  402.         /* calculate register ID and look it up */
  403.         registerid = ip->ir1 & 0x1ff;
  404.         regp = find_copper_register_info(registerid);
  405.  
  406.         /* if we found the register in our table, print the text
  407.          * else whine about something we don't understand */
  408.         if (regp)
  409.         {
  410.             regtext = regp->regname;
  411.             longtext = regp->longname;
  412.         }
  413.         else
  414.         {
  415.             regtext = "UNKNOWN_OPCODE";
  416.             longtext = "";
  417.         }
  418.         printf("   move   $%04.4lx,%s",ip->ir2,regtext);
  419.  
  420.         if (*longtext != '\0')
  421.             printf("\t;%s",longtext);
  422.         if (regp->flags & ECS) printf("   (ECS only)");
  423.     }
  424.     printf("\n");
  425. }
  426.  
  427. /* have a go at disassembling a copper list */
  428. void copdis(struct cprlist *coplist) {
  429.  
  430.     int i;
  431.  
  432.     /* check and refuse null list pointers */
  433.     if (coplist == NULL)
  434.     {
  435.         printf("copdis: copper list pointer is null\n");
  436.         return;
  437.     }
  438.  
  439.     for(i=0; i<coplist->MaxCount; i++) {
  440.         disassemble_copper_instruction((struct copinstruction *)coplist->start+i);
  441.         if ((SetSignal(0,0) & 1<<SIGBREAKB_CTRL_C) || *((ULONG *)coplist->start+i) == 0xFFFFFFFE) break;
  442.     }
  443. }
  444.