Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Everyone has a purpose in life. Perhaps yours is watching television. -- David Letterman


devel / comp.emulators.apple2 / Apple II disk emulation crashes on woz2

SubjectAuthor
o Apple II disk emulation crashes on woz2Jens Gaulke

1
Apple II disk emulation crashes on woz2

<ce493f35-02a8-437d-a2a7-497ee6052970n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=375&group=comp.emulators.apple2#375

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:a05:620a:260a:b0:72b:25b4:565f with SMTP id z10-20020a05620a260a00b0072b25b4565fmr2809454qko.5.1679259708036;
Sun, 19 Mar 2023 14:01:48 -0700 (PDT)
X-Received: by 2002:a05:620a:a99:b0:745:6f89:f10 with SMTP id
v25-20020a05620a0a9900b007456f890f10mr5394839qkg.0.1679259707760; Sun, 19 Mar
2023 14:01:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!diablo1.usenet.blueworldhosting.com!usenet.blueworldhosting.com!85.12.63.49.MISMATCH!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.emulators.apple2
Date: Sun, 19 Mar 2023 14:01:47 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c1:d738:4500:ec18:5fc1:8b50:66d5;
posting-account=4TUghwoAAABnyztYvJrWTUS8WXFc5m26
NNTP-Posting-Host: 2003:c1:d738:4500:ec18:5fc1:8b50:66d5
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ce493f35-02a8-437d-a2a7-497ee6052970n@googlegroups.com>
Subject: Apple II disk emulation crashes on woz2
From: jegali70@gmail.com (Jens Gaulke)
Injection-Date: Sun, 19 Mar 2023 21:01:48 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4208
 by: Jens Gaulke - Sun, 19 Mar 2023 21:01 UTC

Hi there,

I managed to get my disk II emulation working - at least I thought so until I discovered an error.

I decided to start with woz images and started with the file format description on applesauce page to write a routine to setup the track info:

def decode_woz2(self, drivestate, filename):
disk_data = drivestate.disk_data
# Überprüfen, ob die Diskette den richtigen Header hat
woz2 = [0x57, 0x4F, 0x5A, 0x32, 0xFF, 0x0A, 0x0D, 0x0A]
found = True
for i in range (len(woz2)):
if woz2[i] != disk_data[i]:
found = False
if not found:
return
if disk_data[22] == 1:
drivestate.is_write_protected = True
else:
drivestate.is_write_protected = False
# checksum überprüfung fehlt noch
# WOZ 2
for htrack in range(80):
tmap_index = disk_data[88 + htrack*2]
if tmap_index < 255:
tmap_offset = 256 + 8*tmap_index
trk = disk_data[tmap_offset:tmap_offset + 8]
drivestate.track_start[htrack] = 512 * (trk[0] + (trk[1] << 8))
drivestate.track_nbits[htrack] = trk[4] + (trk[5] << 8) + (trk[6] << 16) + (trk[7] << 24)
else:
drivestate.track_start[htrack] = 0
drivestate.track_nbits[htrack] = 51200
return True

def decode_woz1(self, drivestate, filename):
disk_data = drivestate.disk_data
# Überprüfen, ob die Diskette den richtigen Header hat
woz1 = [0x57, 0x4F, 0x5A, 0x31, 0xFF, 0x0A, 0x0D, 0x0A]
found = True
for i in range (len(woz1)):
if woz1[i] != disk_data[i]:
found = False
if not found:
return
if disk_data[22] == 1:
drivestate.is_write_protected = True
else:
drivestate.is_write_protected = False
# checksum überprüfung fehlt noch
# WOZ 1
for htrack in range(80):
tmap_index = disk_data[88 + htrack*2]
if tmap_index < 255:
drivestate.track_start[htrack] = 256 + tmap_index * 6656
trk = disk_data[(drivestate.track_start[htrack]+6646):(drivestate.track_start[htrack]+6656)]
drivestate.track_nbits[htrack] = trk[2] + (trk[3] << 8)
else:
drivestate.track_start[htrack] = 0
drivestate.track_nbits[htrack] = 51200
return True

It works fine for woz1 disks, woz2 disks are read but it seems I get "wrong bytes". The DOS3.3 disk first reads then crashes, a choplifter disk reads the starting picture but with some flashing ascii chars on it before it crashes.

I think my softswitch routines work fine as woz1 images start perfectly, so I think the error must be in decoding the woz2 images.

Do you have any recommendation for me?

Cheers,
Jens

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor