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 thencrashes 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)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
On Friday, March 24, 2023 at 3:21:51 PM UTC-7, Jens Gaulke wrote:crashes with an illegal opcode. What am I missing?
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
Many nights of poring over boot traces. /sneed to worry about WRITE for now, so this leaves SHIFT, LOAD, and READ.
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
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 behelpful 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#664is easier to read that python code?
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
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
On Friday, March 24, 2023 at 3:21:51 PM UTC-7, Jens Gaulke wrote:crashes with an illegal opcode. What am I missing?
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
Many nights of poring over boot traces. /sneed to worry about WRITE for now, so this leaves SHIFT, LOAD, and READ.
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
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 behelpful 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#664is easier to read that python code?
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
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
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 found a very stupid error. To do some testing, I had implemented a Routine for changing values in the ROM.learned, that DOS tries to access the 16k RAM Card.
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
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.
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!
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:
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.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 468 |
Nodes: | 16 (2 / 14) |
Uptime: | 18:51:07 |
Calls: | 9,440 |
Calls today: | 3 |
Files: | 13,594 |
Messages: | 6,109,822 |