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

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

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

revision 1402 by dbug, Sun Feb 2 12:27:33 2014 UTC revision 1403 by Jede, Mon Apr 17 20:43:40 2017 UTC
# Line 125  read_one_sector Line 125  read_one_sector
125          ; the correct track.          ; the correct track.
126          ;          ;
127          ldx #loader_track_position          ldx #loader_track_position
128            .dsb ((FDC_track_register&3)-((*+3)&3))&3,$ea
129          cpx FDC_track_register          cpx FDC_track_register
130          beq track_ok          beq track_ok
131                    
132            .dsb ((FDC_data&3)-((*+3)&3))&3,$ea
133          ; Write the track number in the FDC data register          ; Write the track number in the FDC data register
134          stx FDC_data          stx FDC_data
135    
136            .dsb ((FDC_drq&3)-((*+3)&3))&3,$ea
137  wait_drive2  wait_drive2
138          lda FDC_drq                             ; 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
139          bmi wait_drive2          bmi wait_drive2
# Line 139  wait_drive2 Line 142  wait_drive2
142          ; Send a SEEK command (change track)          ; Send a SEEK command (change track)
143          ;          ;
144          lda #CMD_Seek          lda #CMD_Seek
145            .dsb ((FDC_command_register&3)-((*+3)&3))&3,$ea
146          sta FDC_command_register          sta FDC_command_register
147          ;          ;
148          ; 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.          ; 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.
# Line 149  wait_drive2 Line 153  wait_drive2
153  r_wait_completion  r_wait_completion
154          dey          dey
155          bne r_wait_completion          bne r_wait_completion
156            .dsb ((FDC_status_register&3)-((*+3)&3))&3,$ea
157  r2_wait_completion  r2_wait_completion
158          lda FDC_status_register          lda FDC_status_register
159          lsr          lsr
# Line 160  track_ok Line 165  track_ok
165          ; Write the sector number in the FDC sector register          ; Write the sector number in the FDC sector register
166  __auto__sector_index  __auto__sector_index
167          lda #loader_sector_position          lda #loader_sector_position
168            .dsb ((FDC_sector_register&3)-((*+3)&3))&3,$ea
169          sta FDC_sector_register ;          sta FDC_sector_register ;
170                    
171          ; Interdire les IRQ du fdc ICI !          ; Interdire les IRQ du fdc ICI !
# Line 171  __auto__sector_index Line 177  __auto__sector_index
177          ; Send a READSECTOR command          ; Send a READSECTOR command
178          ;          ;
179          lda #CMD_ReadSector          lda #CMD_ReadSector
180            .dsb ((FDC_command_register&3)-((*+3)&3))&3,$ea
181          sta FDC_command_register          sta FDC_command_register
182    
183          ldy #wait_status_floppy          ldy #wait_status_floppy
# Line 184  waitcommand Line 191  waitcommand
191          ; Read the sector data          ; Read the sector data
192          ;          ;
193          ldy #0          ldy #0
194            .dsb ((FDC_drq&3)-((*+3)&3))&3,$ea
195  fetch_bytes_from_FDC  fetch_bytes_from_FDC
196          lda FDC_drq          lda FDC_drq
197          bmi fetch_bytes_from_FDC          bmi fetch_bytes_from_FDC
198            .dsb ((FDC_data&3)-((*+3)&3))&3,$ea
199          lda FDC_data          lda FDC_data
200  __auto_write_address  __auto_write_address
201          sta location_loader,y          sta location_loader,y
# Line 195  __auto_write_address Line 204  __auto_write_address
204          bne fetch_bytes_from_FDC          bne fetch_bytes_from_FDC
205          ; Done loading the sector          ; Done loading the sector
206                    
207            .dsb ((FDC_status_register&3)-((*+3)&3))&3,$ea
208          lda FDC_status_register          lda FDC_status_register
209          and #$1C          and #$1C
210                                    

Legend:
Removed from v.1402  
changed lines
  Added in v.1403

  ViewVC Help
Powered by ViewVC 1.1.26