TF536 and CDTV's cd drive

68030 + SDRAM + IDE

Moderators: terriblefire, Terriblefire Moderator

terriblefire
Moderator Team
Moderator Team
Posts: 5368
Joined: Mon Aug 28, 2017 10:56 pm
Location: Glasgow, UK

Re: TF536 and CDTV's cd drive

Post by terriblefire »

Realistically if you want good CDTV support then someone needs to rewrite or at least heavily refactor the cdtv.device driver. I wish people would stop asking about support of this as its been covered to death. Someone needs to learn to write device drivers and just fix it. You will get a partial fix from the patches i proposed but its utterly non-ideal.
———
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
User avatar
alexh
Posts: 698
Joined: Tue Oct 17, 2017 4:51 pm
Location: Oxfordshire

Re: TF536 and CDTV's cd drive

Post by alexh »

terriblefire wrote: Sat Oct 24, 2020 12:57 pmThere is a list of about 30 locations that need patched in the 2.3 rom.
Ok. Thanks. I will extract them from the other thread. My skills with 68k IDA Pro are not good enough to re-produce this work I am afraid.
terriblefire wrote: Sat Oct 24, 2020 1:09 pm Realistically if you want good CDTV support then someone needs to rewrite or at least heavily refactor the cdtv.device driver.
Understood. I was very grateful for the amount of time you spent on this, especially resourcing cdtv.device
terriblefire wrote: Sat Oct 24, 2020 1:09 pm Someone needs to learn to write device drivers and just fix it.
Unfortunately that is not me. If I knew anything about AmigaOS and how to write device drivers I'd re-write cdtv.device / cdfs.library to a Gayle style PATA controller and standard ATAPI protocol. So CDTV users could replace their dying ultra rare caddie drives with slot-loading PATA laptop drives (some slot-loading laptop drives are an amazing physical fit for the CDTV both for the CD loading and the eject button)

However a hardware bridge from the CDTVs custom Matsushita protocol to PATA interface with ATAPI protocol seems infinitely more achievable.
terriblefire wrote: Sat Oct 24, 2020 1:09 pmI wish people would stop asking about support of this as its been covered to death.
Understood. I won't ask questions about this again directed to yourself. Thanks for all your hard work. The TF536 CDTV users will continue to discuss it amongst ourselves and see if we can find a solution. The community you created will see what we can do with the toys you gave us.
Principal ASIC Engineer - SystemVerilog, VHDL
Thalion Webshrine - http://thalion.atari.org
STf,STfm,STe,MegaST,MegaSTe,Falcon060
A500+,A600,A4000/060,CD32,CDTV
User avatar
alexh
Posts: 698
Joined: Tue Oct 17, 2017 4:51 pm
Location: Oxfordshire

Re: TF536 and CDTV's cd drive

Post by alexh »

JOTD has updated the python script for patching the original CDTV Extended ROM v2.30 with all the allocmem locations TF identified.

https://github.com/jotd666/amiga68ktool ... dtv_rom.py

Toni Wilen of WinUAE has seen the discussions about this issue and he notes he was in the process of adding new 24-bit only DMA features to the latest WinUAE beta. I am hopeful that it might behave more like a real CDTV + TF536 soon.

http://eab.abime.net/showpost.php?p=143 ... stcount=81

This could help the development of a compatible CDTV extended ROM for TF536.
Principal ASIC Engineer - SystemVerilog, VHDL
Thalion Webshrine - http://thalion.atari.org
STf,STfm,STe,MegaST,MegaSTe,Falcon060
A500+,A600,A4000/060,CD32,CDTV
terriblefire
Moderator Team
Moderator Team
Posts: 5368
Joined: Mon Aug 28, 2017 10:56 pm
Location: Glasgow, UK

Re: TF536 and CDTV's cd drive

Post by terriblefire »

I've read of some projects to patch the roms... The issue (as i see it from my disassembly) is that the driver blindly uses the buffer provided for DMA. Not all cases are covered by the 2 location patch... although it does help enormously.
———
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
User avatar
alexh
Posts: 698
Joined: Tue Oct 17, 2017 4:51 pm
Location: Oxfordshire

Re: TF536 and CDTV's cd drive

Post by alexh »

Since I wrote this quite a bit of work has been done. All the Allocmem calls have been interpreted and understood both in Extended Kickstart 2.30 & 2.07 together with Kickstart 3.1 v40.63.

Lots of Allocmem memory attribute locations in ROM, graciously identified by yourself, have been eliminated as not being used for DMAC source/destination. Some Allocmem memory attribute constants in ROM turned out to be byte swapped before being used so I'd patched them wrong (e.g. utility.library)

As you found out you need to patch only two locations in the extended ROM to make the CD-ROM work after booting from IDE or FDD.

The (suspected) Allocmem calls in Kickstart have not yet been found that currently prevent booting from CD-ROM and prevent the CDTV SCSI controller from working. I think they may not be constants but generated from code. But there are suspects.

I'm not actively working on this, but another very competent CDTV owner and enthusiast is.

It is a shame they didn't fix this in the "unsupported" CDTV versions of KS3.2 and it's corresponding Extended ROM. Have you read the FAQ? They incorrectly blame it not working on a known and worked around bug in the CDTV DMAC (it sometimes corrupts the last 8 bytes of DMAs so you had to use oversized intermediate buffers and transfer 8 bytes more than you need)
Principal ASIC Engineer - SystemVerilog, VHDL
Thalion Webshrine - http://thalion.atari.org
STf,STfm,STe,MegaST,MegaSTe,Falcon060
A500+,A600,A4000/060,CD32,CDTV
terriblefire
Moderator Team
Moderator Team
Posts: 5368
Joined: Mon Aug 28, 2017 10:56 pm
Location: Glasgow, UK

Re: TF536 and CDTV's cd drive

Post by terriblefire »

alexh wrote: Thu May 20, 2021 9:07 pm
The (suspected) Allocmem calls in Kickstart have not yet been found that currently prevent booting from CD-ROM and prevent the CDTV SCSI controller from working. I think they may not be constants but generated from code. But there are suspects.

IMHO this driver needs rewritten. Its got some appalling things in it like three NOPs for a delay. The driver needs to allocate is own buffers for reads, read there, then copy to the target, deallocate. Its not like that overhead will be any slower than the single speed CD drive in the thing anyways. It will never be sufficient just to patch the OS allocations.
———
"It is not necessarily a supply voltage at no load, but the amount of current it can provide when touched that
indicates how much hurting you shall receive."
User avatar
alexh
Posts: 698
Joined: Tue Oct 17, 2017 4:51 pm
Location: Oxfordshire

Re: TF536 and CDTV's cd drive

Post by alexh »

Just a little follow up.

The CDTV enthusiast that is looking into this, after a long weekend debugging, has found another AllocMem buffer in the CDTV Extended ROM that is used by the DMAC.

It is in "CDTV Bootstrap , cdstrap 9.7 (12.11.91)". Like the others it has the wrong MemType attribute but the MemType is being passed as a stack variable, which is not easy to trace just by looking at a disassembly and cannot be found by simply scanning the ROM file.

When this AllocMem Memtype is patched to ChipRAM the CDTV will boot from CD-ROM with 32-bit Fast Mem installed.

It has only been tested in WinUAE 4.5.0 beta 7 (or later) with 24-bit DMAC enabled and a TF536 like configuration.

Unpatched the same WinUAE configuration doesn't boot from CD-ROM.

I'm going to try it on my CDTV + TF536 when I can but there is strong evidence it will work.

Full technical details will be published by the CDTV enthusiast working on this soon. (They want to try and fix the 2.30 bookmark.device to make it work on A570 and CDTV, plus find out if it is possible to patch the CDTV SCSI controller driver too).

This wouldn't have been possible without TF who did a lot of the groundwork.
Principal ASIC Engineer - SystemVerilog, VHDL
Thalion Webshrine - http://thalion.atari.org
STf,STfm,STe,MegaST,MegaSTe,Falcon060
A500+,A600,A4000/060,CD32,CDTV
manmax
Posts: 8
Joined: Fri Jun 12, 2020 2:39 pm

Re: TF536 and CDTV's cd drive

Post by manmax »

Amazing job !! I hope it will work with a real CDTV
dalek
Posts: 224
Joined: Thu Nov 08, 2018 11:03 am
Location: NSW Australia

Re: TF536 and CDTV's cd drive

Post by dalek »

Nice!

I just happened across a CDTV the other day so if you want someone else to test in a real machine I'm happy to do so (can burn my own extended rom if needed)
User avatar
alexh
Posts: 698
Joined: Tue Oct 17, 2017 4:51 pm
Location: Oxfordshire

Re: TF536 and CDTV's cd drive

Post by alexh »

dalek wrote: Wed May 26, 2021 4:18 am if you want someone else to test in a real machine I'm happy to do so (can burn my own extended rom if needed)
You have a spare TF536 you could put in it?
Principal ASIC Engineer - SystemVerilog, VHDL
Thalion Webshrine - http://thalion.atari.org
STf,STfm,STe,MegaST,MegaSTe,Falcon060
A500+,A600,A4000/060,CD32,CDTV
Post Reply

Return to “TF536”