/[projet1]/public/oric/demos/SlideShowDemo/code/sector_2-microdisc.asm
Defence Force logotype

Diff of /public/oric/demos/SlideShowDemo/code/sector_2-microdisc.asm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1046 by dbug, Sat Dec 21 13:50:30 2013 UTC revision 1047 by dbug, Sun Dec 22 11:02:56 2013 UTC
# Line 111  read_one_sector Line 111  read_one_sector
111          stx FDC_data          stx FDC_data
112    
113  wait_drive2  wait_drive2
114          lda $318                                ; We are waiting for the drive maybe not useful if drive is ready after the eprom boot          lda FDC_drq                             ; We are waiting for the drive maybe not useful if drive is ready after the eprom boot
115          bmi wait_drive2          bmi wait_drive2
116                    
117          ;          ;
# Line 119  wait_drive2 Line 119  wait_drive2
119          ;          ;
120          lda #CMD_Seek          lda #CMD_Seek
121          sta FDC_command_register          sta FDC_command_register
122          jsr WaitCompletion          ;
123            ; Command words should only be loaded in the Command Register when the Busy status bit is off (Status bit 0). The one exception is the Force Interrupt command.
124            ; Whenever a command is being executed, the Busy status bit is set.
125            ; When a command is completed, an interrupt is generated and the busy status bit is reset.
126            ; The Status Register indicates whethter the completed command encountered an error or was fault free. For ease of discussion, commands are divided into four types (I, II, III, IV).
127            ldy #4
128    r_wait_completion
129            dey
130            bne r_wait_completion
131    r2_wait_completion
132            lda FDC_status_register
133            lsr
134            bcs r2_wait_completion
135            asl
136    
137  track_ok          track_ok        
138    
139          ; Write the sector number in the FDC sector register          ; Write the sector number in the FDC sector register
# Line 130  __auto__sector_index Line 144  __auto__sector_index
144          ; Interdire les IRQ du fdc ICI !          ; Interdire les IRQ du fdc ICI !
145          ;lda #%10000101                         ; on force les le Microdisk en side0, drive A ... Set le bit de données !!!          ;lda #%10000101                         ; on force les le Microdisk en side0, drive A ... Set le bit de données !!!
146          lda #%10000100                  ; on force les le Microdisk en side0, drive A ... Set le bit de données !!!          lda #%10000100                  ; on force les le Microdisk en side0, drive A ... Set le bit de données !!!
147          sta MICRODISC          sta FDC_flags
148                                                    
149          ;          ;
150          ; Send a READSECTOR command          ; Send a READSECTOR command
# Line 150  waitcommand Line 164  waitcommand
164          ;          ;
165          ldy #0          ldy #0
166  fetch_bytes_from_FDC  fetch_bytes_from_FDC
167          lda $0318          lda FDC_drq
168          bmi fetch_bytes_from_FDC          bmi fetch_bytes_from_FDC
169          lda $0313          lda FDC_data
170  __auto_write_address  __auto_write_address
171          sta location_loader,y          sta location_loader,y
172    
# Line 178  sector_OK Line 192  sector_OK
192          ;          ;
193          sei          sei
194          lda #%10000001                  ; Disable the FDC (Eprom select + FDC Interrupt request)          lda #%10000001                  ; Disable the FDC (Eprom select + FDC Interrupt request)
195          sta MICRODISC          sta FDC_flags
196                    
197            ldx #FDC_OFFSET_MICRODISC
198          jmp location_loader          jmp location_loader
199    
200                    
201  ;  
 ; Command words should only be loaded in the Command Register when the  
 ; Busy status bit is off (Status bit 0). The one exception is the Force  
 ; Interrupt command. Whenever a command is being executed, the Busy status  
 ; bit is set. When a command is completed, an interrupt is generated and  
 ; the busy status bit is reset. The Status Register indicates whethter the  
 ; completed command encountered an error or was fault free. For ease of  
 ; discussion, commands are divided into four types (I, II, III, IV).  
 ;  
 WaitCompletion  
 .(  
         ldy #4  
 r_wait_completion  
         dey  
         bne r_wait_completion  
 r2_wait_completion  
         lda FDC_status_register  
         lsr  
         bcs r2_wait_completion  
         asl  
         rts  
 .)  
202    
203    
204  sector_counter          .byt (($FFFF-location_loader)+1)/256  sector_counter          .byt (($FFFF-location_loader)+1)/256

Legend:
Removed from v.1046  
changed lines
  Added in v.1047

  ViewVC Help
Powered by ViewVC 1.1.26