רקע בפסקל - תכנות - HWzone פורומים
עבור לתוכן
  • צור חשבון

רקע בפסקל


creative

Recommended Posts

שלום לכולם

יש לי בעיה בפסקל אני רוצה שיהיה משהו שיעבוד ברקע:

program aa;
uses crt;


var buffer : array[0..63999] of byte;

procedure setnew;
          var R,G,B,I : byte;
begin
        R:=0;
        G:=0;
        B:=0;
        for I:= 1 to 255 do begin
        port[$3c8]:=I;
        port[$3c9]:=B;
        port[$3c9]:=G;
        port[$3c9]:=R;
        if B < 63 then inc(B);
        if (B = 63) and (G < 63) then inc(G);
        if (G = 63) and (R < 63) then inc(R);

        end;
end;



procedure clearbuffer;
          var I : word;
begin
        for I:= 0 to 63999 do begin
        buffer[I]:= 0;
end;
end;

procedure randb;
          var I : word;
              F : byte;
begin
        I := 63680;
    repeat
        F:=random(256);
        buffer[I]:=F;
        buffer[I-320]:=F;
        buffer[I+1]:=F;
        buffer[I+1-320]:=F;
        buffer[I+2]:=F;
        buffer[I+2-320]:=F;
        buffer[I+3]:=F;
        buffer[I+3-320]:=F;
        I:=I+4;
    until I >= 63999;
end;

procedure show;
          var I : word;
begin
       for I:= 0 to 63359 do begin
        mem[$a000:I]:=buffer[I];
        end;
end;

procedure smudge;
          var I : word;
          var B : word;
begin
        for I := 30000 to 63680 do begin
        B:=buffer[I-1];
        B:=B+buffer[I+1];
        B:=B+buffer[I-320];
        B:=B+buffer[I+320];
        B := B shr 2;
        if B > 0 then  dec(B);
        buffer[I-320]:=B;
        end;
end;


begin

        asm mov ax,13h;int 10h; end;
        randomize;
        setnew;
        clearbuffer;
repeat
      randb;
      smudge;
      show;
until port[$60] = 1;
      asm mov ax,13h; int 10h; end;
end.

שזה ירוץ ברקע והתכנית שלי גם תרוץ על הרקע הזה...

אני לא הצלחתי  אם משהו יודע בבקשה לעזור :hat:

קישור לתוכן
שתף באתרים אחרים

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

×
  • צור חדש...