--- uae/src/filesys.asm 2018/04/24 16:39:49 1.1.1.1 +++ uae/src/filesys.asm 2018/04/24 16:47:17 1.1.1.2 @@ -2,6 +2,9 @@ ; This file can be translated with A68k or PhxAss and then linked with BLink ; to produce an Amiga executable. Make sure it does not contain any ; relocations, then run it through the filesys.sh script +; +; Patrick: It also works with SAS/C asm+slink, but I had to remove +; the .l from jsr.l and jmp.l. dc.l 16 our_seglist: @@ -15,43 +18,13 @@ start: bootcode: lea.l doslibname(pc),a1 - jsr.l -96(a6) ; FindResident + jsr -96(a6) ; FindResident move.l d0,a0 move.l 22(a0),d0 move.l d0,a0 jsr (a0) rts -exter_data: -exter_server: - movem.l a2,-(sp) - moveq.l #0,d0 - jsr.l $F0FF50 - tst.l d0 - beq.b exter_server_exit - ; This is the hard part - we have to send some messages. - move.l 4.w,a6 -EXTS_loop: - moveq.l #2,d0 - jsr.l $F0FF50 - tst.l d0 - beq.b EXTS_done - move.l d0,a2 - moveq.l #3,d0 - jsr.l $F0FF50 - move.l a2,a0 - move.l d0,a1 - jsr -366(a6) ; PutMsg - bra.b EXTS_loop - -EXTS_done: - moveq.l #4,d0 - jsr.l $F0FF50 - moveq.l #1,d0 ; clear Z - it was for us. -exter_server_exit: - movem.l (sp)+,a2 - rts - filesys_init: movem.l d0-d7/a0-a6,-(sp) move.l 4.w,a6 @@ -59,18 +32,18 @@ filesys_init: lea.l explibname(pc),a1 ; expansion lib name moveq.l #36,d0 moveq.l #0,d5 - jsr.l -552(a6) ; OpenLibrary + jsr -552(a6) ; OpenLibrary tst.l d0 bne.b FSIN_explibok lea.l explibname(pc),a1 ; expansion lib name moveq.l #0,d0 moveq.l #1,d5 - jsr.l -552(a6) ; OpenLibrary + jsr -552(a6) ; OpenLibrary FSIN_explibok: move.l d0,a4 moveq.l #88,d0 moveq.l #1,d1 ; MEMF_PUBLIC - jsr.l -198(a6) ; AllocMem + jsr -198(a6) ; AllocMem move.l d0,a3 ; param packet moveq.l #84,d7 ; initialize it @@ -86,7 +59,7 @@ FSIN_init_units: move.l a3,a0 movem.l d6/a3,-(sp) move.l #1,d7 - bsr.b make_dev + bsr.w make_dev movem.l (sp)+,d6/a3 addq.l #$1,d6 bra.b FSIN_init_units @@ -94,10 +67,10 @@ FSIN_init_units: FSIN_units_ok: move.l 4.w,a6 move.l a4,a1 - jsr.l -414(a6) ; CloseLibrary - bsr.b setup_exter + jsr -414(a6) ; CloseLibrary + bsr.w setup_exter move.l 4.w,a6 - jsr.l $F0FF80 + jsr $F0FF80 moveq.l #3,d1 moveq.l #-10,d2 move.l #$200000,a0 @@ -112,6 +85,40 @@ FSIN_chip_done general_ret: rts +exter_data: +exter_server: + movem.l a2,-(sp) + moveq.l #0,d0 + jsr $F0FF50 + tst.l d0 + beq.b exter_server_exit + ; This is the hard part - we have to send some messages. + move.l 4.w,a6 +EXTS_loop: + moveq.l #2,d0 + jsr $F0FF50 + cmp.l #1,d0 + blt.b EXTS_done + bgt.b EXTS_signal_reply + jsr -366(a6) ; PutMsg + bra.b EXTS_loop +EXTS_signal_reply: + cmp.l #2,d0 + bgt.b EXTS_reply + move.l d1,d0 + jsr -$144(a6) ; Signal + bra.b EXTS_loop +EXTS_reply: + jsr -$17a(a6) ; ReplyMsg + bra.b EXTS_loop +EXTS_done: + moveq.l #4,d0 + jsr $F0FF50 + moveq.l #1,d0 ; clear Z - it was for us. +exter_server_exit: + movem.l (sp)+,a2 + rts + setup_exter: move.l 4.w,a6 moveq.l #26,d0 @@ -125,7 +132,7 @@ setup_exter: lea.l exter_server(pc),a0 move.l a0,18(a1) moveq.l #13,d0 - jmp.l -168(a6) ; AddIntServer + jmp -168(a6) ; AddIntServer make_dev: ; IN: A0 param_packet, D6: unit_no, D7: boot, A4: expansionbase move.l $F0FFFC,a5 ; filesys base @@ -135,12 +142,12 @@ make_dev: ; IN: A0 param_packet, D6: uni ; Don't init hardfiles if < V36 and.l d5,d0 - bne.b general_ret + bne.w general_ret move.l a4,a6 - jsr.l -144(a6) ; MakeDosNode() + jsr -144(a6) ; MakeDosNode() move.l d0,a3 ; devicenode - jsr.l $F0FF20 ; record in ui.startup + jsr $F0FF20 ; record in ui.startup moveq.l #0,d0 move.l d0,8(a3) ; dn_Task move.l d0,16(a3) ; dn_Handler @@ -164,7 +171,7 @@ MKDV_doboot: move.l 4.w,a6 moveq.l #20,d0 moveq.l #0,d1 - jsr.l -198(a6) ; AllocMem + jsr -198(a6) ; AllocMem move.l d0,a1 ; bootnode moveq.l #0,d0 move.l d0,(a1) @@ -176,7 +183,7 @@ MKDV_doboot: move.l $104(a5),10(a1) ; filesys_configdev move.l a3,16(a1) ; devicenode lea.l 74(a4),a0 ; MountList - jmp.l -270(a6) ; Enqueue() + jmp -270(a6) ; Enqueue() MKDV_noboot: move.l a3,a0 @@ -184,7 +191,7 @@ MKDV_noboot: move.l d1,a1 moveq.l #-1,d0 move.l a4,a6 ; expansion base - jmp.l -150(a6) ; AddDosNode + jmp -150(a6) ; AddDosNode filesys_mainloop: move.l 4.w,a6 @@ -208,7 +215,7 @@ filesys_mainloop: ; 32: the volume (80+44+1 bytes) move.l #80+44+1+20+12,d0 move.l #$10001,d1 ; MEMF_PUBLIC | MEMF_CLEAR - jsr.l -198(a6) ; AllocMem + jsr -198(a6) ; AllocMem move.l d0,a3 moveq.l #0,d6 move.l d6,(a3) @@ -225,7 +232,7 @@ filesys_mainloop: move.l d0,a4 move.l 10(a4),d3 ; ln_Name moveq.l #0,d0 - jsr.l $F0FF40 + jsr $F0FF40 bra.b FSML_Reply ; We abuse some of the fields of the message we get. Offset 0 is @@ -247,7 +254,7 @@ FSML_loop: ; It's a dummy packet indicating that some queued command finished. moveq.l #1,d0 - jsr.l $F0FF50 + jsr $F0FF50 ; Go through the queue and reply all those that finished. lea.l 4(a3),a2 move.l (a2),a0 @@ -285,7 +292,7 @@ FSML_FromDOS: FSML_DoCommand: bsr.b LockCheck ; Make sure there are enough locks for the C code to grab. - jsr.l $F0FF30 + jsr $F0FF30 tst.l d0 beq.b FSML_Reply ; The command did not complete yet. Enqueue it and increase number of @@ -332,7 +339,7 @@ LKCK_ListEnd: move.l d7,a2 moveq.l #24,d0 ; sizeof Lock is 20, 4 for chain moveq.l #1,d1 ; MEMF_PUBLIC - jsr.l -198(a6) ; AllocMem + jsr -198(a6) ; AllocMem addq.w #1,d6 move.l d0,a2 move.l d7,(a2)