LTCD_060719.ISO
This commit is contained in:
commit
f86e69648b
156 files changed
+49537
No files matched your search
@@ -0,0 +1,245 @@
|
||||
U4i class RGBEntry
|
||||
{
|
||||
U1 r,g,b,reserved;
|
||||
};
|
||||
|
||||
U4i class BGREntry
|
||||
{
|
||||
U1 b,g,r,reserved;
|
||||
};
|
||||
|
||||
class BMPFile
|
||||
{
|
||||
U2 type;
|
||||
U4 file_size;
|
||||
U4 reserved;
|
||||
U4 data_offset;
|
||||
|
||||
U4 header_size;
|
||||
U4 width;
|
||||
U4 height;
|
||||
U2 planes;
|
||||
U2 bit_cnt;
|
||||
U4 compression;
|
||||
U4 image_size;
|
||||
U4 x_pixels_per_meter;
|
||||
U4 y_pixels_per_meter;
|
||||
U4 colors_used;
|
||||
U4 important_colors;
|
||||
|
||||
U0 end;
|
||||
|
||||
BGREntry pallette[16];
|
||||
};
|
||||
|
||||
|
||||
BMPFile *NewBMPFile(U8 width,U8 height,U8 bits)
|
||||
{
|
||||
BMPFile *r;
|
||||
U8 size;
|
||||
if (bits==24)
|
||||
size=offset(BMPFile.end)+
|
||||
width*height*sizeof(RGBEntry);
|
||||
else
|
||||
size=offset(BMPFile.end)+
|
||||
width*height>>1+16*sizeof(BGREntry);
|
||||
r=MAllocZ(size);
|
||||
r->type=0x4D42;
|
||||
r->planes=1;
|
||||
r->file_size=size;
|
||||
r->data_offset=offset(BMPFile.end);
|
||||
r->header_size=offset(BMPFile.end)-
|
||||
offset(BMPFile.header_size);
|
||||
r->width=width;
|
||||
r->height=height;
|
||||
if (bits==24) {
|
||||
r->bit_cnt=32;
|
||||
r->image_size=width*height<<2;
|
||||
} else {
|
||||
r->bit_cnt=4;
|
||||
r->image_size=width*height>>1;
|
||||
r->data_offset+=16*sizeof(BGREntry);
|
||||
r->pallette[BLACK] =0x00000000;
|
||||
r->pallette[BLUE] =0x00000080;
|
||||
r->pallette[GREEN] =0x00008000;
|
||||
r->pallette[CYAN] =0x00008080;
|
||||
r->pallette[RED] =0x00800000;
|
||||
r->pallette[PURPLE] =0x00800080;
|
||||
r->pallette[BROWN] =0x00808000;
|
||||
r->pallette[LTGRAY] =0x00808080;
|
||||
|
||||
r->pallette[DKGRAY] =0x00000000;
|
||||
r->pallette[LTBLUE] =0x000000FF;
|
||||
r->pallette[LTGREEN] =0x0000FF00;
|
||||
r->pallette[LTCYAN] =0x0000FFFF;
|
||||
r->pallette[LTRED] =0x00FF0000;
|
||||
r->pallette[LTPURPLE]=0x00FF00FF;
|
||||
r->pallette[YELLOW] =0x00FFFF00;
|
||||
r->pallette[WHITE] =0x00FFFFFF;
|
||||
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
public void CaptureScreen4(I1 *filename)
|
||||
{// 4 bit color
|
||||
U1 *src,j;
|
||||
U8 wd=grbase->width>>3,pl=wd*grbase->height;
|
||||
U4 *img=MAlloc(pl<<2);
|
||||
BMPFile *r=NewBMPFile(grbase->width,grbase->height,4);
|
||||
I8 x,y,i;
|
||||
RGBEntry *rgb;
|
||||
|
||||
while (gr_screen_capture)
|
||||
SwapInNext;
|
||||
gr_screen_capture=img;
|
||||
while (gr_screen_capture)
|
||||
SwapInNext;
|
||||
|
||||
rgb=r+r->data_offset;
|
||||
for (y=grbase->height-1;y>=0;y--) {
|
||||
src=y*wd+img;
|
||||
for (x=0;x<wd;x++) {
|
||||
j=*src++;
|
||||
for (i=1;i<0x100;i<<=1) {
|
||||
if (i&j)
|
||||
*rgb |= 0x10;
|
||||
i<<=1;
|
||||
|
||||
if (i&j)
|
||||
*rgb |= 0x01;
|
||||
rgb++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rgb=r+r->data_offset;
|
||||
for (y=grbase->height-1;y>=0;y--) {
|
||||
src=y*wd+img+pl;
|
||||
for (x=0;x<wd;x++) {
|
||||
j=*src++;
|
||||
for (i=1;i<0x100;i<<=1) {
|
||||
if (i&j)
|
||||
*rgb |= 0x20;
|
||||
i<<=1;
|
||||
|
||||
if (i&j)
|
||||
*rgb |= 0x02;
|
||||
rgb++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rgb=r+r->data_offset;
|
||||
for (y=grbase->height-1;y>=0;y--) {
|
||||
src=y*wd+img+pl<<1;
|
||||
for (x=0;x<wd;x++) {
|
||||
j=*src++;
|
||||
for (i=1;i<0x100;i<<=1) {
|
||||
if (i&j)
|
||||
*rgb |= 0x40;
|
||||
i<<=1;
|
||||
|
||||
if (i&j)
|
||||
*rgb |= 0x04;
|
||||
rgb++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rgb=r+r->data_offset;
|
||||
for (y=grbase->height-1;y>=0;y--) {
|
||||
src=y*wd+img+pl*3;
|
||||
for (x=0;x<wd;x++) {
|
||||
j=*src++;
|
||||
for (i=1;i<0x100;i<<=1) {
|
||||
if (i&j)
|
||||
*rgb |= 0x80;
|
||||
i<<=1;
|
||||
|
||||
if (i&j)
|
||||
*rgb |= 0x08;
|
||||
rgb++;
|
||||
}
|
||||
}
|
||||
}
|
||||
WriteFile(filename,r,r->file_size);
|
||||
Free(img);
|
||||
Free(r);
|
||||
}
|
||||
|
||||
public void CaptureScreen24(I1 *filename)
|
||||
{// 24 bit color
|
||||
U1 *src,j;
|
||||
U8 wd=grbase->width>>3,pl=wd*grbase->height;
|
||||
U4 *img=MAlloc(pl<<2);
|
||||
BMPFile *r=NewBMPFile(grbase->width,grbase->height,24);
|
||||
I8 x,y,i;
|
||||
RGBEntry *rgb;
|
||||
|
||||
while (gr_screen_capture)
|
||||
SwapInNext;
|
||||
gr_screen_capture=img;
|
||||
while (gr_screen_capture)
|
||||
SwapInNext;
|
||||
|
||||
rgb=r+r->data_offset;
|
||||
for (y=grbase->height-1;y>=0;y--) {
|
||||
src=y*wd+img;
|
||||
for (x=0;x<wd;x++) {
|
||||
j=*src++;
|
||||
for (i=0x80;i;i>>=1) {
|
||||
if (i&j)
|
||||
rgb->r=0x7F;
|
||||
rgb+=4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rgb=r+r->data_offset;
|
||||
for (y=grbase->height-1;y>=0;y--) {
|
||||
src=y*wd+img+pl;
|
||||
for (x=0;x<wd;x++) {
|
||||
j=*src++;
|
||||
for (i=0x80;i;i>>=1) {
|
||||
if (i&j)
|
||||
rgb->g=0x7F;
|
||||
rgb+=4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rgb=r+r->data_offset;
|
||||
for (y=grbase->height-1;y>=0;y--) {
|
||||
src=y*wd+img+pl<<1;
|
||||
for (x=0;x<wd;x++) {
|
||||
j=*src++;
|
||||
for (i=0x80;i;i>>=1) {
|
||||
if (i&j)
|
||||
rgb->b=0x7F;
|
||||
rgb+=4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rgb=r+r->data_offset;
|
||||
for (y=grbase->height-1;y>=0;y--) {
|
||||
src=y*wd+img+pl*3;
|
||||
for (x=0;x<wd;x++) {
|
||||
j=*src++;
|
||||
for (i=0x80;i;i>>=1) {
|
||||
if (i&j) {
|
||||
if (rgb->r) rgb->r=0xFF;
|
||||
if (rgb->g) rgb->g=0xFF;
|
||||
if (rgb->b) rgb->b=0xFF;
|
||||
}
|
||||
rgb+=4;
|
||||
}
|
||||
}
|
||||
}
|
||||
WriteFile(filename,r,r->file_size);
|
||||
Free(img);
|
||||
Free(r);
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
asm {
|
||||
#define BOOT_ADDRESS 0x040000
|
||||
#define BLK_SIZE 0x200
|
||||
#define CD_BLK_SIZE 2048
|
||||
#define BOOT_HIGH_LOC ((0xA0000-5*BLK_SIZE)>>4)
|
||||
|
||||
#define BOOT_CODE_FLOPPY 1
|
||||
#define BOOT_CODE_HARDDRIVE 2
|
||||
#define BOOT_CODE_CDROM 3
|
||||
#define BOOT_CODE_RAM 4
|
||||
|
||||
#define WIN_NOP 0x00
|
||||
#define WIN_DEV_RESET 0x08
|
||||
#define WIN_PACKETCMD 0xA0 /* Send a packet cmd. */
|
||||
|
||||
#define ERR_STAT 0x01
|
||||
#define DRQ_STAT 0x08
|
||||
#define SEEK_STAT 0x10
|
||||
#define READY_STAT 0x40
|
||||
#define BUSY_STAT 0x80
|
||||
|
||||
#define DRIVE_READY (READY_STAT | SEEK_STAT)
|
||||
#define DATA_READY (DRQ_STAT)
|
||||
|
||||
#define IDE_PRIMARY_BASE 0x1F0
|
||||
#define IDE_SECONDARY_BASE 0x170
|
||||
|
||||
#define IDE_DATA_REG (0)
|
||||
#define IDE_FEATURE_REG (1)
|
||||
#define IDE_NSECTOR_REG (2)
|
||||
#define IDE_SECTOR_REG (3)
|
||||
#define IDE_LCYL_REG (4)
|
||||
#define IDE_HCYL_REG (5)
|
||||
#define IDE_SELECT_REG (6)
|
||||
#define IDE_STATUS (7)
|
||||
#define IDE_CMD (7)
|
||||
#define IDE_CONTROL_REG (0x3F6-0x1F0)
|
||||
|
||||
USE16
|
||||
BCD2_START::
|
||||
CLD
|
||||
MOV AX,BOOT_HIGH_LOC
|
||||
MOV ES,AX
|
||||
MOV SS,AX
|
||||
MOV SP,5*BLK_SIZE
|
||||
|
||||
CALL U2 GET_IP
|
||||
GET_IP:
|
||||
POP BX
|
||||
SUB BX,GET_IP
|
||||
SHR BX,4
|
||||
MOV AX,CS //COPY HIGH
|
||||
ADD AX,BX
|
||||
MOV DS,AX
|
||||
MOV CX,CD_BLK_SIZE
|
||||
XOR SI,SI
|
||||
XOR DI,DI
|
||||
REP_MOVSB
|
||||
|
||||
MOV AX,SS
|
||||
MOV DS,AX
|
||||
MOV AX,BOOT_ADDRESS/16
|
||||
MOV ES,AX
|
||||
XOR DI,DI //ES:[DI]=DEST
|
||||
|
||||
MOV SI,MSG_PS
|
||||
CALL BCD2_PUTS
|
||||
XOR AH,AH
|
||||
INT 0x16
|
||||
MOV SI,IDE_SECONDARY_BASE
|
||||
CMP AL,'S'
|
||||
JE @@12
|
||||
CMP AL,'s'
|
||||
JE @@12
|
||||
MOV SI,IDE_PRIMARY_BASE
|
||||
|
||||
@@12:
|
||||
/**********
|
||||
PUSH ES
|
||||
XOR AX,AX
|
||||
MOV ES,AX
|
||||
MOV AL,U1 ES:[0x3EE]
|
||||
POP ES
|
||||
*******/
|
||||
|
||||
PUSH SI
|
||||
MOV SI,MSG_UNIT
|
||||
CALL BCD2_PUTS
|
||||
XOR AH,AH
|
||||
INT 0x16
|
||||
POP SI
|
||||
|
||||
SHL AL,4
|
||||
OR AL,0xE0
|
||||
MOV U1 [BCD2_UNIT_VALUE+1],AL
|
||||
|
||||
CLI
|
||||
DU1 0xEA;
|
||||
DU2 BCD2_MAIN,BOOT_HIGH_LOC;
|
||||
|
||||
MSG_PS::
|
||||
DU1 "\r\n\r\n\r\n\r\n"
|
||||
"\r\nBooting LoseThos Operating System from CD-ROM..."
|
||||
"\r\n\r\nPlease specify the location of the CD-ROM"
|
||||
"\r\ndrive you are booting from. (I don't know how"
|
||||
"\r\nto detect it.) Typically, CD-ROMs are on the"
|
||||
"\r\nsecondary controller, so press 's' if this is the case."
|
||||
"\r\n\r\n (p)rimary or (s)econdary IDE controller:",0;
|
||||
MSG_UNIT::
|
||||
DU1 "\r\n\r\nTypically, CD-ROMs are the master unit, so"
|
||||
"\r\npress '0' if this is the case."
|
||||
"\r\n\r\n Unit (0=Master or 1=Slave):",0;
|
||||
BCD2_PUTS::
|
||||
LODSB
|
||||
OR AL,AL
|
||||
JZ BCD2_RET
|
||||
MOV AH,0x0E
|
||||
MOV BX,0x07
|
||||
INT 0x10
|
||||
JMP BCD2_PUTS
|
||||
|
||||
BCD2_STAT::
|
||||
MOV DX,SI
|
||||
ADD DX,IDE_STATUS
|
||||
IN AL,DX
|
||||
BCD2_RET:
|
||||
RET
|
||||
BCD2_SELECT_UNIT::
|
||||
MOV DX,SI
|
||||
ADD DX,IDE_SELECT_REG
|
||||
BCD2_UNIT_VALUE::
|
||||
MOV AL,0xF0 //Gets patched
|
||||
OUT DX,AL
|
||||
RET
|
||||
BCD2_CMD::
|
||||
MOV AH,AL
|
||||
XOR AL,AL
|
||||
MOV DX,SI
|
||||
ADD DX,IDE_FEATURE_REG
|
||||
OUT DX,AL
|
||||
MOV AL,AH
|
||||
MOV DX,SI
|
||||
ADD DX,IDE_CMD
|
||||
OUT DX,AL
|
||||
RET
|
||||
BCD2_WAIT_NOT_BUSY::
|
||||
CALL BCD2_STAT
|
||||
AND AL,BUSY_STAT
|
||||
JNZ BCD2_WAIT_NOT_BUSY
|
||||
RET
|
||||
BCD2_WAIT_DRQ::
|
||||
CALL BCD2_STAT
|
||||
AND AL,DRQ_STAT
|
||||
JZ BCD2_WAIT_DRQ
|
||||
RET
|
||||
BCD2_PKT::
|
||||
PUSH AX
|
||||
CALL BCD2_WAIT_DRQ
|
||||
POP BX
|
||||
MOV AL,BH
|
||||
MOV AH,BL
|
||||
MOV DX,SI
|
||||
ADD DX,IDE_DATA_REG
|
||||
OUT DX,AX
|
||||
RET
|
||||
BCD2_RESET::
|
||||
CALL BCD2_SELECT_UNIT
|
||||
MOV AL,WIN_DEV_RESET
|
||||
CALL BCD2_CMD
|
||||
CALL BCD2_WAIT_NOT_BUSY
|
||||
RET
|
||||
|
||||
BCD2_MAIN::
|
||||
CALL BCD2_RESET
|
||||
BCD2_WAIT_READY::
|
||||
MOV ECX,100000 //Busy wait
|
||||
MOV DX,0x379 //Par Port
|
||||
@@1: IN AL,DX
|
||||
DEC ECX
|
||||
JNZ @@1
|
||||
BCD2_WAIT_READY2::
|
||||
CALL BCD2_SELECT_UNIT
|
||||
MOV AL,WIN_NOP
|
||||
CALL BCD2_CMD
|
||||
CALL BCD2_WAIT_NOT_BUSY
|
||||
CALL BCD2_STAT
|
||||
AND AL,READY_STAT
|
||||
JNZ @@1
|
||||
CALL BCD2_RESET
|
||||
JMP BCD2_WAIT_READY
|
||||
|
||||
@@1: CALL BCD2_SELECT_UNIT
|
||||
MOV AL,WIN_PACKETCMD
|
||||
CALL BCD2_CMD
|
||||
MOV AX,0x1B00
|
||||
CALL BCD2_PKT
|
||||
XOR AX,AX
|
||||
CALL BCD2_PKT
|
||||
MOV AX,0x0100
|
||||
CALL BCD2_PKT
|
||||
XOR AX,AX
|
||||
CALL BCD2_PKT
|
||||
XOR AX,AX
|
||||
CALL BCD2_PKT
|
||||
XOR AX,AX
|
||||
CALL BCD2_PKT
|
||||
CALL BCD2_WAIT_NOT_BUSY
|
||||
|
||||
MOV DX,SI
|
||||
ADD DX,IDE_FEATURE_REG
|
||||
IN AL,DX
|
||||
OR AL,AL
|
||||
JNZ BCD2_WAIT_READY
|
||||
|
||||
BCD2_SEND_READ::
|
||||
MOV AL,8
|
||||
MOV DX,SI
|
||||
ADD DX,IDE_CONTROL_REG
|
||||
OUT DX,AL
|
||||
CALL BCD2_SELECT_UNIT
|
||||
MOV AL,0
|
||||
MOV DX,SI
|
||||
ADD DX,IDE_LCYL_REG
|
||||
OUT DX,AL
|
||||
MOV AL,8
|
||||
INC DX //IDE_HCYL_REG
|
||||
OUT DX,AL
|
||||
MOV AL,WIN_PACKETCMD
|
||||
CALL BCD2_CMD
|
||||
MOV AX,0xA800
|
||||
CALL BCD2_PKT
|
||||
BCD2_BLK_HI::
|
||||
MOV AX,512
|
||||
CALL BCD2_PKT
|
||||
BCD2_BLK_LO::
|
||||
MOV AX,512
|
||||
CALL BCD2_PKT
|
||||
XOR AX,AX //cnt_hi
|
||||
CALL BCD2_PKT
|
||||
BCD2_BLK_CNT::
|
||||
MOV AX,512
|
||||
PUSH AX
|
||||
CALL BCD2_PKT
|
||||
XOR EAX,EAX
|
||||
CALL BCD2_PKT
|
||||
|
||||
POP AX //cnt
|
||||
SHL EAX,10
|
||||
MOV EBX,EAX
|
||||
|
||||
@@10: CALL BCD2_WAIT_DRQ
|
||||
|
||||
XOR ECX,ECX
|
||||
MOV DX,SI
|
||||
ADD DX,IDE_HCYL_REG
|
||||
IN AL,DX
|
||||
MOV CH,AL
|
||||
MOV DX,SI
|
||||
ADD DX,IDE_LCYL_REG
|
||||
IN AL,DX
|
||||
MOV CL,AL
|
||||
SHR1 CX
|
||||
JZ @@10
|
||||
CMP CX,0x7F00
|
||||
JB @@20
|
||||
MOV CX,0x7F00
|
||||
@@20: PUSH CX
|
||||
MOV DX,SI
|
||||
ADD DX,IDE_DATA_REG
|
||||
REP_INSW
|
||||
|
||||
MOV AX,DI
|
||||
SHR AX,4
|
||||
MOV DX,AX
|
||||
MOV AX,ES
|
||||
ADD AX,DX
|
||||
MOV ES,AX
|
||||
AND DI,0xF
|
||||
|
||||
POP CX
|
||||
SUB EBX,ECX
|
||||
JZ @@100 //TODO look-up branch
|
||||
JNC @@10
|
||||
|
||||
@@100: CALL BCD2_WAIT_NOT_BUSY
|
||||
|
||||
MOV AX,SI
|
||||
SHL EAX,16
|
||||
MOV AH,U1 [BCD2_UNIT_VALUE+1]
|
||||
MOV AL,BOOT_CODE_CDROM
|
||||
MOV EBX,EAX
|
||||
|
||||
DU1 0xEA;
|
||||
BCD2_JMP_START::
|
||||
DU2 0,BOOT_ADDRESS/16;
|
||||
BCD2_END::
|
||||
END
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,185 @@
|
||||
//This only boots to primary IDE, unit 0
|
||||
asm {
|
||||
#define BOOT_ADDRESS 0x040000
|
||||
#define BLK_SIZE 0x200
|
||||
#define LT_XSUM 0xA5CF3796
|
||||
#define BOOT_HIGH_LOC ((0xA0000-2*BLK_SIZE)>>4)
|
||||
|
||||
#define BOOT_CODE_FLOPPY 1
|
||||
#define BOOT_CODE_HARDDRIVE 2
|
||||
#define BOOT_CODE_CDROM 3
|
||||
#define BOOT_CODE_RAM 4
|
||||
|
||||
#define WIN_MULTREAD 0xC4 /* read sectors using multiple mode*/
|
||||
#define WIN_DEV_RESET 0x08
|
||||
#define WIN_READ_NATIVE_MAX 0xF8
|
||||
#define WIN_SET_MAX 0xF9
|
||||
|
||||
#define ERR_STAT 0x01
|
||||
#define INDEX_STAT 0x02
|
||||
#define ECC_STAT 0x04 /* Corrected error */
|
||||
#define DRQ_STAT 0x08
|
||||
#define SEEK_STAT 0x10
|
||||
#define WRERR_STAT 0x20
|
||||
#define READY_STAT 0x40
|
||||
#define BUSY_STAT 0x80
|
||||
|
||||
#define BAD_R_STAT (BUSY_STAT | ERR_STAT)
|
||||
#define BAD_W_STAT (BAD_R_STAT | WRERR_STAT)
|
||||
#define BAD_STAT (BAD_R_STAT | DRQ_STAT)
|
||||
#define DRIVE_READY (READY_STAT | SEEK_STAT)
|
||||
#define DATA_READY (DRQ_STAT)
|
||||
|
||||
#define IDE_BASE0 0x1F0
|
||||
#define IDE_BASE1 0x3F6
|
||||
|
||||
#define IDE_DATA_REG (IDE_BASE0+0)
|
||||
#define IDE_FEATURE_REG (IDE_BASE0+1)
|
||||
#define IDE_NSECTOR_REG (IDE_BASE0+2)
|
||||
#define IDE_SECTOR_REG (IDE_BASE0+3)
|
||||
#define IDE_LCYL_REG (IDE_BASE0+4)
|
||||
#define IDE_HCYL_REG (IDE_BASE0+5)
|
||||
#define IDE_SELECT_REG (IDE_BASE0+6)
|
||||
#define IDE_STATUS (IDE_BASE0+7)
|
||||
#define IDE_CMD (IDE_BASE0+7)
|
||||
#define IDE_CONTROL_REG (IDE_BASE1+0)
|
||||
|
||||
|
||||
USE16
|
||||
BHD2_START::
|
||||
DU1 32 DUP(0);
|
||||
BHD2_CODE::
|
||||
CLI
|
||||
CLD
|
||||
MOV AX,BOOT_HIGH_LOC
|
||||
MOV SS,AX
|
||||
MOV ES,AX
|
||||
MOV SP,2*BLK_SIZE
|
||||
CALL U2 GET_IP
|
||||
GET_IP:
|
||||
POP BX
|
||||
SUB BX,GET_IP
|
||||
SHR BX,4
|
||||
MOV AX,CS //COPY HIGH
|
||||
ADD AX,BX
|
||||
MOV DS,AX
|
||||
MOV CX,BLK_SIZE
|
||||
XOR SI,SI
|
||||
XOR DI,DI
|
||||
REP_MOVSB
|
||||
|
||||
DU1 0xEA;
|
||||
DU2 BHD2_HISTART,BOOT_HIGH_LOC;
|
||||
|
||||
BHD2_WAIT_BUSY:
|
||||
MOV DX,IDE_STATUS
|
||||
IN AL,DX
|
||||
AND AL,BUSY_STAT
|
||||
JNZ BHD2_WAIT_BUSY
|
||||
RET
|
||||
|
||||
BHD2_ATA_CMD:
|
||||
PUSH AX
|
||||
MOV DX,IDE_FEATURE_REG
|
||||
XOR AL,AL
|
||||
OUT DX,AL
|
||||
POP AX
|
||||
MOV DX,IDE_CMD
|
||||
OUT DX,AL
|
||||
RET
|
||||
|
||||
BHD2_SELECT:
|
||||
MOV DX,IDE_SELECT_REG
|
||||
MOV AL,0xE0 //Unit 0
|
||||
OUT DX,AL
|
||||
RET
|
||||
|
||||
BHD2_BLK:: DU4 ?;
|
||||
|
||||
|
||||
BHD2_HISTART:
|
||||
//Init Drive
|
||||
CALL BHD2_SELECT
|
||||
MOV AL,WIN_DEV_RESET
|
||||
CALL BHD2_ATA_CMD
|
||||
CALL BHD2_WAIT_BUSY
|
||||
|
||||
CALL BHD2_SELECT
|
||||
MOV AL,WIN_READ_NATIVE_MAX
|
||||
CALL BHD2_ATA_CMD
|
||||
CALL BHD2_WAIT_BUSY
|
||||
|
||||
MOV DX,IDE_CONTROL_REG
|
||||
MOV AL,8
|
||||
OUT DX,AL
|
||||
MOV DX,IDE_SECTOR_REG
|
||||
XOR AL,AL
|
||||
OUT DX,AL
|
||||
MOV DX,IDE_NSECTOR_REG
|
||||
OUT DX,AL
|
||||
MOV DX,IDE_LCYL_REG
|
||||
OUT DX,AL
|
||||
MOV DX,IDE_HCYL_REG
|
||||
OUT DX,AL
|
||||
MOV DX,IDE_SELECT_REG
|
||||
OR AL,0xEF //Unit 0
|
||||
OUT DX,AL
|
||||
|
||||
MOV AL,WIN_SET_MAX
|
||||
CALL BHD2_ATA_CMD
|
||||
CALL BHD2_WAIT_BUSY
|
||||
|
||||
BHD2_RESTART::
|
||||
MOV CX,512 //Gets patched
|
||||
MOV AX,BOOT_ADDRESS/16
|
||||
MOV ES,AX
|
||||
|
||||
@@1: XOR DI,DI
|
||||
PUSH CX
|
||||
|
||||
//READ BLK
|
||||
MOV DX,IDE_CONTROL_REG
|
||||
MOV AL,8
|
||||
OUT DX,AL
|
||||
MOV DX,IDE_SECTOR_REG
|
||||
MOV AL,U1 [BHD2_BLK]
|
||||
OUT DX,AL
|
||||
MOV DX,IDE_NSECTOR_REG
|
||||
MOV AL,1 //Blk Cnt
|
||||
OUT DX,AL
|
||||
MOV DX,IDE_LCYL_REG
|
||||
MOV AL,U1 [BHD2_BLK+1]
|
||||
OUT DX,AL
|
||||
MOV DX,IDE_HCYL_REG
|
||||
MOV AL,U1 [BHD2_BLK+2]
|
||||
OUT DX,AL
|
||||
MOV DX,IDE_SELECT_REG
|
||||
MOV AL,U1 [BHD2_BLK+3]
|
||||
OR AL,0xE0 //Unit 0
|
||||
OUT DX,AL
|
||||
MOV AL,WIN_MULTREAD
|
||||
CALL BHD2_ATA_CMD
|
||||
|
||||
MOV DX,IDE_STATUS
|
||||
@@10: IN AL,DX
|
||||
AND AL,DATA_READY
|
||||
JZ @@10
|
||||
MOV CX,BLK_SIZE/2
|
||||
MOV DX,IDE_DATA_REG
|
||||
REP_INSW
|
||||
CALL BHD2_WAIT_BUSY
|
||||
|
||||
POP CX
|
||||
INC U4 [BHD2_BLK]
|
||||
MOV AX,ES
|
||||
ADD AX,BLK_SIZE/16
|
||||
MOV ES,AX
|
||||
LOOP @@1
|
||||
|
||||
MOV EBX,BOOT_CODE_HARDDRIVE
|
||||
DU1 0xEA;
|
||||
BHD2_JMP_START::
|
||||
DU2 0,BOOT_ADDRESS/16;
|
||||
BHD2_END::
|
||||
END
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1078
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,270 @@
|
||||
public I8 PopUpReplaceSkipAllCancelEdit(I1 *msg)
|
||||
{
|
||||
I8 i;
|
||||
Ltf *l=LtfNew;
|
||||
LtfPutS(l,msg);
|
||||
LtfPutS(l,"$$CM +LX, 2,4$$$$BT, \"REPLACE\",0$$");
|
||||
LtfPutS(l,"$$CM +LX, 22,0$$$$BT, \"SKIP\",1$$");
|
||||
LtfPutS(l,"$$CM +LX, 2,4$$$$BT, \"ALL\",2$$");
|
||||
LtfPutS(l,"$$CM +LX, 22,0$$$$BT, \"ABORT ALL\",3$$");
|
||||
LtfPutS(l,"$$CM +LX, 2,4$$$$BT, \"EDIT\",4$$");
|
||||
LtfPutS(l,"$$CM +LX, 22,0$$$$BT, \"ABORT FILE\",5$$");
|
||||
LtfPutS(l,"$$CM +LX, 2,4$$$$BT, \"SKIP FILE\",6$$");
|
||||
i=PopUpMenu(l);
|
||||
LtfDel(l);
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
|
||||
U8 GrepFile(I1 *pattern,I1 *name,U8 *flags,I1 *replace_text)
|
||||
{
|
||||
BoolU4 first_on_line,write_this_file=FALSE,cont=!Bt(flags,FUf_CANCEL);
|
||||
I1 *src,*dst,*dst2,*name_buf=NULL;
|
||||
U8 ss_flags;
|
||||
Ltf *l=LtfRead(name, LTFF_PLAIN_TEXT_WITH_TABS | LTFF_NO_CURSOR);
|
||||
LtfEntry *cl;
|
||||
I8 i,j,plen,rlen,dlen;
|
||||
U8 cnt=0;
|
||||
|
||||
ss_flags=(Bt(flags,FUf_IGNORE)) ? SS_IGNORE_CASE :0;
|
||||
if (Bt(flags,FUf_LABEL))
|
||||
ss_flags|=SS_WHOLE_LABELS;
|
||||
|
||||
plen=StrLen(pattern);
|
||||
if (replace_text)
|
||||
rlen=StrLen(replace_text);
|
||||
cl=l->dummy.next;
|
||||
while (cl!=l && cont) {
|
||||
if (cl->btype==LTFT_TEXT) {
|
||||
src=cl->display;
|
||||
first_on_line=TRUE;
|
||||
while (src && cont) {
|
||||
if (src=SearchString(src,pattern,ss_flags)) {
|
||||
cnt++;
|
||||
if (first_on_line || Bt(flags,FUf_REPLACE)) {
|
||||
first_on_line=FALSE;
|
||||
PutFileLink(name,cl->y+1,TRUE);
|
||||
name_buf=MSPrintF("%s,%d",name,cl->y+1);
|
||||
PrintF(" %s\r\n",cl->display);
|
||||
}
|
||||
if (Bt(flags,FUf_REPLACE)) {
|
||||
if (Bt(flags,FUf_ALL))
|
||||
i=2;
|
||||
else {
|
||||
i=PopUpReplaceSkipAllCancelEdit("");
|
||||
if (i==3) {
|
||||
Bts(flags,FUf_CANCEL);
|
||||
cont=FALSE;
|
||||
write_this_file=FALSE;
|
||||
} else if (i==2)
|
||||
Bts(flags,FUf_ALL);
|
||||
else if (i==5) {
|
||||
cont=FALSE;
|
||||
write_this_file=FALSE;
|
||||
} else if (i==6)
|
||||
cont=FALSE;
|
||||
}
|
||||
if (!i || i==2) {
|
||||
dlen=StrLen(cl->display);
|
||||
dst=MAlloc(dlen+1+rlen-plen);
|
||||
dst2=dst;
|
||||
j=src-cl->display;
|
||||
for (i=0;i<j;i++)
|
||||
*dst++=cl->display[i];
|
||||
for (i=0;i<rlen;i++)
|
||||
*dst++=replace_text[i];
|
||||
src=dst;
|
||||
for (i=j+plen;i<=dlen;i++)
|
||||
*dst++=cl->display[i];
|
||||
Free(cl->display);
|
||||
cl->display=dst2;
|
||||
PrintF("%12s,%04X*%s\r\n",name,cl->y+1,dst2);
|
||||
write_this_file=TRUE;
|
||||
} else {
|
||||
src++;
|
||||
if (i==4) {
|
||||
Free(name_buf);
|
||||
name_buf=NewString(l->filename.name);
|
||||
l->flags&=~LTFF_NO_CURSOR;
|
||||
l->cur_entry=cl;
|
||||
l->cur_data_col=cl->min_col;
|
||||
LtfWrite(l);
|
||||
LtfDel(l);
|
||||
PrintF("Wrote:%s\r\n",name_buf);
|
||||
Edit(name_buf);
|
||||
l=LtfRead(name_buf, LTFF_PLAIN_TEXT_WITH_TABS);
|
||||
cl=l->cur_entry;
|
||||
if (cl->last!=l) cl=cl->last;
|
||||
src=NULL;
|
||||
write_this_file=FALSE;
|
||||
}
|
||||
}
|
||||
} else
|
||||
src++;
|
||||
Free(name_buf);
|
||||
name_buf=NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
cl=cl->next;
|
||||
}
|
||||
if (write_this_file) {
|
||||
LtfWrite(l);
|
||||
PrintF("Wrote:%s\r\n",l->filename.name);
|
||||
}
|
||||
LtfDel(l);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
U8 GrepList(I1 *pattern,LTDirEntry *tempm1,U8 *flags,I1 *replace_text)
|
||||
{
|
||||
U8 cnt=0;
|
||||
LTDirEntry *tempm2;
|
||||
|
||||
while (tempm1 && !Bt(flags,FUf_CANCEL)) {
|
||||
tempm2=tempm1->next;
|
||||
if (tempm1->attr & LT_ATTR_DIR) {
|
||||
if (tempm1->sub) {
|
||||
PrintF("%S %s\r\n","ST_SCANNING_DIRECTORY",tempm1->full_name);
|
||||
cnt+=GrepList(pattern,tempm1->sub,flags,replace_text);
|
||||
}
|
||||
} else
|
||||
cnt+=GrepFile(pattern,tempm1->full_name,flags,replace_text);
|
||||
DelLTDirEntry(tempm1);
|
||||
tempm1=tempm2;
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
|
||||
public U8 Grep(I1 *pattern,I1 *wild=TEXT_FILE_MASK,I1 *flags="+r+i+l",I1 *replace_text=NULL)
|
||||
|
||||
//This does not do regular expressions--my bad
|
||||
//Anyway, it's good for searching and replacing.
|
||||
//Let's say it stands for global replace ;-)
|
||||
|
||||
//"+r"=recurse
|
||||
//"+i"=ignore case
|
||||
//"+l"=whole labels only.
|
||||
// This will check for a nonlabel character before
|
||||
// and after. If you have a variable, "ll" and don't
|
||||
// want to match words like "will" and "wallow", you
|
||||
// set this flag and it will see that the characters
|
||||
// before or after "ll" are label characters.
|
||||
|
||||
{
|
||||
U8 cnt=0;
|
||||
FlagsStruct f;
|
||||
GetFFlags(&f,"ST_FILE_UTIL_FLAGS",flags);
|
||||
AssignBit(&f.on,FUf_REPLACE,replace_text);
|
||||
cnt+=GrepList(pattern,FindFiles(wild,&f.on),&f.on,replace_text);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
public U8 FileOccurrences(I1 *pattern,I1 *wild=TEXT_FILE_MASK,I1 *flags="+r+i+l")
|
||||
{
|
||||
U8 cnt;
|
||||
BoolU4 old_silent=Silent(TRUE);
|
||||
cnt=Grep(pattern,wild,flags);
|
||||
Silent(old_silent);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
LTDirEntry MCFindMatch(LTDirEntry *pattern,LTDirEntry *list)
|
||||
{
|
||||
while (list) {
|
||||
if (!StrCmp(pattern->name,list->name) && pattern->attr==list->attr)
|
||||
return list;
|
||||
list=list->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void MergeChkList(LTDirEntry *m1,LTDirEntry *m2,U8 *fuf_flags,U8 *df_flags)
|
||||
{
|
||||
I8 i;
|
||||
LTDirEntry *tempm2;
|
||||
while (m1 && !(*df_flags & DF_ABORT_ALL_FILES)) {
|
||||
tempm2=MCFindMatch(m1,m2);
|
||||
if (!tempm2)
|
||||
coutln "Does Not Exist:",m1->full_name;
|
||||
else {
|
||||
if (m1->attr & LT_ATTR_DIR)
|
||||
MergeChkList(m1->sub,tempm2->sub,fuf_flags,df_flags);
|
||||
else {
|
||||
i=m1->datetime-tempm2->datetime;
|
||||
if (AbsI8(i)>LTDATE_FREQ*2) { //Filedates can shift due to conversion
|
||||
coutln m1->full_name;
|
||||
if (Bt(fuf_flags,FUf_DIFF)) {
|
||||
if (IsTextFile(m1->full_name))
|
||||
*df_flags=Diff(tempm2->full_name,m1->full_name,*df_flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m1=m1->next;
|
||||
}
|
||||
}
|
||||
|
||||
public void MergeChk(I1 *dst_mask,I1 *src_mask,I1 *flags="+r")
|
||||
//r=recurse
|
||||
//d=diff
|
||||
{
|
||||
U8 df_flags=0;
|
||||
LTDirEntry *tempm1=NULL,*tempm2=NULL;
|
||||
FlagsStruct f;
|
||||
GetFFlags(&f,"ST_FILE_UTIL_FLAGS",flags);
|
||||
coutln "WARNING:This is based strictly on file dates.";
|
||||
tempm1=FindFiles(src_mask,&f.on);
|
||||
tempm2=FindFiles(dst_mask,&f.on);
|
||||
MergeChkList(tempm1,tempm2,&f.on,&df_flags);
|
||||
DelLTDirList(tempm1);
|
||||
DelLTDirList(tempm2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CommMergeChkList(U8 port,LTDirEntry *m1,LTDirEntry *m2,U8 *fuf_flags,U8 *df_flags)
|
||||
{
|
||||
I8 i;
|
||||
LTDirEntry *tempm2;
|
||||
while (m1 && !(*df_flags & DF_ABORT_ALL_FILES)) {
|
||||
tempm2=MCFindMatch(m1,m2);
|
||||
if (!tempm2)
|
||||
coutln "Does Not Exist:",m1->name;
|
||||
else {
|
||||
if (m1->attr & LT_ATTR_DIR)
|
||||
CommMergeChkList(port,m1->sub,tempm2->sub,fuf_flags,df_flags);
|
||||
else {
|
||||
i=m1->datetime-tempm2->datetime;
|
||||
if (AbsI8(i)>LTDATE_FREQ*2) { //Filedates can shift due to conversion
|
||||
coutln m1->name;
|
||||
if (Bt(fuf_flags,FUf_DIFF)) {
|
||||
if (IsTextFile(m1->name))
|
||||
*df_flags=Diff(tempm2->name,m1->name,*df_flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
m1=m1->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//$BK,1$Not Done$BK,0$
|
||||
public void CommMergeChk(U8 port,I1 *dst_mask,I1 *src_mask,I1 *flags="+r")
|
||||
//r=recurse
|
||||
//d=diff
|
||||
{
|
||||
U8 df_flags=0;
|
||||
LTDirEntry *tempm1=NULL,*tempm2=NULL;
|
||||
FlagsStruct f;
|
||||
GetFFlags(&f,"ST_FILE_UTIL_FLAGS",flags);
|
||||
coutln "WARNING:This is based strictly on file dates.";
|
||||
tempm1=FindFiles(src_mask,&f.on);
|
||||
tempm2=FindFiles(dst_mask,&f.on);
|
||||
CommMergeChkList(port,tempm1,tempm2,&f.on,&df_flags);
|
||||
DelLTDirList(tempm1);
|
||||
DelLTDirList(tempm2);
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,207 @@
|
||||
ClassStruct *DbgFindFun(Ltf *l,I8 line_offset=0)
|
||||
{
|
||||
I1 st[256],st2[256],*filename=l->filename.name;
|
||||
I8 line=l->cur_entry->y+1+line_offset;
|
||||
U8 i;
|
||||
SysHashEntry *temph;
|
||||
SysHashTable *h=Fs->hash_table;
|
||||
ClassStruct *tempc;
|
||||
DbgInfo *tempd;
|
||||
while (h) {
|
||||
for (i=0;i<=h->mask;i++) {
|
||||
temph=h->body[i];
|
||||
while (temph) {
|
||||
if (temph->type&HTT_FUNCTION) {
|
||||
tempc=temph;
|
||||
if (tempd=tempc->debug) {
|
||||
StrCpy(st,tempc->source_link);
|
||||
RemoveFirstSeg(st,":",st2);
|
||||
RemoveLastSeg(st,",",st2);
|
||||
if (!StrCmp(st,filename)) {
|
||||
if (line>=tempd->min_line && line<=tempd->max_line)
|
||||
return tempc;
|
||||
}
|
||||
}
|
||||
}
|
||||
temph=temph->next;
|
||||
}
|
||||
}
|
||||
h=h->next;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void WatchLocals()
|
||||
{
|
||||
TssStruct *tss=Fs->parent_tss,*dbg_tss=tss->dbg_tss;
|
||||
Ltf *l;
|
||||
ClassStruct *tempc;
|
||||
U8 j,sc,ch;
|
||||
while (TRUE) {
|
||||
// PutS("$$CL$$");
|
||||
LtfBottom(Fs->cur_ltf);
|
||||
if (l=dbg_tss->cur_ltf) {
|
||||
if (tempc=DbgFindFun(l,0)) {
|
||||
Preempt(OFF);
|
||||
ClassRep2(Fs->cur_ltf,tss->ebp,tempc->string,0,HTT_FUNCTION);
|
||||
Preempt(ON);
|
||||
}
|
||||
}
|
||||
if (ScanChar(&sc,&ch)) {
|
||||
j=jiffies+JIFFY_FREQ*5;
|
||||
LtfPutChar(Fs->cur_ltf,ch,sc,TRUE);
|
||||
do {
|
||||
if (ch==CH_CTRLQ || ch==CH_ESC) Exit;
|
||||
if (ScanChar(&sc,&ch)) {
|
||||
j=jiffies+JIFFY_FREQ*5;
|
||||
LtfPutChar(Fs->cur_ltf,ch,sc,TRUE);
|
||||
}
|
||||
Sleep(100);
|
||||
} while (jiffies<j);
|
||||
} else
|
||||
Sleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Dbg()
|
||||
{
|
||||
// TssStruct *tss;
|
||||
|
||||
Fs->dbg_tss=Spawn(&UserCmdLine,"Debug",Fs);
|
||||
|
||||
/*** Not ready for prime time
|
||||
tss=Spawn(&ServantUserCmdLine,"WATCH TASK",Fs);
|
||||
while (!Bt(&tss->task_flags,TSSf_IDLE))
|
||||
SwapInNext;
|
||||
Bts(&tss->crt_flags,CRTf_SHOW);
|
||||
QueueTaskRequest(tss,Fs,"WatchLocals;",(1<<TSSCf_EXIT_ON_COMPLETE));
|
||||
****/
|
||||
}
|
||||
|
||||
|
||||
void ToggleBpt(Ltf *l,I8 line_offset=0,U8 flags=SBPTF_BPT)
|
||||
{
|
||||
I1 st[256],st2[256],*filename=l->filename.name;
|
||||
I8 line=l->cur_entry->y+1+line_offset;
|
||||
SysHashEntry *temph;
|
||||
SysHashTable *h=Fs->hash_table;
|
||||
ClassStruct *tempc;
|
||||
U8 i,a;
|
||||
DbgInfo *tempd;
|
||||
LtfEntry *ll;
|
||||
while (h) {
|
||||
for (i=0;i<=h->mask;i++) {
|
||||
temph=h->body[i];
|
||||
while (temph) {
|
||||
if (temph->type&HTT_FUNCTION) {
|
||||
tempc=temph;
|
||||
if (tempd=tempc->debug) {
|
||||
StrCpy(st,tempc->source_link);
|
||||
RemoveFirstSeg(st,":",st2);
|
||||
RemoveLastSeg(st,",",st2);
|
||||
if (!StrCmp(st,filename)) {
|
||||
if (line>=tempd->min_line && line<=tempd->max_line) {
|
||||
a=tempd->body[line-tempd->min_line];
|
||||
ll=l->cur_entry;
|
||||
while (ll->last->btype!=LTFT_CR &&
|
||||
ll->last->btype!=LTFT_SOFT_CR &&
|
||||
ll->last!=l)
|
||||
ll=ll->last;
|
||||
l->cur_entry=ll;
|
||||
l->cur_data_col=ll->min_col;
|
||||
if (flags==SBPTF_BPT) {
|
||||
if (!RBpt(Fs->parent_tss,a)) {
|
||||
SBpt(Fs->parent_tss,a,flags);
|
||||
Auto("$$BP$$");
|
||||
} else {
|
||||
if (ll->btype==LTFT_BPT) {
|
||||
l->cur_entry=ll->next;
|
||||
l->cur_data_col=l->cur_entry->min_col;
|
||||
RemQue(ll);
|
||||
LtfDelEntry(ll,l->mem_tss);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!FindBpt(Fs->parent_tss,a,ALL_MASK,FALSE))
|
||||
SBpt(Fs->parent_tss,a,flags);
|
||||
}
|
||||
if (line_offset) {
|
||||
l->x=0;
|
||||
l->y=line-1;
|
||||
LtfUpdateWindowJoin(l,FALSE,FALSE,FALSE,TRUE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
temph=temph->next;
|
||||
}
|
||||
}
|
||||
h=h->next;
|
||||
}
|
||||
}
|
||||
|
||||
void ClearAllBpts(Ltf *l)
|
||||
{
|
||||
LtfEntry *ll,*ll2;
|
||||
CBpt(Fs->parent_tss);
|
||||
ll=l->dummy.next;
|
||||
while (ll!=l) {
|
||||
ll2=ll->next;
|
||||
if (ll->btype==LTFT_BPT) {
|
||||
if (l->cur_entry==ll) {
|
||||
l->cur_entry=ll->next;
|
||||
l->cur_data_col=l->cur_entry->min_col;
|
||||
}
|
||||
RemQue(ll);
|
||||
LtfDelEntry(ll,l->mem_tss);
|
||||
}
|
||||
ll=ll2;
|
||||
}
|
||||
}
|
||||
|
||||
void LtfGo() //Continue after breakpoint
|
||||
{
|
||||
TssStruct *tss=Fs->parent_tss;
|
||||
U4 *eip=&tss->eip;
|
||||
CBpt(tss,SBPTF_STEP);
|
||||
*eip-=1;
|
||||
DBpt(tss,*eip);
|
||||
Btr(&tss->task_flags,TSSf_SUSPENDED);
|
||||
}
|
||||
|
||||
public void Go() //Continue after breakpoint
|
||||
{
|
||||
LtfGo;
|
||||
Exit;
|
||||
}
|
||||
|
||||
public void Step() //Single step (ASM)
|
||||
{
|
||||
TssStruct *tss=Fs->parent_tss;
|
||||
U4 *eip=&tss->eip;
|
||||
I1 buf[256];
|
||||
U8 my_eip;
|
||||
CBpt(tss,SBPTF_STEP);
|
||||
*eip-=1;
|
||||
DBpt(tss,*eip);
|
||||
my_eip=*eip;
|
||||
DasmIns(buf,&my_eip); //get addr of next ins start
|
||||
SBpt(tss,my_eip,SBPTF_STEP);
|
||||
Btr(&tss->task_flags,TSSf_SUSPENDED);
|
||||
Exit;
|
||||
}
|
||||
|
||||
void LtfStep(Ltf *l) //Single step
|
||||
{
|
||||
TssStruct *tss=Fs->parent_tss;
|
||||
U4 *eip=&tss->eip;
|
||||
CBpt(tss,SBPTF_STEP);
|
||||
*eip-=1;
|
||||
DBpt(tss,*eip);
|
||||
ToggleBpt(l,1,SBPTF_STEP);
|
||||
Btr(&tss->task_flags,TSSf_SUSPENDED);
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user