comparison level1/modules/ddisk.asm @ 1970:19b2c99a0b80

Patches to support upgraded Dragon 32.
author afra
date Sun, 08 Jan 2006 02:39:25 +0000
parents 3826bfe7d2e5
children 136a4e706aa6
comparison
equal deleted inserted replaced
1969:b8d8f771f26c 1970:19b2c99a0b80
76 * 2005-06-17, P.Harvey-Smith. 76 * 2005-06-17, P.Harvey-Smith.
77 * Ok, this'll teach me to submit code before testing on the real hardware ! 77 * Ok, this'll teach me to submit code before testing on the real hardware !
78 * Seperated NMI disable/drive select code on alpha, as above patches 78 * Seperated NMI disable/drive select code on alpha, as above patches
79 * worked fine on Mess, but not on real hardware (timing problems). 79 * worked fine on Mess, but not on real hardware (timing problems).
80 * 80 *
81 * 2006-01-08
82 * Added support for Dragon 32, that has had a memory upgraded to 64K,
83 * this is treated like the Dragon 64 EXCEPT that the code to manipulate
84 * the ACIA is not included. This is required due to the incomplete
85 * address decoding, writes to the non-existant ACIA would hit the PIA
86 * at FF00, and cause a crash.
87 *
81 88
82 nam DDisk 89 nam DDisk
83 ttl Dragon Floppy driver 90 ttl Dragon Floppy driver
84 91
85 * Disassembled 02/04/21 22:37:46 by Disasm v1.6 (C) 1988 by RML 92 * Disassembled 02/04/21 22:37:46 by Disasm v1.6 (C) 1988 by RML
386 clr DskError,u 393 clr DskError,u
387 394
388 lda #$FF ; Make DP=$FF, to make i/o faster 395 lda #$FF ; Make DP=$FF, to make i/o faster
389 tfr a,dp 396 tfr a,dp
390 397
398 ;
399 ; Do not attempt to talk to ACIA if this machine does not have one !
400 ;
401
402 IFEQ Upgraded32
391 lda <DPAciaCmd ; Save ACIA Command reg 403 lda <DPAciaCmd ; Save ACIA Command reg
392 sta >SaveACIACmd,u 404 sta >SaveACIACmd,u
393 anda #$FE ; Disable ACIA inturrupt 405 anda #$FE ; Disable ACIA inturrupt
394 sta <DPAciaCmd 406 sta <DPAciaCmd
395 bita #$40 ; Is Tx inturrupt enabled ? 407 bita #$40 ; Is Tx inturrupt enabled ?
396 beq L00DE 408 beq L00DE
397 L00D8 lda <DPAciaStat ; Yes, wait for Tx to complete 409 L00D8 lda <DPAciaStat ; Yes, wait for Tx to complete
398 bita #$10 410 bita #$10
399 beq L00D8 411 beq L00D8
412 ENDC
400 413
401 L00DE orcc #$50 ; Mask inturrupts 414 L00DE orcc #$50 ; Mask inturrupts
402 lda <DPPia0CRB ; Save PIA0 IRQ Status 415 lda <DPPia0CRB ; Save PIA0 IRQ Status
403 sta >SavePIA0CRB,u 416 sta >SavePIA0CRB,u
404 lda #$34 ; Disable it. 417 lda #$34 ; Disable it.
405 sta <DPPia0CRB 418 sta <DPPia0CRB
419
420 IFEQ Upgraded32
406 lda <DPACIACmd ; Disable ACIA Inturrupt 421 lda <DPACIACmd ; Disable ACIA Inturrupt
407 anda #$FE 422 anda #$FE
408 sta <DPACIACmd 423 sta <DPACIACmd
424 ENDC
425
409 lda <DPPIACRB ; Set PIA to generate FIRQ on FDC DRQ 426 lda <DPPIACRB ; Set PIA to generate FIRQ on FDC DRQ
410 ora #$03 427 ora #$03
411 sta <DPPIACRB 428 sta <DPPIACRB
412 lda <DPPIADB ; Clear any outstanding inturrupt 429 lda <DPPIADB ; Clear any outstanding inturrupt
413 ldy #$FFFF 430 ldy #$FFFF
450 sta <DPDskCtl 467 sta <DPDskCtl
451 ENDC 468 ENDC
452 469
453 lda >SavePIA0CRB,u ; Recover PIA0 state 470 lda >SavePIA0CRB,u ; Recover PIA0 state
454 sta <DPPia0CRB 471 sta <DPPia0CRB
455 lda <DPPIACRB ; Recover ACIA state 472
473 lda <DPPIACRB ; Disable Drive FIRQ source.
456 anda #$FC 474 anda #$FC
457 sta <DPPIACRB ; Disable Drive FIRQ source. 475 sta <DPPIACRB
458 lda >SaveACIACmd,u 476
477 IFEQ Upgraded32
478 lda >SaveACIACmd,u ; Recover ACIA state
459 sta <DPAciaCmd 479 sta <DPAciaCmd
480 ENDC
481
460 rts 482 rts
461 483
462 * Write 484 * Write
463 * 485 *
464 * Entry: 486 * Entry: