Rewrite of .86F handling code; Applied TheCollector1995's hardware cursor fix.
This commit is contained in:
33
src/disc.h
33
src/disc.h
@@ -74,3 +74,36 @@ extern int drive_type[2];
|
||||
/*Used in the Read A Track command. Only valid for disc_readsector(). */
|
||||
#define SECTOR_FIRST -2
|
||||
#define SECTOR_NEXT -1
|
||||
|
||||
/* Bits 0-3 define byte type, bit 5 defines whether it is a per-track (0) or per-sector (1) byte, if bit 7 is set, the byte is the index hole. */
|
||||
#define BYTE_GAP0 0x00
|
||||
#define BYTE_GAP1 0x10
|
||||
#define BYTE_GAP4 0x20
|
||||
#define BYTE_GAP2 0x40
|
||||
#define BYTE_GAP3 0x50
|
||||
#define BYTE_I_SYNC 0x01
|
||||
#define BYTE_ID_SYNC 0x41
|
||||
#define BYTE_DATA_SYNC 0x51
|
||||
#define BYTE_IAM_SYNC 0x02
|
||||
#define BYTE_IDAM_SYNC 0x42
|
||||
#define BYTE_DATAAM_SYNC 0x52
|
||||
#define BYTE_IAM 0x03
|
||||
#define BYTE_IDAM 0x43
|
||||
#define BYTE_DATAAM 0x53
|
||||
#define BYTE_ID 0x44
|
||||
#define BYTE_DATA 0x54
|
||||
#define BYTE_ID_CRC 0x45
|
||||
#define BYTE_DATA_CRC 0x55
|
||||
|
||||
#define BYTE_INDEX_HOLE 0x80 /* 1 = index hole, 0 = regular byte */
|
||||
#define BYTE_IS_SECTOR 0x40 /* 1 = per-sector, 0 = per-track */
|
||||
#define BYTE_IS_POST_TRACK 0x20 /* 1 = after all sectors, 0 = before or during all sectors */
|
||||
#define BYTE_IS_DATA 0x10 /* 1 = data, 0 = id */
|
||||
#define BYTE_TYPE 0x0F /* 5 = crc, 4 = data, 3 = address mark, 2 = address mark sync, 1 = sync, 0 = gap */
|
||||
|
||||
#define BYTE_TYPE_GAP 0x00
|
||||
#define BYTE_TYPE_SYNC 0x01
|
||||
#define BYTE_TYPE_AM_SYNC 0x02
|
||||
#define BYTE_TYPE_AM 0x03
|
||||
#define BYTE_TYPE_DATA 0x04
|
||||
#define BYTE_TYPE_CRC 0x05
|
||||
|
1113
src/disc_86f.c
1113
src/disc_86f.c
File diff suppressed because it is too large
Load Diff
@@ -4,6 +4,7 @@
|
||||
#include "ibm.h"
|
||||
#include "disc.h"
|
||||
#include "disc_sector.h"
|
||||
#include "fdc.h"
|
||||
#include "fdd.h"
|
||||
|
||||
/*Handling for 'sector based' image formats (like .IMG) as opposed to 'stream based' formats (eg .FDI)*/
|
||||
@@ -170,39 +171,6 @@ int id_positions[2][2][MAX_SECTORS];
|
||||
/* 4 = ISO, 0 = IBM */
|
||||
int media_type = 0;
|
||||
|
||||
/* Bits 0-3 define byte type, bit 5 defines whether it is a per-track (0) or per-sector (1) byte, if bit 7 is set, the byte is the index hole. */
|
||||
#define BYTE_GAP0 0x00
|
||||
#define BYTE_GAP1 0x10
|
||||
#define BYTE_GAP4 0x20
|
||||
#define BYTE_GAP2 0x40
|
||||
#define BYTE_GAP3 0x50
|
||||
#define BYTE_I_SYNC 0x01
|
||||
#define BYTE_ID_SYNC 0x41
|
||||
#define BYTE_DATA_SYNC 0x51
|
||||
#define BYTE_IAM_SYNC 0x02
|
||||
#define BYTE_IDAM_SYNC 0x42
|
||||
#define BYTE_DATAAM_SYNC 0x52
|
||||
#define BYTE_IAM 0x03
|
||||
#define BYTE_IDAM 0x43
|
||||
#define BYTE_DATAAM 0x53
|
||||
#define BYTE_ID 0x44
|
||||
#define BYTE_DATA 0x54
|
||||
#define BYTE_ID_CRC 0x45
|
||||
#define BYTE_DATA_CRC 0x55
|
||||
|
||||
#define BYTE_INDEX_HOLE 0x80 /* 1 = index hole, 0 = regular byte */
|
||||
#define BYTE_IS_SECTOR 0x40 /* 1 = per-sector, 0 = per-track */
|
||||
#define BYTE_IS_POST_TRACK 0x20 /* 1 = after all sectors, 0 = before or during all sectors */
|
||||
#define BYTE_IS_DATA 0x10 /* 1 = data, 0 = id */
|
||||
#define BYTE_TYPE 0x0F /* 5 = crc, 4 = data, 3 = address mark, 2 = address mark sync, 1 = sync, 0 = gap */
|
||||
|
||||
#define BYTE_TYPE_GAP 0x00
|
||||
#define BYTE_TYPE_SYNC 0x01
|
||||
#define BYTE_TYPE_AM_SYNC 0x02
|
||||
#define BYTE_TYPE_AM 0x03
|
||||
#define BYTE_TYPE_DATA 0x04
|
||||
#define BYTE_TYPE_CRC 0x05
|
||||
|
||||
#define GAP3_LEN_VARIABLE 0x1B
|
||||
|
||||
int gap3_sizes[3][2] = { {74, 36}, {77, 77}, {60, 60} };
|
||||
|
@@ -777,7 +777,6 @@ bad_command:
|
||||
fdc.dtl = 4000000;
|
||||
fdc.format_sectors = fdc.params[2];
|
||||
fdc.format_n = fdc.params[1];
|
||||
if ((fdc.format_sectors == 18) && (fdc.format_n == 2)) fatal("Deliberate fatal\n");
|
||||
fdc.format_state = 1;
|
||||
fdc.pos = 0;
|
||||
fdc.stat = 0x30;
|
||||
|
14
src/fdc.h
14
src/fdc.h
@@ -14,6 +14,7 @@ void fdc_discchange_clear(int drive);
|
||||
void fdc_set_dskchg_activelow();
|
||||
void fdc_3f1_enable(int enable);
|
||||
void fdc_set_ps1();
|
||||
int fdc_get_bit_rate();
|
||||
int fdc_get_bitcell_period();
|
||||
|
||||
/* A few functions to communicate between Super I/O chips and the FDC. */
|
||||
@@ -27,3 +28,16 @@ void fdc_update_densel_polarity(int densel_polarity);
|
||||
void fdc_update_densel_force(int densel_force);
|
||||
void fdc_update_drvrate(int drive, int drvrate);
|
||||
void fdc_update_drv2en(int drv2en);
|
||||
|
||||
int fdc_get_format_n();
|
||||
int fdc_is_mfm();
|
||||
double fdc_get_hut();
|
||||
double fdc_get_hlt();
|
||||
void fdc_request_next_sector_id();
|
||||
void fdc_stop_id_request();
|
||||
int fdc_get_gap();
|
||||
int fdc_get_dtl();
|
||||
int fdc_get_format_sectors();
|
||||
|
||||
void fdc_finishread();
|
||||
void fdc_sector_finishread();
|
||||
|
@@ -612,7 +612,7 @@ void svga_poll(void *p)
|
||||
|
||||
if (svga->displine == svga->hwcursor_latch.y+1 && svga->hwcursor_latch.ena && svga->interlace)
|
||||
{
|
||||
svga->hwcursor_on = 64 - svga->hwcursor_latch.yoff;
|
||||
svga->hwcursor_on = 64 - (svga->hwcursor_latch.yoff + 1);
|
||||
svga->hwcursor_oddeven = 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user