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

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

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

revision 1397 by dbug, Sun Apr 9 10:42:35 2017 UTC revision 1398 by Jede, Sun Apr 9 18:38:29 2017 UTC
# Line 138  read_one_sector Line 138  read_one_sector
138          ; the correct track.          ; the correct track.
139          ;          ;
140          ldx #FLOPPY_LOADER_TRACK          ldx #FLOPPY_LOADER_TRACK
141            .dsb ((FDC_track_register&3)-((*+3)&3))&3,$ea
142          cpx FDC_track_register          cpx FDC_track_register
143          beq track_ok          beq track_ok
144                    
# Line 145  read_one_sector Line 146  read_one_sector
146          stx FDC_data          stx FDC_data
147    
148  wait_drive2  wait_drive2
149            .dsb ((FDC_drq&3)-((*+3)&3))&3,$ea
150          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
151          bmi wait_drive2          bmi wait_drive2
152                    
# Line 152  wait_drive2 Line 154  wait_drive2
154          ; Send a SEEK command (change track)          ; Send a SEEK command (change track)
155          ;          ;
156          lda #CMD_Seek          lda #CMD_Seek
157            .dsb ((FDC_command_register&3)-((*+3)&3))&3,$ea
158          sta FDC_command_register          sta FDC_command_register
159          ;          ;
160          ; 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 163  r_wait_completion Line 166  r_wait_completion
166          dey          dey
167          bne r_wait_completion          bne r_wait_completion
168  r2_wait_completion  r2_wait_completion
169            .dsb ((FDC_status_register&3)-((*+3)&3))&3,$ea
170          lda FDC_status_register          lda FDC_status_register
171          lsr          lsr
172          bcs r2_wait_completion          bcs r2_wait_completion
# Line 173  track_ok Line 177  track_ok
177          ; Write the sector number in the FDC sector register          ; Write the sector number in the FDC sector register
178  __auto__sector_index  __auto__sector_index
179          lda #FLOPPY_LOADER_SECTOR          lda #FLOPPY_LOADER_SECTOR
180            .dsb ((FDC_sector_register&3)-((*+3)&3))&3,$ea
181          sta FDC_sector_register ;          sta FDC_sector_register ;
182                    
183          lda #%10000100                  ; Force the system to use the Side 0 of the A: drive          lda #%10000100                  ; Force the system to use the Side 0 of the A: drive
# Line 182  __auto__sector_index Line 187  __auto__sector_index
187          ; Send a READSECTOR command          ; Send a READSECTOR command
188          ;          ;
189          lda #CMD_ReadSector          lda #CMD_ReadSector
190            .dsb ((FDC_command_register&3)-((*+3)&3))&3,$ea
191          sta FDC_command_register          sta FDC_command_register
192    
193          ldy #wait_status_floppy          ldy #wait_status_floppy
# Line 196  waitcommand Line 202  waitcommand
202          ;          ;
203          ldy #0          ldy #0
204  fetch_bytes_from_FDC  fetch_bytes_from_FDC
205            .dsb ((FDC_drq&3)-((*+3)&3))&3,$ea
206          lda FDC_drq          lda FDC_drq
207          bmi fetch_bytes_from_FDC          bmi fetch_bytes_from_FDC
208            .dsb ((FDC_data&3)-((*+3)&3))&3,$ea
209          lda FDC_data          lda FDC_data
210  __auto_write_address  __auto_write_address
211          sta FLOPPY_LOADER_ADDRESS,y          sta FLOPPY_LOADER_ADDRESS,y
# Line 206  __auto_write_address Line 214  __auto_write_address
214          bne fetch_bytes_from_FDC          bne fetch_bytes_from_FDC
215          ; Done loading the sector          ; Done loading the sector
216                    
217            .dsb ((FDC_status_register&3)-((*+3)&3))&3,$ea
218          lda FDC_status_register          lda FDC_status_register
219          and #$1C          and #$1C
220                                    

Legend:
Removed from v.1397  
changed lines
  Added in v.1398

  ViewVC Help
Powered by ViewVC 1.1.26