Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Builder/Windows/XM8.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,10 @@
<ClCompile Include="..\..\Source\ePC-8801MA\vm\i8251.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\i8253.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\i8255.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\pc8801\pc88.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\pc8801\pc8801.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\pcm1bit.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\pc8801\pc88.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\pc8801\pc8801.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\noise.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\pcm1bit.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\upd1990a.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\upd765a.cpp" />
<ClCompile Include="..\..\Source\ePC-8801MA\vm\z80.cpp" />
Expand Down Expand Up @@ -416,9 +417,10 @@
<ClInclude Include="..\..\Source\ePC-8801MA\vm\i8251.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\i8253.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\i8255.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\pc8801\pc88.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\pc8801\pc8801.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\pcm1bit.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\pc8801\pc88.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\pc8801\pc8801.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\noise.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\pcm1bit.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\upd1990a.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\upd765a.h" />
<ClInclude Include="..\..\Source\ePC-8801MA\vm\vm.h" />
Expand Down Expand Up @@ -452,4 +454,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
20 changes: 13 additions & 7 deletions Builder/Windows/XM8.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,12 @@
<ClCompile Include="..\..\Source\ePC-8801MA\vm\pc8801\pc88.cpp">
<Filter>ソース ファイル\ePC-8801MA\vm\pc8801</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\ePC-8801MA\vm\pc8801\pc8801.cpp">
<Filter>ソース ファイル\ePC-8801MA\vm\pc8801</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\ePC-8801MA\vm\pc8801\pc8801.cpp">
<Filter>ソース ファイル\ePC-8801MA\vm\pc8801</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\ePC-8801MA\vm\noise.cpp">
<Filter>ソース ファイル\ePC-8801MA\vm</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\UI\emu.cpp">
<Filter>ソース ファイル\UI</Filter>
</ClCompile>
Expand Down Expand Up @@ -236,9 +239,12 @@
<ClInclude Include="..\..\Source\ePC-8801MA\vm\device.h">
<Filter>ヘッダー ファイル\ePC-8801MA\vm</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\ePC-8801MA\vm\pc8801\pc8801.h">
<Filter>ヘッダー ファイル\ePC-8801MA\vm\pc8801</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\ePC-8801MA\vm\pc8801\pc8801.h">
<Filter>ヘッダー ファイル\ePC-8801MA\vm\pc8801</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\ePC-8801MA\vm\noise.h">
<Filter>ヘッダー ファイル\ePC-8801MA\vm</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\UI\emu_sdl.h">
<Filter>ヘッダー ファイル\UI</Filter>
</ClInclude>
Expand Down Expand Up @@ -332,4 +338,4 @@
<Filter>リソース ファイル</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
</Project>
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ set(SRCS
Source/ePC-8801MA/vm/i8255.cpp
Source/ePC-8801MA/vm/disksub.cpp
Source/ePC-8801MA/vm/pcm1bit.cpp
Source/ePC-8801MA/vm/noise.cpp
Source/ePC-8801MA/vm/upd765a.cpp
Source/ePC-8801MA/vm/upd1990a.cpp
Source/ePC-8801MA/vm/fmsound.cpp
Expand Down Expand Up @@ -238,4 +239,4 @@ if(ENABLE_PACKAGING)
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
include(CPack)
endif()
endif()
83 changes: 65 additions & 18 deletions Source/ePC-8801MA/vm/disk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,8 @@ bool DISK::make_track(int trk, int side)
return true;
}

bool DISK::get_sector(int trk, int side, int index)
{
bool DISK::get_sector(int trk, int side, int index)
{
sector_size.sd = sector_num.sd = 0;
sector = NULL;

Expand Down Expand Up @@ -640,12 +640,38 @@ bool DISK::get_sector(int trk, int side, int index)
data_size.read_2bytes_le_from(t + 14);
t += data_size.sd + 0x10;
}
set_sector_info(t);
return true;
}

void DISK::set_sector_info(uint8 *t)
{
set_sector_info(t);
return true;
}

bool DISK::get_sector_info(int trk, int side, int index, uint8* c, uint8* h, uint8* r, uint8* n, bool* mfm, int* length)
{
if(!get_sector(trk, side, index)) {
return false;
}
if(c != NULL) {
*c = id[0];
}
if(h != NULL) {
*h = id[1];
}
if(r != NULL) {
*r = id[2];
}
if(n != NULL) {
*n = id[3];
}
if(mfm != NULL) {
*mfm = (density == 0x00);
}
if(length != NULL) {
*length = sector_size.sd;
}
return true;
}

void DISK::set_sector_info(uint8 *t)
{
// header info
id[0] = t[0];
id[1] = t[1];
Expand Down Expand Up @@ -685,14 +711,24 @@ void DISK::set_deleted(bool value)
deleted = value;
}

void DISK::set_crc_error(bool value)
{
void DISK::set_crc_error(bool value)
{
if(sector != NULL) {
uint8 *t = sector - 0x10;
t[8] = (t[8] & 0x0f) | (value ? 0xb0 : t[7]); // FIXME: always data crc error ?
}
crc_error = value;
}
crc_error = value;
}

void DISK::set_data_mark_missing()
{
if(sector != NULL) {
uint8 *t = sector - 0x10;
t[8] = (t[8] & 0x0f) | 0xf0;
t[14] = t[15] = 0;
}
crc_error = false;
}

bool DISK::format_track(int trk, int side)
{
Expand Down Expand Up @@ -821,19 +857,30 @@ void DISK::trim_buffer()
memcpy(buffer, tmp_buffer, file_size.d);
}

int DISK::get_rpm()
{
int DISK::get_rpm()
{
if(drive_rpm != 0) {
return drive_rpm;
} else if(inserted) {
return (media_type == MEDIA_TYPE_2HD) ? 360 : 300;
} else {
return (drive_type == DRIVE_TYPE_2HD) ? 360 : 300;
}
}

int DISK::get_track_size()
{
}

int DISK::get_max_tracks()
{
if(drive_type != DRIVE_TYPE_UNK) {
return (drive_type != DRIVE_TYPE_2D) ? 84 : 42;
} else if(inserted) {
return (media_type != MEDIA_TYPE_2D) ? 84 : 42;
} else {
return 84;
}
}

int DISK::get_track_size()
{
if(inserted) {
return media_type == MEDIA_TYPE_144 ? 12500 : media_type == MEDIA_TYPE_2HD ? 10410 : drive_mfm ? 6250 : 3100;
} else {
Expand Down
22 changes: 17 additions & 5 deletions Source/ePC-8801MA/vm/disk.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,20 @@ class DISK
bool get_track(int trk, int side);
bool make_track(int trk, int side);
bool get_sector(int trk, int side, int index);
bool get_sector_info(int trk, int side, int index, uint8* c, uint8* h, uint8* r, uint8* n, bool* mfm, int* length);
void set_deleted(bool value);
void set_crc_error(bool value);
void set_data_crc_error(bool value)
{
set_crc_error(value);
}

bool format_track(int trk, int side);
void insert_sector(uint8 c, uint8 h, uint8 r, uint8 n, bool deleted, bool crc_error, uint8 fill_data, int length);
void sync_buffer();

void set_data_mark_missing();

bool format_track(int trk, int side);
void insert_sector(uint8 c, uint8 h, uint8 r, uint8 n, bool deleted, bool crc_error, uint8 fill_data, int length);
void sync_buffer();

int get_max_tracks();
int get_rpm();
int get_track_size();
double get_usec_per_track()
Expand All @@ -190,6 +193,15 @@ class DISK
double get_usec_per_bytes(int bytes);
int get_bytes_per_usec(double usec);
bool check_media_type();
bool correct_timing()
{
// Keep current XM8 behavior: standard images use fixed timing path.
return !is_standard_image;
}
bool ignore_crc()
{
return config.ignore_crc;
}

bool inserted;
bool ejected;
Expand Down
Loading