示例#1
0
        public EditSplit()
        {
            InitializeComponent();
            int tx = pictureBox.Width;
            int ty = pictureBox.Height;

            bitmapZoom       = new DirectBitmap(pictureZoom.Width >> 3, pictureZoom.Height >> 3);
            bmpLock          = new DirectBitmap(tx, ty);
            pictureBox.Image = bmpLock.Bitmap;
            bitmapCpc        = new BitmapCpc(taillex << 1, tailley << 1, mode);      // ###
            retard.Minimum   = BitmapCpc.retardMin;
            retard.Maximum   = BitmapCpc.retardMin + 32;

            for (int i = 0; i < 16; i++)
            {
                // Générer les contrôles de "couleurs"
                colors[i]             = new Label();
                colors[i].BorderStyle = BorderStyle.FixedSingle;
                colors[i].Location    = new Point(4 + i * 48, 20);
                colors[i].Size        = new Size(40, 32);
                colors[i].Tag         = i;
                colors[i].Click      += ClickColor;
                groupPal.Controls.Add(colors[i]);
            }
            Reset();
            DisplayLigne(true);
        }
示例#2
0
        static public void CreeAsm(StreamWriter wr, BitmapCpc bmp)
        {
            WriteDebFile(wr, 32 + BitmapCpc.retardMin);
            int nbLigneVide = 0;
            int tpsImage = 3;
            int reste = 0;
            int oldc2 = 0, oldc3 = 0, oldc4 = 0, oldc5 = 0, oldc6 = 0, oldPen = 0;

            for (int y = 0; y < 272; y++)
            {
                LigneSplit lSpl = bmp.splitEcran.LignesSplit[y];
                if (lSpl.ListeSplit[0].enable)
                {
                    int retPrec = 0;
                    if (nbLigneVide > 0 || reste > 0)
                    {
                        retPrec     = (reste << 3) + (nbLigneVide * 512);
                        nbLigneVide = 0;
                    }
                    int retard = lSpl.retard - BitmapCpc.retardMin;
                    GenereRetard(wr, retard + retPrec);
                    int retSameCol = 0;
                    wr.WriteLine("; ---- Ligne " + y.ToString() + " ----");
                    if (reste < 0 && lSpl.numPen == oldPen)
                    {
                        GenereRetard(wr, (6 + reste) << 3);
                    }
                    else
                    {
                        wr.WriteLine("	LD	C,"+ lSpl.numPen.ToString() + "			; (2 NOPs)");
                        wr.WriteLine("	OUT	(C),C			; (4 NOPs)");
                        oldPen = lSpl.numPen;
                    }
                    int c1 = CpcVGA[lSpl.ListeSplit[0].couleur];
                    wr.WriteLine("	LD	C,#"+ c1.ToString("X2") + "			; (2 NOPs)");
                    int c2 = CpcVGA[lSpl.ListeSplit[1].couleur];
                    int c3 = CpcVGA[lSpl.ListeSplit[2].couleur];
                    if (c2 != oldc2 || c3 != oldc3)
                    {
                        wr.WriteLine("	LD	DE,#"+ c2.ToString("X2") + c3.ToString("X2") + "		; (3 NOPs)");
                    }
                    else
                    {
                        retSameCol += 24;
                    }

                    int c4 = CpcVGA[lSpl.ListeSplit[3].couleur];
                    int c5 = CpcVGA[lSpl.ListeSplit[4].couleur];
                    if (c4 != oldc4 || c5 != oldc5)
                    {
                        wr.WriteLine("	LD	HL,#"+ c4.ToString("X2") + c5.ToString("X2") + "		; (3 NOPs)");
                    }
                    else
                    {
                        retSameCol += 24;
                    }

                    int c6 = CpcVGA[lSpl.ListeSplit[5].couleur];
                    if (c6 != oldc6)
                    {
                        wr.WriteLine("	LD	A,#"+ c6.ToString("X2") + "			; (2 NOPs)");
                    }
                    else
                    {
                        retSameCol += 16;
                    }

                    if (retSameCol > 0)
                    {
                        GenereRetard(wr, retSameCol);
                    }

                    wr.WriteLine("	OUT	(C),C			; (4 NOPs)");
                    int tpsLine = (retard >> 3) + 20;
                    int lg      = lSpl.ListeSplit[0].longueur - 32;
                    tpsLine += lg >> 3;
                    if (lSpl.ListeSplit[1].enable)
                    {
                        if (lg > 0)
                        {
                            GenereRetard(wr, lg);
                            lg = 0;
                        }
                        wr.WriteLine("	OUT	(C),D			; (4 NOPs)");
                        tpsLine += 4;
                        if (lSpl.ListeSplit[2].enable)
                        {
                            int lgs = lSpl.ListeSplit[1].longueur - 32;
                            GenereRetard(wr, lgs);
                            wr.WriteLine("	OUT	(C),E			; (4 NOPs)");
                            tpsLine += 4 + (lgs >> 3);
                            if (lSpl.ListeSplit[3].enable)
                            {
                                lgs = lSpl.ListeSplit[2].longueur - 32;
                                GenereRetard(wr, lgs);
                                wr.WriteLine("	OUT	(C),H			; (4 NOPs)");
                                tpsLine += 4 + (lgs >> 3);
                                if (lSpl.ListeSplit[4].enable)
                                {
                                    lgs = lSpl.ListeSplit[3].longueur - 32;
                                    GenereRetard(wr, lgs);
                                    wr.WriteLine("	OUT	(C),L			; (4 NOPs)");
                                    tpsLine += 4 + (lgs >> 3);
                                    if (lSpl.ListeSplit[5].enable)
                                    {
                                        lgs = lSpl.ListeSplit[4].longueur - 32;
                                        GenereRetard(wr, lgs);
                                        wr.WriteLine("	OUT	(C),A			; (4 NOPs)");
                                        tpsLine += 4 + (lgs >> 3);
                                    }
                                }
                            }
                        }
                    }
                    oldc2 = c2;
                    oldc3 = c3;
                    oldc4 = c4;
                    oldc5 = c5;
                    oldc6 = c6;
                    reste = 64 - tpsLine + (lg >> 3);
                }
                else
                {
                    nbLigneVide++;
                    wr.WriteLine("; ---- Ligne " + y.ToString() + " (vide) ----");
                }

                tpsImage += 64;
            }
            if (nbLigneVide > 0 || reste > 0)
            {
                tpsImage -= ((nbLigneVide * 64) + reste);
            }

            GenereRetard(wr, (17439 - tpsImage) << 3);
            WriteEndFile(wr, bmp.Palette);
        }