Pascal/Turbo Pascal - Sigo sin poder correrlo :(

 
Vista:

Sigo sin poder correrlo :(

Publicado por Luis (29 intervenciones) el 13/06/2012 12:52:03
Hola, todavia he tratado de correr el programa decorazon y aun sigo sin poder correrlo ayuda plis, ya no se q mas hacer, no se puede hacer pero sin utilizar la unidad GRAPH?¿?¿?¿?¿?¿?¿?¿?

program corazon;
uses
crt,GRAPH;
const mcorazon : array[1..12,1..15] of byte = (
(0,0,1,1,1,0,0,0,0,0,1,1,1,0,0),
(0,1,0,0,0,1,0,0,0,1,0,0,0,1,0),
(1,0,0,0,0,0,1,0,1,0,0,0,0,0,1),
(1,0,0,0,0,0,0,1,0,0,0,0,0,0,1),
(1,0,0,0,0,0,0,0,0,0,0,0,0,0,1),
(0,1,0,0,0,0,0,0,0,0,0,0,0,1,0),
(0,0,1,0,0,0,0,0,0,0,0,0,1,0,0),
(0,0,0,1,0,0,0,0,0,0,0,1,0,0,0),
(0,0,0,0,1,0,0,0,0,0,1,0,0,0,0),
(0,0,0,0,0,1,0,0,0,1,0,0,0,0,0),
(0,0,0,0,0,0,1,0,1,0,0,0,0,0,0),
(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0));
var driver, modo : integer;
x, y : integer;
begin
driver := detect;
initgraph(driver, modo,'c:\progra~1\TP\BGI');

if graphresult <> 0 then
begin
halt(1);
end
else
begin
for y := 1 to 12 do
for x := 1 to 15 do
begin
if mcorazon[y,x] = 1 then
begin
putpixel(100 + x * 4,130 + y * 4,12);
putpixel(100 + (x * 4) - 1,130 + (y * 4) - 1,12);
putpixel(100 + (x * 4) + 1,130 + (y * 4) + 1,12);
putpixel(100 + x * 2,100 + y * 2,10);
putpixel(100 + x ,80 + y ,15);
end;
end;
readln;
closegraph;
end;
end.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Sigo sin poder correrlo :(

Publicado por ramon (2158 intervenciones) el 16/06/2012 00:35:25
Si no detecta la unidad graph es problema de configuración o sea las datos de posición de la
unidad no son correctos pero ten en cuenta que el fallo puede deberse a la librería bgi
que no la encontrara.
una solución propria ser que pusieras todo el programa en c:\ en vez de en archivoprogram para
evitar los nombres largos eso te resolvería el problema.

No octante te preparare algo con pascal y ensamblador .
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Sigo sin poder correrlo :(

Publicado por Luis (29 intervenciones) el 16/06/2012 16:13:18
Hola Ramon logre correrlo me salen 3 corazones q van de pequeño a grande asi es como se deberia de ver el programa¿?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Sigo sin poder correrlo :(

Publicado por ramon (2158 intervenciones) el 16/06/2012 20:24:27
Correcto esa es la visualizacion del programa.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Sigo sin poder correrlo :(

Publicado por ramon (2158 intervenciones) el 19/06/2012 18:38:31
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
{Mira sin unidad graph pero tienes que tener una tarjeta compatible con estándar vesa}
 
program corazones;
 {$g+} {$N+} {$F+}
 uses
    crt, dos;
  const
     corazon : array[1..21] of string[23] = (
     '00000000000000000000000',
     '00001111000000011100000',
     '00112222110011122211000',
     '01222222210122222222100',
     '01222222221222222222100',
     '12222222212222222222210',
     '12222222222222222222210',
     '12222222222222222222210',
     '12222222222222222222100',
     '12222222222222222222100',
     '12222222222222222222100',
     '01222222222222222221000',
     '01122222222222222210000',
     '00112222222222222110000',
     '00001222222222221100000',
     '00000122222222211000000',
     '00000122222221100000000',
     '00000012221110000000000',
     '00000012210000000000000',
     '00000001100000000000000',
     '00000010000000000000000');
 
  type
    ptmodeList = ^modeList;
    modeList = Array [0..255] of word;
 
    informevesa = record
                  asignatura : array[1..4] of char;
                  nversion   : word;
                  punterofar : pchar;
                  capacidad  : longint;
                  codigos    : ptmodelist;
              end;
 
   datosvesa = record
              data : array[1..12] of byte;
              areavisible : procedure;
              data1 : array[1..13] of byte;
         end;
 
 
 
   var
    vesa : boolean;
    dato1 : informevesa;
    dato2 : datosvesa;
    regs  : registers;
    CurrentReadBank : integer;
    CurrentWriteBank : integer;
    BankShift : word;
    ReadWindow : byte;
    WriteWindow : byte;
    bytesporlinea : integer;
    HardwarePages : byte;
    x, y : integer;
    maxx, maxy : word;
    ViewWidth : integer;
    ViewHeight: integer;
    color01 : integer;
 
 
  function byte2word(h, l : byte) : word; assembler;
   asm
      mov ah, h
      mov al, l
   end;
 
  function esistevesa : boolean;
  begin
     esistevesa := false;
     regs.ah := $4f;
     regs.al := $00;
     regs.es := seg(dato1);
     regs.di := ofs(dato1);
     intr($10,regs);
     if (regs.ah = $00) and (regs.al = $4f) then
     esistevesa := true
   else
     esistevesa := false;
 end;
 
  function indentificacion_vesa(modo : word) : boolean;
  begin
      indentificacion_vesa := false;
      regs.ah := $4f;
      regs.al := $01;
      regs.cx := modo;
      regs.es := seg(dato2);
      regs.di := ofs(dato2);
      intr($10,regs);
      if (regs.al = $4f) and (regs.ah = $00) then
      indentificacion_vesa := true
    else
      indentificacion_vesa := false;
  end;
 
  function conectavesa(modo : word) : boolean;
  begin
      regs.ah := $4f;
      regs.al := $02;
      regs.bx := modo;
      intr($10,regs);
      if (regs.al = $4f) and (regs.ah = $00) then
      conectavesa := true
    else
      conectavesa := false;
  end;
 
  procedure closevesa;
  begin
      regs.ah := $00;
      regs.al := $03;
      intr($10,regs);
   end;
 
   procedure setbankindex(win : byte; bankr : integer); assembler;
   asm
     mov ax,4f05h
     mov bh,00h
     mov bl,[win]
     mov dx,[bankr]
     int 10h
  end;
 
  procedure setwritebank(banknr : integer);
  begin
      if banknr = currentwritebank then
      exit;
      currentwritebank := banknr;
      banknr := banknr shl bankshift;
      setbankindex(writewindow, banknr);
      if readwindow = writewindow then
      currentreadbank := currentwritebank;
  end;
 
  procedure putpixel(x, y : integer; color : byte);
  var
      offs : longint;
  begin
      offs := longint(y) * bytesporlinea + x;
      setwritebank(integer(offs shr 16));
      mem[segA000:word(offs)] := byte(color);
  end;
 
  procedure pintacorazones;
  begin
    if esistevesa then
     begin
        if indentificacion_vesa($101) then
        begin
           conectavesa($101);
          vesa := true;
          bytesporlinea := 640;
          ViewWidth := 640;
          ViewHeight := 480;
          maxx := 640;
          maxy := 480;
          for y := 1 to 21 do
          begin
           for x := 1 to 23 do
           begin
           if corazon[y,x] = '1' then
           begin
           putpixel(50 + x + 8,100 + y + 8,14);
           putpixel((50 + 1) + x + 8,(100 + 1) + y + 8,14);
           end;
           if corazon[y,x] = '2' then
           putpixel(50 + x + 8,100 + y + 8,4);
           end;
         end;
          for y := 1 to 21 do
          begin
           for x := 1 to 23 do
           begin
           if corazon[y,x] = '1' then
           begin
           putpixel(100 + (x * 2),110 + (y * 2),14);
           putpixel((100 + 1) + (x * 2),(110 + 1) + (y * 2),14);
           putpixel((100 + 2) + (x * 2),(110 + 2) + (y * 2),14);
           end;
           if corazon[y,x] = '2' then
           putpixel(100 + (x * 2),110 + (y * 2),4);
           end;
         end;
         for y := 1 to 21 do
          begin
           for x := 1 to 23 do
           begin
           if corazon[y,x] = '1' then
           begin
           putpixel(160 + (x * 3),120 + (y * 3),14);
           putpixel((160 + 1) + (x * 3),(120 + 1) + (y * 3),14);
           putpixel((160 + 2) + (x * 3),(120 + 2) + (y * 3),14);
           end;
           if corazon[y,x] = '2' then
           putpixel(160 + (x * 3),120 + (y * 3),4);
           end;
         end;
           readkey;
           closevesa;
        end;
     end;
  end;
 
  begin
      pintacorazones;
  end.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar