base:flexloader_3.0
Differences
This shows you the differences between two versions of the page.
base:flexloader_3.0 [2015-04-17 04:31] – external edit 127.0.0.1 | base:flexloader_3.0 [2015-05-17 11:36] (current) – burglar | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Flexloader 3.0 ====== | ||
+ | WARNING: This is NOT an IRQ loader, it's only stable without IRQ and screen off. | ||
+ | |||
+ | Non drive locking IRQ/FAST loader 1541 only | ||
+ | |||
+ | This source can be compiled with tass/ | ||
+ | |||
+ | The drive initialize routine is to slow to run within a irq. | ||
+ | |||
+ | The original routine sets #$0f to $1c07, the frequency of the stepper motor. | ||
+ | This is unusually fast! According to the [[http:// | ||
+ | |||
+ | < | ||
+ | ; | ||
+ | ; loader v3.0 (c) Jayce/Focus 1993! | ||
+ | ; finally converted to turboassembler/ | ||
+ | ; | ||
+ | *= $6000 | ||
+ | jsr faster ;for faster acces to 1541 | ||
+ | jsr init ;warm reset vectors | ||
+ | lda #$00 | ||
+ | sta $d020 | ||
+ | sta $d011 | ||
+ | jsr fopen ;open logical file | ||
+ | |||
+ | ; | ||
+ | ;-remove this sei if a irq is used - | ||
+ | ; | ||
+ | sei | ||
+ | ; | ||
+ | |||
+ | jmp load ;and go loading | ||
+ | |||
+ | |||
+ | ; | ||
+ | fnln .byte 16 | ||
+ | fnm .text " | ||
+ | ; | ||
+ | |||
+ | fopen lda fnln | ||
+ | ldx #<fnm | ||
+ | ldy #>fnm | ||
+ | jsr $ffbd | ||
+ | lda #1 | ||
+ | ldy #0 | ||
+ | ldx #8 | ||
+ | jsr $ffba | ||
+ | jsr $ffc0 | ||
+ | bcc fopeno | ||
+ | fopener | ||
+ | jsr $ffc3 | ||
+ | jsr $ffcc | ||
+ | |||
+ | jmp fopen;keep jumping on error | ||
+ | |||
+ | fopeno | ||
+ | jsr $ffc6 | ||
+ | bcs fopener | ||
+ | jsr $ffa5 | ||
+ | lda $90 | ||
+ | bne fopener | ||
+ | lda #0 | ||
+ | sta getchara | ||
+ | sta getcharb | ||
+ | sta getcharc | ||
+ | jsr insdisk | ||
+ | lda #$08 | ||
+ | jsr $ffb1 | ||
+ | lda #$6f | ||
+ | jsr $ff93 | ||
+ | ldy #$00 | ||
+ | fopen1 | ||
+ | jsr $ffa8 | ||
+ | iny | ||
+ | cpy #$20 | ||
+ | bne fopen1 | ||
+ | jsr $ffae | ||
+ | lda #$01 ;reload address lo byte | ||
+ | sta $ae | ||
+ | lda #$08 ;reload address hi byte (here it's $0801) | ||
+ | sta $af | ||
+ | rts | ||
+ | |||
+ | getchara .byte 0 | ||
+ | getcharb .byte 0 | ||
+ | getcharc .byte 0 | ||
+ | |||
+ | |||
+ | |||
+ | load jsr getchar | ||
+ | jsr getchar | ||
+ | load1 jsr getchar | ||
+ | jsr putch | ||
+ | lda $90 | ||
+ | beq load1 | ||
+ | stop jsr init | ||
+ | jmp $080d ; jump adress after loading | ||
+ | |||
+ | getchar | ||
+ | bne getchar1 | ||
+ | lda #2 | ||
+ | sta getcharb | ||
+ | jsr charin | ||
+ | sta getchara | ||
+ | bne getchar1 | ||
+ | jsr charin | ||
+ | sta getcharc | ||
+ | getchar1 lda getchara | ||
+ | bne getchar2 | ||
+ | lda getcharb | ||
+ | cmp getcharc | ||
+ | bne getchar2 | ||
+ | jsr charin | ||
+ | ldx #$80 | ||
+ | stx $90 | ||
+ | rts | ||
+ | getchar2 lda #$00 | ||
+ | sta $90 | ||
+ | jsr charin | ||
+ | inc getcharb | ||
+ | inc $ac | ||
+ | bne getchar3 | ||
+ | inc $ad | ||
+ | getchar3 rts | ||
+ | |||
+ | charin | ||
+ | lda #$0b | ||
+ | sta $dd00 | ||
+ | charin0 | ||
+ | bpl charin | ||
+ | |||
+ | ; | ||
+ | ;-remove this if no irq is used - | ||
+ | ; | ||
+ | charin1 ; lda $d012 | ||
+ | ; cmp #$31 ; | ||
+ | ; bcs charin1 | ||
+ | ; | ||
+ | |||
+ | charin2 | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | nop | ||
+ | lda $dd00 | ||
+ | lsr a | ||
+ | lsr a | ||
+ | eor $dd00 | ||
+ | lsr a | ||
+ | lsr a | ||
+ | eor $dd00 | ||
+ | lsr a | ||
+ | lsr a | ||
+ | eor #3 ;$dd00 bankswitch value | ||
+ | eor $dd00 | ||
+ | rts | ||
+ | |||
+ | |||
+ | putch tax | ||
+ | lda $af | ||
+ | beq putche | ||
+ | txa | ||
+ | ldx #$00 | ||
+ | inc $01 ; use the Y to set $01 manualy if needed | ||
+ | sta ($ae,x) | ||
+ | dec $01 | ||
+ | ;sta $d020 ;(flash aaahaaaaa!) | ||
+ | inc $ae | ||
+ | bne putche | ||
+ | inc $af | ||
+ | putche | ||
+ | |||
+ | |||
+ | fstt .byte $4d, | ||
+ | cli | ||
+ | lda $f9 | ||
+ | asl a | ||
+ | tax | ||
+ | lda $06,x | ||
+ | sta $08 | ||
+ | lda $07,x | ||
+ | sta $09 | ||
+ | lda #$80 | ||
+ | sta $01 | ||
+ | jmp $030d | ||
+ | |||
+ | ;insert the code into the 1541 #08 | ||
+ | insdisk | ||
+ | sta $fb | ||
+ | lda #$03 | ||
+ | sta $fc | ||
+ | lda #< | ||
+ | sta $fd | ||
+ | lda #> | ||
+ | sta $fe | ||
+ | insd0 lda #$08 ;<< device ID #08 | ||
+ | jsr $ffb1 | ||
+ | lda #$6f | ||
+ | jsr $ff93 | ||
+ | lda #$4d | ||
+ | jsr $ffa8 | ||
+ | lda #$2d | ||
+ | jsr $ffa8 | ||
+ | lda #" | ||
+ | jsr $ffa8 | ||
+ | lda $fb | ||
+ | jsr $ffa8 | ||
+ | lda $fc | ||
+ | jsr $ffa8 | ||
+ | lda #$20 | ||
+ | jsr $ffa8 | ||
+ | ldy #$00 | ||
+ | insd1 lda ($fd),y | ||
+ | jsr $ffa8 | ||
+ | iny | ||
+ | cpy #$20 | ||
+ | bne insd1 | ||
+ | jsr $ffae | ||
+ | clc | ||
+ | lda $fd | ||
+ | adc #$20 | ||
+ | sta $fd | ||
+ | bcc insd2 | ||
+ | inc $fe | ||
+ | insd2 clc | ||
+ | lda $fb | ||
+ | adc #$20 | ||
+ | sta $fb | ||
+ | cmp #$e0 | ||
+ | bcc insd0 | ||
+ | rts | ||
+ | |||
+ | ;---a byte dump of the in-drive code --- | ||
+ | diskdat | ||
+ | .byte $5b, | ||
+ | .byte $e6, | ||
+ | .byte $09, | ||
+ | .byte $c9, | ||
+ | .byte $ad, | ||
+ | .byte $01, | ||
+ | .byte $02, | ||
+ | .byte $20, | ||
+ | .byte $20, | ||
+ | .byte $03, | ||
+ | .byte $d0, | ||
+ | .byte $aa, | ||
+ | .byte $85, | ||
+ | .byte $c0, | ||
+ | .byte $fb, | ||
+ | .byte $a6, | ||
+ | .byte $fb, | ||
+ | .byte $0f, | ||
+ | .byte $03, | ||
+ | .byte $0f, | ||
+ | .byte $a9, | ||
+ | .byte $60, | ||
+ | .byte $a0, | ||
+ | .byte $00, | ||
+ | .byte $00, | ||
+ | .byte $ad, | ||
+ | .byte $80, | ||
+ | .byte $60, | ||
+ | .byte $03, | ||
+ | .byte $c1, | ||
+ | .byte $00, | ||
+ | .byte $0f, | ||
+ | .byte $09, | ||
+ | .byte $0a, | ||
+ | |||
+ | ;-- a faster drive access stuff -- | ||
+ | |||
+ | faster | ||
+ | jsr $ffb1 | ||
+ | lda #$6f | ||
+ | jsr $ff93 | ||
+ | lda #$4d ; M | ||
+ | jsr $ffa8 | ||
+ | lda #$2d ; - | ||
+ | jsr $ffa8 | ||
+ | lda #$57 ; W | ||
+ | jsr $ffa8 | ||
+ | lda #$07 ; <$1c07, stepper motor frequency | ||
+ | jsr $ffa8 | ||
+ | lda #$1c ; >$1c07 | ||
+ | jsr $ffa8 | ||
+ | lda #$01 ; data length 1 byte | ||
+ | jsr $ffa8 | ||
+ | lda #$0f ; frequency = $0f | ||
+ | jsr $ffa8 | ||
+ | jsr $ffae | ||
+ | rts | ||
+ | |||
+ | init | ||
+ | sei | ||
+ | jsr $fd15 | ||
+ | jsr $fda3 | ||
+ | ldx #$00 | ||
+ | jsr $e5aa | ||
+ | cli | ||
+ | rts | ||
+ | </ |
base/flexloader_3.0.txt · Last modified: 2015-05-17 11:36 by burglar