Skip to content

Commit 2afcb56

Browse files
committed
Revert disk reading, offset does not work
1 parent 7103a75 commit 2afcb56

File tree

8 files changed

+17
-10
lines changed

8 files changed

+17
-10
lines changed

docs/emu6502_web_bg.wasm

27 Bytes
Binary file not shown.

emu6502_web/pkg/emu6502_web_bg.wasm

27 Bytes
Binary file not shown.

emu6502_web/style.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

emulator/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ serde_json = "1.0.140"
2525
crossbeam-epoch = "0.9.18"
2626
ryu = "1.0.20"
2727
autocfg = "1.4.0"
28-
crossbeam-channel = "0.5.14"
28+
crossbeam-channel = "0.5.15"
2929
num_cpus = "1.16.0"
3030

3131
[features]

emulator/src/cpu.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3136,7 +3136,7 @@ impl CPU {
31363136
}
31373137
}
31383138

3139-
/* TRB */
3139+
/* TSB */
31403140
0x04 | 0x0c => {
31413141
if self.m65c02 {
31423142
self.tsb(opcode);

emulator/src/disk.rs

+12-5
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,9 @@ impl DiskDrive {
18551855

18561856
// If crc32 checksum is not zero, check the crc32 value
18571857
if crc32_check != 0 && crc32_value != crc32_check {
1858-
let err_message = format!("Invalid woz2 file - Checksum Failed ({crc32_value:08X}))");
1858+
let crc32_value_be = crc32_value.to_be();
1859+
let err_message =
1860+
format!("Invalid woz2 file - Checksum Failed ({crc32_value_be:08X}))");
18591861
return Err(std::io::Error::new(
18601862
io::ErrorKind::InvalidInput,
18611863
err_message,
@@ -2322,8 +2324,10 @@ impl DiskDrive {
23222324
disk.last_track = disk.track;
23232325
let read_pulse = Self::read_flux_data(disk);
23242326
//let optimal_timing = (disk.optimal_timing as f32 + disk_jitter) / 8.0;
2327+
2328+
let offset = 0;
23252329
let optimal_timing = if !self.q7 {
2326-
disk.optimal_timing as isize * 1000 - 1
2330+
disk.optimal_timing as isize * 1000 + offset
23272331
} else {
23282332
// Writing is always at 4 microseconds
23292333
32 * 1000
@@ -2355,7 +2359,7 @@ impl DiskDrive {
23552359
}
23562360

23572361
self.lss_cycle -= optimal_timing;
2358-
let delay = optimal_timing - (32 * 1000 - 1);
2362+
let delay = optimal_timing - (32 * 1000 + offset);
23592363
if delay < 0 && self.pulse > 0 {
23602364
self.lss_cycle += delay
23612365
}
@@ -2709,9 +2713,12 @@ impl Card for DiskDrive {
27092713
LOC_DRIVEREADMODE => {
27102714
self.q7 = false;
27112715

2712-
// Latch is cleared to make Epidemic works
2713-
self.latch = 0;
2716+
// Workaround to make Epidemic works
2717+
if !self.q6 {
2718+
self.latch = 0;
2719+
}
27142720
}
2721+
27152722
LOC_DRIVEWRITEMODE => {
27162723
self.q7 = true;
27172724
}

sdl_frontend/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ sdl2 = "0.37.0"
2929

3030
[build-dependencies]
3131
embed-resource = "3.0.2"
32-
cc = "1.2.18"
32+
cc = "1.2.19"
3333

3434
[features]
3535
#default = [ ]

self_test/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ emu6502 = { path = "../emulator" }
1010

1111
[target.x86_64-unknown-linux-gnu.dependencies]
1212
pprof = { version = "0.14.0", features = ["flamegraph","protobuf-codec"] }
13-
symbolic-demangle = "12.14.1"
13+
symbolic-demangle = "12.15.3"
1414
inferno = "0.12.2"
1515

1616
[[bin]]

0 commit comments

Comments
 (0)