/[projet1]/public/oric/demos/SlideShowDemo/code/loader.asm
Defence Force logotype

Diff of /public/oric/demos/SlideShowDemo/code/loader.asm

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

revision 1024 by dbug, Sun Dec 15 09:42:42 2013 UTC revision 1035 by dbug, Sun Dec 15 15:35:39 2013 UTC
# Line 23  irq_save_a                     .dsb 1      ; To preserve t Line 23  irq_save_a                     .dsb 1      ; To preserve t
23  Initialize  Initialize
24          jmp StartUp          jmp StartUp
25    
26    #define LOADER
27    
28  ; This file is generated by the floppy builder  ; This file is generated by the floppy builder
29  #include "floppy_description.h"  #include "floppy_description.h"
30    
# Line 30  Initialize Line 32  Initialize
32    
33  StartUp  StartUp
34          ;jmp StartUp          ;jmp StartUp
         jsr SetUpIrqHandlers      
35          jsr SoftHiresWithCopyCharset          jsr SoftHiresWithCopyCharset
36    
   
37          ;ldx #LOADER_FIRST_PICTURE          ;ldx #LOADER_FIRST_PICTURE
38          ;jsr LoadData          ;jsr LoadData
39          ;STOP(1)          ;STOP(1)
# Line 53  loop_forever_demo_finished Line 53  loop_forever_demo_finished
53          jmp loop_forever_demo_finished          jmp loop_forever_demo_finished
54                    
55                    
 ClearZeroPage  
 .(  
         lda #0  
         tax  
 loop  
         sta $00,x  
         dex  
         bne loop          
         rts      
 .)        
   
           
 SetUpIrqHandlers  
         sei  
                   
         ; Make sure the microdisc IRQ is disabled        
         jsr WaitCompletion  
           
         ;lda #%10000100                         ; Disable the FDC (Eprom select + FDC Interrupt request)  
         ;sta MICRODISC  
   
         ;jsr WaitCompletion  
   
         rts      
56                                    
57  IrqHandler  IrqHandler
58          sta irq_save_a          sta irq_save_a
# Line 159  first_side Line 135  first_side
135          lda FileStartSector,x          lda FileStartSector,x
136          sta current_sector          sta current_sector
137    
138        ; FileSizeLow/FileSizeHigh
139          ; Number of sectors to load          ; Number of sectors to load
140          lda FileSectorCount,x            lda FileSizeHigh,x      
141          sta sectors_to_go          sta sectors_to_go
142            lda FileSizeLow,x
143            beq skip
144            inc sectors_to_go
145    skip    
146                    
147          ;          ;
148          ; Loop to read all the sectors            ; Loop to read all the sectors  
# Line 238  microdisc_read_data Line 219  microdisc_read_data
219      bmi microdisc_read_data      bmi microdisc_read_data
220    
221          lda $313          lda $313
222  __auto_write_address          sta $200,y              ; Store the byte in page 2
         sta $c000,y  
223          iny          iny
224    
225          bne microdisc_read_data          bne microdisc_read_data
# Line 247  __auto_write_address Line 227  __auto_write_address
227          lda FDC_status_register          lda FDC_status_register
228          and #$1C          and #$1C
229    
230          ; Try to let time to an IRQ to play          ; Try to let time to an IRQ to play, and during that time copy the sector to the final location
231          cli          cli
232    
233            ldy #0
234    loop_copy
235            lda $200,y                      ; Load the byte from page 2
236    __auto_write_address
237            sta $c000,y             ; Store it to the final location
238            iny
239            bne loop_copy
240    
241          nop          nop
242          nop          nop
243          sei          sei
# Line 258  __auto_write_address Line 247  __auto_write_address
247          dec sectors_to_go          dec sectors_to_go
248          bne read_sectors_loop          bne read_sectors_loop
249    
250            jsr WaitCompletion
251    
252          ; Data successfully loaded (we hope), so we restore the interrupts          ; Data successfully loaded (we hope), so we restore the interrupts
253          cli          cli
254          rts          rts
255                    
256  ExecuteData      ExecuteData    
         jsr SetUpIrqHandlers  
         jsr ClearZeroPage  
257  __auto_execute_address  __auto_execute_address
258          jsr $a000          jmp $a000
         jsr SetUpIrqHandlers  
         rts  
259    
260    
261  WaitCompletion  WaitCompletion

Legend:
Removed from v.1024  
changed lines
  Added in v.1035

  ViewVC Help
Powered by ViewVC 1.1.26