📄 dbg8051.pas
字号:
Exit;
end;
i:=Mem[selROM:RejPC];
if (i<>$12) and ((i and $1f)<>$11) then { ani LCALL, ani ACALL }
begin
Wykonaj;
if OknoInstr<>0 then SendMessage(GetWindow(OknoInstr,gw_Child),
wm_Command,us_OdnowCoTrzeba,0);
OdrysujWszystkie;
AktualizujWtyczki(OknoGlowne);
Exit;
end;
if i=$12 then runto:=RejPC+3 else runto:=RejPC+2;
runprog:=2;
SetMenu(Okno,MenuStop);
end;
procedure WykAnim(Okno:Hwnd;z:byte);
var
m1,m2:HMenu;
p,d:array[0..63] of char;
begin
m1:=GetSubMenu(MenuGlownePL,5);
m2:=GetSubMenu(MenuGlowneEN,5);
case z of
0: anim:=false;
1: anim:=true;
2: anim:=not anim;
end;
if anim then
begin
CheckMenuItem(m1,607,MF_BYCOMMAND or MF_CHECKED);
CheckMenuItem(m2,607,MF_BYCOMMAND or MF_CHECKED);
end
else
begin
CheckMenuItem(m1,607,MF_BYCOMMAND or MF_UNCHECKED);
CheckMenuItem(m2,607,MF_BYCOMMAND or MF_UNCHECKED);
end;
FileSplit(StrPCopy(p,ParamStr(0)),d,nil,nil);
StrCat(d,'DBG8051.INI');
if anim then WritePrivateProfileString('Settings','Animation','1',d) else
WritePrivateProfileString('Settings','Animation','0',d);
end;
procedure WykAktual(Okno:Hwnd;z:byte);
var
m1,m2:HMenu;
p,d:array[0..63] of char;
begin
m1:=GetSubMenu(MenuGlownePL,5);
m2:=GetSubMenu(MenuGlowneEN,5);
case z of
0: aktual:=false;
1: aktual:=true;
2: aktual:=not aktual;
end;
if aktual then
begin
CheckMenuItem(m1,608,MF_BYCOMMAND or MF_CHECKED);
CheckMenuItem(m2,608,MF_BYCOMMAND or MF_CHECKED);
end
else
begin
CheckMenuItem(m1,608,MF_BYCOMMAND or MF_UNCHECKED);
CheckMenuItem(m2,608,MF_BYCOMMAND or MF_UNCHECKED);
end;
FileSplit(StrPCopy(p,ParamStr(0)),d,nil,nil);
StrCat(d,'DBG8051.INI');
if aktual then WritePrivateProfileString('Settings','UpdatingPI','1',d) else
WritePrivateProfileString('Settings','UpdatingPI','0',d);
end;
procedure WykBigMem(Okno:Hwnd;z:byte);
var
m1,m2:HMenu;
p,d:array[0..63] of char;
begin
m1:=GetSubMenu(MenuGlownePL,7);
m2:=GetSubMenu(MenuGlowneEN,7);
bigmem:=boolean(z);
if bigmem then
begin
CheckMenuItem(m1,806,MF_BYCOMMAND or MF_UNCHECKED);
CheckMenuItem(m2,806,MF_BYCOMMAND or MF_UNCHECKED);
CheckMenuItem(m1,807,MF_BYCOMMAND or MF_CHECKED);
CheckMenuItem(m2,807,MF_BYCOMMAND or MF_CHECKED);
end
else
begin
CheckMenuItem(m1,806,MF_BYCOMMAND or MF_CHECKED);
CheckMenuItem(m2,806,MF_BYCOMMAND or MF_CHECKED);
CheckMenuItem(m1,807,MF_BYCOMMAND or MF_UNCHECKED);
CheckMenuItem(m2,807,MF_BYCOMMAND or MF_UNCHECKED);
end;
FileSplit(StrPCopy(p,ParamStr(0)),d,nil,nil);
StrCat(d,'DBG8051.INI');
if bigmem then WritePrivateProfileString('Settings','InternalMem','256',d) else
WritePrivateProfileString('Settings','InternalMem','128',d);
OdrysujOkna(5); {HEX RAM Int}
end;
procedure ZmienStanPulapki;
begin
if OknoInstr=0 then MessageBeep(mb_IconHand) else
SendMessage(OknoInstr,wm_Command,us_ZmienPulapke,0);
end;
procedure ZmienAktywnego(wParam:word);
var
m:HMenu;
nazwa:array[0..63] of char;
begin
m:=GetSubMenu(MenuGlownePL,8);
if GetMenuString(m,wParam,nazwa,63,MF_BYCOMMAND)<>0 then
DoWszystkich(255,wm_Command,us_ZmienAktywnego,longint(@nazwa));
end;
procedure SkoczDoPC;
var adr:PAdresy;
begin
if OknoInstr=0 then MessageBeep(mb_IconHand) else
begin
adr:=pointer(GetWindowLong(GetWindow(OknoInstr,gw_Child),0));
adr^[1]:=RejPC;
SetWindowWord(GetWindow(OknoInstr,gw_Child),4,0);
PostMessage(OknoInstr,wm_Command,us_OdnowWidok,0);
end;
end;
procedure ZmienWielkoscCzcionki(Okno:HWnd);
var
b,code:integer;
p,d:array[0..63] of char;
czcionki:PStrCollection;
info:TCzcionkaInfo;
tmp:PChar;
begin
FileSplit(StrPCopy(p,ParamStr(0)),d,nil,nil);
StrCat(d,'DBG8051.INI');
{pobieramy nazw?i wielko滄 czcionki "systemowej" z pliku .INI}
GetPrivateProfileString('Settings','FontOEM','',p,63,d);
if p[StrLen(p)-1]='B' then info.bold:=true else info.bold:=false;
p[StrLen(p)-1]:=#0;
tmp:=StrRScan(p,',');
tmp^:=#0;
Val(StrPas(tmp+1),info.wielk,code);
New(czcionki,Init(15,15));
WyliczCzcionkiF(czcionki);
info.fonts:=czcionki;
info.numer:=-1;
for b:=0 to czcionki^.Count-1 do
if StrComp(p,czcionki^.At(b))=0 then info.numer:=b;
b:=PokazDialogParam('FONTSIZE',@FunFontSize,longint(@info));
if (b<>1) or (Length(wynik1)>3) or (wynik='') or (wynik1='') then
begin
Dispose(czcionki,Done);
Exit;
end;
Val(wynik1,b,code);
if code<>0 then
begin
MessageBeep(mb_IconHand);
BWCCMessageBox(0,Napis1(1),Napis2(2),mb_OK or mb_TaskModal or mb_IconExclamation);
Dispose(czcionki,Done);
Exit;
end;
if (b<1) or (b>99) then
begin
MessageBeep(mb_IconHand);
BWCCMessageBox(0,Napis1(84),Napis2(2),mb_OK or mb_TaskModal or mb_IconExclamation);
Dispose(czcionki,Done);
Exit;
end;
StrPCopy(p,wynik+','+wynik1+wynik2);
WritePrivateProfileString('Settings','FontOEM',p,d);
MessageBeep(mb_OK);
BWCCMessageBox(0,Napis1(85),'Debugger 8051',mb_OK or mb_TaskModal or mb_IconInformation);
Dispose(czcionki,Done);
end;
function NoweOknoMDI(wParam:word;aktyw,ustaw:boolean;ax,ay,acx,acy:integer):word;
const
MDICreate:TMDICreateStruct=(
szClass : nil; szTitle : nil;
hOwner : 0;
x : 0; y : 0;
cx : 0; cy : 0;
style : 0; LParam : 0);
var a:array[0..15] of char;
begin
if aktyw then StrCopy(a,'DBGMDICL1') else StrCopy(a,'DBGMDICL0');
with MDICreate do
begin
szClass:=@a;
hOwner:=hInstance;
szTitle:=''; {Napis1(wParam-us_OknoIns+26)}
LParam:=wParam-us_OknoIns;
if ustaw then begin x:=ax; y:=ay; cx:=acx; cy:=acy; end else
begin x:=cw_UseDefault; y:=cw_UseDefault; cx:=cw_UseDefault; cy:=cw_UseDefault; end;
end;
if (wParam IN [us_OknoPorty,us_OknoTerminal]) and not(wtrakciezmian) then
DoWszystkich(wParam-us_OknoIns,wm_Close,0,0); {okno portow lub terminala moze byc tylko 1}
NoweOknoMDI:=SendMessage(Klient,wm_MDICreate,0,longint(@MDICreate));
PostMessage(OknoGlowne,wm_Command,us_ListaOkien,0);
end;
function FunDbgMDICl(Okno:HWnd;Kod_meldunku,wParam:word;LParam:longint):longint; EXPORT;
var
s:^TMDICreateStruct;
lpmmi:^TMinMaxInfo;
a,b:word;
R,R2:TRect;
o:HWnd;
txt:PChar;
clname:array[0..10] of char;
begin
FunDbgMDICl:=0;
case Kod_meldunku of
wm_KeyDown: begin
SendMessage(GetWindow(Okno,GW_CHILD),wm_KeyDown,wParam,LParam);
FunDbgMDICl:=DefMDIChildProc(Okno,wm_KeyDown,wParam,LParam);
end;
wm_NCActivate: begin
if wParam<>0 then
begin
OknoAktualne:=Okno;
if (GetWindowWord(Okno,0)=0) and {okienko instrukcji}
(GetWindowWord(Okno,2)=1) then OknoInstr:=Okno; {i do tego aktywne}
if (GetWindowWord(Okno,0)=11) then OknoTerm:=Okno; {okienko terminala}
UpdateWindow(Okno);
end;
FunDbgMDICl:=DefMDIChildProc(Okno,wm_NCActivate,wParam,LParam);
end;
wm_NCLButtonDblClk: PostMessage(Okno,wm_Command,us_ZmianaAkt,0);
wm_Close: begin
PostMessage(OknoGlowne,wm_Command,us_ListaOkien,0);
FunDbgMDICl:=DefMDIChildProc(Okno,wm_Close,wParam,LParam);
end;
wm_Destroy: begin
if (GetWindowWord(Okno,0)=0) and (Okno=OknoInstr) then OknoInstr:=0;
if (GetWindowWord(Okno,0)=11) and (Okno=OknoTerm) then OknoTerm:=0;
end;
wm_Size: if wParam=SIZE_RESTORED then
SendMessage(GetWindow(Okno,GW_CHILD),wm_Command,us_ZmienRozmiary,LParam);
wm_GetMinMaxInfo: begin
lpmmi:=pointer(LParam);
case GetWindowWord(Okno,0) of
3..5: begin
lpmmi^.ptMinTrackSize.x:=FontOEMszer*38+RamkaSzer+WindaSzer+3;
lpmmi^.ptMaxTrackSize.x:=lpmmi^.ptMinTrackSize.x;
end;
11: begin
lpmmi^.ptMaxTrackSize.x:=FontOEMszer*80+RamkaSzer;
lpmmi^.ptMaxTrackSize.y:=FontOEMwys*25+RamkaWys;
end;
end;
end;
wm_Command: case wParam of
us_ZmianaJez: PostMessage(GetWindow(Okno,gw_Child),wm_Command,wParam,LParam);
us_ZmienAktywnego: begin
txt:=pointer(LParam);
GetWindowText(Okno,buforzn2,63);
if StrComp(txt,buforzn2)=0 then
SendMessage(Klient,wm_MDIActivate,Okno,0);
end;
us_OdnowWidok: SendMessage(GetWindow(Okno,gw_Child),wm_Command,us_OdnowWidok,
LParam);
us_OdnowCoTrzeba: if GetWindowWord(Okno,2)=1 then
SendMessage(GetWindow(Okno,gw_Child),wm_Command,
us_OdnowWidok,LParam);
us_ZmianaAkt: begin
a:=GetWindowWord(Okno,0); {typ okienka}
b:=GetWindowWord(Okno,2); {0-nieaktywne, 1-aktywne}
GetWindowRect(Okno,R);
MapWindowPoints(HWND_DESKTOP,Klient,R,2);
wtrakciezmian:=true;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -