Changeset 42 for branches/simple/Forms
- Timestamp:
- Sep 8, 2023, 11:20:27 PM (15 months ago)
- Location:
- branches/simple/Forms
- Files:
-
- 11 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/simple/Forms/FormConsole.pas
r41 r42 4 4 5 5 uses 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls ;6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, Device; 7 7 8 8 type … … 10 10 { TFormConsole } 11 11 12 TFormConsole = class(TForm )12 TFormConsole = class(TFormDevice) 13 13 Memo1: TMemo; 14 14 public -
branches/simple/Forms/FormMain.pas
r41 r42 43 43 {$R *.lfm} 44 44 45 uses 46 Screen, Channel; 47 45 48 { TFormMain } 46 49 … … 49 52 FormScreen := TFormScreen.Create(nil); 50 53 FormConsole := TFormConsole.Create(nil); 51 InitMachine 16;54 InitMachine8; 52 55 end; 53 56 … … 66 69 FreeAndNil(FormScreen); 67 70 FreeAndNil(FormConsole); 68 FreeAndNil(Machine8); 71 if Assigned(Machine8) then FreeAndNil(Machine8); 72 if Assigned(Machine16) then FreeAndNil(Machine16); 69 73 end; 70 74 … … 80 84 Console.OnWrite := FormConsole.ConsoleWrite; 81 85 Screen.OnChange := FormScreen.ScreenChange; 82 FormScreen. Machine := Machine8;86 FormScreen.Screen := TScreen.Create(bw8, Machine8.Screen, nil); 83 87 with Memory do begin 84 88 // LD A8, 'A' … … 90 94 // LD A8, 'A' 91 95 WritePos8(Byte(inLoadImmediate8)); 92 WritePos8(Ord('H')); 93 // OUT (0), A8 94 WritePos8(Byte(inOutput8)); 95 WritePos8(1); 96 WritePos8(Ord('B')); 96 97 // OUT (0), A8 97 98 WritePos8(Byte(inOutput8)); … … 110 111 Console.OnWrite := FormConsole.ConsoleWrite; 111 112 Screen.OnChange := FormScreen.ScreenChange; 112 FormScreen. Machine := Machine16;113 FormScreen.Screen := TScreen.Create(bw16, nil, Machine16.Screen); 113 114 with Memory do begin 114 115 // LD A8, 'A' … … 122 123 WritePos16(Ord('H')); 123 124 // OUT8 (0), A8 124 WritePos8(Byte(inOutput 8));125 WritePos8(Byte(inOutput16)); 125 126 WritePos16(1); 126 127 // HALT -
branches/simple/Forms/FormScreen.pas
r41 r42 4 4 5 5 uses 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Machine; 6 Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Screen, 7 Channel, Device; 7 8 8 9 type … … 10 11 { TFormScreen } 11 12 12 TFormScreen = class(TForm )13 TFormScreen = class(TFormDevice) 13 14 Image1: TImage; 14 15 TimerDraw: TTimer; … … 17 18 DrawPending: Boolean; 18 19 public 19 Machine: TMachine;20 Screen: TScreen; 20 21 procedure ScreenChange(Sender: TObject); 21 22 end; … … 36 37 if DrawPending then begin 37 38 DrawPending := False; 38 if Machine is TMachine16then39 with TMachine16(Machine).Screendo begin39 if Screen.BitWidth = bw8 then 40 with Screen.Screen8 do begin 40 41 Image1.Picture.Bitmap.SetSize(Width * CharSize, Height * CharSize); 41 42 Image1.Picture.Bitmap.Canvas.FillRect(0, 0, Image1.Picture.Bitmap.Width, … … 46 47 Chr(Memory.Read8(Y * Width + X))); 47 48 end else 48 if Machine is TMachine8then49 with TMachine8(Machine).Screendo begin49 if Screen.BitWidth = bw16 then 50 with Screen.Screen16 do begin 50 51 Image1.Picture.Bitmap.SetSize(Width * CharSize, Height * CharSize); 51 52 Image1.Picture.Bitmap.Canvas.FillRect(0, 0, Image1.Picture.Bitmap.Width,
Note:
See TracChangeset
for help on using the changeset viewer.