Procházet zdrojové kódy

emul/8086/pcat: fix broken int13h logic

I had forgotten that heads index increment before track index.
master
Virgil Dupras před 3 roky
rodič
revize
5a77b80d3d
2 změnil soubory, kde provedl 5 přidání a 5 odebrání
  1. +4
    -4
      emul/8086/pcat.c
  2. +1
    -1
      recipes/pcat/blk/607

+ 4
- 4
emul/8086/pcat.c Zobrazit soubor

@@ -6,8 +6,8 @@

#define WCOLS 80
#define WLINES 25
#define SEC_PER_TRK 0x3f
#define TRK_PER_HEAD 0xff
#define SEC_PER_TRK 0x24
#define HEADCNT 2

extern uint8_t byteregtable[8];
extern union _bytewordregs_ regs;
@@ -49,7 +49,7 @@ static void int13() {
// CL = sector number (1-based), AL = sector count
// DH = head number, CH = track number
// ES:BX = dest addr
fseek(fp, ((((dh*TRK_PER_HEAD)+ch)*SEC_PER_TRK)+cl-1)*512, SEEK_SET);
fseek(fp, (((ch*HEADCNT*SEC_PER_TRK)+(dh*SEC_PER_TRK))+cl-1)*512, SEEK_SET);
for (int i=0; i<(al*512); i++) {
if (cmd == 0x03) { // write
fputc(getmem8(segregs[reges], bx+i), fp);
@@ -62,7 +62,7 @@ static void int13() {
case 0x08: // poll sectors per track / per head
// we just report a lot of them
regs.wordregs[regcx] = SEC_PER_TRK;
regs.byteregs[regdh] = TRK_PER_HEAD-1;
regs.byteregs[regdh] = HEADCNT-1;
break;
}
}


+ 1
- 1
recipes/pcat/blk/607 Zobrazit soubor

@@ -2,7 +2,7 @@
( AH=read sectors, AL=1 sector, BX=dest,
CH=trackno CL=secno DH=head DL=drive )
FDSPT C@ /MOD ( AX BX sec trk )
FDHEADS C@ /MOD SWAP ( AX BX sec head trk )
FDHEADS C@ /MOD ( AX BX sec head trk )
8 LSHIFT ROT OR 1+ ( AX BX head CX )
SWAP 8 LSHIFT 0x03 C@ ( boot drive ) OR ( AX BX CX DX )
13H 2DROP 2DROP


Načítá se…
Zrušit
Uložit