2020-02-15 20:01:48 +00:00
|
|
|
U0 RawAccess(I64 drv_let=0)
|
|
|
|
{
|
2020-12-23 23:27:18 +00:00
|
|
|
CDrive *drive = Letter2Drive(drv_let);
|
|
|
|
CBlkDev *bd = Letter2BlkDev(drv_let);
|
|
|
|
I64 blk, old_offset, old_size;
|
|
|
|
U8 *buf = MAlloc(BLK_SIZE);
|
2020-02-20 23:40:10 +00:00
|
|
|
|
|
|
|
DriveRep;
|
|
|
|
PressAKey;
|
|
|
|
|
|
|
|
ClassRep(drive);
|
|
|
|
PressAKey;
|
|
|
|
|
|
|
|
ClassRep(bd);
|
|
|
|
PressAKey;
|
|
|
|
|
|
|
|
//Temporarily change partition range to full device.
|
|
|
|
//Normally, you are limited to just your partition.
|
|
|
|
//This is obviously $BK,1$dangerous$BK,0$!
|
2020-12-23 23:27:18 +00:00
|
|
|
old_offset =drive->drv_offset;
|
2020-02-20 23:40:10 +00:00
|
|
|
old_size =drive->size;
|
2020-12-23 23:27:18 +00:00
|
|
|
drive->drv_offset = 0;
|
|
|
|
drive->size = bd->max_blk + 1;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
Rename abs_addres to abs_address.
Update documentation/comments to rename addr, fun, var, stmt, blk, desc, reg, seg, ptr, dup, clus, val, and bttn, to address, function, variable, statement, block, description, register, segment, pointer, duplicate, cluster, value, and button, respectively.
2021-10-07 02:35:32 +01:00
|
|
|
blk = I64Get("Block to Read: ", old_offset, 0, bd->max_blk);
|
2020-12-23 23:27:18 +00:00
|
|
|
BlkRead(drive, buf, blk, 1);
|
|
|
|
D(buf, BLK_SIZE);
|
|
|
|
}
|
|
|
|
catch
|
2020-02-20 23:40:10 +00:00
|
|
|
PutExcept;
|
|
|
|
|
2020-12-23 23:27:18 +00:00
|
|
|
drive->drv_offset = old_offset;
|
|
|
|
drive->size = old_size;
|
2020-02-20 23:40:10 +00:00
|
|
|
|
|
|
|
Free(buf);
|
2020-02-15 20:01:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
RawAccess;
|
|
|
|
|
2020-02-15 22:53:02 +00:00
|
|
|
//See $LK,"BlkRead",A="MN:BlkRead"$(), $LK,"BlkWrite",A="MN:BlkWrite"$(), $LK,"DriveLock",A="MN:DriveLock"$(), $LK,"DriveUnlock",A="MN:DriveUnlock"$()
|
2020-02-15 20:01:48 +00:00
|
|
|
//$LK,"DBlk",A="MN:DBlk"$(), $LK,"DClus",A="MN:DClus"$(), $LK,"BlkDevLock",A="MN:BlkDevLock"$() and $LK,"BlkDevUnlock",A="MN:BlkDevUnlock"$().
|