| ;; http://CPCrulez.fr
NOLIST ORG #9000 RUN &9000 DEB LD BC,#FA7E LD A,1 OUT (C),A LD HL,MESGO CALL ZPRINT CALL #BB06 DI LD BC,#FB7E CALL RECALE XOR A LD (PISTE), A START LD A,4 CALL PUTFDC XOR A CALL PUTFDC CALL GETFDC AND #C0 JP NZ,ERROR LD IX,SECT LD HL,FORMAT LD D,6 FORM LD A,(HL) CALL PUTFDC INC HL DEC D JR NZ,FORM LD D,3 LD E,(HL) LD H,0 LD A,(IX+0) DATA LD L,A TEST IN A,(C) JP P,TEST INC C OUT (C),E DEC C TEST1 IN A, (C) JP P,TEST1 INC C OUT (C),H DEC C TEST2 IN A,(C) JP P,TEST2 INC C OUT (C),L DEC C TEST3 IN A,(C) JP P,TEST3 INC C OUT (C),D DEC C INC IX LD A,(IX+0) CP #FF JR NZ,DATA LD HL,TAMP LD D,7 GET CALL GETFDC LD (HL),A INC HL DEC D JR NZ,GET LD A, (TAMP) AND #C8 JR NZ,RESTART LD A,(TAMP+1) AND #82 JP NZ,ERROR LD A,(TAMP+2) AND #22 JP NZ,ERROR LD A,4 CALL PUTFDC XOR A CALL PUTFDC CALL GETFDC AND #C0 JP NZ,ERROR EI LD A,"#" CALL #BB5A DI LD HL,PISTE INC (HL) LD A,(HL) CP 42 JR Z,SUIT SEEK LD A,#0F CALL PUTFDC XOR A CALL PUTFDC LD A, (HL) CALL PUTFDC CALL READY JP START RESTART CALL RECALE JR SEEK RECALE LD A,7 CALL PUTFDC XOR A CALL PUTFDC READY LD A,8 CALL PUTFDC CALL GETFDC LD E,A CALL GETFDC LD A,E AND #20 JR Z,READY RET SUIT LD A,7 CALL PUTFDC XOR A CALL PUTFDC CALL READY LD HL,ZEND CALL ZPRINT MOTOFF LD BC,#FA7E XOR A OUT (C),A EI RET ERROR EI CALL MOTOFF LD HL,MESERR CALL ZPRINT RET MESERR DB "Erreur (disquette protegee ou lecteur vide)" ZEND DB ",",10,13,0 MESGO DM "Pressez une touche pour lancer le formatage",10,13,0 ZPRINT LD A,(HL) OR A RET Z CALL #BB5A INC HL JR ZPRINT PUTFDC PUSH AF LIETA IN A,(C) RLA JR NC, LIETA SORS INC C POP AF OUT (C),A DEC C RET GETFDC PUSH BC LD BC,#FB7E LITFDC IN A,(C) RLA JR NC, LITFDC INC C IN A,(C) POP BC RET FORMAT DB #4D,0,3,5,80 REMP DB #AC PISTE DB 0 SECT DB 1,4,2,5,3,#FF TAMP DS 7,0 |