mirror of
https://github.com/paleotronic/diskm8.git
synced 2024-12-21 03:29:58 +00:00
prodos large volumes block mapping fix
This commit is contained in:
parent
2ca1798d95
commit
086a2da973
@ -2,16 +2,14 @@ package disk
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
|
||||
"fmt"
|
||||
)
|
||||
|
||||
//import "math/rand"
|
||||
|
@ -1172,11 +1172,13 @@ func (d *DSKWrapper) PRODOS800ChecksumBlock(b int) string {
|
||||
|
||||
func (d *DSKWrapper) PRODOSGetBlockSectors(block int) (int, int, int) {
|
||||
|
||||
track := block / PRODOS_BLOCKS_PER_TRACK
|
||||
bpt := d.Format.USPT() / 2
|
||||
|
||||
bo := block % PRODOS_BLOCKS_PER_TRACK
|
||||
track := block / bpt
|
||||
|
||||
if d.Layout == SectorOrderProDOSLinear {
|
||||
bo := block % bpt
|
||||
|
||||
if d.Layout == SectorOrderProDOSLinear || len(d.Data) >= PRODOS_800KB_DISK_BYTES {
|
||||
return track, bo * 2, bo*2 + 1
|
||||
}
|
||||
|
||||
@ -1584,6 +1586,8 @@ func (fd *ProDOSFileDescriptor) Publish(dsk *DSKWrapper) error {
|
||||
|
||||
func (dsk *DSKWrapper) PRODOSWrite(b int, data []byte) error {
|
||||
|
||||
//log.Printf("====> Request to write block %.4x", b)
|
||||
|
||||
for len(data) < 512 {
|
||||
data = append(data, 0x00)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user