Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

You have a message from the operator.


devel / comp.emulators.apple2 / Question concerning Disk II emulation / timing

SubjectAuthor
* Question concerning Disk II emulation / timingJens Gaulke
`* Question concerning Disk II emulation / timingMichael AppleWin Debugger Dev
 +- Question concerning Disk II emulation / timingJens Gaulke
 `* Question concerning Disk II emulation / timingJens Gaulke
  +- Question concerning Disk II emulation / timingD Finnigan
  +* Question concerning Disk II emulation / timingMichael AppleWin Debugger Dev
  |`- Question concerning Disk II emulation / timingpeter....@gmail.com
  `* Question concerning Disk II emulation / timingI am Rob
   `* Question concerning Disk II emulation / timingSteve Nickolas
    `* Question concerning Disk II emulation / timingJens Gaulke
     `- Question concerning Disk II emulation / timingJens Gaulke

1
Question concerning Disk II emulation / timing

<0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:a05:622a:88:b0:3e2:976d:ebe9 with SMTP id o8-20020a05622a008800b003e2976debe9mr1674060qtw.1.1679696510883;
Fri, 24 Mar 2023 15:21:50 -0700 (PDT)
X-Received: by 2002:a81:b645:0:b0:545:7164:49aa with SMTP id
h5-20020a81b645000000b00545716449aamr1802701ywk.1.1679696510429; Fri, 24 Mar
2023 15:21:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!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: Fri, 24 Mar 2023 15:21:50 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c1:d707:a000:e5b4:912e:530d:a75;
posting-account=4TUghwoAAABnyztYvJrWTUS8WXFc5m26
NNTP-Posting-Host: 2003:c1:d707:a000:e5b4:912e:530d:a75
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com>
Subject: Question concerning Disk II emulation / timing
From: jegali70@gmail.com (Jens Gaulke)
Injection-Date: Fri, 24 Mar 2023 22:21:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 19397
 by: Jens Gaulke - Fri, 24 Mar 2023 22:21 UTC

Hi there,

I tried to do Disk II emulation and implemented all softswitches and the functions as far as I understood them from Jim Sather. The only disk image start starts for me is "Apple Galaxian". A standard DOS 3.3 System Master reads some tracks and then crashes with an illegal opcode. What am I missing? Do I have some timing problems in my emulation? Did I not correctly implement the softswitch functions?

I attached my code (I hope the formatting will not be corrupted) and would be really glad to get an answer ...

import random
import pygame
from dataclasses import dataclass
import threading
import math
import re

@dataclass
class DRIVE_STATE:
filename: str
half_track: int
prev_half_track: int
write_mode: bool
current_phase: int
disk_has_changes: bool
motor_running: bool
track_start: list
track_nbits: list
track_location: int
is_write_protected: bool
disk_data: bytearray
status: str

firmware = [0xA2,0x20,0xA0,0x00,0xA2,0x03,0x86,0x3C,0x8A,0x0A,0x24,0x3C,0xF0,0x10,0x05,0x3C,
0x49,0xFF,0x29,0x7E,0xB0,0x08,0x4A,0xD0,0xFB,0x98,0x9D,0x56,0x03,0xC8,0xE8,0x10,
0xE5,0x20,0x58,0xFF,0xBA,0xBD,0x00,0x01,0x0A,0x0A,0x0A,0x0A,0x85,0x2B,0xAA,0xBD,
0x8E,0xC0,0xBD,0x8C,0xC0,0xBD,0x8A,0xC0,0xBD,0x89,0xC0,0xA0,0x50,0xBD,0x80,0xC0,
0x98,0x29,0x03,0x0A,0x05,0x2B,0xAA,0xBD,0x81,0xC0,0xA9,0x56,0xa9,0x00,0xea,0x88,
0x10,0xEB,0x85,0x26,0x85,0x3D,0x85,0x41,0xA9,0x08,0x85,0x27,0x18,0x08,0xBD,0x8C,
0xC0,0x10,0xFB,0x49,0xD5,0xD0,0xF7,0xBD,0x8C,0xC0,0x10,0xFB,0xC9,0xAA,0xD0,0xF3,
0xEA,0xBD,0x8C,0xC0,0x10,0xFB,0xC9,0x96,0xF0,0x09,0x28,0x90,0xDF,0x49,0xAD,0xF0,
0x25,0xD0,0xD9,0xA0,0x03,0x85,0x40,0xBD,0x8C,0xC0,0x10,0xFB,0x2A,0x85,0x3C,0xBD,
0x8C,0xC0,0x10,0xFB,0x25,0x3C,0x88,0xD0,0xEC,0x28,0xC5,0x3D,0xD0,0xBE,0xA5,0x40,
0xC5,0x41,0xD0,0xB8,0xB0,0xB7,0xA0,0x56,0x84,0x3C,0xBC,0x8C,0xC0,0x10,0xFB,0x59,
0xD6,0x02,0xA4,0x3C,0x88,0x99,0x00,0x03,0xD0,0xEE,0x84,0x3C,0xBC,0x8C,0xC0,0x10,
0xFB,0x59,0xD6,0x02,0xA4,0x3C,0x91,0x26,0xC8,0xD0,0xEF,0xBC,0x8C,0xC0,0x10,0xFB,
0x59,0xD6,0x02,0xD0,0x87,0xA0,0x00,0xA2,0x56,0xCA,0x30,0xFB,0xB1,0x26,0x5E,0x00,
0x03,0x2A,0x5E,0x00,0x03,0x2A,0x91,0x26,0xC8,0xD0,0xEE,0xE6,0x27,0xE6,0x3D,0xA5,
0x3D,0xCD,0x00,0x08,0xA6,0x2B,0x90,0xDB,0x4C,0x01,0x08,0x00,0x00,0x00,0x00,0x00]

DEFAULT_VOLUME = 254
NUM_DRIVES = 2
DOS_NUM_SECTORS = 16
DOS_NUM_TRACKS = 35
DOS_TRACK_BYTES = 256 * DOS_NUM_SECTORS
RAW_TRACK_BYTES = 0x1A00
STANDARD_2IMG_HEADER_SIZE = 64
STANDARD_PRODOS_BLOCKS = 280

# diskdata = [0,1][0,35][1a00]

pickbit = [128, 64, 32, 16, 8, 4, 2, 1]
clearbit = [0b01111111, 0b10111111, 0b11011111, 0b11101111, 0b11110111, 0b11111011, 0b1111101, 0b11111110]

class FloppyDisk:

def __init__(self, myApple, slot) -> None:
self.drive = 0
self.is_motor_on = False
self.is_write_protected = [0,1]
#self.disk_data = [[0 for i in range(2*DOS_NUM_TRACKS)], [0 for i in range(2*DOS_NUM_TRACKS)]]
self.curr_phys_track = 0
self.curr_nibble = 0

self.drive_curr_phys_track = [0,0]
self.real_track = [0 for i in range(RAW_TRACK_BYTES+1)]

self.latch_data = 0
self.write_mode = False
self.load_mode = False
self.drive_spin = False

self.gcr_nibble_pos = 0
self.gcr_nibbles = []

pygame.mixer.pre_init(frequency=44100, size=-16, channels=1, allowedchanges=0)
pygame.init()
pygame.mixer.init(frequency=44100, size=-16, channels=1, allowedchanges=0)
self.motor_sound = pygame.mixer.Sound(f'./src_audio_driveMotor.mp3')
self.track_off_end = pygame.mixer.Sound(f'./src_audio_driveTrackOffEnd.mp3')
self.track_seek = pygame.mixer.Sound(f'./src_audio_driveTrackSeek..mp3')

self.setup_firmware(myApple, slot)

self.drive_state = [DRIVE_STATE('', 0, 0, False, 0, False, False, [None]*80, [None]*80, 0, False, self.load_wozdisk(), ""),
DRIVE_STATE('', 0, 0, False, 0, False, False, [None]*80, [None]*80, 0, False, self.load_wozdisk(), "")]

self.reset_drives()

self.disk_data = [self.load_wozdisk(), self.load_wozdisk()]
#arraypart = self.disk_data[0][0:12]
#print (' '.join('{:02x}'.format(x) for x in arraypart))

self.init_diskstates(0,'Dung Beetles.woz')
self.init_diskstates(1,'DOS_3.3_System_Master.woz')

self.SLOT = slot << 4
self.DRVPH0_OFF = 0xC080 + self.SLOT
self.DRVPH0_ON = self.DRVPH0_OFF + 1
self.DRVPH1_OFF = 0xC082 + self.SLOT
self.DRVPH1_ON = self.DRVPH1_OFF + 1
self.DRVPH2_OFF = 0xC084 + self.SLOT
self.DRVPH2_ON = self.DRVPH2_OFF + 1
self.DRVPH3_OFF = 0xC086 + self.SLOT
self.DRVPH3_ON = self.DRVPH3_OFF + 1
self.DRVMOTOR_OFF = 0xC088 + self.SLOT
self.DRVMOTOR_ON = self.DRVMOTOR_OFF + 1
self.DRVSEL_0 = 0xC08A + self.SLOT
self.DRVSEL_1 = self.DRVSEL_0 + 1
self.DRVDATA_SHIFT = 0xC08C + self.SLOT
self.DRVDATA_LOAD = self.DRVDATA_SHIFT + 1
self.DRVREAD = 0xC08E + self.SLOT
self.DRVWRITE = 0xC08F + self.SLOT
self.DRVPH0_isSet = False
self.DRVPH1_isSet = False
self.DRVPH2_isSet = False
self.DRVPH3_isSet = False
self.DRVMOTOR_isSet = False
self.DRVDATA_isSet = False
self.DRVREAD_isSet = False

self.current_drive = 0
self.prev_cycle = 0
self.data_register = 0
self.sm = None

def setup_firmware(self, myApple, slot):
for i in range(0x100):
myApple.memory.ram.write_byte(0xC000 + (slot << 8) + i, firmware[i])

def load_wozdisk(self):
filename = 'DOS_3.3_System_Master.woz'
#filename = 'Dung Beetles.woz'
#filename = 'Apple DOS 3.3 August 1980.woz'
#filename = 'Choplifter.dsk'
#filename = 'Apple_Galaxian.woz'
diskdata = []
with open(filename, "rb") as f:
diskdata = bytearray(f.read())
return diskdata

def reset_drives(self):
#self.stop_motor(0)
#self.stop_motor(1)
self.drive_state[0].half_track = 68
self.drive_state[1].half_track = 68
self.drive_state[0].prev_half_track = 68
self.drive_state[1].prev_half_track = 68

def is_dsk(self, filename):
isdsk = filename.endswith(".dsk") or filename.endswith(".do")
ispo = filename.endswith(".po")
return isdsk | ispo

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


Click here to read the complete article
Re: Question concerning Disk II emulation / timing

<7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:a05:620a:b11:b0:73b:aa08:79ea with SMTP id t17-20020a05620a0b1100b0073baa0879eamr1300865qkg.5.1679751842508;
Sat, 25 Mar 2023 06:44:02 -0700 (PDT)
X-Received: by 2002:a05:6902:709:b0:b21:5fb4:c6e6 with SMTP id
k9-20020a056902070900b00b215fb4c6e6mr2803319ybt.11.1679751842234; Sat, 25 Mar
2023 06:44:02 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.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: Sat, 25 Mar 2023 06:44:01 -0700 (PDT)
In-Reply-To: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:600:c67f:5fc0:ddff:5618:65cb:4769;
posting-account=9Dd-GgoAAAAjVgCPcBurQ6c4EXW6Wi8v
NNTP-Posting-Host: 2601:600:c67f:5fc0:ddff:5618:65cb:4769
References: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com>
Subject: Re: Question concerning Disk II emulation / timing
From: michael.pohoreski@gmail.com (Michael AppleWin Debugger Dev)
Injection-Date: Sat, 25 Mar 2023 13:44:02 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4743
 by: Michael AppleWin Deb - Sat, 25 Mar 2023 13:44 UTC

On Friday, March 24, 2023 at 3:21:51 PM UTC-7, Jens Gaulke wrote:
> I tried to do Disk II emulation and implemented all softswitches and the functions as far as I understood them from Jim Sather. The only disk image start starts for me is "Apple Galaxian". A standard DOS 3.3 System Master reads some tracks and then crashes with an illegal opcode. What am I missing?
Many nights of poring over boot traces. /s

Seriously, the "secret sauce" is nothing more then hard work of logging to tell where things are going off the rails.
i.e.
When you boot DOS 3.3, what are the PC & regs when it crashes? What stage of DOS doe the PC reach? Stage 0? Stage 1? Stage 2?

> Do I have some timing problems in my emulation? Did I not correctly implement the softswitch functions?

The easiest way to debug this would probably be to use a process of elimination as you verify the softswitches one-one by one.

0. Write a small test program to select drive 0, wait, select drive 1, wait to rule our DRVSEL_1 and DRVSEL_2. Yes, this is trivial. Yes, you need to eliminate this.

1. I would then rule out the MOTORON, MOTOROFF. Yes this is again trivial, and yes you need to eliminate this.

2 I would test the four PHASE0..PHASE3 softswitches by writing a small assembly program to move the track outwards 40 tracks and then inwards 40 tracks logging the track number. That leaves four softswitches to test SHIFT, LOAD, READ, WRITE. You don't need to worry about WRITE for now, so this leaves SHIFT, LOAD, and READ.

3. Prepare a "raw disk" so that each of 35 tracks contains nothing but FF filler and only ONE disk nibble of an unique track marker. Modify the utility from step (1) to read the raw 4&4 disk nibble, and step the 35 tracks. This SO question may be helpful as Nick was kind enough to provide some nibble counting code:
https://retrocomputing.stackexchange.com/questions/503/absolute-maximum-number-of-nibbles-on-an-apple-ii-floppy-disk-track/664#664

4. Get .do/.dsk working first before .woz. I don't see your 6&2 decode logic? Have you verified this is correct?

5. You may want to use a "simpler" program to trace. I'm extremely biased so something like Fantavision since I have already written up the boot-tracing :-) but any program/game where you already have boot-tracing notes (say from 4AM) would work.
https://github.com/Michaelangel007/apple2_fantavision_reloaded#ye-olde-boot-tracing

6. I already mentioned the DOS 3.3 System Master above.

7. Use another emulator to debug your emulator. i.e In AppleWin see the disk logging defines, LOG_DISK_PHASES, LOG_DISK_NIBBLES_SPIN, LOG_DISK_NIBBLES_READ, etc. in source/Disk.cpp.

There are also some interesting comments in DataLatchReadWriteWOZ().

> I attached my code (I hope the formatting will not be corrupted)
Unfortunately, Python uses the retarded decision of using whitespace for code blocks which sadly means indentation will usually be completely lost due to HTML defaulting to sequences of white space being collapsed. Do you have a git repository where it is easier to read that python code?

Pro-Tip: (Almost) no one wants to read a dump of code, but we can give you pointers if you share more details of what you have tried and where exactly things have stopped working.

Good luck! Keep us posted as you trace through the issue.

Michael

Re: Question concerning Disk II emulation / timing

<ce633e2e-4e14-4f17-ac2d-07ad7500f9e4n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:ae9:e810:0:b0:746:83a6:5f1a with SMTP id a16-20020ae9e810000000b0074683a65f1amr3727490qkg.15.1680102589979;
Wed, 29 Mar 2023 08:09:49 -0700 (PDT)
X-Received: by 2002:a05:6902:18cd:b0:b78:45fd:5f01 with SMTP id
ck13-20020a05690218cd00b00b7845fd5f01mr11897719ybb.7.1680102589415; Wed, 29
Mar 2023 08:09:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!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: Wed, 29 Mar 2023 08:09:48 -0700 (PDT)
In-Reply-To: <7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c1:d705:a800:e5d7:6c1b:458b:62f6;
posting-account=4TUghwoAAABnyztYvJrWTUS8WXFc5m26
NNTP-Posting-Host: 2003:c1:d705:a800:e5d7:6c1b:458b:62f6
References: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com> <7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ce633e2e-4e14-4f17-ac2d-07ad7500f9e4n@googlegroups.com>
Subject: Re: Question concerning Disk II emulation / timing
From: jegali70@gmail.com (Jens Gaulke)
Injection-Date: Wed, 29 Mar 2023 15:09:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 5003
 by: Jens Gaulke - Wed, 29 Mar 2023 15:09 UTC

On Saturday, March 25, 2023 at 2:44:03 PM UTC+1, Michael AppleWin Debugger Dev wrote:
> On Friday, March 24, 2023 at 3:21:51 PM UTC-7, Jens Gaulke wrote:
> > I tried to do Disk II emulation and implemented all softswitches and the functions as far as I understood them from Jim Sather. The only disk image start starts for me is "Apple Galaxian". A standard DOS 3.3 System Master reads some tracks and then crashes with an illegal opcode. What am I missing?
> Many nights of poring over boot traces. /s
>
> Seriously, the "secret sauce" is nothing more then hard work of logging to tell where things are going off the rails.
> i.e.
> When you boot DOS 3.3, what are the PC & regs when it crashes? What stage of DOS doe the PC reach? Stage 0? Stage 1? Stage 2?
> > Do I have some timing problems in my emulation? Did I not correctly implement the softswitch functions?
> The easiest way to debug this would probably be to use a process of elimination as you verify the softswitches one-one by one.
>
> 0. Write a small test program to select drive 0, wait, select drive 1, wait to rule our DRVSEL_1 and DRVSEL_2. Yes, this is trivial. Yes, you need to eliminate this.
>
> 1. I would then rule out the MOTORON, MOTOROFF. Yes this is again trivial, and yes you need to eliminate this.
>
> 2 I would test the four PHASE0..PHASE3 softswitches by writing a small assembly program to move the track outwards 40 tracks and then inwards 40 tracks logging the track number. That leaves four softswitches to test SHIFT, LOAD, READ, WRITE. You don't need to worry about WRITE for now, so this leaves SHIFT, LOAD, and READ.
>
> 3. Prepare a "raw disk" so that each of 35 tracks contains nothing but FF filler and only ONE disk nibble of an unique track marker. Modify the utility from step (1) to read the raw 4&4 disk nibble, and step the 35 tracks. This SO question may be helpful as Nick was kind enough to provide some nibble counting code:
> https://retrocomputing.stackexchange.com/questions/503/absolute-maximum-number-of-nibbles-on-an-apple-ii-floppy-disk-track/664#664
>
> 4. Get .do/.dsk working first before .woz. I don't see your 6&2 decode logic? Have you verified this is correct?
>
> 5. You may want to use a "simpler" program to trace. I'm extremely biased so something like Fantavision since I have already written up the boot-tracing :-) but any program/game where you already have boot-tracing notes (say from 4AM) would work.
> https://github.com/Michaelangel007/apple2_fantavision_reloaded#ye-olde-boot-tracing
>
> 6. I already mentioned the DOS 3.3 System Master above.
>
> 7. Use another emulator to debug your emulator. i.e In AppleWin see the disk logging defines, LOG_DISK_PHASES, LOG_DISK_NIBBLES_SPIN, LOG_DISK_NIBBLES_READ, etc. in source/Disk.cpp.
>
> There are also some interesting comments in DataLatchReadWriteWOZ().
> > I attached my code (I hope the formatting will not be corrupted)
> Unfortunately, Python uses the retarded decision of using whitespace for code blocks which sadly means indentation will usually be completely lost due to HTML defaulting to sequences of white space being collapsed. Do you have a git repository where it is easier to read that python code?
>
> Pro-Tip: (Almost) no one wants to read a dump of code, but we can give you pointers if you share more details of what you have tried and where exactly things have stopped working.
>
> Good luck! Keep us posted as you trace through the issue.
>
> Michael

Re: Question concerning Disk II emulation / timing

<c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:a05:622a:1807:b0:3dc:8b51:31dc with SMTP id t7-20020a05622a180700b003dc8b5131dcmr1055872qtc.4.1680102917572;
Wed, 29 Mar 2023 08:15:17 -0700 (PDT)
X-Received: by 2002:a81:4520:0:b0:541:85d2:af21 with SMTP id
s32-20020a814520000000b0054185d2af21mr9758555ywa.5.1680102917217; Wed, 29 Mar
2023 08:15:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.emulators.apple2
Date: Wed, 29 Mar 2023 08:15:16 -0700 (PDT)
In-Reply-To: <7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c1:d705:a800:f9d5:d633:dba6:ac6b;
posting-account=4TUghwoAAABnyztYvJrWTUS8WXFc5m26
NNTP-Posting-Host: 2003:c1:d705:a800:f9d5:d633:dba6:ac6b
References: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com> <7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com>
Subject: Re: Question concerning Disk II emulation / timing
From: jegali70@gmail.com (Jens Gaulke)
Injection-Date: Wed, 29 Mar 2023 15:15:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jens Gaulke - Wed, 29 Mar 2023 15:15 UTC

On Saturday, March 25, 2023 at 2:44:03 PM UTC+1, Michael AppleWin Debugger Dev wrote:
> On Friday, March 24, 2023 at 3:21:51 PM UTC-7, Jens Gaulke wrote:
> > I tried to do Disk II emulation and implemented all softswitches and the functions as far as I understood them from Jim Sather. The only disk image start starts for me is "Apple Galaxian". A standard DOS 3.3 System Master reads some tracks and then crashes with an illegal opcode. What am I missing?
> Many nights of poring over boot traces. /s
>
> Seriously, the "secret sauce" is nothing more then hard work of logging to tell where things are going off the rails.
> i.e.
> When you boot DOS 3.3, what are the PC & regs when it crashes? What stage of DOS doe the PC reach? Stage 0? Stage 1? Stage 2?
> > Do I have some timing problems in my emulation? Did I not correctly implement the softswitch functions?
> The easiest way to debug this would probably be to use a process of elimination as you verify the softswitches one-one by one.
>
> 0. Write a small test program to select drive 0, wait, select drive 1, wait to rule our DRVSEL_1 and DRVSEL_2. Yes, this is trivial. Yes, you need to eliminate this.
>
> 1. I would then rule out the MOTORON, MOTOROFF. Yes this is again trivial, and yes you need to eliminate this.
>
> 2 I would test the four PHASE0..PHASE3 softswitches by writing a small assembly program to move the track outwards 40 tracks and then inwards 40 tracks logging the track number. That leaves four softswitches to test SHIFT, LOAD, READ, WRITE. You don't need to worry about WRITE for now, so this leaves SHIFT, LOAD, and READ.
>
> 3. Prepare a "raw disk" so that each of 35 tracks contains nothing but FF filler and only ONE disk nibble of an unique track marker. Modify the utility from step (1) to read the raw 4&4 disk nibble, and step the 35 tracks. This SO question may be helpful as Nick was kind enough to provide some nibble counting code:
> https://retrocomputing.stackexchange.com/questions/503/absolute-maximum-number-of-nibbles-on-an-apple-ii-floppy-disk-track/664#664
>
> 4. Get .do/.dsk working first before .woz. I don't see your 6&2 decode logic? Have you verified this is correct?
>
> 5. You may want to use a "simpler" program to trace. I'm extremely biased so something like Fantavision since I have already written up the boot-tracing :-) but any program/game where you already have boot-tracing notes (say from 4AM) would work.
> https://github.com/Michaelangel007/apple2_fantavision_reloaded#ye-olde-boot-tracing
>
> 6. I already mentioned the DOS 3.3 System Master above.
>
> 7. Use another emulator to debug your emulator. i.e In AppleWin see the disk logging defines, LOG_DISK_PHASES, LOG_DISK_NIBBLES_SPIN, LOG_DISK_NIBBLES_READ, etc. in source/Disk.cpp.
>
> There are also some interesting comments in DataLatchReadWriteWOZ().
> > I attached my code (I hope the formatting will not be corrupted)
> Unfortunately, Python uses the retarded decision of using whitespace for code blocks which sadly means indentation will usually be completely lost due to HTML defaulting to sequences of white space being collapsed. Do you have a git repository where it is easier to read that python code?
>
> Pro-Tip: (Almost) no one wants to read a dump of code, but we can give you pointers if you share more details of what you have tried and where exactly things have stopped working.
>
> Good luck! Keep us posted as you trace through the issue.
>
> Michael

Hi all,

I found a very stupid error. To do some testing, I had implemented a Routine for changing values in the ROM.
The call to this Routine was still active, and so while booting up DOS, DOS tried to access ROM addresses and changed contents of the ROM. This caused the illegal Instruction I talked about. I disabled the writing to the ROM and the dsk booted up. So I learned, that DOS tries to access the 16k RAM Card.

On top of that I remembered that french_postcards needed a RAM expansion to boot up properly and I implemented the 16k language Card. The 16k are working well and some dsk are booting up properly.

At the moment , I try to unify the woz and dsk routines to make handling easier.

There are just two things that bother me. Booting up karateka does not switch to graphics mode correctly though I Implemented all the softswitches and they work correctly When testing via AppleSoft. Second topic: booting a Disk is slooooow. I have no idea how to Speed that up at the Moment.

That's how it is going at the moment. Thank you all for your support!

Cheers, Jens

Re: Question concerning Disk II emulation / timing

<dog_cow-1680120688@macgui.com>

  copy mid

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

  copy link   Newsgroups: comp.emulators.apple2
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: dog_cow@macgui.com (D Finnigan)
Newsgroups: comp.emulators.apple2
Subject: Re: Question concerning Disk II emulation / timing
Date: Wed, 29 Mar 2023 20:11:29 -0000 (UTC)
Organization: Mac GUI
Lines: 20
Message-ID: <dog_cow-1680120688@macgui.com>
References: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com> <7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com> <c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 29 Mar 2023 20:11:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5b2e71f159c9c92de51b562a2686b8fb";
logging-data="475809"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+NSu2kt3oAMXIpfx45Aslc"
User-Agent: Mac GUI Usenet
Cancel-Lock: sha1:8LJ1ec5b4DjKqHzvoY1v+624CBk=
In-Reply-To: <c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com>
 by: D Finnigan - Wed, 29 Mar 2023 20:11 UTC

Jens Gaulke wrote:
>
> To do some testing, I had implemented a
> Routine for changing values in the ROM.
> The call to this Routine was still active, and so while booting up DOS,
> DOS
> tried to access ROM addresses and changed contents of the ROM. This caused
> the illegal Instruction I talked about.

Back in the old days, Apple Computer used to always guarantee that the
contents of ROM would never change during execution of your program.
Probably this is the reason why.

;-)

--
]DF$
The New Apple II User's Guide:
https://macgui.com/newa2guide/

Re: Question concerning Disk II emulation / timing

<47d58a37-76e5-4537-aa2a-ade61851a94dn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:ae9:ef95:0:b0:745:811c:2aea with SMTP id d143-20020ae9ef95000000b00745811c2aeamr4909819qkg.11.1680200757993;
Thu, 30 Mar 2023 11:25:57 -0700 (PDT)
X-Received: by 2002:ac8:5702:0:b0:3e3:93ae:d118 with SMTP id
2-20020ac85702000000b003e393aed118mr9347366qtw.12.1680200757764; Thu, 30 Mar
2023 11:25:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!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: Thu, 30 Mar 2023 11:25:57 -0700 (PDT)
In-Reply-To: <c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:600:c67f:5fc0:b823:a4eb:83ea:f018;
posting-account=9Dd-GgoAAAAjVgCPcBurQ6c4EXW6Wi8v
NNTP-Posting-Host: 2601:600:c67f:5fc0:b823:a4eb:83ea:f018
References: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com>
<7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com> <c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <47d58a37-76e5-4537-aa2a-ade61851a94dn@googlegroups.com>
Subject: Re: Question concerning Disk II emulation / timing
From: michael.pohoreski@gmail.com (Michael AppleWin Debugger Dev)
Injection-Date: Thu, 30 Mar 2023 18:25:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 4364
 by: Michael AppleWin Deb - Thu, 30 Mar 2023 18:25 UTC

On Wednesday, March 29, 2023 at 8:15:18 AM UTC-7, Jens Gaulke wrote:
> I found a very stupid error. To do some testing, I had implemented a Routine for changing values in the ROM.
> The call to this Routine was still active, and so while booting up DOS, DOS tried to access ROM addresses and changed contents of the ROM. This caused the illegal Instruction I talked about. I disabled the writing to the ROM and the dsk booted up. So I learned, that DOS tries to access the 16k RAM Card.

Yes, sadly DOS 3.3 rudely futzes with the language card at 3FCB:

3FCB:AD 81 C0 022 LDA $C081 ; magic number If only ROMIN = $C081 for Language Card (LC)
3FCE:AD 81 C0 023 LDA $C081 ; magic number 1st read = read ROM, 2nd read = write enable LC Bank 2
3FD1:A9 00 024 LDA #0
3FD3:8D 00 E0 025 STA $E000

> On top of that I remembered that french_postcards needed a RAM expansion to boot up properly and I implemented the 16k language Card. The 16k are working well and some dsk are booting up properly.

Awesome to hear!

> There are just two things that bother me. Booting up karateka does not switch to graphics mode correctly though I Implemented all the softswitches and they work correctly

Hmm, I just took a quick look at the Karateka and it is hitting these softswitches (low byte stored $1020 .. $1028):

1000:A0 00 LDY #$00
1015:BC 20 10 LDY $1020,X
1018:99 00 C0 STA KEYBOARD,Y
101B:F0 0D BEQ $102A
101D:E8 INX
101E:D0 F5 BNE $1015
1020:5F B_1020 db #$5F
1021:57 B_1021 db #$57
1022:52 B_1022 db #$52
1023:54 B_1023 db #$54
1024:50 B_1024 db #$50
1025:0C B_1025 db #$0C
1026:08 B_1026 db #$08
1027:04 B_1027 db #$04
1028:02 B_1028 db #$02
1029:00 B_1029 db #$00
102A:A6 2B LDX BAS2H

i.e.
C05F
C057
C052
C054
C050
C00C
C008
C004
C002

Might be a place to start?

> When testing via AppleSoft. Second topic: booting a Disk is slooooow. I have no idea how to Speed that up at the Moment.

In AppleWin check the variable: bool m_enhanceDisk

It looks like we omit the spinning up time in Disk2InterfaceCard::ReadWrite():
i.e.
if (!m_enhanceDisk && pDrive->m_spinning)

> That's how it is going at the moment. Thank you all for your support!

Thanks for the update!

Michael

Re: Question concerning Disk II emulation / timing

<7446de1a-d4d8-4045-8600-acb256326e1en@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:a05:620a:1a07:b0:745:d4b9:76bd with SMTP id bk7-20020a05620a1a0700b00745d4b976bdmr8238519qkb.11.1680377830519;
Sat, 01 Apr 2023 12:37:10 -0700 (PDT)
X-Received: by 2002:a05:6902:1006:b0:b78:4b00:775f with SMTP id
w6-20020a056902100600b00b784b00775fmr14981905ybt.4.1680377830175; Sat, 01 Apr
2023 12:37:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer03.ams4!peer.am4.highwinds-media.com!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: Sat, 1 Apr 2023 12:37:09 -0700 (PDT)
In-Reply-To: <47d58a37-76e5-4537-aa2a-ade61851a94dn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=81.223.177.90; posting-account=bGpciwoAAACg2KT8pQMph7tnt3o_9vtu
NNTP-Posting-Host: 81.223.177.90
References: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com>
<7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com> <c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com>
<47d58a37-76e5-4537-aa2a-ade61851a94dn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7446de1a-d4d8-4045-8600-acb256326e1en@googlegroups.com>
Subject: Re: Question concerning Disk II emulation / timing
From: peter.ferrie@gmail.com (peter....@gmail.com)
Injection-Date: Sat, 01 Apr 2023 19:37:10 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1606
 by: peter....@gmail.com - Sat, 1 Apr 2023 19:37 UTC

DOS turns off the drive on exit, and skips spin-up if the parameters are the same on the next call and the disk appears to be still spinning. Maybe that's causing the read failure?

Re: Question concerning Disk II emulation / timing

<86b1a343-6d33-4be6-ad5d-6a4cef8232e4n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:a05:622a:1884:b0:3d5:bb6:9240 with SMTP id v4-20020a05622a188400b003d50bb69240mr12150074qtc.4.1680481766334;
Sun, 02 Apr 2023 17:29:26 -0700 (PDT)
X-Received: by 2002:a25:d80b:0:b0:b82:410e:daab with SMTP id
p11-20020a25d80b000000b00b82410edaabmr4495235ybg.8.1680481766189; Sun, 02 Apr
2023 17:29:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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, 2 Apr 2023 17:29:25 -0700 (PDT)
In-Reply-To: <c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=207.195.86.7; posting-account=U4TNXwoAAABP4nIJHynAJZ69O_f3LY2g
NNTP-Posting-Host: 207.195.86.7
References: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com>
<7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com> <c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <86b1a343-6d33-4be6-ad5d-6a4cef8232e4n@googlegroups.com>
Subject: Re: Question concerning Disk II emulation / timing
From: gids.rs@sasktel.net (I am Rob)
Injection-Date: Mon, 03 Apr 2023 00:29:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1624
 by: I am Rob - Mon, 3 Apr 2023 00:29 UTC

> There are just two things that bother me. Booting up karateka does not switch to graphics mode correctly though I Implemented all the softswitches and they work correctly When testing via AppleSoft. Second topic:

Might be the order in which the soft switches are accessed. Sweet16 has the same problem. $C050 has to be accessed before any other softswitch.

Re: Question concerning Disk II emulation / timing

<alpine.DEB.2.21.2304030037350.26361@sd-119843.dedibox.fr>

  copy mid

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

  copy link   Newsgroups: comp.emulators.apple2
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From: usotsuki@buric.co (Steve Nickolas)
Newsgroups: comp.emulators.apple2
Subject: Re: Question concerning Disk II emulation / timing
Date: Mon, 3 Apr 2023 00:41:23 -0400
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <alpine.DEB.2.21.2304030037350.26361@sd-119843.dedibox.fr>
References: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com> <7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com> <c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com> <86b1a343-6d33-4be6-ad5d-6a4cef8232e4n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Injection-Info: dont-email.me; posting-host="948a982de762c9d30f4520e6e3e2c09d";
logging-data="2997939"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WGQndBzM/Bu5JiFaiZGV8temoqo9C6OE="
User-Agent: Alpine 2.21 (DEB 202 2017-01-01)
Cancel-Lock: sha1:9MNVBZjSOnaFbYujdjvOJV9nH28=
X-X-Sender: mary@sd-119843.dedibox.fr
In-Reply-To: <86b1a343-6d33-4be6-ad5d-6a4cef8232e4n@googlegroups.com>
 by: Steve Nickolas - Mon, 3 Apr 2023 04:41 UTC

On Sun, 2 Apr 2023, I am Rob wrote:

>> There are just two things that bother me. Booting up karateka does not
>> switch to graphics mode correctly though I Implemented all the
>> softswitches and they work correctly When testing via AppleSoft. Second
>> topic:
>
> Might be the order in which the soft switches are accessed. Sweet16 has
> the same problem. $C050 has to be accessed before any other softswitch.

For what it's worth, I frequently hit them from the bottom up, C057, C054,
C052, C050.

I just looked at one of my file cracks: it says that it relies on the
firmware to hit C052 and C054 (in no defined order, but fwiw, it's the
FE84-FE89-FE93-FB2F dance you see some variation of in a lot of software)
and then it hits C057, and only some time later hits C050.

So you're going to need to be prepared for the softswitches to be hit in
any arbitrary order.

-uso.

Re: Question concerning Disk II emulation / timing

<1380a3a4-11b9-4866-b92c-55035c0773b1n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:a05:622a:88:b0:3e1:934d:ba1a with SMTP id o8-20020a05622a008800b003e1934dba1amr14485077qtw.3.1680553436409;
Mon, 03 Apr 2023 13:23:56 -0700 (PDT)
X-Received: by 2002:a81:e504:0:b0:541:61aa:9e60 with SMTP id
s4-20020a81e504000000b0054161aa9e60mr115405ywl.6.1680553436016; Mon, 03 Apr
2023 13:23:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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: Mon, 3 Apr 2023 13:23:55 -0700 (PDT)
In-Reply-To: <alpine.DEB.2.21.2304030037350.26361@sd-119843.dedibox.fr>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c1:d704:db00:2dd9:41fb:15f4:2dff;
posting-account=4TUghwoAAABnyztYvJrWTUS8WXFc5m26
NNTP-Posting-Host: 2003:c1:d704:db00:2dd9:41fb:15f4:2dff
References: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com>
<7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com> <c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com>
<86b1a343-6d33-4be6-ad5d-6a4cef8232e4n@googlegroups.com> <alpine.DEB.2.21.2304030037350.26361@sd-119843.dedibox.fr>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1380a3a4-11b9-4866-b92c-55035c0773b1n@googlegroups.com>
Subject: Re: Question concerning Disk II emulation / timing
From: jegali70@gmail.com (Jens Gaulke)
Injection-Date: Mon, 03 Apr 2023 20:23:56 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2711
 by: Jens Gaulke - Mon, 3 Apr 2023 20:23 UTC

Hi all,

the errors in the graphical representation were due to the fact that I overestimated the performance of Python. I refreshed the screen completely every 20 ms, as I know it from game programming. The setting of all pixels including the calculation of the color values blew up these 20ms. I now use a surfarray3d and set the respective pixel when it is set in RAM. Then I flash every 20ms the content of the surfarray3d on the screen. for this I use a surfarray3d for hires1 and one for hires2. Depending on the softswitch I flash the corresponding surfarray3d. This works surprisingly well. What I don't like so much is that my object-oriented structure has suffered a bit.

That sometimes softswitches are set wildly and I have to take this into account in the graphics output, I have noticed in the meantime. I try to map this behavior by my new graphics routines.

Now that Karateka runs graphically, I took care of the joystick implementation. In most cases this works as well.

Actually I just wanted to resurrect my old Apple II, but here one more function and there one more function... that's really fun.

Thank you all for your input and the exchange, I really appreciate that!

Re: Question concerning Disk II emulation / timing

<8bdde695-f599-4b63-91b3-0e5417f727b5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.emulators.apple2
X-Received: by 2002:a05:622a:4815:b0:3e6:43fe:a9 with SMTP id fb21-20020a05622a481500b003e643fe00a9mr2402276qtb.1.1680553882215;
Mon, 03 Apr 2023 13:31:22 -0700 (PDT)
X-Received: by 2002:a81:ad04:0:b0:544:5aa0:e212 with SMTP id
l4-20020a81ad04000000b005445aa0e212mr138808ywh.6.1680553881951; Mon, 03 Apr
2023 13:31:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.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: Mon, 3 Apr 2023 13:31:21 -0700 (PDT)
In-Reply-To: <1380a3a4-11b9-4866-b92c-55035c0773b1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c1:d704:db00:2dd9:41fb:15f4:2dff;
posting-account=4TUghwoAAABnyztYvJrWTUS8WXFc5m26
NNTP-Posting-Host: 2003:c1:d704:db00:2dd9:41fb:15f4:2dff
References: <0e702e4f-a43e-4dfa-b58c-4df71a4bb903n@googlegroups.com>
<7ea0deea-ad4c-4d42-a46e-47ceb33e9700n@googlegroups.com> <c6396737-fcda-4c5c-b962-9a2cf523b1c6n@googlegroups.com>
<86b1a343-6d33-4be6-ad5d-6a4cef8232e4n@googlegroups.com> <alpine.DEB.2.21.2304030037350.26361@sd-119843.dedibox.fr>
<1380a3a4-11b9-4866-b92c-55035c0773b1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8bdde695-f599-4b63-91b3-0e5417f727b5n@googlegroups.com>
Subject: Re: Question concerning Disk II emulation / timing
From: jegali70@gmail.com (Jens Gaulke)
Injection-Date: Mon, 03 Apr 2023 20:31:22 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1913
 by: Jens Gaulke - Mon, 3 Apr 2023 20:31 UTC

I also got the speed problem with the floppy drive under control.

first i restructured the gameloop and then realized that i was providing each sector "on demand" in the DSK routine. but since some sectors are read multiple times, i was wasting clock cycles here. I then converted the DSK file completely, stored it in an array and access the array on demand.

Stupid me

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor