Date: 2007-09-10 10:48:36
Hallo allemaal, First a question for all of you: has anyone a maller formatting routine that I can use to replace the original one? I know JiffyDOS has one AFAIK and I just hope someone can give me some onfo about it. Using a smaller routine can free up some bytes I can use for another routine, see below. Thanks in advance! Hallo Antitrack, > Which hardware have you been using to read CF-cards? A PC and a...... 1541 :) The used hardware inside the 1541: - a male IDE connector (from a scrapped PC) - a 74LS139, 74LS245 and 74LS244 One half of the 139 generates the /RD and /WR signals with PHI2 and R/W als input, the other half generates the two ChipSelect signals needed for the IDE bus. Remark: so far I haven't found any reason or use for the second CS signal so I probably will drop it in future designs. The 245 buffers the data bus, the 244 the three addresslines and the reset line. The CS input of all parts is connected to O4 of the onboard 74LS42 thus mapping the IDE drive at address $1000. > Can you share the code? I can but it is so simple that IMHO an example will do: .eq IDEcs0 = $1000 ; CS0 .eq IDEdata = IDEcs0 + 0 .eq IDEerror = IDEcs0 + 1 .eq IDEnumSec = IDEcs0 + 2 ; number of sectors .eq IDElba0 = IDEcs0 + 3 ; starts counting from ONE !!! .eq IDElba1 = IDEcs0 + 4 .eq IDElba2 = IDEcs0 + 5 .eq IDElba3 = IDEcs0 + 6 .eq IDEstatus = IDEcs0 + 7 ; when reading .eq IDEcommand = IDEcs0 + 7 ; when writing ; Read very first sector from harddisk ldx #1 stx IDEnumSec ; number of sectors stx IDElba0 ; start with sector 1 dex stx IDElba1 stx IDElba2 lda #$E0 ; bit 6 = LBA mode! sta IDElba3 jsr ReadIdeSector etc. JobReadSector jsr LedOn lda #$20 ; read sector jsr SendCommand ldy #0 sty IDEtmp0 JobReadSec lda IDEdata sta (BUFPNT),Y iny bne JobReadSec jsr LedOff rts ;** Send command to IDE ;- in: A contains command ;- out: A contains error code SendCommand sta IDEcommand SendCommand010 lda IDEstatus ; ready? bmi SendCommand010 ; if not, -> wait and #1 ; error? rts As you can see, it is just a matter of writing to or reading from some registers. But to be honest, I haven't tested anything in ML yet. So far I tested things in Basic by using M-R and M-W commands. And here I ran into a weird problem that costed me quite some valuable time. I used a 256 MB CF card as HD simply because of the physical size and the fact I didn't need an extra powersupply. But when checking a sector I found out that the data was corrupted in a very weird but regular way and I was only able to write 128 bytes to the card ( the LED on the adapter card went out after 128 bytes). As I knew things had worked fine in the beginning with a real HD I replaced the CF card and..... things worked fine again! But my PC accepted the CF card as well W/O any problem. Because I need this CF card for other things and having enough HD's laying around, I decided to forget the problem for the moment. At this moment I'm focussing on a Basic program that enables a standard 1541 plus my IDE inteface to exchange data with the HD. The idea is to store a small ML program in a buffer using M-W (or a &-file) and transferring data to/from the HD using another free buffer. But with a bit of luck I can squeeze the program in the free spaces of the original ROM. Then the only thing I have to tell the program is at which sector of the HD it should start to write/read the data to/from. I'm also working on a complete replacemant of the original ROM. I found out that not needing the formatting and head moving routines I saved about 2000 bytes. Again with a bit of luck I can squeeze the extra routines for sudirectories inside these 2000 bytes. -- ___ / __|__ / / |_/ Groetjes, Ruud \ \__|_\ \___| URL: Ruud.C64.org De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor de geadresseerde. Wanneer u dit bericht per abuis ontvangt, verzoeken wij u contact op te nemen met de afzender per kerende e-mail. Verder verzoeken wij u in dat geval dit e-mailbericht te vernietigen en de inhoud ervan aan niemand openbaar te maken. Wij aanvaarden geen aansprakelijkheid voor onjuiste, onvolledige dan wel ontijdige overbrenging van de inhoud van een verzonden e-mailbericht, noch voor daarbij overgebrachte virussen. Stichting Pensioenfonds ABP is gevestigd te Heerlen en ingeschreven bij de Kamer van Koophandel Zuid Limburg onder nummer: 41074000 The information contained in this e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail; please delete in this case the e-mail and do not disclose its contents to any person. We don't accept liability for any errors, omissions, delays of receipt or viruses in the contents of this message which arise as a result of e-mail transmission. Stichting Pensioenfonds ABP, having its registered office at Heerlen, is registered in the Traderegister of the Chamber of Commerce Zuid Limburg (Maastricht), the Netherlands, registration number: 41074000 Message was sent through the cbm-hackers mailing list
Archive generated by hypermail pre-2.1.8.