PDA

View Full Version : Open source small ROM parts


Don_Adan
23 January 2012, 14:27
I started next small project. This time I reworked/updated short Amiga ROM modules.

http://wt.exotica.org.uk/test.html

At first new filesystem.resource with DOS6/DOS7/DOS8 support. Seems that DOS7 and DOS8
now works for Amiga68k.

Here is filesystem.resource source.


; Resourced version of filesystem.resource (40.1) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Bart 'Kodiak' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

;lbC000000 ILLEGAL
; dc.l lbC000000
; dc.l lbW00019E
; dc.l $1280850
; dc.l FileSystemres.MSG
; dc.l filesysres401.MSG
; dc.l lbC000098
;FileSystemres.MSG dc.b 'FileSystem.resource',0
;filesysres401.MSG dc.b 'filesysres 40.1 (15.2.93)',$D,$A,0

;lbC00004A MOVEA.L $12(A5),A2
;lbC00004E MOVE.L (A2),D0
; BEQ.S lbC00005E
; CMP.L 14(A2),D2
; BEQ.S lbC00005C
; MOVEA.L D0,A2
; BRA.S lbC00004E

;lbC00005C MOVEQ #1,D0
;lbC00005E RTS

;lbC000060 MOVE.L #$10001,D1
; JSR -$C6(A6)
; TST.L D0
; BEQ.S lbC000080
; MOVEA.L D0,A2
; LEA $1A(A5),A0
; MOVEA.L (A0),A1
; MOVE.L A2,(A0)
; SUBQ.L #4,A0
; MOVEM.L A0/A1,(A2)
; MOVE.L A2,(A1)
;lbC000080 RTS

;lbC000082 MOVE.L D2,14(A2)
; MOVE.L D1,$12(A2)
; CLR.L $16(A2)
; LEA filesysres401.MSG(PC),A0
; MOVE.L A0,10(A2)
; RTS

;lbC000098 MOVEM.L D2/A2/A3/A5,-(SP)
; LEA FileSystemres.MSG(PC),A1
; JSR -$1F2(A6)
; TST.L D0
; BEQ.S lbC0000F6
; MOVEA.L D0,A5
; MOVE.L #$444F5305,D2
;lbC0000B0 BSR.S lbC00004A
; BNE.S lbC0000BA
; MOVEQ #$1A,D0
; BSR.S lbC000060
; BEQ.S lbC0000CC
;lbC0000BA MOVE.L #$280001,D1
; CMP.L $12(A2),D1
; BLE.S lbC0000C8
; BSR.S lbC000082
;lbC0000C8 SUBQ.B #1,D2
; BNE.S lbC0000B0
;lbC0000CC MOVE.L #$554E4901,D2
; BSR.L lbC00004A
; BNE.S lbC0000EE
; MOVEQ #$2A,D0
; BSR.S lbC000060
; BEQ.S lbC0000EE
; MOVEQ #0,D1
; BSR.S lbC000082
; BSET #3,$19(A2)
; BSET #7,$26(A2)
;lbC0000EE MOVEQ #0,D0
;lbC0000F0 MOVEM.L (SP)+,D2/A2/A3/A5
; RTS

;lbC0000F6 MOVEQ #$33,D0
; ROL.L #2,D0
; MOVE.L #$10001,D1
; JSR -$C6(A6)
; TST.L D0
; BEQ.S lbC0000EE
; MOVEA.L D0,A5
; MOVE.B #8,8(A5)
; LEA FileSystemres.MSG(PC),A0
; MOVE.L A0,10(A5)
; LEA filesysres401.MSG(PC),A0
; MOVE.L A0,14(A5)
; LEA $12(A5),A3
; MOVE.L A3,8(A3)
; ADDQ.L #4,A3
; CLR.L (A3)
; MOVE.L A3,-(A3)
; LEA $20(A5),A2
; MOVE.L #$444F5305,D2
;lbC000138 MOVE.L #$280001,D1
; BSR.L lbC000082
; MOVEA.L A3,A0
; MOVEA.L A2,A1
; ADDQ.L #4,A0
; MOVE.L 4(A0),D0
; MOVE.L A1,4(A0)
; EXG D0,A0
; MOVEM.L D0/A0,(A1)
; MOVE.L A1,(A0)
; ADDA.W #$1A,A2
; SUBQ.B #1,D2
; BNE.S lbC000138
; LEA $A2(A5),A2
; MOVE.L #$554E4901,D2
; MOVEQ #0,D1
; BSR.L lbC000082
; MOVEA.L A3,A0
; MOVEA.L A2,A1
; ADDQ.L #4,A0
; MOVE.L 4(A0),D0
; MOVE.L A1,4(A0)
; EXG D0,A0
; MOVEM.L D0/A0,(A1)
; MOVE.L A1,(A0)
; BSET #3,$19(A2)
; BSET #7,$26(A2)
; MOVEA.L A5,A1
; JSR -$1E6(A6)
; MOVE.L A5,D0
; BRA.L lbC0000F0

;lbW00019E

MatchTag
ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b 1 ; flags
dc.b $2E ; version
dc.b 8 ; type
dc.b $50 ; priority
Values
dc.l FileSystemres.MSG ; name
dc.l filesysres401.MSG ; id string
dc.l InitResource ; init code

; static values

dc.l $444F5308 ; DOS8
dc.l $554E4901 ; UNI1
dc.l $002E0000 ; fse_Version (46.0)
dc.l $00010001 ; cleared mem flags

CheckID
move.l $12(A5),D0 ; fsr_FileSysEntries
Next
move.l D0,A2
move.l (A2),D0
beq.b NoEntry
cmp.l 14(A2),D5 ; fse_DosType
bne.b Next
moveq #1,D0
NoEntry
rts

InitResource
movem.l D2-D7/A2/A4/A5,-(SP)
movem.l Values(PC),D2-D7/A4
moveq #0,D4
exg D4,A4
move.l D2,A1
jsr -$1F2(A6) ; OpenResource
tst.l D0
beq.b FirstTime
move.l D0,A5
NextDOS bsr.b CheckID
bne.b Found
moveq #$1A,D0
bsr.b AllocAndLink
beq.b Failed
Found
cmp.l $12(A2),D7 ; check for FFS Vxx.x
ble.b InRange
bsr.b SetInfo
InRange
subq.b #1,D5
bne.b NextDOS
Failed
move.l D6,D5 ; UNI1
bsr.b CheckID
bne.b Bug
moveq #$2A,D0
bsr.b AllocAndLink
beq.b Quit
bsr.b SetInfoZero
bsr.b SetMe
; bra.b SetPtr ; possible bug for me, missing branch here
Bug moveq #0,D0 ; or here must be move.l A5,D0
Quit
movem.l (SP)+,D2-D7/A2/A4/A5
rts

AllocAndLink
move.l D4,D1
jsr -$C6(A6) ; AllocMem
tst.l D0
beq.b NoMemory
move.l D0,A2
AddHead
lea $1A(A5),A0
move.l (A0),A1
move.l A2,(A0)
subq.l #4,A0
movem.l A0/A1,(A2)
move.l A2,(A1)
NoMemory
rts

SetInfoZero
moveq #0,D7
SetInfo
movem.l D3/D5/D7/A4,10(A2)
rts

FirstTime
moveq #71,D0
lsl.w #2,D0 ; 284=32(head)+8*26(8xDOS)+42(UNI)+2(unused)
move.l D4,D1
jsr -$C6(A6) ; AllocMem
tst.l D0
beq.b Quit
move.l D0,A5
addq.l #8,D0
move.l D0,A2
move.w #$800,(A2)+ ; 8 - type
move.l D2,(A2)+ ; 10
move.l D3,(A2)+ ; 14
move.l A2,8(A2) ; 18
addq.l #4,A2
move.l A2,-(A2)
lea $20(A5),A2
LoopDos
bsr.b SetInfo
bsr.b AddHead
lea $1A(A2),A2
subq.b #1,D5
bne.b LoopDos
move.l D6,D5 ; UNI1
bsr.b SetInfoZero
bsr.b AddHead
bsr.b SetMe
move.l A5,A1
jsr -$1E6(A6) ; AddResource
SetPtr
move.l A5,D0
bra.b Quit

SetMe
bset #3,$19(A2)
bset #7,$26(A2)
rts

FileSystemres.MSG dc.b 'FileSystem.resource',0
filesysres401.MSG dc.b 'filesysres 46.0 (21.1.2012)',$D,$A,0
cnop 0,4
EndSkip

Don_Adan
23 January 2012, 14:29
Here is misc.resource source.


; Resourced version of misc.resource (37.1) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Bart 'Kodiak' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

;lbC03FE6C ILLEGAL
; dc.l lbC03FE6C
; dc.l lbW03FF1C
; dc.l $1250846
; dc.l miscresource.MSG
; dc.l misc3718191.MSG
; dc.l lbC03FEAC
;miscresource.MSG dc.b 'misc.resource',0
;misc3718191.MSG dc.b 'misc 37.1 (8.1.91)',$D,$A,0
; dc.b 0
; dc.b 0
; dc.b 0

;lbC03FEAC MOVE.L A2,-(SP)
; LEA lbW03FF14(PC),A0
; LEA lbW03FECC(PC),A1
; SUBA.L A2,A2
; MOVEQ #$32,D0
; JSR -$54(A6)
; TST.L D0
; BEQ.S lbC03FEC8
; MOVEA.L D0,A1
; JSR -$1E6(A6)
;lbC03FEC8 MOVEA.L (SP)+,A2
; RTS

;lbW03FECC dc.w $A008
; dc.w $800
; dc.w $800A
; dc.l miscresource.MSG
; dc.l $A00E0600
; dc.l $90140025
; dc.l $90160001
; dc.w 0

;lbC03FEE4 MOVEA.L 4.W,A0
; EXG A0,A6
; LSL.W #2,D0
; MOVE.W D0,D1
; ADDQ.B #1,$127(A6)
; MOVE.L $22(A0,D1.W),D0
; BNE.S lbC03FEFC
; MOVE.L A1,$22(A0,D1.W)
;lbC03FEFC MOVE.L A6,-(SP)
; MOVEA.L 4.W,A6
; JSR -$8A(A6) ; Permit - This call is guaranteed to preserve all registers.
; MOVEA.L (SP)+,A6
; EXG A0,A6
; RTS

;lbC03FF0C LSL.W #2,D0
; CLR.L $22(A6,D0.W)
; RTS

;lbW03FF14 dc.w $FFFF
; dc.w lbC03FEE4-lbW03FF14
; dc.w lbC03FF0C-lbW03FF14
; dc.w $FFFF
;lbW03FF1C

MatchTag
ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b 1 ; flags
dc.b $26 ; version
dc.b 8 ; type
dc.b $46 ; priority
dc.l miscresource.MSG ; name
dc.l misc3718191.MSG ; id string
dc.l InitResource ; init code

InitResource
move.l A2,-(SP)
lea Vectors(PC),A0 ; Vectors
lea Structure(PC),A1 ; Structure
sub.l A2,A2 ; init
moveq #$32,D0 ; dSize
jsr -$54(A6) ; MakeLibrary
move.l (SP)+,A2
tst.l D0
beq.b Failed
move.l D0,A1
jmp -$1E6(A6) ; AddResource

Structure
dc.w $A008 ; base offset $8
dc.w $0800 ; type
dc.w $800A ; base offset $A
dc.l miscresource.MSG ; name
dc.w $A00E ; base offset $E
dc.w $0600 ; id ???
dc.w $9014 ; base offset $14
dc.w $0026 ; version
dc.w $9016 ; base offset $16
dc.w 0 ; revision
dc.w 0 ; no more

; D0 - input
; A1 - input
; A6 - resource base

AllocMiscResource
move.l A6,-(SP)
lsl.w #2,D0
lea $22(A6,D0.W),A0
move.l 4.W,A6
addq.b #1,$127(A6)
move.l (A0),D0
bne.b Permit
move.l A1,(A0)
Permit
jsr -$8A(A6) ; Permit - This call is guaranteed to preserve all registers.
move.l (SP)+,A6
Failed
rts

; D0 - input
; A6 - resource base

FreeMiscResource
lsl.w #2,D0
clr.l $22(A6,D0.W)
rts

Vectors
dc.w $FFFF
dc.w AllocMiscResource-Vectors ; -6 _LVOAllocMiscResource
dc.w FreeMiscResource-Vectors ; -12 _LVOFreeMiscResource
dc.w $FFFF

miscresource.MSG dc.b 'misc.resource',0
misc3718191.MSG dc.b 'misc 38.0 (21.1.2012)',$D,$A,0
cnop 0,4
EndSkip

Bamiga2002
23 January 2012, 16:49
You dude are on ROMoroids! :D
Cool project!

Don_Adan
25 January 2012, 14:06
Here is potgo.resource source.


; Resourced version of potgo.resource (37.4) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Bart 'Kodiak' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

;lbC03FD34 ILLEGAL
; dc.l lbC03FD34
; dc.l lbW03FE6A
; dc.l $81250864
; dc.l potgoresource.MSG0
; dc.l potgo37428191.MSG
; dc.l lbW03FD74
;potgoresource.MSG0 dc.b 'potgo.resource',0
;potgo37428191.MSG dc.b 'potgo 37.4 (28.1.91)',$D,$A,0
;lbW03FD74 dc.l $2A
; dc.l lbW03FD84
; dc.l lbW03FD8E
; dc.l lbC03FD9E
;lbW03FD84 dc.w $FFFF
; dc.w lbC03FDAE-lbW03FD84
; dc.w lbC03FE1C-lbW03FD84
; dc.w lbC03FE32-lbW03FD84
; dc.w $FFFF
;lbW03FD8E dc.w $A008
; dc.w $800
; dc.w $800A
; dc.l potgoresource.MSG0
; dc.l $A00E0600
; dc.w 0

;lbC03FD9E MOVEA.L D0,A0
; MOVE.W #$FF00,$DFF034
; MOVE.L A6,$22(A0)
; RTS

;lbC03FDAE MOVE.L D2,-(SP)
; MOVEA.L $22(A6),A0
; MOVE.W #$4000,$DFF09A
; ADDQ.B #1,$126(A0)
; MOVE.W $26(A6),D2
; MOVE.W D2,D1
; ANDI.W #$5500,D1
; LSL.W #1,D1
; OR.W D2,D1
; NOT.W D1
; AND.W D1,D0
; BTST #0,D0
; BEQ.S lbC03FDEA
; MOVE.W D2,D1
; LSR.W #1,D1
; NOT.W D1
; ANDI.W #$5500,D1
; AND.W D2,D1
; BEQ.S lbC03FDEA
; BCLR #0,D0
;lbC03FDEA BTST #0,D2
; BEQ.S lbC03FE00
; MOVE.W D0,D1
; LSR.W #1,D1
; ANDI.W #$5500,D0
; AND.W D1,D0
; MOVE.W D0,D1
; LSL.W #1,D1
; OR.W D1,D0
;lbC03FE00 ANDI.L #$FF01,D0
; OR.W D0,$26(A6)
; SUBQ.B #1,$126(A0)
; BGE.S lbC03FE18
; MOVE.W #$C000,$DFF09A
;lbC03FE18 MOVE.L (SP)+,D2
; RTS

;lbC03FE1C ANDI.W #$5501,D0
; MOVE.W D0,D1
; LSL.W #1,D1
; ANDI.W #$AA00,D1
; OR.W D1,D0
; NOT.W D0
; AND.W D0,$26(A6)
; RTS

;lbC03FE32 AND.W D1,D0
; NOT.W D1
; MOVEA.L $22(A6),A0
; MOVE.W #$4000,$DFF09A
; ADDQ.B #1,$126(A0)
; AND.W D1,$28(A6)
; OR.W $28(A6),D0
; MOVE.W D0,$DFF034
; CLR.B D0
; MOVE.W D0,$28(A6)
; SUBQ.B #1,$126(A0)
; BGE.S lbC03FE68
; MOVE.W #$C000,$DFF09A
;lbC03FE68 RTS

;lbW03FE6A

MatchTag ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b $81 ; flags
dc.b $26 ; version
dc.b 8 ; type
dc.b $64 ; priority
dc.l potgoresource.MSG ; name
dc.l potgo37428191.MSG ; id string
dc.l MakeLibrary ; init
MakeLibrary
dc.l $2A ; dSize
dc.l Vectors
dc.l Structure
dc.l Init
Vectors
dc.w $FFFF
dc.w AllocPotBits-Vectors ; -6 _LVOAllocPotBits
dc.w FreePotBits-Vectors ; -12 _LVOFreePotBits
dc.w WritePotgo-Vectors ; -18 _LVOWritePotgo
dc.w $FFFF
Structure
dc.w $A008 ; base offset $8
dc.w $800 ; type
dc.w $800A ; base offset $A
dc.l potgoresource.MSG ; name
dc.w $A00E ; base offset $E
dc.w $600 ; id ???
dc.w 0

Init
move.l D0,A0
move.w #$FF00,$DFF034
move.l A6,$22(A0)
rts

; D0 - input
; A6 - resource base

FreePotBits
and.w #$5501,D0 ; %0101010100000001
move.w D0,D1 ; %0101010100000001
add.w D1,D1 ; %1010101000000010
and.w #$AA00,D1 ; %1010101000000000
or.w D1,D0 ; %1111111000000001
not.w D0 ; %0000000111111110
and.w D0,$26(A6)
rts

; D0 - input
; A6 - resource base

AllocPotBits
bsr.b AddPot
move.w $26(A6),D1
move.w D1,-(SP)
and.w #$5500,D1
add.w D1,D1
or.w (SP),D1
not.w D1
and.w D1,D0
btst #0,D0
beq.b TestPot
move.w (SP),D1
lsr.w #1,D1
not.w D1
and.w #$5500,D1
and.w (SP),D1
beq.b TestPot
bclr #0,D0
TestPot
move.w (SP)+,D1
btst #0,D1
beq.b EvenPot
move.w D0,D1
lsr.w #1,D1
and.w #$5500,D0
and.w D1,D0
move.w D0,D1
add.w D1,D1
or.w D1,D0
EvenPot
and.w #$FF01,D0
or.w D0,$26(A6)
SubPot
subq.b #1,$126(A0)
bge.b More
move.w #$C000,$DFF09A
More
rts

AddPot
move.l $22(A6),A0
move.w #$4000,$DFF09A
addq.b #1,$126(A0)
rts

; D0 - input
; D1 - input
; A6 - resource base

WritePotgo
and.w D1,D0
not.w D1
bsr.b AddPot
and.w D1,$28(A6)
or.w $28(A6),D0
move.w D0,$DFF034
clr.b D0
move.w D0,$28(A6)
bra.b SubPot

potgoresource.MSG dc.b 'potgo.resource',0
potgo37428191.MSG dc.b 'potgo 38.0 (23.1.2012)',$D,$A,0
cnop 0,4
EndSkip

Don_Adan
26 January 2012, 14:00
Here is battmem.resource source.
Original version has one small (?) bug.


; Resourced version of battmem.resource (39.2) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Bart 'Kodiak' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

;lbC03FB50 ILLEGAL
; dc.l lbC03FB50
; dc.l lbC03FD34
; dc.l $1270845
; dc.l battmemresour.MSG
; dc.l battmem392639.MSG
; dc.l lbC03FBD4
;battmemresour.MSG dc.b 'battmem.resource',0,0
;battclockreso.MSG1 dc.b 'battclock.resource',0,0
;battmem392639.MSG dc.b 'battmem 39.2 (6.3.92)',$D,$A,0
;lbW03FBA8 dc.w $FFFF
; dc.w lbC03FC2C-lbW03FBA8
; dc.w lbC03FC3E-lbW03FBA8
; dc.w lbC03FC50-lbW03FBA8
; dc.w lbC03FCC2-lbW03FBA8
; dc.w $FFFF
;lbW03FBB4 dc.w $A008
; dc.w $800
; dc.w $800A
; dc.l battmemresour.MSG
; dc.l $A00E0600
; dc.l $90140027
; dc.l $90160002
; dc.w $8018
; dc.l battmem392639.MSG
; dc.l 0

;lbC03FBD4 MOVEM.L D2/A2/A3/A6,-(SP)
; SUBA.L A2,A2
; LEA battclockreso.MSG1(PC),A1
; JSR -$1F2(A6)
; TST.L D0
; BEQ.S lbC03FC24
; MOVEA.L D0,A3
; LEA lbW03FBA8(PC),A0
; LEA lbW03FBB4(PC),A1
; SUBA.L A2,A2
; MOVEQ #$5A,D0
; JSR -$54(A6)
; MOVEA.L D0,A2
; TST.L D0
; BEQ.S lbC03FC24
; MOVE.L #0,$22(A2) ; bug !!! must be move.w or $20(A2)
; MOVE.L A6,$24(A2)
; MOVE.L A3,$28(A2)
; LEA $2C(A2),A0
; JSR -$22E(A6)
; MOVEA.L A2,A1
; JSR -$1E6(A6)
; MOVEA.L A2,A6
; MOVEQ #0,D1
; MOVEQ #1,D2
; BSR.S lbC03FC50
;lbC03FC24 MOVE.L A2,D0
; MOVEM.L (SP)+,D2/A2/A3/A6
; RTS

;lbC03FC2C LEA $2C(A6),A0
; MOVE.L A6,-(SP)
; MOVEA.L $24(A6),A6
; JSR -$234(A6)
; MOVEA.L (SP)+,A6
; RTS

;lbC03FC3E LEA $2C(A6),A0
; MOVE.L A6,-(SP)
; MOVEA.L $24(A6),A6
; JSR -$23A(A6)
; MOVEA.L (SP)+,A6
; RTS

;lbC03FC50 MOVEM.L D0/D1/A0,-(SP)
; LEA $2C(A6),A0
; MOVE.L A6,-(SP)
; MOVEA.L $24(A6),A6
; JSR -$234(A6)
; MOVEA.L (SP)+,A6
; MOVEM.L (SP)+,D0/D1/A0
; MOVEM.L D2-D5/A2,-(SP)
; MOVEA.L A0,A2
; MOVE.L D0,D5
; MOVE.L D1,D3
; MOVE.L D1,D4
; ANDI.L #7,D4
; LSR.L #3,D3
; BEQ.S lbC03FC96
; MOVEQ #8,D2
;lbC03FC80 MOVE.L D5,D1
; MOVE.L A6,-(SP)
; MOVEA.L $28(A6),A6
; JSR -$18(A6)
; MOVEA.L (SP)+,A6
; MOVE.B D0,(A2)+
; ADDQ.L #8,D5
; SUBQ.L #1,D3
; BNE.S lbC03FC80
;lbC03FC96 MOVE.L D4,D2
; BEQ.S lbC03FCAA
; MOVE.L D5,D1
; MOVE.L A6,-(SP)
; MOVEA.L $28(A6),A6
; JSR -$18(A6)
; MOVEA.L (SP)+,A6
; MOVE.B D0,(A2)+
;lbC03FCAA MOVEM.L (SP)+,D2-D5/A2
; LEA $2C(A6),A0
; MOVE.L A6,-(SP)
; MOVEA.L $24(A6),A6
; JSR -$23A(A6)
; MOVEA.L (SP)+,A6
; MOVEQ #0,D0
; RTS

;lbC03FCC2 MOVEM.L D0/D1/A0,-(SP)
; LEA $2C(A6),A0
; MOVE.L A6,-(SP)
; MOVEA.L $24(A6),A6
; JSR -$234(A6)
; MOVEA.L (SP)+,A6
; MOVEM.L (SP)+,D0/D1/A0
; MOVEM.L D2-D5/A2,-(SP)
; MOVEA.L A0,A2
; MOVE.L D0,D5
; MOVE.L D1,D3
; MOVE.L D1,D4
; ANDI.L #7,D4
; LSR.L #3,D3
; BEQ.S lbC03FD08
; MOVEQ #8,D2
;lbC03FCF2 MOVE.L D5,D1
; MOVE.B (A2)+,D0
; MOVE.L A6,-(SP)
; MOVEA.L $28(A6),A6
; JSR -$1E(A6)
; MOVEA.L (SP)+,A6
; ADDQ.L #8,D5
; SUBQ.L #1,D3
; BNE.S lbC03FCF2
;lbC03FD08 MOVE.L D4,D2
; BEQ.S lbC03FD1C
; MOVE.L D5,D1
; MOVE.B (A2)+,D0
; MOVE.L A6,-(SP)
; MOVEA.L $28(A6),A6
; JSR -$1E(A6)
; MOVEA.L (SP)+,A6
;lbC03FD1C MOVEM.L (SP)+,D2-D5/A2
; LEA $2C(A6),A0
; MOVE.L A6,-(SP)
; MOVEA.L $24(A6),A6
; JSR -$23A(A6)
; MOVEA.L (SP)+,A6
; MOVEQ #0,D0
; RTS

;lbC03FD34

MatchTag
ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b 1 ; flags
dc.b $28 ; version
dc.b 8 ; type
dc.b $45 ; priority
dc.l battmemresour.MSG ; name
dc.l battmem392639.MSG ; id string
dc.l InitResource ; init code
Vectors
dc.w $FFFF
dc.w ObtainBattSemaphore-Vectors ; -6 _LVOObtainBattSemaphore
dc.w ReleaseBattSemaphore-Vectors ; -12 _LVOReleaseBattSemaphore
dc.w ReadBattMem-Vectors ; -18 _LVOReadBattMem
dc.w WriteBattMem-Vectors ; -24 _LVOWriteBattMem
dc.w $FFFF
Structure
dc.w $A008 ; base offset $8
dc.w $0800 ; type
dc.w $800A ; base offset $A
dc.l battmemresour.MSG ; name
dc.w $A00E ; base offset $E
dc.w $0600 ; id ???
dc.w $9014 ; base offset $14
dc.w $0028 ; version
dc.w $9016 ; base offset $16
dc.w $0000 ; revision
dc.w $8018 ; base offset $18
dc.l battmem392639.MSG ; id string
dc.w 0 ; no more

InitResource
movem.l D2/A2/A3/A6,-(SP)
lea battclockreso.MSG1(PC),A1
jsr -$1F2(A6) ; OpenResource
tst.l D0
beq.b Quit
move.l D0,A3
lea Vectors(PC),A0
lea Structure(PC),A1
sub.l A2,A2
moveq #$5A,D0 ; dSize
jsr -$54(A6) ; MakeLibrary
tst.l D0
beq.b Quit
move.l D0,A2
lea $22(A2),A0
clr.w (A0)+ ; possible bug here
move.l A6,(A0)+ ; exec base
move.l A3,(A0)+ ; battclock base, set A0
jsr -$22E(A6) ; InitSemaphore
move.l A2,A1
jsr -$1E6(A6) ; AddResource
move.l A2,A6
moveq #0,D1
moveq #1,D2
bsr.b ReadBattMem
move.l A2,D0 ; resource base
Quit
movem.l (SP)+,D2/A2/A3/A6
rts

ObtainBattSemaphore
lea -$234.W,A1
bra.b SemaphoreMain ; ObtainSemaphore

ReleaseBattSemaphore
lea -$23A.W,A1
SemaphoreMain
lea $2C(A6),A0
move.l A6,-(SP)
move.l $24(A6),A6 ; exec base
jsr (A6,A1.W) ; ReleaseSemaphore
move.l (SP)+,A6
rts

; D1 - input
; D2 - input
; A6 - resource base

ReadBattMem
lea ReadBatt(PC),A1
bra.b BattMain

; D1 - input
; D2 - input
; A6 - resource base

WriteBattMem
lea WriteBatt(PC),A1
BattMain
movem.l D2-D7/A2/A3/A6,-(SP)
move.l A0,A2
move.l A1,A3
move.l D0,D5
move.l D1,D3
lea $24(A6),A0
move.l (A0)+,A6 ; exec base
move.l (A0)+,D6 ; battclock base, set A0
move.l A0,D7 ; backup A0
jsr -$234(A6) ; ObtainSemaphore
exg D6,A6 ; battclock base
moveq #7,D4
and.l D3,D4
lsr.l #3,D3
beq.b SkipBatt
moveq #8,D2
LoopBatt
jsr (A3)
addq.l #8,D5
subq.l #1,D3
bne.b LoopBatt
SkipBatt
move.l D4,D2
beq.b LastBatt
jsr (A3)
LastBatt
exg D6,A6 ; exec base
move.l D7,A0
jsr -$23A(A6) ; ReleaseSemaphore
movem.l (SP)+,D2-D7/A2/A3/A6
moveq.l #0,D0
rts

WriteBatt
move.l D5,D1
move.b (A2)+,D0 ; write
jmp -$1E(A6) ; PrivateFunction2

ReadBatt
move.l D5,D1
jsr -$18(A6) ; PrivateFunction1
move.b D0,(A2)+ ; read
rts

battmemresour.MSG dc.b 'battmem.resource',0
battclockreso.MSG1 dc.b 'battclock.resource',0
battmem392639.MSG dc.b 'battmem 40.0 (25.1.2012)',$D,$A,0

EndSkip

Don_Adan
29 January 2012, 15:58
Optimised potgo.resource, thanks to Mcoder for the help.
Here is A4000 bonus source.


; Resourced version of A4000 bonus (40.1) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Bart 'Kodiak' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

MatchTag
ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b 1 ; flags
dc.b $28 ; version
dc.b 0 ; type
dc.b $65 ; priority
dc.l A4000bonus.MSG ; name
dc.l bonus40115293.MSG ; id string
dc.l Init ; init code

Init
MOVEM.L D2-D7/A2-A5,-(SP)
BTST #2,$129(A6) ; 68030/68040 CPU check
BEQ.B Quit
MOVEQ #$66,D0
MOVEQ #2,D1 ; chipmem
JSR -$C6(A6) ; AllocMem
TST.L D0
BEQ.B Quit
MOVEA.L D0,A1
MOVEA.L D0,A5
LEA userFunc(PC),A0
MOVEQ #$32,D0
Copy
MOVE.W (A0)+,(A1)+
DBF D0,Copy
JSR -$27C(A6) ; CacheClearU (no input)
BTST #3,$129(A6) ; 68040 CPU check
SEQ D3 ; D3 input
MOVEQ #0,D0
MOVEQ #-1,D1
JSR -$288(A6) ; CacheControl (D0/D1 input)
MOVE.L D0,-(SP) ; output
JSR -$1E(A6) ; Supervisor (A5 input)
MOVE.L (SP)+,D0
MOVE.L D0,D1
JSR -$288(A6) ; CacheControl (D0/D1 input)
MOVEA.L A5,A1
MOVEQ #$66,D0
JSR -$D2(A6) ; FreeMem
Quit
MOVEM.L (SP)+,D2-D7/A2-A5
MOVEQ #0,D0
RTS

userFunc
ORI.W #$700,SR
LEA $DE0003,A4
LEA $7F7FFF0,A3
MOVEQ #7,D2
CMPI.B #$7F,$40(A4)
BEQ.B Exit
MOVEM.L (A3),D4-D7
MOVEA.L A3,A2
MOVE.L A2,(A2)+
MOVE.L A2,(A2)+
MOVE.L A2,(A2)+
MOVE.L A2,(A2)+
MOVE.L D2,D0
OR.B (A4),D0
NOP
MOVE.B D0,(A4)
Loop1 NOP
MOVE.B (A4),D1
AND.B D2,D1
CMP.B D2,D1
BNE.B Loop1
MOVE.L D2,D0
MOVEQ #3,D1
Compare CMPA.L -(A2),A2
DBNE D1,Compare
BNE.B Skip
MOVEQ #4,D0
AND.B D3,D0
ADDQ.L #1,D0
Skip NOT.L D0
AND.B (A4),D0
NOP
MOVE.B D0,(A4)
AND.B D2,D0
Loop2 NOP
MOVE.B (A4),D1
AND.B D2,D1
CMP.B D0,D1
BNE.B Loop2
MOVEM.L D4-D7,(A3)
Exit RTE

A4000bonus.MSG dc.b 'A4000 bonus',0
bonus40115293.MSG dc.b 'bonus 40.1 (15.2.93)',$D,$A,0
dc.b 0
cnop 0,4
EndSkip

Don_Adan
01 February 2012, 14:53
Here is mathffp.library source.


; Resourced version of mathffp.library (40.1) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Bart 'Kodiak' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

;lbC040944 ILLEGAL
; dc.l lbC040944
; dc.l lbC040DE0
; dc.l $80280988
; dc.l mathffplibrar.MSG
; dc.l mathffp401163.MSG
; dc.l lbL040988
;mathffplibrar.MSG dc.b 'mathffp.library',0
;mathffp401163.MSG dc.b 'mathffp 40.1 (16.3.93)',$D,$A,0
; dc.b 0
;lbL040988 dc.l $22
; dc.l lbW0409C8
; dc.l lbW040998
; dc.l 0
;lbW040998 dc.w $A008
; dc.w $900
; dc.w $800A
; dc.l mathffplibrar.MSG
; dc.l $A00E0600
; dc.l $90140028
; dc.l $90160001
; dc.w $8018
; dc.l mathffp401163.MSG
; dc.w 0

;lbC0409B6 ADDQ.W #1,$20(A6)
; MOVE.L A6,D0
; RTS

;lbC0409BE SUBQ.W #1,$20(A6)
;lbC0409C2 MOVEQ #0,D0
; RTS

; dc.w 0
;lbW0409C8 dc.w $FFFF
; dc.w lbC0409B6-lbW0409C8
; dc.w lbC0409BE-lbW0409C8
; dc.w lbC0409C2-lbW0409C8
; dc.w lbC0409C2-lbW0409C8
; dc.w lbC0409EC-lbW0409C8
; dc.w lbC040A40-lbW0409C8
; dc.w lbC040A78-lbW0409C8
; dc.w lbC040AB4-lbW0409C8
; dc.w lbC040ADC-lbW0409C8
; dc.w lbC040AE2-lbW0409C8
; dc.w lbC040B06-lbW0409C8
; dc.w lbC040AEC-lbW0409C8
; dc.w lbC040BFC-lbW0409C8
; dc.w lbC040CC4-lbW0409C8
; dc.w lbC040D46-lbW0409C8
; dc.w lbC040D3C-lbW0409C8
; dc.w $FFFF

;lbC0409EC MOVE.B D0,D1
; BMI.S lbC040A14
; BEQ.S lbC040A04
; CLR.B D0
; SUB.B #$41,D1
; BMI.S lbC040A10
; SUB.B #$1F,D1
; BPL.S lbC040A06
; NEG.B D1
; LSR.L D1,D0
;lbC040A04 RTS

;lbC040A06 MOVEQ #-1,D0
; LSR.L #1,D0
; ORI.B #2,CCR
; RTS

;lbC040A10 MOVEQ #0,D0
; RTS

;lbC040A14 CLR.B D0
; SUB.B #$C1,D1
; BMI.S lbC040A10
; SUB.B #$1F,D1
; BPL.S lbC040A2A
; NEG.B D1
; LSR.L D1,D0
; NEG.L D0
; RTS

;lbC040A2A BNE.S lbC040A32
; NEG.L D0
; TST.L D0
; BMI.S lbC040A04
;lbC040A32 MOVEQ #0,D0
; BSET #$1F,D0
; ORI.B #2,CCR
; RTS

; dc.w 0

;lbC040A40 MOVEQ #$5F,D1
; TST.L D0
; BEQ.S lbC040A76
; BPL.S lbC040A50
; MOVEQ #-$20,D1
; NEG.L D0
; BVS.S lbC040A74
; SUBQ.B #1,D1
;lbC040A50 CMP.L #$7FFF,D0
; BHI.S lbC040A5E
; SWAP D0
; SUB.B #$10,D1
;lbC040A5E ADD.L D0,D0
; DBMI D1,lbC040A5E
; TST.B D0
; BPL.S lbC040A74
; ADD.L #$100,D0
; BCC.S lbC040A74
; ROXR.L #1,D0
; ADDQ.B #1,D1
;lbC040A74 MOVE.B D1,D0
;lbC040A76 RTS

;lbC040A78 TST.B D1
; BPL.S lbC040A88
; TST.B D0
; BPL.S lbC040A88
; CMP.B D0,D1
; BNE.S lbC040A8E
; CMP.L D0,D1
; BRA.S lbC040A8E

;lbC040A88 CMP.B D1,D0
; BNE.S lbC040A8E
; CMP.L D1,D0
;lbC040A8E MOVEM.L A6,-(SP)
; MOVEA.L 4,A6
; JSR -$210(A6)
; MOVEA.L (SP)+,A6
; MOVE.W D0,D1
; MOVEQ #0,D0
; MOVE.W D1,CCR
; BLT.S lbC040AAE
; BGT.S lbC040AAA
; BRA.S lbC040AB0

;lbC040AAA SUBQ.L #1,D0
; BRA.S lbC040AB0

;lbC040AAE ADDQ.L #1,D0
;lbC040AB0 MOVE.W D1,CCR
; RTS

;lbC040AB4 TST.B D1
; MOVEM.L A6,-(SP)
; MOVEA.L 4,A6
; JSR -$210(A6)
; MOVEA.L (SP)+,A6
; MOVE.W D0,D1
; MOVEQ #0,D0
; MOVE.W D1,CCR
; BLT.S lbC040AD2
; BGT.S lbC040AD6
; BRA.S lbC040AD8

;lbC040AD2 SUBQ.L #1,D0
; BRA.S lbC040AD8

;lbC040AD6 ADDQ.L #1,D0
;lbC040AD8 MOVE.W D1,CCR
; RTS

;lbC040ADC ANDI.B #$7F,D0
; RTS

;lbC040AE2 TST.B D0
; BEQ.S lbC040AEA
; EORI.B #$80,D0
;lbC040AEA RTS

;lbC040AEC MOVEM.L D3-D5,-(SP)
; MOVE.B D1,D4
; BEQ.S lbC040B5A
; EORI.B #$80,D4
; BMI.L lbC040B80
; MOVE.B D0,D5
; BMI.L lbC040B86
; BNE.S lbC040B16
; BRA.S lbC040B50

;lbC040B06 MOVEM.L D3-D5,-(SP)
; MOVE.B D1,D4
; BMI.S lbC040B80
; BEQ.S lbC040B5A
; MOVE.B D0,D5
; BMI.S lbC040B86
; BEQ.S lbC040B50
;lbC040B16 SUB.B D4,D5
; BMI.S lbC040B62
; MOVE.B D0,D4
; CMP.B #$18,D5
; BCC.S lbC040B5A
; MOVE.L D1,D3
; CLR.B D3
; LSR.L D5,D3
; MOVE.B #$80,D0
; ADD.L D3,D0
; BCS.S lbC040B38
;lbC040B30 MOVE.B D4,D0
; MOVEM.L (SP)+,D3-D5
; RTS

;lbC040B38 ROXR.L #1,D0
; ADDQ.B #1,D4
; BVS.S lbC040B40
; BCC.S lbC040B30
;lbC040B40 MOVEQ #-1,D0
; SUBQ.B #1,D4
; MOVE.B D4,D0
; ORI.B #2,CCR
; MOVEM.L (SP)+,D3-D5
; RTS

;lbC040B50 MOVE.L D1,D0
; MOVE.B D4,D0
; MOVEM.L (SP)+,D3-D5
; RTS

;lbC040B5A TST.B D0
; MOVEM.L (SP)+,D3-D5
; RTS

;lbC040B62 CMP.B #$E8,D5
; BLE.S lbC040B50
; NEG.B D5
; MOVE.L D1,D3
; CLR.B D0
; LSR.L D5,D0
; MOVE.B #$80,D3
; ADD.L D3,D0
; BCS.S lbC040B38
; MOVE.B D4,D0
; MOVEM.L (SP)+,D3-D5
; RTS

;lbC040B80 MOVE.B D0,D5
; BMI.S lbC040B16
; BEQ.S lbC040B50
;lbC040B86 MOVEQ #-$80,D3
; EOR.B D3,D5
; SUB.B D4,D5
; BEQ.S lbC040BE8
; BMI.S lbC040BD4
; CMP.B #$18,D5
; BCC.S lbC040B5A
; MOVE.B D0,D4
; MOVE.B D3,D0
; MOVE.L D1,D3
;lbC040B9C CLR.B D3
; LSR.L D5,D3
; SUB.L D3,D0
; BMI.S lbC040B30
;lbC040BA4 MOVE.B D4,D5
;lbC040BA6 CLR.B D0
; SUBQ.B #1,D4
; CMP.L #$7FFF,D0
; BHI.S lbC040BB8
; SWAP D0
; SUB.B #$10,D4
;lbC040BB8 ADD.L D0,D0
; DBMI D4,lbC040BB8
; EOR.B D4,D5
; BMI.S lbC040BCC
; MOVE.B D4,D0
; BEQ.S lbC040BCC
; MOVEM.L (SP)+,D3-D5
; RTS

;lbC040BCC MOVEQ #0,D0
; MOVEM.L (SP)+,D3-D5
; RTS

;lbC040BD4 CMP.B #$E8,D5
; BLE.L lbC040B50
; NEG.B D5
; MOVE.L D0,D3
; MOVE.L D1,D0
; MOVE.B #$80,D0
; BRA.S lbC040B9C

;lbC040BE8 MOVE.B D0,D5
; EXG D5,D4
; MOVE.B D1,D0
; SUB.L D1,D0
; BEQ.S lbC040BCC
; BPL.S lbC040BA4
; NEG.L D0
; MOVE.B D5,D4
; BRA.S lbC040BA6

; dc.w 0

;lbC040BFC MOVEM.L D3-D5,-(SP)
; MOVE.B D0,D5
; BEQ.S lbC040C56
; MOVE.B D1,D4
; BEQ.S lbC040C78
; ADD.W D5,D5
; ADD.W D4,D4
; MOVEQ #-$80,D3
; EOR.B D3,D4
; EOR.B D3,D5
; ADD.B D4,D5
; BVS.S lbC040C80
; MOVE.B D3,D4
; EOR.W D4,D5
; ROR.W #1,D5
; SWAP D5
; MOVE.W D1,D5
; CLR.B D0
; CLR.B D5
; MOVE.W D5,D4
; MULU.W D0,D4
; SWAP D4
; MOVE.L D0,D3
; SWAP D3
; MULU.W D5,D3
; ADD.L D3,D4
; SWAP D1
; MOVE.L D1,D3
; MULU.W D0,D3
; ADD.L D3,D4
; CLR.W D4
; ADDX.B D4,D4
; SWAP D4
; SWAP D0
; MULU.W D1,D0
; SWAP D1
; SWAP D5
; ADD.L D4,D0
; BPL.S lbC040C5C
; ADD.L #$80,D0
; MOVE.B D5,D0
; BEQ.S lbC040C78
;lbC040C56 MOVEM.L (SP)+,D3-D5
; RTS

;lbC040C5C SUBQ.B #1,D5
; BVS.S lbC040C78
; BCS.S lbC040C78
; MOVEQ #$40,D4
; ADD.L D4,D0
; ADD.L D0,D0
; BCC.S lbC040C6E
; ROXR.L #1,D0
; ADDQ.B #1,D5
;lbC040C6E MOVE.B D5,D0
; BEQ.S lbC040C78
; MOVEM.L (SP)+,D3-D5
; RTS

;lbC040C78 MOVEQ #0,D0
; MOVEM.L (SP)+,D3-D5
; RTS

;lbC040C80 BPL.S lbC040C78
; EOR.B D1,D0
; OR.L #$FFFFFF7F,D0
; TST.B D0
; ORI.B #2,CCR
; MOVEM.L (SP)+,D3-D5
; RTS

; dc.w 0

;lbC040C98 DIVU.W #0,D0
; TST.L D1
; BNE.S lbC040CC4
;lbC040CA0 OR.L #$FFFFFF7F,D0
; TST.B D0
; ORI.B #2,CCR
;lbC040CAC MOVEM.L (SP)+,D3-D5
; RTS

;lbC040CB2 SWAP D1
; SWAP D0
;lbC040CB6 EOR.B D1,D0
; BRA.S lbC040CA0

;lbC040CBA BMI.S lbC040CB6
;lbC040CBC MOVEQ #0,D0
; MOVEM.L (SP)+,D3-D5
; RTS

;lbC040CC4 MOVEM.L D3-D5,-(SP)
; MOVE.B D1,D5
; BEQ.S lbC040C98
; MOVE.L D0,D4
; BEQ.S lbC040CAC
; MOVEQ #-$80,D3
; ADD.W D5,D5
; ADD.W D4,D4
; EOR.B D3,D5
; EOR.B D3,D4
; SUB.B D5,D4
; BVS.S lbC040CBA
; CLR.B D0
; SWAP D0
; SWAP D1
; CMP.W D1,D0
; BMI.S lbC040CEE
; ADDQ.B #2,D4
; BVS.S lbC040CB2
; ROR.L #1,D0
;lbC040CEE SWAP D0
; MOVE.B D3,D5
; EOR.W D5,D4
; LSR.W #1,D4
; MOVE.L D0,D3
; DIVU.W D1,D3
; MOVE.W D3,D5
; MULU.W D1,D3
; SUB.L D3,D0
; SWAP D0
; SWAP D1
; MOVE.W D1,D3
; CLR.B D3
; MULU.W D5,D3
; SUB.L D3,D0
; BCC.S lbC040D14
;lbC040D0E SUBQ.W #1,D5
; ADD.L D1,D0
; BCC.S lbC040D0E
;lbC040D14 MOVE.L D1,D3
; SWAP D3
; CLR.W D0
; DIVU.W D3,D0
; SWAP D5
; BMI.S lbC040D28
; MOVE.W D0,D5
; ADD.L D5,D5
; SUBQ.B #1,D4
; MOVE.W D5,D0
;lbC040D28 MOVE.W D0,D5
; ADD.L #$80,D5
; MOVE.L D5,D0
; MOVE.B D4,D0
; BEQ.S lbC040CBC
; MOVEM.L (SP)+,D3-D5
; RTS

;lbC040D3C BSR.L lbC040AE2
; BSR.S lbC040D46
; BRA.L lbC040AE2

;lbC040D46 MOVE.B D0,D1
; BMI.S lbC040D72
; BEQ.S lbC040D6C
; CLR.B D0
; SUB.B #$41,D1
; BMI.S lbC040D6E
; SUB.B #$1F,D1
; BPL.S lbC040D62
; NEG.B D1
; LSR.L D1,D0
; LSL.L D1,D0
; NEG.B D1
;lbC040D62 ADD.B #$1F,D1
; ADD.B #$41,D1
; MOVE.B D1,D0
;lbC040D6C RTS

;lbC040D6E MOVEQ #0,D0
; RTS

;lbC040D72 BSR.L lbC040AE2
; MOVE.L D0,-(SP)
; BSR.S lbC040D46
; MOVE.L D0,-(SP)
; MOVE.L D0,D1
; MOVE.L 4(SP),D0
; BSR.L lbC040AEC
; MOVEM.L (SP),D0
; BEQ.S lbC040D96
; MOVE.L #$80000041,D1
; BSR.L lbC040B06
;lbC040D96 ADDQ.L #8,SP
; BRA.L lbC040AE2

; dc.b 'MC68343 FLOATING POINT FIRMWARE(C) COPYRIGHT'
; dc.b ' 1981 BY MOTOROLA INC.',0,0

;lbC040DE0

MatchTag
ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b $80 ; flags
dc.b $29 ; version
dc.b 9 ; type
dc.b $88 ; priority
dc.l mathffplibrar.MSG ; name
dc.l mathffp401163.MSG ; id string
dc.l MakeLibrary
MakeLibrary
dc.l $22 ; dSize
dc.l Vectors
dc.l Structure
dc.l 0 ; Init
Structure
dc.w $A008 ; base offset $8
dc.w $900 ; type
dc.w $800A ; base offset $A
dc.l mathffplibrar.MSG ; name
dc.w $A00E ; base offset $E
dc.w $0600 ; id ???
dc.w $9014 ; base offset $14
dc.w $0029 ; version
dc.w $9016 ; base offset $16
dc.w $0000 ; revision
dc.w $8018 ; base offset $18
dc.l mathffp401163.MSG ; id string
dc.w 0 ; no more

LibOpen
addq.w #1,$20(A6)
move.l A6,D0
rts

Vectors dc.w $FFFF
dc.w LibOpen-Vectors ; -6 _LVOLibOpen
dc.w LibClose-Vectors ; -12 _LVOLibClose
dc.w LibExpunge-Vectors ; -18 _LVOLibExpunge
dc.w LibReserved-Vectors ; -24 _LVOLibReserved
dc.w SPFix-Vectors ; -30 * _LVOSPFix
dc.w SPFlt-Vectors ; -36 _LVOSPFlt
dc.w SPCmp-Vectors ; -42 * _LVOSPCmp
dc.w SPTst-Vectors ; -48 * _LVOSPTst
dc.w SPAbs-Vectors ; -54 * _LVOSPAbs
dc.w SPNeg-Vectors ; -60 * _LVOSPNeg
dc.w SPAdd-Vectors ; -66 _LVOSPAdd
dc.w SPSub-Vectors ; -72 _LVOSPSub
dc.w SPMul-Vectors ; -78 * _LVOSPMul
dc.w SPDiv-Vectors ; -84 * _LVOSPDiv
dc.w SPFloor-Vectors ; -90 * _LVOSPFloor
dc.w SPCeil-Vectors ; -96 * _LVOSPCeil
dc.w $FFFF


SPFlt MOVEQ #$5F,D1
TST.L D0
BEQ.B FltZero
BPL.B FltPlus
MOVEQ #-$20,D1
NEG.L D0
BVS.B FltBvs
SUBQ.B #1,D1
FltPlus CMP.L #$7FFF,D0
BHI.B FltDBMI
SWAP D0
SUB.B #$10,D1
FltDBMI ADD.L D0,D0
DBMI D1,FltDBMI
TST.B D0
BPL.B FltBvs
ADD.L #$100,D0
BCC.B FltBvs
ROXR.L #1,D0
ADDQ.B #1,D1
FltBvs MOVE.B D1,D0
FltZero RTS


SPCmp tst.b D1
bpl.b PlusCmp
tst.b D0
bpl.b PlusCmp
exg D0,D1
PlusCmp
cmp.b D1,D0
bne.b TestCmp
cmp.l D1,D0
TestCmp
bsr.b GetCC
blt.b OneCmp
bgt.b MinusOneCmp
ZeroCmp
moveq #0,D0
bra.b QuitCmp

MinusOneCmp
moveq #-1,D0
bra.b QuitCmp
OneCmp
moveq #1,D0
bra.b QuitCmp
GetCC
pea (A6)
move.l 4.W,A6
jsr -$210(A6) ; GetCC
move.l (SP)+,A6
move.w D0,D1
QuitCmp
move.w D1,CCR
rts


SPTst
tst.b D1
bsr.b GetCC
blt.b MinusOneCmp
bgt.b OneCmp
bra.b ZeroCmp


SPAbs and.b #$7F,D0
rts


SPDiv
movem.l D3-D5,-(SP)
move.b D1,D5
beq.b DivZero
move.l D0,D4
beq.b DivQuit
moveq #-$80,D3
add.w D5,D5
add.w D4,D4
eor.b D3,D5
eor.b D3,D4
sub.b D5,D4
bvs.b DivOflow
clr.b D0
swap D0
swap D1
cmp.w D1,D0
bmi.b DivMinus
addq.b #2,D4
bvs.b DivOverflow
ror.l #1,D0
DivMinus
swap D0
move.b D3,D5
eor.w D5,D4
lsr.w #1,D4
move.l D0,D3
divu.w D1,D3
move.w D3,D5
mulu.w D1,D3
sub.l D3,D0
swap D0
swap D1
move.w D1,D3
clr.b D3
mulu.w D5,D3
sub.l D3,D0
bcc.b DivOK
DivMore
subq.w #1,D5
add.l D1,D0
bcc.b DivMore
DivOK
move.l D1,D3
swap D3
clr.w D0
divu.w D3,D0
swap D5
bmi.b DivNorm
move.w D0,D5
add.l D5,D5
subq.b #1,D4
move.w D5,D0
DivNorm
move.w D0,D5
add.l #$80,D5
move.l D5,D0
move.b D4,D0
beq.b DivUnder
DivQuit
movem.l (SP)+,D3-D5
rts

DivZero
divu.w #0,D0 ; call divide by zero handler
bra.b DivSkip
DivOverflow
swap D1
swap D0
DivFlow
eor.b D1,D0
DivSkip
or.l #$FFFFFF7F,D0
tst.b D0
or.b #2,CCR ; SET OVERFLOW BIT ON
bra.b DivQuit

MulUnder
DivOflow
bmi.b DivFlow
MulZero
DivUnder
moveq #0,D0
bra.b DivQuit

MulNorma
subq.b #1,D5
bvs.b MulZero
bcs.b MulZero
moveq #$40,D4
add.l D4,D0
add.l D0,D0
bcc.b MulNumber
roxr.l #1,D0
addq.b #1,D5
MulNumber
move.b D5,D0
beq.b MulZero
bra.b MulQuit


SPMul
movem.l D3-D5,-(SP)
move.b D0,D5
beq.b MulQuit
move.b D1,D4
beq.b MulZero
add.w D5,D5
add.w D4,D4
moveq #-$80,D3
eor.b D3,D4
eor.b D3,D5
add.b D4,D5
bvs.b MulUnder
move.b D3,D4
eor.w D4,D5
ror.w #1,D5
swap D5
move.w D1,D5
clr.b D0
clr.b D5
move.w D5,D4
mulu.w D0,D4
swap D4
move.l D0,D3
swap D3
mulu.w D5,D3
add.l D3,D4
swap D1
move.l D1,D3
mulu.w D0,D3
add.l D3,D4
clr.w D4
addx.b D4,D4
swap D4
swap D0
mulu.w D1,D0
swap D1
swap D5
add.l D4,D0
bpl.b MulNorma
add.l #$80,D0
move.b D5,D0
beq.b MulZero
MulQuit
movem.l (SP)+,D3-D5
rts

SPFix
move.b D0,D1
bmi.b FixMinus
beq.b FixQuit
sub.b #$41,D1
bmi.b Zero
sub.b #$1F,D1
bpl.b FixPlus
clr.b D0
neg.b D1
lsr.l D1,D0
FixQuit
rts

FixPlus
moveq #-1,D0
lsr.l #1,D0
bra.b FixCCR

FixMinus
sub.b #$C1,D1
bmi.b Zero
clr.b D0
sub.b #$1F,D1
bpl.b FixOflow
neg.b D1
lsr.l D1,D0
neg.l D0
rts

FixOflow
bne.b FixOver
neg.l D0
bmi.b FixQuit
FixOver
moveq #1,D0
ror.l #1,D0
FixCCR
or.b #2,CCR ; SET OVERFLOW BIT ON
rts

LibClose
subq.w #1,$20(A6)
LibReserved
LibExpunge
Zero
moveq #0,D0
rts


SPCeil bsr.b SPNeg
bsr.b SPFloor


SPNeg tst.b D0
beq.b ZeroNeg
eor.b #$80,D0
ZeroNeg
rts


SPFloor
move.b D0,D1
bmi.b MinusFloor
beq.b QuitFloor
sub.b #$41,D1
bmi.b Zero
sub.b #$1F,D1
bpl.b PlusFloor
neg.b D1
lsr.l D1,D0
lsl.l D1,D0
neg.b D1
PlusFloor
add.b #$60,D1
move.b D1,D0
QuitFloor
rts

MinusFloor
bsr.b SPNeg
move.l D0,-(SP)
bsr.b SPFloor
move.l (SP),D1
exg D0,D1
move.l D1,-(SP)
bsr.b SPSub
movem.l (SP)+,D0/D1
beq.b SPNeg
move.l #$80000041,D1
bsr.b SPAdd
bra.b SPNeg

SPSub
movem.l D3-D5,-(SP)
moveq #-128,D3
move.b D1,D4
beq.b NoChange
eor.b D3,D4
bmi.b Minus1
move.b D0,D5
bmi.b Minus2
bne.b Back1
Result
move.l D1,D0
bra.b Restore

Large cmp.b #$E8,D5
ble.b Result
neg.b D5
clr.b D0
lsr.l D5,D0
move.l D1,D5
move.b D3,D5
add.l D5,D0
bcs.b Carry
bra.b Restore

NoChange
tst.b D0
bra.b QuitAdd

SPAdd movem.l D3-D5,-(SP)
moveq #-128,D3
move.b D1,D4
bmi.b Minus1
beq.b NoChange
move.b D0,D5
bmi.B Minus2
beq.b Result
Back1
sub.b D4,D5
bmi.b Large
move.b D0,D4
cmp.b #$18,D5
bcc.b NoChange
move.b D3,D0
move.l D1,D3
clr.b D3
lsr.l D5,D3
add.l D3,D0
bcs.b Carry
Restore
move.b D4,D0
QuitAdd
movem.l (SP)+,D3-D5
rts

Carry
roxr.l #1,D0
addq.b #1,D4
bvs.b Overflow
bcc.b Restore
Overflow
moveq #-1,D0
subq.b #1,D4
move.b D4,D0
or.b #2,CCR
bra.b QuitAdd

Minus1 move.b D0,D5
bmi.b Back1
beq.b Result
Minus2
eor.b D3,D5
sub.b D4,D5
beq.b Equal
bmi.b Large2
cmp.b #$18,D5
bcc.b NoChange
move.b D0,D4
move.b D3,D0
move.l D1,D3
Back2 clr.b D3
lsr.l D5,D3
sub.l D3,D0
bmi.b Restore
Back3 move.b D4,D5
Back4 clr.b D0
subq.b #1,D4
cmp.l #$7FFF,D0
bhi.b Shift
swap D0
sub.b #$10,D4
Shift add.l D0,D0
dbmi D4,Shift
eor.b D4,D5
bmi.b Under
move.b D4,D0
bne.b QuitAdd
Under
moveq #0,D0
bra.b QuitAdd

Large2 cmp.b #$E8,D5
ble.w Result
neg.b D5
move.l D0,D3
move.l D1,D0
move.b #$80,D0
bra.b Back2

Equal move.b D0,D5
exg D5,D4
move.b D1,D0
sub.l D1,D0
beq.b Under
bpl.b Back3
neg.l D0
move.b D5,D4
bra.b Back4

mathffplibrar.MSG dc.b 'mathffp.library',0
mathffp401163.MSG dc.b 'mathffp 41.0 (1.2.2012)',$D,$A,0

cnop 0,4
EndSkip


Here are original Motorola's FFP (commented) source code.

Don_Adan
14 February 2012, 14:02
Misc.resource structures optimised by meynaf. Thanks.



; Resourced version of misc.resource (37.1) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Bart 'Kodiak' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

;lbC03FE6C ILLEGAL
; dc.l lbC03FE6C
; dc.l lbW03FF1C
; dc.l $1250846
; dc.l miscresource.MSG
; dc.l misc3718191.MSG
; dc.l lbC03FEAC
;miscresource.MSG dc.b 'misc.resource',0
;misc3718191.MSG dc.b 'misc 37.1 (8.1.91)',$D,$A,0
; dc.b 0
; dc.b 0
; dc.b 0

;lbC03FEAC MOVE.L A2,-(SP)
; LEA lbW03FF14(PC),A0
; LEA lbW03FECC(PC),A1
; SUBA.L A2,A2
; MOVEQ #$32,D0
; JSR -$54(A6)
; TST.L D0
; BEQ.S lbC03FEC8
; MOVEA.L D0,A1
; JSR -$1E6(A6)
;lbC03FEC8 MOVEA.L (SP)+,A2
; RTS

;lbW03FECC dc.w $A008
; dc.w $800
; dc.w $800A
; dc.l miscresource.MSG
; dc.l $A00E0600
; dc.l $90140025
; dc.l $90160001
; dc.w 0

;lbC03FEE4 MOVEA.L 4.W,A0
; EXG A0,A6
; LSL.W #2,D0
; MOVE.W D0,D1
; ADDQ.B #1,$127(A6)
; MOVE.L $22(A0,D1.W),D0
; BNE.S lbC03FEFC
; MOVE.L A1,$22(A0,D1.W)
;lbC03FEFC MOVE.L A6,-(SP)
; MOVEA.L 4.W,A6
; JSR -$8A(A6) ; Permit - This call is guaranteed to preserve all registers.
; MOVEA.L (SP)+,A6
; EXG A0,A6
; RTS

;lbC03FF0C LSL.W #2,D0
; CLR.L $22(A6,D0.W)
; RTS

;lbW03FF14 dc.w $FFFF
; dc.w lbC03FEE4-lbW03FF14
; dc.w lbC03FF0C-lbW03FF14
; dc.w $FFFF
;lbW03FF1C

MatchTag
ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b $81 ; flags
dc.b $26 ; version
dc.b 8 ; type
dc.b $46 ; priority
dc.l miscresource.MSG ; name
dc.l misc3718191.MSG ; id string
dc.l MakeLibrary ; init

MakeLibrary
dc.l $32 ; $22=struct library, +4.l
dc.l Vectors
dc.l Structure ; cf. exec/InitStruct
dc.l 0 ; init code (0=none)

Structure
dc.w $A608 ; off=08, siz=.b, len=6+1
dc.b 8 ; type=resource (8)
dc.b 0 ; pri (9)
dc.l miscresource.MSG ; name (a)
dc.b 6 ; flags (e)
dc.b 0 ; pad
dc.w $9114 ; off=14, siz=.w, len=1+1
dc.w 38,0 ; old 37,1
dc.w 0 ; no more

; D0 - input
; A1 - input
; A6 - resource base

AllocMiscResource
move.l A6,-(SP)
lsl.w #2,D0
lea $22(A6,D0.W),A0
move.l 4.W,A6
addq.b #1,$127(A6)
move.l (A0),D0
bne.b Permit
move.l A1,(A0)
Permit
jsr -$8A(A6) ; Permit - This call is guaranteed to preserve all registers.
move.l (SP)+,A6
rts

; D0 - input
; A6 - resource base

FreeMiscResource
lsl.w #2,D0
clr.l $22(A6,D0.W)
rts

Vectors
dc.w $FFFF
dc.w AllocMiscResource-Vectors ; -6 _LVOAllocMiscResource
dc.w FreeMiscResource-Vectors ; -12 _LVOFreeMiscResource
dc.w $FFFF

miscresource.MSG dc.b 'misc.resource',0
misc3718191.MSG dc.b 'misc 38.0 (13.2.2012)',$D,$A,0
cnop 0,4
EndSkip

apex
17 October 2012, 09:17
Don, you are the ROMGOD! :) Thank you for your work...

mfilos
17 October 2012, 09:46
All these mini modules, work just fine in my custom 3.9 ROM using also the newest DOS.library without issues!
Keep up the good work mate :)

Ratte
19 October 2012, 03:16
All these mini modules,...
whats next?
wbfind :p

Don_Adan
04 November 2012, 18:24
whats next?
wbfind :p

If you want, I can try, but I'm lazy and a few busy, due my bet with Phil (10 months to finish). I started to optimise/rework some other ROM parts, f.e. trackdisk device, scsi device, exec library. If you have any ideas, you can always tell me.

Don_Adan
09 November 2012, 18:01
Two more ROM-s part is now available.
Wbfind (original in C), especially for Ratte, not tested by me.


; Resourced version of wbfind (40.1) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Barry 'Bart' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Bob 'Kodiak' Burns, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

;MatchTag
; ILLEGAL ; match word
; dc.l MatchTag ; match tag
; dc.l EndSkip ; end skip
; dc.b 4 ; flags
; dc.b $28 ; version
; dc.b 0 ; type
; dc.b $92 ; priority
; dc.l wbfind4017693.MSG ; name
; dc.l wbfind4017693.MSG ; id string
; dc.l Init ; init code
;wbfind4017693.MSG dc.b 'wbfind 40.1 (7.6.93)',$D,$A,0
; dc.b 'Nq',0
;lbL000034 dc.l 0

; LEA lbL000034(PC),A0
; JMP lbC0001CE

;lbW000042 dc.w 0

;Init SUBA.W #12,SP
; MOVEM.L D2/D6/D7/A2-A6,-(SP)
; MOVEA.L A6,A5 ; exec base
; MOVE.L A6,$28(SP) ; exec base
; LEA doslibrary.MSG(PC),A1
; MOVEQ #$25,D0
; JSR -$228(A6) ; open library
; MOVEA.L D0,A4 ; dos base
; MOVE.L D0,$24(SP) ; dos base
; BEQ.L lbC000174
; LEA lbW000042,A0
; MOVE.L A0,D7
; LEA lbL000034,A1
; SUB.L A1,D7
; LEA LIBSworkbench.MSG(PC),A0
; MOVE.L A0,D1
; MOVEQ #-2,D2
; MOVEA.L A4,A6 ; dos library
; JSR -$54(A6) ; Lock
; MOVE.L D0,D6
; BEQ.S lbC000092
; MOVE.L D6,D1
; JSR -$5A(A6) ; UnLock
; BRA.L lbC00016C

;lbC000092 LEA lbW000042,A0
; MOVE.L A0,D0
; LEA lbL000034,A1
; SUB.L A1,D0
; MOVEQ #$64,D1
; ADD.L D1,D0
; MOVE.L #$10001,D1
; MOVEA.L A5,A6
; JSR -$2AC(A6) ; AllocVec
; MOVE.L D0,$20(SP)
; BEQ.L lbC00016C
; MOVEA.L D0,A1
; LEA lbL000034,A0
; MOVE.L D7,D0
; JSR -$270(A6)
; JSR -$27C(A6)
; MOVEQ #9,D1
; MOVEA.L A4,A6
; JSR -$28E(A6) ; LockDosList
; MOVEA.L D0,A2
; BRA.S lbC00011C

;lbC0000D8 ADDA.L D7,A3
; MOVEA.L A3,A5
; MOVE.L $28(A2),D0
; ASL.L #2,D0
; MOVEA.L D0,A0
; LEA 1(A0),A4
; MOVE.B (A0),D6
; EXT.W D6
; EXT.L D6
; BRA.S lbC0000F2

;lbC0000F0 MOVE.B (A4)+,(A5)+
;lbC0000F2 MOVE.L D6,D0
; SUBQ.L #1,D6
; TST.L D0
; BNE.S lbC0000F0
; LEA libsworkbench.MSG(PC),A4
;lbC0000FE MOVE.B (A4)+,D0
; MOVE.B D0,(A5)+
; BNE.S lbC0000FE
; MOVEA.L $24(SP),A4 ; dos base
; MOVE.L A3,D1
; MOVEQ #-2,D2
; MOVEA.L A4,A6
; JSR -$54(A6) ; Lock
; MOVE.L D0,D6
; BEQ.S lbC00011C
; MOVE.L D6,D1
; JSR -$5A(A6) ; UnLock
;lbC00011C MOVE.L A2,D1
; MOVEQ #9,D2
; MOVEA.L A4,A6
; JSR -$2B2(A6) ; NextDosEntry
; MOVEA.L D0,A2
; MOVEA.L $20(SP),A3
; TST.L D0
; BEQ.S lbC000134
; TST.L D6
; BEQ.S lbC0000D8
;lbC000134 MOVEQ #9,D1
; MOVEA.L A4,A6
; JSR -$294(A6) ; UnLockDosList
; MOVEA.L $28(SP),A5
; TST.L D6
; BEQ.S lbC000164
; MOVEA.L A5,A6 ; exec base
; JSR -$84(A6) ; Forbid
; LEA $FFFFFDD8,A0 ; funcOffset A0.W
; LEA 4(A3),A1
; MOVE.L A1,D0 ; funcEntry D0
; MOVEA.L A5,A1 ; library A1
; JSR -$1A4(A6) ; SetFunction
; MOVE.L D0,(A3)
; JSR -$8A(A6) ; Permit
; BRA.S lbC00016C

;lbC000164 MOVEA.L A3,A1
; MOVEA.L A5,A6
; JSR -$2B2(A6) ; FreeVec
;lbC00016C MOVEA.L A4,A1
; MOVEA.L A5,A6
; JSR -$19E(A6) ; CloseLibrary
;lbC000174 MOVEQ #0,D0
; MOVEM.L (SP)+,D2/D6/D7/A2-A6
; ADDA.W #12,SP
; RTS

;doslibrary.MSG dc.b 'dos.library',0
;LIBSworkbench.MSG dc.b 'LIBS:workbench.library',0,0
;libsworkbench.MSG dc.b ':libs/workbench.library',0
;workbenchlibr.MSG dc.b 'workbench.library',0

;lbC0001CE SUBQ.W #4,SP
; MOVEM.L D6/D7/A2-A6,-(SP)
; MOVE.L D0,D7
; MOVEA.L A1,A4 ; library name
; MOVEA.L A0,A5
; MOVEA.L (A5),A3
; MOVE.L A6,$1C(SP)
; JSR (A3)
; MOVE.L D0,D6
; BNE.S lbC00021C
; LEA workbenchlibr.MSG(PC),A2
; BRA.S lbC0001F0

;lbC0001EC ADDQ.L #1,A4
; ADDQ.L #1,A2
;lbC0001F0 MOVE.B (A4),D0
; BEQ.S lbC0001F8
; CMP.B (A2),D0
; BEQ.S lbC0001EC
;lbC0001F8 MOVE.B (A4),D0
; CMP.B (A2),D0
; BNE.S lbC00021C
; LEA lbW000042,A0
; MOVE.L A0,D0
; LEA lbL000034,A1
; SUB.L A1,D0
; MOVEA.L A5,A1
; ADDA.L D0,A1
; MOVE.L D7,D0
; MOVEA.L $1C(SP),A6
; JSR (A3)
; MOVE.L D0,D6
;lbC00021C MOVE.L D6,D0
; MOVEM.L (SP)+,D6/D7/A2-A6
; ADDQ.W #4,SP
; RTS

; dc.w 0

;EndSkip

MatchTag
ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b 4 ; flags
dc.b $29 ; version
dc.b 0 ; type
dc.b $92 ; priority
dc.l wbfind4017693.MSG ; name
dc.l wbfind4017693.MSG ; id string
dc.l Init ; init code

BaseWB
dc.l 0
lea BaseWB(PC),A0
jmp NewOpenLibrary ; don't optimise/change this !!!
BaseWBEnd

Init
movem.l D2/D6/D7/A3-A6,-(SP)
move.l A6,A5 ; exec base
moveq #4,D0 ; dos library
jsr -$32A(A6) ; TaggedOpenLibrary
move.l D0,D7 ; dos base
beq.b Error
lea LIBSworkbench.MSG(PC),A0
move.l A0,D1
moveq #-2,D2
move.l D7,A6 ; dos base
jsr -$54(A6) ; Lock
move.l D0,D6
beq.b AllocVec
move.l D6,D1
jsr -$5A(A6) ; UnLock
move.l A5,A6
bra.b Close

AllocVec
moveq #$64+(BaseWBEnd-BaseWB),D0
move.l #$10001,D1 ; cleared chip mem
move.l A5,A6
jsr -$2AC(A6) ; AllocVec
tst.l D0
beq.b Close
move.l D0,A3
move.l D0,A1
lea BaseWB(PC),A0
moveq #(BaseWBEnd-BaseWB),D0
jsr -$270(A6) ; CopyMem
jsr -$27C(A6) ; CacheClearU
moveq #9,D1
move.l D7,A6 ; dos base
jsr -$28E(A6) ; LockDosList
move.l D0,A4
bra.b Next

Free
move.l A3,A1
move.l A5,A6
jsr -$2B2(A6) ; FreeVec
Close
move.l D7,A1
jsr -$19E(A6) ; CloseLibrary
moveq #0,D0
Error
movem.l (SP)+,D2/D6/D7/A3-A6
rts

Loop
lea BaseWBEnd-BaseWB(A3),A1 ; destination
move.l A1,D1 ; for Lock
move.l $28(A4),A0
add.l A0,A0
add.l A0,A0
moveq #0,D0
move.b (A0)+,D0 ; source
bra.b DoCopy

CopyName
move.b (A0)+,(A1)+
DoCopy
dbf D0,CopyName
lea libsworkbench.MSG(PC),A0
Copy
move.b (A0)+,(A1)+
bne.b Copy
moveq #-2,D2
jsr -$54(A6) ; Lock
move.l D0,D6
beq.b Next
move.l D6,D1
jsr -$5A(A6) ; UnLock
Next
move.l A4,D1
moveq #9,D2
jsr -$2B2(A6) ; NextDosEntry
tst.l D0
beq.b Unlock
move.l D0,A4
tst.l D6
beq.b Loop
Unlock
moveq #9,D1
jsr -$294(A6) ; UnLockDosList
tst.l D6
beq.b Free
move.l A5,A6 ; exec base
jsr -$84(A6) ; Forbid
lea -552.W,A0 ; funcOffset A0.W
move.l A3,D0
addq.l #4,D0 ; funcEntry D0
move.l A5,A1 ; library A1
jsr -$1A4(A6) ; SetFunction
move.l D0,(A3)
jsr -$8A(A6) ; Permit
bra.b Close

; D0 - input (lib version)
; A0 - input (BaseWB)
; A1 - input (lib name)
; D0 - output (lib base)

NewOpenLibrary
movem.l D0/A0/A1,-(SP)
move.l (A0),A0
jsr (A0)
move.l D0,D1
beq.b Extra
NoFound
lea 12(SP),SP
rts
Extra
moveq #17,D1 ; size of library name
move.l 8(SP),A0
lea workbenchlibr.MSG(PC),A1
CheckName
cmpm (A0)+,(A1)+
bne.b NoFound
dbf D1,CheckName
movem.l (SP)+,D0/A0/A1
lea BaseWBEnd-BaseWB(A0),A1
move.l (A0),A0
jmp (A0)

LIBSworkbench.MSG dc.b 'LIBS:workbench.library',0
libsworkbench.MSG dc.b ':libs/'
workbenchlibr.MSG dc.b 'workbench.library',0

wbfind4017693.MSG dc.b 'wbfind 41.0 (5.9.2012)',$D,$A,0
cnop 0,4
EndSkip



Here is wbtask (original in ASM), not tested by me. Thanks to Thor for help.


; Resourced version of wbtask (39.1) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Barry 'Bart' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Bob 'Kodiak' Burns, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

;MatchTag
; ILLEGAL ; match word
; dc.l MatchTag ; match tag
; dc.l EndSkip ; end skip
; dc.b 0 ; flags
; dc.b $27 ; version
; dc.b 1 ; type
; dc.b $88 ; priority
; dc.l workbenchtask.MSG ; name
; dc.l wbtag39120492.MSG ; id string
; dc.l Init ; init code

;Init
; dc.l 0
; MOVEQ #0,D2
; BRA.S lbC03FF4E

; dc.l 0
; MOVEQ #1,D2
; BRA.S lbC03FF4E

; dc.l 0
; MOVEQ #2,D2
;lbC03FF4E MOVEM.L D2/A2/A3/A6,-(SP)
; MOVEA.L 4.W,A6
; MOVEA.L $114(A6),A2
; LEA workbenchtask.MSG(PC),A0
; MOVE.L A0,10(A2)
; CMPI.W #2,D2
; BNE.S lbC03FF7A
; LEA $5C(A2),A0
; JSR -$180(A6) ; WaitPort
; LEA $5C(A2),A0
; JSR -$174(A6) ; GetMsg
; MOVEA.L D0,A3
;lbC03FF7A MOVEQ #10,D0 ; workbench library
; JSR -$32A(A6) ; TaggedOpenLibrary
; TST.L D0
; BEQ.S lbC03FFA8
; MOVEA.L D0,A6 ; workbench library base
; CMPI.W #2,D2
; BEQ.S lbC03FF92
; MOVE.W D2,D0
; MOVEQ #0,D1
; BRA.S lbC03FF9A

;lbC03FF92 MOVE.L $18(A3),D0
; MOVE.L $14(A3),D1
;lbC03FF9A JSR -$2A(A6) ; workbench LVO's
; MOVEA.L A6,A1 ; workbench library base
; MOVEA.L 4.W,A6
; JSR -$19E(A6) ; CloseLibrary
;lbC03FFA8 CMPI.W #2,D2
; BNE.S lbC03FFB4
; MOVEA.L A3,A1
; JSR -$17A(A6) ; ReplyMsg
;lbC03FFB4 MOVEM.L (SP)+,D2/A2/A3/A6
; RTS

;workbenchtask.MSG dc.b 'workbench.task',0
;wbtag39120492.MSG dc.b 'wbtag 39.1 (20.4.92)',$D,$A,0
;EndSkip

MatchTag
ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b 0 ; flags
dc.b $28 ; version
dc.b 1 ; type
dc.b $88 ; priority
dc.l workbenchtask.MSG ; name
dc.l wbtag39120492.MSG ; id string
dc.l Init ; init code

; The reason for the "NULL" bytes is that this is a "fake" segment list,
; which is because loadwb (at least up to v34) started
; the workbench via CreateProc(). Thus, the init pointer does not point to
; code to be executed in this case, but it is rather picked
; up by loadwb, divided by four and passed into CreateProc() for starting
; the workbench task (actually, process). An offset is added
; to this BPTR to implement various workbench parameters, i.e. "loadwb
; -debug" uses another entry point, loads d2 with a different
; value, and by that, configures the workbench differently through its
; init function.

; D2 is used as an input register to specify how the workbench is loaded,
; i.e. which options it was loaded with.

Init
dc.l 0
moveq #0,D2
bra.b TaskMe

dc.l 0
moveq #1,D2
bra.b TaskMe

dc.l 0
moveq #2,D2
TaskMe
movem.l D2/D3/A2/A6,-(SP)
move.l 4.W,A6
moveq #10,D0 ; workbench library
jsr -$32A(A6) ; TaggedOpenLibrary
move.l D0,D3 ; workbench lib base
beq.b Quit
move.l $114(A6),A2
lea workbenchtask.MSG(PC),A0
move.l A0,10(A2)
move.l D2,D0
moveq #0,D1
subq.w #2,D2
bne.b Private
lea $5C(A2),A0
jsr -$180(A6) ; WaitPort
lea $5C(A2),A0
jsr -$174(A6) ; GetMsg
move.l D0,A2
move.l $14(A2),D1
move.l $18(A2),D0
Private
exg D3,A6 ; workbench lib base
jsr -$2A(A6) ; wb private LVO
move.l A6,A1
exg D3,A6 ; exec base
jsr -$19E(A6) ; CloseLibrary
tst.w D2
bne.b Quit
move.l A2,A1
jsr -$17A(A6) ; ReplyMsg
Quit
movem.l (SP)+,D2/D3/A2/A6
rts

workbenchtask.MSG dc.b 'workbench.task',0
wbtag39120492.MSG dc.b 'wbtag 40.0 (8.11.2012)',$D,$A,0
EndSkip

Arnie
10 November 2012, 12:06
Nice work :great

Any chance of carddisk.resource to include CF0: in the boot menu ? :)

mfilos
10 November 2012, 14:18
Tested these modules as well and work like a charm :)

@Arnie
It's not that simple mate.
You also need a modified compactflash.device which certainly needs permissions from the author.

Don_Adan
10 November 2012, 18:40
Nice work :great

Any chance of carddisk.resource to include CF0: in the boot menu ? :)

I want to rework of carddisk.resource to, but I don't know if I'm good enough to add support for CF0: in bootmenu. This is dependent to some things.

Arnie
10 November 2012, 20:04
Tested these modules as well and work like a charm :)

@Arnie
It's not that simple mate.
You also need a modified compactflash.device which certainly needs permissions from the author.

Hi mfilos,

What's wrong with the compactflash.device... i.e., what needs to be altered?

Messing around with the carddisk.resource in hex editor, I managed to get CF0: in the boot menu but the parameters for CF cards are for CC0: and I don't know how to change them?

I could get the 3.9 rom to boot in WinUAE but not in my Amiga 600 so I couldn't test it to see if it booted CF0: :sad

Ratte
11 November 2012, 23:03
Here is A4000 bonus source.


; Resourced version of A4000 bonus (40.1) from Amiga ROM 3.1 for Amiga68k ROM 1.0

....

A4000bonus.MSG dc.b 'A4000 bonus',0
bonus40115293.MSG dc.b 'bonus 40.1 (15.2.93)',$D,$A,0
dc.b 0
cnop 0,4
EndSkip


A4000 & A3000 are equal.

Better start helping aros68k ...

Don_Adan
17 November 2012, 16:59
A4000 & A3000 are equal.

I know, both versions are identical except ID string. This ROM part is perhaps used by some programs to detect A3000 and A4000.


Better start helping aros68k ...

I know only 68K ASM, and don't want to learn C.

Optimised version of wbfind is available.


; Resourced version of wbfind (40.1) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Barry 'Bart' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Bob 'Kodiak' Burns, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

;MatchTag
; ILLEGAL ; match word
; dc.l MatchTag ; match tag
; dc.l EndSkip ; end skip
; dc.b 4 ; flags
; dc.b $28 ; version
; dc.b 0 ; type
; dc.b $92 ; priority
; dc.l wbfind4017693.MSG ; name
; dc.l wbfind4017693.MSG ; id string
; dc.l Init ; init code
;wbfind4017693.MSG dc.b 'wbfind 40.1 (7.6.93)',$D,$A,0
; dc.b 'Nq',0
;lbL000034 dc.l 0

; LEA lbL000034(PC),A0
; JMP lbC0001CE

;lbW000042 dc.w 0

;Init SUBA.W #12,SP
; MOVEM.L D2/D6/D7/A2-A6,-(SP)
; MOVEA.L A6,A5 ; exec base
; MOVE.L A6,$28(SP) ; exec base
; LEA doslibrary.MSG(PC),A1
; MOVEQ #$25,D0
; JSR -$228(A6) ; open library
; MOVEA.L D0,A4 ; dos base
; MOVE.L D0,$24(SP) ; dos base
; BEQ.L lbC000174
; LEA lbW000042,A0
; MOVE.L A0,D7
; LEA lbL000034,A1
; SUB.L A1,D7
; LEA LIBSworkbench.MSG(PC),A0
; MOVE.L A0,D1
; MOVEQ #-2,D2
; MOVEA.L A4,A6 ; dos library
; JSR -$54(A6) ; Lock
; MOVE.L D0,D6
; BEQ.S lbC000092
; MOVE.L D6,D1
; JSR -$5A(A6) ; UnLock
; BRA.L lbC00016C

;lbC000092 LEA lbW000042,A0
; MOVE.L A0,D0
; LEA lbL000034,A1
; SUB.L A1,D0
; MOVEQ #$64,D1
; ADD.L D1,D0
; MOVE.L #$10001,D1
; MOVEA.L A5,A6
; JSR -$2AC(A6) ; AllocVec
; MOVE.L D0,$20(SP)
; BEQ.L lbC00016C
; MOVEA.L D0,A1
; LEA lbL000034,A0
; MOVE.L D7,D0
; JSR -$270(A6)
; JSR -$27C(A6)
; MOVEQ #9,D1
; MOVEA.L A4,A6
; JSR -$28E(A6) ; LockDosList
; MOVEA.L D0,A2
; BRA.S lbC00011C

;lbC0000D8 ADDA.L D7,A3
; MOVEA.L A3,A5
; MOVE.L $28(A2),D0
; ASL.L #2,D0
; MOVEA.L D0,A0
; LEA 1(A0),A4
; MOVE.B (A0),D6
; EXT.W D6
; EXT.L D6
; BRA.S lbC0000F2

;lbC0000F0 MOVE.B (A4)+,(A5)+
;lbC0000F2 MOVE.L D6,D0
; SUBQ.L #1,D6
; TST.L D0
; BNE.S lbC0000F0
; LEA libsworkbench.MSG(PC),A4
;lbC0000FE MOVE.B (A4)+,D0
; MOVE.B D0,(A5)+
; BNE.S lbC0000FE
; MOVEA.L $24(SP),A4 ; dos base
; MOVE.L A3,D1
; MOVEQ #-2,D2
; MOVEA.L A4,A6
; JSR -$54(A6) ; Lock
; MOVE.L D0,D6
; BEQ.S lbC00011C
; MOVE.L D6,D1
; JSR -$5A(A6) ; UnLock
;lbC00011C MOVE.L A2,D1
; MOVEQ #9,D2
; MOVEA.L A4,A6
; JSR -$2B2(A6) ; NextDosEntry
; MOVEA.L D0,A2
; MOVEA.L $20(SP),A3
; TST.L D0
; BEQ.S lbC000134
; TST.L D6
; BEQ.S lbC0000D8
;lbC000134 MOVEQ #9,D1
; MOVEA.L A4,A6
; JSR -$294(A6) ; UnLockDosList
; MOVEA.L $28(SP),A5
; TST.L D6
; BEQ.S lbC000164
; MOVEA.L A5,A6 ; exec base
; JSR -$84(A6) ; Forbid
; LEA $FFFFFDD8,A0 ; funcOffset A0.W
; LEA 4(A3),A1
; MOVE.L A1,D0 ; funcEntry D0
; MOVEA.L A5,A1 ; library A1
; JSR -$1A4(A6) ; SetFunction
; MOVE.L D0,(A3)
; JSR -$8A(A6) ; Permit
; BRA.S lbC00016C

;lbC000164 MOVEA.L A3,A1
; MOVEA.L A5,A6
; JSR -$2B2(A6) ; FreeVec
;lbC00016C MOVEA.L A4,A1
; MOVEA.L A5,A6
; JSR -$19E(A6) ; CloseLibrary
;lbC000174 MOVEQ #0,D0
; MOVEM.L (SP)+,D2/D6/D7/A2-A6
; ADDA.W #12,SP
; RTS

;doslibrary.MSG dc.b 'dos.library',0
;LIBSworkbench.MSG dc.b 'LIBS:workbench.library',0,0
;libsworkbench.MSG dc.b ':libs/workbench.library',0
;workbenchlibr.MSG dc.b 'workbench.library',0

;lbC0001CE SUBQ.W #4,SP
; MOVEM.L D6/D7/A2-A6,-(SP)
; MOVE.L D0,D7
; MOVEA.L A1,A4 ; library name
; MOVEA.L A0,A5
; MOVEA.L (A5),A3
; MOVE.L A6,$1C(SP)
; JSR (A3)
; MOVE.L D0,D6
; BNE.S lbC00021C
; LEA workbenchlibr.MSG(PC),A2
; BRA.S lbC0001F0

;lbC0001EC ADDQ.L #1,A4
; ADDQ.L #1,A2
;lbC0001F0 MOVE.B (A4),D0
; BEQ.S lbC0001F8
; CMP.B (A2),D0
; BEQ.S lbC0001EC
;lbC0001F8 MOVE.B (A4),D0
; CMP.B (A2),D0
; BNE.S lbC00021C
; LEA lbW000042,A0
; MOVE.L A0,D0
; LEA lbL000034,A1
; SUB.L A1,D0
; MOVEA.L A5,A1
; ADDA.L D0,A1
; MOVE.L D7,D0
; MOVEA.L $1C(SP),A6
; JSR (A3)
; MOVE.L D0,D6
;lbC00021C MOVE.L D6,D0
; MOVEM.L (SP)+,D6/D7/A2-A6
; ADDQ.W #4,SP
; RTS

; dc.w 0

;EndSkip

MatchTag
ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b 4 ; flags
dc.b $29 ; version
dc.b 0 ; type
dc.b $92 ; priority
dc.l wbfind4017693.MSG ; name
dc.l wbfind4017693.MSG ; id string
dc.l Init ; init code

Init
movem.l D2/D6/D7/A3-A6,-(SP)
move.l A6,A5 ; exec base
moveq #4,D0 ; dos library
jsr -$32A(A6) ; TaggedOpenLibrary
move.l D0,D7 ; dos base
beq.b Error
lea LIBSworkbench.MSG(PC),A0
move.l A0,D1
moveq #-2,D2
move.l D7,A6 ; dos base
jsr -$54(A6) ; Lock
move.l D0,D6
beq.b AllocVec
move.l D6,D1
jsr -$5A(A6) ; UnLock
move.l A5,A6
bra.b Close

AllocVec
moveq #(32+24+4+NewOpenLibraryEnd-NewOpenLibrary),D0
moveq #1,D1 ; fast mem
move.l A5,A6
jsr -$2AC(A6) ; AllocVec
tst.l D0
beq.b Close
move.l D0,A1
clr.l (A1)+
move.l A1,A3
lea NewOpenLibrary(PC),A0
moveq #(NewOpenLibraryEnd-NewOpenLibrary),D0
jsr -$270(A6) ; CopyMem
jsr -$27C(A6) ; CacheClearU
moveq #9,D1
move.l D7,A6 ; dos base
jsr -$28E(A6) ; LockDosList
move.l D0,A4
bra.b Next

Free
subq.l #4,A3
move.l A3,A1
move.l A5,A6
jsr -$2B2(A6) ; FreeVec
Close
move.l D7,A1
jsr -$19E(A6) ; CloseLibrary
moveq #0,D0
Error
movem.l (SP)+,D2/D6/D7/A3-A6
rts

Loop
lea NewOpenLibraryEnd-NewOpenLibrary(A3),A1 ; destination
move.l A1,D1 ; for Lock
move.l $28(A4),A0
add.l A0,A0
add.l A0,A0
moveq #0,D0
move.b (A0)+,D0 ; source
bra.b DoCopy

CopyName
move.b (A0)+,(A1)+
DoCopy
dbf D0,CopyName
lea libsworkbench.MSG(PC),A0
Copy
move.b (A0)+,(A1)+
bne.b Copy
moveq #-2,D2
jsr -$54(A6) ; Lock
move.l D0,D6
beq.b Next
move.l D6,D1
jsr -$5A(A6) ; UnLock
Next
move.l A4,D1
moveq #9,D2
jsr -$2B2(A6) ; NextDosEntry
tst.l D0
beq.b Unlock
move.l D0,A4
tst.l D6
beq.b Loop
Unlock
moveq #9,D1
jsr -$294(A6) ; UnLockDosList
tst.l D6
beq.b Free
move.l A5,A6 ; exec base
jsr -$84(A6) ; Forbid
lea -552.W,A0 ; funcOffset A0.W
move.l A3,D0 ; funcEntry D0
move.l A5,A1 ; library A1
jsr -$1A4(A6) ; SetFunction
move.l D0,-(A3)
jsr -$8A(A6) ; Permit
bra.b Close

; D0 - input (lib version)
; A1 - input (lib name)
; D0 - output (lib base)

NewOpenLibrary
move.l D0,-(SP)
move.l A1,-(SP)
move.l NewOpenLibrary-4(PC),A0
jsr (A0)
move.l (SP)+,A1
move.l D0,D1
beq.b Check
NoWBlib
addq.l #4,SP
rts
Check
moveq #18-1,D1 ; size of library name
lea workbenchlibr.MSG(PC),A0
CheckName
cmpm (A0)+,(A1)+
bne.b NoWBlib
dbf D1,CheckName
move.l (SP)+,D0 ; version
lea NewOpenLibraryEnd(PC),A1
move.l NewOpenLibrary-4(PC),A0
jmp (A0)
NewOpenLibraryEnd

LIBSworkbench.MSG dc.b 'LIBS:workbench.library',0
libsworkbench.MSG dc.b ':libs/'
workbenchlibr.MSG dc.b 'workbench.library',0

wbfind4017693.MSG dc.b 'wbfind 41.0 (17.11.2012)',$D,$A,0
cnop 0,4
EndSkip

Minuous
20 November 2012, 12:56
So, as I read it, the ones which have been improved are:

filesystem.resource with DOS6/DOS7/DOS8 support
battmem.resource bug fix
misc.resource optimized
potgo.resource optimized

I am planning to incorporate these into the next version of BB4 if you don't object?

mfilos
20 November 2012, 13:15
You forgot wbfind but that doesn't have a reason to be incorporated in the BB4 :)

Don_Adan
25 November 2012, 13:44
So, as I read it, the ones which have been improved are:

filesystem.resource with DOS6/DOS7/DOS8 support
battmem.resource bug fix
misc.resource optimized
potgo.resource optimized

I am planning to incorporate these into the next version of BB4 if you don't object?

No problem.

wXR
25 November 2012, 14:01
Guys can we please get all of these cool updates and projects into some kind of version-controlled repository? I think that would be really helpful for would-be BoingBag contributors, too.

Mrs Beanbag
30 November 2012, 15:38
What I'd really like to see in an Amiga ROM is native support for Linux Ext2 filesystem! Then it would be possible to format and install a HDD for a real classic Amiga on any Linux PC without emulators, which would be very convenient, plus it is generally a better filesystem than FFS in many ways.

I could perhaps do this myself if I knew where to begin.

Don_Adan
30 November 2012, 16:09
What I'd really like to see in an Amiga ROM is native support for Linux Ext2 filesystem! Then it would be possible to format and install a HDD for a real classic Amiga on any Linux PC without emulators, which would be very convenient, plus it is generally a better filesystem than FFS in many ways.

I could perhaps do this myself if I knew where to begin.

Seems that for Amiga must exist Unix filesystem already, it uses "UNI1" ID. I never seen this filesystem, perhaps this is part of Amiga 3000 UNIX models. Perhaps this filesystem can be updated to add support for Linux Ext2 filesystem.

Jope
02 December 2012, 10:16
What I'd really like to see in an Amiga ROM is native support for Linux Ext2 filesystem! Then it would be possible to format and install a HDD for a real classic Amiga on any Linux PC without emulators, which would be very convenient, plus it is generally a better filesystem than FFS in many ways.

I could perhaps do this myself if I knew where to begin.

Don't waste ROM space with that, as the Amiga already supports loading your custom filesystem from the RDB.

Where to begin: make an ext2/3/4 handler for AmigaOS. The PFS3 and SFS source codes are out there to steal the AmigaOS bits from, Mr. Babel's Amiga Guru Book contains lots of useful information too.

If you want to partition the disk in Linux, there's amiga-fdisk. It may not be capable of installing filesystems to the RDB like HDToolBox and clones, but it's open source so you can add the functionality.

Now having said that, IMO using ext2 is not a good idea on the Amiga. It is even more fragile than FFS if improperly unmounted and you'll have to figure out your own mapping for amiga protection bits, file comments etc.

Your time is better spent in making SFS and PFS3 drivers for Linux (FUSE drivers perhaps) to ease file transfer when you've mounted an Amiga drive.

Mrs Beanbag
02 December 2012, 17:12
Any way to get the Amiga to recognise standard MBR? MBR and RDB apparently can co-exist, but I take it the Amiga simply ignores the MBR in this case. I suppose one could write the code to handle the RDB into the Linux filesystem driver, and treat it as part of the first partition's meta-data.

delshay
02 December 2012, 19:05
Does 3.9 roms affect other OS? ie morph or OS4.x
Is it possible to do 4.x roms?

OFF TOPIC

I do believe the A1200 motherboard takes some other type of flash on board or was it a clock correct me if I am wrong as I cannot remember,can this space be used?

NOTE: I am talking about the soldering pads

mfilos
02 December 2012, 21:12
3.9 ROMS doesn't affect OS4.x and Morphos as I tried them on my previous A1200D PPC without problems.

I don't think that 4.x is quite feasible but you never knows

Mrs Beanbag
03 December 2012, 18:16
Where to begin: make an ext2/3/4 handler for AmigaOS. The PFS3 and SFS source codes are out there to steal the AmigaOS bits from, Mr. Babel's Amiga Guru Book contains lots of useful information too.
Unfortunately this book is not available anywhere :(

Now thinking about making an entirely new filesystem with Amiga and SSDs in mind, maybe I should start a new thread about this.

TheCyberDruid
03 December 2012, 18:27
Unfortunately this book is not available anywhere :(

2 minutes on Google: http://www.embedupload.com/?d=7JGBKJINEH

Mrs Beanbag
03 December 2012, 18:55
Hmm well I could download it, but isn't that the reason the author won't publish the latest edition? It feels wrong. But I guess I don't have any other option.

Edit: plus that site seems to want me to install a .exe, dodgy as hell... not even possible anyway since I use Linux. Everywhere else I find it is the same.

TheCyberDruid
03 December 2012, 19:15
Well, since the reprint won't be published anyway... Seems like the links are all dead, but you can still find it as a torrent and on UseNet.

cosmicfrog
03 December 2012, 23:29
yep it sucks but hey if Babel wants to let his hard won knowlege fade away what choice do ppl have when the are after information

frankly an amiga user who dosn`t know piracy is rife needs to stay in there ivory tower

personaly I would love a Hardcopy of both books, not that I can afford them or even use them to there fullest but I still want em

Mrs Beanbag
04 December 2012, 12:42
True, but I can sympathise with the man, I mean it's not like the old days (and even when it was we used to copy games not books), you'd think any Amiga users left now would have more sense, especially the ones who would read such a book. But there you go.

TheCyberDruid
04 December 2012, 12:53
It just takes one idiot to rain on everybody's parade... My two cent are that he overreacted and he'd still have sold a lot of books. Now the only option is to wait for a copy on eBay or get it by other means. I just think that if you want to do something useful for the Amiga and the only mean to get the information is by downloading a PDF, I'd do it.

Oh and I'm pretty sure that noone that would have bought a reprint uploaded that PDF in the first place...

mark_k
04 December 2012, 14:54
Seems that for Amiga must exist Unix filesystem already, it uses "UNI1" ID. I never seen this filesystem, perhaps this is part of Amiga 3000 UNIX models. Perhaps this filesystem can be updated to add support for Linux Ext2 filesystem.

I think the "UNI\1" designation was just used for defining partitions in the RDB. There was never an AmigaOS filesystem to access Amiga UNIX partitions.


Where to begin: make an ext2/3/4 handler for AmigaOS. The PFS3 and SFS source codes are out there to steal the AmigaOS bits from, Mr. Babel's Amiga Guru Book contains lots of useful information too.

There is already an ext2/ext3 filesystem for the Amiga (http://aminet.net/package/disk/misc/ext2fs_0.41). But there's no source code and I don't know whether it's RDB-installable.

Bamiga2002
05 December 2012, 09:56
One question:
how to put WBFind & WBTask to use?

mfilos
05 December 2012, 20:57
WBFind is a module that is only needed if you make a custom ROM with Workbench.library OUTSIDE the ROM due to lacks of space.
For example making a custom Kick 3.9 for an A4000 isn't feasible as A4000 supports only 512KB ROMS (unless you have a Romy board from SpeedGeek).
Leaving out Workbench.library and it's possible. Then you put the WBFind module and voila...you can just copy Workbench.library in LIBS and you won't have a problem.

WBtask is an updated module of the internal WBtask module of Kickstart 3.1 ROM

Bamiga2002
06 December 2012, 16:46
Thanks! Put WBTask resident using LoadModule :)

Hewitson
07 December 2012, 14:56
What I'd really like to see in an Amiga ROM is native support for Linux Ext2 filesystem! Then it would be possible to format and install a HDD for a real classic Amiga on any Linux PC without emulators, which would be very convenient, plus it is generally a better filesystem than FFS in many ways.

I could perhaps do this myself if I knew where to begin.
Linux has supported Amiga filesystems for years (CONFIG_AFFS_FS kernel option). You should always compile kernel and applications yourself, you never know what features you are missing out on ;)

Most notably, support for affs can be compiled into Linux kernels, and offers full read, write and format support on FFS and OFS partitions of all dostypes except DOS\6 and DOS\7 (which are probably incredibly rare).

Don_Adan
09 December 2012, 13:28
I think the "UNI\1" designation was just used for defining partitions in the RDB. There was never an AmigaOS filesystem to access Amiga UNIX partitions.


Which filesystem is used by Amix ? For me it must be UNIX filesystem for Amiga.

BTW.Here is some infos about UNI1:
http://ftp.uni-erlangen.de/pub/Linux/LOCAL/680x0/bin/system/disk/fdisk.readme

Don_Adan
03 January 2013, 16:02
Optimised version of cia resource is available.


; Resourced version of cia.resource (39.1) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Barry 'Bart' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Bob 'Kodiak' Burns, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

MatchTag
ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b 1 ; flags
; dc.b $27 ; version

dc.b $28 ; new version

dc.b 8 ; type
dc.b $50 ; priority
dc.l ciaresource.MSG ; name
dc.l cia39110392.MSG ; id string
dc.l InitResource ; init code
;ciaresource.MSG dc.b 'cia.resource',0,0
;ciaaresource.MSG1 dc.b 'ciaa.resource',0
;ciabresource.MSG0 dc.b 'ciab.resource',0
;cia39110392.MSG dc.b 'cia 39.1 (10.3.92)',$D,$A,0
; dc.b 0
; dc.b 0
; dc.b 0
Vectors
dc.w $FFFF
dc.w AddICRVector-Vectors ; -6 _LVOAddICRVector
dc.w RemICRVector-Vectors ; -12 _LVORemICRVector
dc.w AbleICR-Vectors ; -18 _LVOAbleICR
dc.w SetICR-Vectors ; -24 _LVOSetICR
dc.w $FFFF

InitResource
MOVEM.L A2/A3,-(SP)
MOVEQ #$20,D0
MOVE.L #$10001,D1
JSR -$C6(A6) ; AllocMem
MOVEA.L D0,A3 ; resource base, no error code
; BSR.L MakeLib

bsr.b MakeLib

MOVE.L A2,4(A3)
MOVEQ #0,D0
MOVEQ #3,D1
MOVEM.L D0/D1/A2,8(A3)
BSET D0,$86(A2)
MOVE.L #$BFE001,$22(A2)
MOVE.L A6,$7C(A2) ; exec base
MOVE.W #8,$26(A2)
MOVE.L #IO_PortsInt,$12(A1)
MOVEQ #3,D0 ; I/O Ports and timers
JSR -$A8(A6) ; AddIntServer
LEA ciaaresource.MSG1(PC),A0
BSR.S AddResource
BSR.S MakeLib
MOVE.L A2,(A3)
LEA $BFD000,A0
MOVE.L A0,$22(A2)
MOVE.L A6,$7C(A2) ; exec base
MOVEQ #-$40,D0
OR.B D0,$200(A0)
OR.B D0,(A0)
MOVE.W #$2000,$26(A2)
MOVE.L #ExternalInt,$12(A1)
MOVEQ #13,D0 ; External interrupt
JSR -$A8(A6) ; AddIntServer
LEA ciabresource.MSG0(PC),A0
BSR.S AddResource
MOVEM.L (SP)+,A2/A3
RTS

MakeLib LEA Vectors(PC),A0
SUBA.L A1,A1
SUBA.L A2,A2
; MOVEQ #$11,D0
; ROL.L #3,D0

moveq #136/2,D0
add.w D0,D0

JSR -$54(A6) ; MakeLibrary
MOVEA.L D0,A2 ; again, no error check
; MOVE.B #8,8(A2)
; CLR.B 9(A2)

move.w #$800,8(A2)

LEA $2A(A2),A1
; MOVE.B #2,8(A1)
; MOVE.B #$78,9(A1)

move.w #$278,8(A1)

MOVE.L A2,14(A1)
MOVE.L A3,$80(A2)
RTS

AddResource MOVE.L A0,10(A1)
MOVE.L A0,10(A2)
MOVEA.L A2,A1 ; A1 input
; JSR -$1E6(A6) ; AddResource
; RTS

jmp -$1E6(A6) ; AddResource

IO_PortsInt MOVEM.L D2/A2,-(SP)
MOVEA.L A1,A2
lbC03F6FC BCLR #0,$87(A2)
BEQ.S lbC03F710
MOVEA.L $80(A2),A1
MOVEM.L $18(A1),A1/A5
JSR (A5)
lbC03F710 MOVE.W SR,D0
ORI.W #$700,SR
MOVE.B $BFED01,D2
BCLR #7,D2
OR.B $29(A2),D2
MOVE.B D2,$29(A2)
AND.B $28(A2),D2
MOVE.B D2,$84(A2)
BEQ.S lbC03F75E
EOR.B D2,$29(A2)
MOVE.W D0,SR
MOVEA.L $7C(A2),A6 ; set exec base in A6
LEA $DFF000,A0 ; set chip in A0
LSR.B #1,D2
BCS.S lbC03F768
lbC03F746 LSR.B #1,D2
BCS.S lbC03F772
BEQ.S lbC03F6FC
lbC03F74C LSR.B #1,D2
BCS.S lbC03F77C
BEQ.S lbC03F6FC
lbC03F752 LSR.B #1,D2
BCS.S lbC03F786
BEQ.S lbC03F6FC
lbC03F758 LSR.B #1,D2
BCS.S lbC03F790
BRA.S lbC03F6FC

lbC03F75E MOVE.W D0,SR
MOVEM.L (SP)+,D2/A2
MOVEQ #0,D0
RTS

lbC03F768 MOVEM.L $40(A2),A1/A5
JSR (A5)
BRA.S lbC03F746

lbC03F772 MOVEM.L $4C(A2),A1/A5
JSR (A5)
BRA.S lbC03F74C

lbC03F77C MOVEM.L $58(A2),A1/A5
JSR (A5)
BRA.S lbC03F752

lbC03F786 MOVEM.L $64(A2),A1/A5
JSR (A5)
BRA.S lbC03F758

lbC03F790 MOVEM.L $70(A2),A1/A5
JSR (A5)
BRA.L lbC03F6FC

; A0 and A6 are not set for ExternalInt handler

ExternalInt MOVEM.L D2/A2,-(SP)
MOVE.B $BFDD00,D2
BCLR #7,D2
OR.B $29(A1),D2
MOVE.B D2,$29(A1)
AND.B $28(A1),D2
BEQ.S lbC03F7E0
MOVE.B D2,$84(A1)
MOVEA.L A1,A2
EOR.B D2,$29(A2)
LSR.B #1,D2
BCS.S lbC03F7E8
lbC03F7C6 LSR.B #1,D2
BCS.S lbC03F7F2
BEQ.S lbC03F7DC
lbC03F7CC LSR.B #1,D2
BCS.S lbC03F7FC
BEQ.S lbC03F7DC
lbC03F7D2 LSR.B #1,D2
BCS.S lbC03F806
BEQ.S lbC03F7DC
lbC03F7D8 LSR.B #1,D2
BCS.S lbC03F810
lbC03F7DC CLR.B $84(A2)
lbC03F7E0 MOVEM.L (SP)+,D2/A2
MOVEQ #0,D0
RTS

lbC03F7E8 MOVEM.L $40(A2),A1/A5
JSR (A5)
BRA.S lbC03F7C6

lbC03F7F2 MOVEM.L $4C(A2),A1/A5
JSR (A5)
BRA.S lbC03F7CC

lbC03F7FC MOVEM.L $58(A2),A1/A5
JSR (A5)
BRA.S lbC03F7D2

lbC03F806 MOVEM.L $64(A2),A1/A5
JSR (A5)
BRA.S lbC03F7D8

lbC03F810 MOVEM.L $70(A2),A1/A5
JSR (A5)
BRA.S lbC03F7DC

; D0 - input
; A1 - input
; A6 - resource base
; D0 - output

AddICRVector MOVEQ #0,D1
MOVE.B D0,D1
MULU.W #12,D1
MOVEA.L $7C(A6),A0
MOVE.W #$4000,$DFF09A
ADDQ.B #1,$126(A0)
LEA $40(A6,D1.W),A0
MOVE.L 8(A0),D1
BNE.S lbC03F914
lbC03F8E4 MOVE.L A1,8(A0)
MOVE.L $12(A1),4(A0)
MOVE.L 14(A1),(A0)
BSET D0,$85(A6)
MOVE.W #$80,D1
BSR.S lbC03F96C
lbC03F8FC MOVEA.L $7C(A6),A0
SUBQ.B #1,$126(A0)
BGE.S lbC03F90E
MOVE.W #$C000,$DFF09A
lbC03F90E RTS

lbC03F910 MOVE.L D1,D0
BRA.S lbC03F8FC

lbC03F914 BTST D0,$86(A6)
BEQ.S lbC03F910
MOVEM.L D0-D3/A0-A3/A6,-(SP)
BSR.S lbC03F978
BNE.S lbC03F950
BSR.S lbC03F992
MOVEM.L (SP)+,D0-D3/A0-A3/A6
BRA.S lbC03F8E4

; D0 - input
; A1 - input
; A6 - resource base

RemICRVector MOVEA.L $7C(A6),A0
MOVE.W #$4000,$DFF09A
ADDQ.B #1,$126(A0)
BSR.S lbC03F956
MOVEM.L D0-D3/A0-A3/A6,-(SP)
BSR.S lbC03F978
MOVEM.L 8(A1),D0/D1/A6
CMP.B D1,D3
BLE.S lbC03F950
BSR.S lbC03F956
BSR.S lbC03F992
lbC03F950 MOVEM.L (SP)+,D0-D3/A0-A3/A6
BRA.S lbC03F910

lbC03F956 MOVEQ #0,D1
MOVE.B D0,D1
MULU.W #12,D1
LEA $40(A6,D1.W),A0
CLR.L 8(A0)
MOVEQ #0,D1
BCLR D0,$85(A6)
lbC03F96C BSET D0,D1
MOVE.W D1,D0
; BSR.L AbleICR

bsr.b AbleICR

MOVEQ #0,D0
RTS

lbC03F978 MOVEA.L $80(A6),A1
MOVEM.L (A1),A2/A3
MOVEQ #3,D3
MOVEQ #$40,D2
lbC03F984 EXG A3,A2
LSR.B #3,D2
BTST D2,$85(A2)
DBEQ D3,lbC03F984
RTS

lbC03F992 AND.B #1,D2
MOVEM.L D2/D3/A2,8(A1)
CLR.B $86(A3)
CLR.B $86(A2)
BSET D2,$86(A2)
MOVEA.L $14(A1),A0
JMP (A0)

; D0 - input
; A6 - resource base
; D0 - output

AbleICR
; MOVEA.L $7C(A6),A0
; MOVE.W #$4000,$DFF09A
; ADDQ.B #1,$126(A0)
; MOVEA.L $22(A6),A0 ; timer

bsr.b SetMe

MOVE.B D0,$D00(A0)
MOVEQ #0,D1
MOVE.B $28(A6),D1
TST.B D0
BEQ.S lbC03F85E
BCLR #7,D0
BNE.S lbC03F8BC
NOT.B D0
AND.B D0,$28(A6)
BRA.S lbC03F85E

lbC03F8BC OR.B D0,$28(A6)
BRA.S lbC03F85E

SetMe
move.l $7C(A6),A0
move.w #$4000,$DFF09A
addq.b #1,$126(A0)
move.l $22(A6),A0 ; timer
rts

; D0 - input
; A6 - resource base
; D0 - output

SetICR
; MOVEA.L $7C(A6),A0 ; exec base
; MOVE.W #$4000,$DFF09A
; ADDQ.B #1,$126(A0)
; MOVEA.L $22(A6),A0 ; timer

bsr.b SetMe

MOVE.B $D00(A0),D1
BCLR #7,D1
OR.B D1,$29(A6)
MOVEQ #0,D1
MOVE.B $29(A6),D1
OR.B $84(A6),D1
TST.B D0
BEQ.S lbC03F85E
BCLR #7,D0
BNE.S lbC03F85A
NOT.B D0
AND.B D0,$29(A6)
AND.B D0,$84(A6)
BRA.S lbC03F85E

lbC03F85A OR.B D0,$29(A6)
lbC03F85E MOVE.B $28(A6),D0
AND.B $29(A6),D0
BEQ.S lbC03F876
MOVE.W $26(A6),D0
OR.W #$8000,D0
MOVE.W D0,$DFF09C
lbC03F876 MOVEA.L $7C(A6),A0 ; exec base
SUBQ.B #1,$126(A0)
BGE.S lbC03F888
MOVE.W #$C000,$DFF09A
lbC03F888 MOVE.L D1,D0
RTS

ciaresource.MSG dc.b 'cia.resource',0,0
ciaaresource.MSG1 dc.b 'ciaa.resource',0
ciabresource.MSG0 dc.b 'ciab.resource',0
cia39110392.MSG dc.b 'cia 40.0 (3.1.2013)',$D,$A,0

cnop 0,4
EndSkip

mfilos
03 January 2013, 22:35
Tried it as always and system seems to work just fine :)
Thanks for these updates as always DonAdan mate \o/

Bamiga2002
04 January 2013, 09:27
Thanks Don, installed this yesterday :)

fgh
20 January 2013, 18:53
Could some of you ROM-gurus check this patch (http://eab.abime.net/showpost.php?p=506385&postcount=25) that Toni Wilen has suggested will keep PCMCIA enabled with >4MB Z2-RAM installed?

Any way to get the Amiga to recognise standard MBR? MBR and RDB apparently can co-exist, but I take it the Amiga simply ignores the MBR in this case.

FAT95 can read MBR's and FAT file systems.
RDB position is more flexible than FAT, so place the RDB after the FAT, and the amiga can access both.
It has been done, although not by myself..

Arnie
20 January 2013, 19:12
Yes, it can be done. I have successfully created Usb sticks and HD partitions with both MBR & RDB on the same device. I find Aros the easiest for this task.

wawa
21 January 2013, 01:54
Quote:
Originally Posted by Ratte
Better start helping aros68k ...
I know only 68K ASM, and don't want to learn C.

you could propose crucial optimisations that you find out about to be inlined into c code in 68k branch. that could be very helpful. toni wilen is one of the two 68k maintainers. i think he would likely be bothered to review if you had any proposals.

Don_Adan
26 January 2013, 15:16
you could propose crucial optimisations that you find out about to be inlined into c code in 68k branch. that could be very helpful. toni wilen is one of the two 68k maintainers. i think he would likely be bothered to review if you had any proposals.

If you want you can compile AROS module using CodeWarrior for Mac 68k:
http://macintoshgarden.org/apps/c?page=2

Later you can give/send to me CodeWarrior binary and direct deassembler (CodeWarrior has this option, if I remember right) output of compiled AROS module.

Don_Adan
26 January 2013, 15:19
Optimised version of cia resource, more bytes gained.


; Resourced version of cia.resource (39.1) from Amiga ROM 3.1 for Amiga68k ROM 1.0
; For easy recognition all changes are done using lower cases and ";" signs
; Original code is removed with ";" signs
; New code is added using lower cases only

; We made it...
; OS Group: Bryce Nesbitt, Michael Sinz, Peter Cherna, Darren Greenwald, Randell Jesup, Jerry Horanoff
; GFX: Allan Havemose, Barry 'Bart' Whitebook, Spence Shanson, Steve Beats, Chris Green, Ray Brand, Jim Barkley
; Special Projects: Eric Cotton, Martin Hunt, Bill Koester, Martin Taillefer, Brian Jackson, Kaori Kuwata, David Junod, Palmyra Pawlik, Kevin Klop
; NET: Brian Jackson, Greg Miller, Kenneth Dyke
; GUI: Peter Cherna, Martin Taillefer, David Junod, Kaori Kuwata
; Others: Andy Finkel, Dale 'Duck' Luck, Jim 'Jimm' Mackraz, Bob 'Kodiak' Burns, Jeff Porter, Carolyn Scheppner, David Haynie,
; Lauren Brown, CATS (Commodore Amiga Technical Support), QA (Quality Assurance), SA (Software Assurance)
; Thanks to: Bill Hawes, Software Distillery
; Better than ever.

MatchTag
ILLEGAL ; match word
dc.l MatchTag ; match tag
dc.l EndSkip ; end skip
dc.b 1 ; flags
; dc.b $27 ; version

dc.b $28 ; new version

dc.b 8 ; type
dc.b $50 ; priority
dc.l ciaresource.MSG ; name
dc.l cia39110392.MSG ; id string
dc.l InitResource ; init code
;ciaresource.MSG dc.b 'cia.resource',0,0
;ciaaresource.MSG1 dc.b 'ciaa.resource',0
;ciabresource.MSG0 dc.b 'ciab.resource',0
;cia39110392.MSG dc.b 'cia 39.1 (10.3.92)',$D,$A,0
; dc.b 0
; dc.b 0
; dc.b 0
Vectors
dc.w $FFFF
dc.w AddICRVector-Vectors ; -6 _LVOAddICRVector
dc.w RemICRVector-Vectors ; -12 _LVORemICRVector
dc.w AbleICR-Vectors ; -18 _LVOAbleICR
dc.w SetICR-Vectors ; -24 _LVOSetICR
dc.w $FFFF

InitResource
MOVEM.L A2/A3,-(SP)
MOVEQ #$20,D0
MOVE.L #$10001,D1
JSR -$C6(A6) ; AllocMem
MOVEA.L D0,A3 ; resource base, no error code
; BSR.L MakeLib

bsr.b MakeLib

MOVE.L A2,4(A3)
MOVEQ #0,D0
MOVEQ #3,D1
MOVEM.L D0/D1/A2,8(A3)
BSET D0,$86(A2)
MOVE.L #$BFE001,$22(A2)
MOVE.L A6,$7C(A2) ; exec base
MOVE.W #8,$26(A2)
MOVE.L #IO_PortsInt,$12(A1)
MOVEQ #3,D0 ; I/O Ports and timers
JSR -$A8(A6) ; AddIntServer
LEA ciaaresource.MSG1(PC),A0
BSR.S AddResource
BSR.S MakeLib
MOVE.L A2,(A3)
LEA $BFD000,A0
MOVE.L A0,$22(A2)
MOVE.L A6,$7C(A2) ; exec base
MOVEQ #-$40,D0
OR.B D0,$200(A0)
OR.B D0,(A0)
MOVE.W #$2000,$26(A2)
MOVE.L #ExternalInt,$12(A1)
MOVEQ #13,D0 ; External interrupt
JSR -$A8(A6) ; AddIntServer
LEA ciabresource.MSG0(PC),A0
BSR.S AddResource
MOVEM.L (SP)+,A2/A3
RTS

MakeLib LEA Vectors(PC),A0
SUBA.L A1,A1
SUBA.L A2,A2
; MOVEQ #$11,D0
; ROL.L #3,D0

moveq #136/2,D0
add.w D0,D0

JSR -$54(A6) ; MakeLibrary
MOVEA.L D0,A2 ; again, no error check
; MOVE.B #8,8(A2)
; CLR.B 9(A2)

move.w #$800,8(A2)

LEA $2A(A2),A1
; MOVE.B #2,8(A1)
; MOVE.B #$78,9(A1)

move.w #$278,8(A1)

MOVE.L A2,14(A1)
MOVE.L A3,$80(A2)
RTS

AddResource MOVE.L A0,10(A1)
MOVE.L A0,10(A2)
MOVEA.L A2,A1 ; A1 input
; JSR -$1E6(A6) ; AddResource
; RTS

jmp -$1E6(A6) ; AddResource

IO_PortsInt MOVEM.L D2/A2,-(SP)
MOVEA.L A1,A2
lbC03F6FC BCLR #0,$87(A2)
BEQ.S lbC03F710
MOVEA.L $80(A2),A1
MOVEM.L $18(A1),A1/A5
JSR (A5)
lbC03F710 MOVE.W SR,D0
ORI.W #$700,SR
MOVE.B $BFED01,D2
BCLR #7,D2
OR.B $29(A2),D2
MOVE.B D2,$29(A2)
AND.B $28(A2),D2
MOVE.B D2,$84(A2)
BEQ.S lbC03F75E
EOR.B D2,$29(A2)
MOVE.W D0,SR
MOVEA.L $7C(A2),A6 ; set exec base in A6
LEA $DFF000,A0 ; set chip register in A0
LSR.B #1,D2
; BCS.S lbC03F768

bcc.b lbC03F746
movem.l $40(A2),A1/A5
jsr (A5)

lbC03F746 LSR.B #1,D2
BCS.S lbC03F772
BEQ.S lbC03F6FC
lbC03F74C LSR.B #1,D2
BCS.S lbC03F77C
BEQ.S lbC03F6FC
lbC03F752 LSR.B #1,D2
BCS.S lbC03F786
BEQ.S lbC03F6FC
lbC03F758 LSR.B #1,D2
BCS.S lbC03F790
BRA.S lbC03F6FC

lbC03F75E MOVE.W D0,SR
MOVEM.L (SP)+,D2/A2
MOVEQ #0,D0
RTS

lbC03F790 MOVEM.L $70(A2),A1/A5
JSR (A5)
; BRA.L lbC03F6FC

bra.b lbC03F6FC


;lbC03F768 MOVEM.L $40(A2),A1/A5
; JSR (A5)
; BRA.S lbC03F746

lbC03F772 MOVEM.L $4C(A2),A1/A5
JSR (A5)
BRA.S lbC03F74C

lbC03F77C MOVEM.L $58(A2),A1/A5
JSR (A5)
BRA.S lbC03F752

lbC03F786 MOVEM.L $64(A2),A1/A5
JSR (A5)
BRA.S lbC03F758


; A0 and A6 are not set for ExternalInt handler

ExternalInt MOVEM.L D2/A2,-(SP)
MOVE.B $BFDD00,D2
BCLR #7,D2
OR.B $29(A1),D2
MOVE.B D2,$29(A1)
AND.B $28(A1),D2
BEQ.S lbC03F7E0
MOVE.B D2,$84(A1)
MOVEA.L A1,A2
EOR.B D2,$29(A2)
LSR.B #1,D2
; BCS.S lbC03F7E8

bcc.b lbC03F7C6
movem.l $40(A2),A1/A5
jsr (A5)

lbC03F7C6 LSR.B #1,D2
BCS.S lbC03F7F2
BEQ.S lbC03F7DC
lbC03F7CC LSR.B #1,D2
BCS.S lbC03F7FC
BEQ.S lbC03F7DC
lbC03F7D2 LSR.B #1,D2
BCS.S lbC03F806
BEQ.S lbC03F7DC
lbC03F7D8 LSR.B #1,D2
BCS.S lbC03F810
lbC03F7DC CLR.B $84(A2)
lbC03F7E0 MOVEM.L (SP)+,D2/A2
MOVEQ #0,D0
RTS

;lbC03F7E8 MOVEM.L $40(A2),A1/A5
; JSR (A5)
; BRA.S lbC03F7C6

lbC03F7F2 MOVEM.L $4C(A2),A1/A5
JSR (A5)
BRA.S lbC03F7CC

lbC03F7FC MOVEM.L $58(A2),A1/A5
JSR (A5)
BRA.S lbC03F7D2

lbC03F806 MOVEM.L $64(A2),A1/A5
JSR (A5)
BRA.S lbC03F7D8

lbC03F810 MOVEM.L $70(A2),A1/A5
JSR (A5)
BRA.S lbC03F7DC

; D0 - input
; A1 - input
; A6 - resource base
; D0 - output

AddICRVector MOVEQ #0,D1
MOVE.B D0,D1
MULU.W #12,D1
MOVEA.L $7C(A6),A0
MOVE.W #$4000,$DFF09A
ADDQ.B #1,$126(A0)
LEA $40(A6,D1.W),A0
MOVE.L 8(A0),D1
BNE.S lbC03F914
lbC03F8E4 MOVE.L A1,8(A0)
MOVE.L $12(A1),4(A0)
MOVE.L 14(A1),(A0)
BSET D0,$85(A6)
MOVE.W #$80,D1
BSR.S lbC03F96C
lbC03F8FC MOVEA.L $7C(A6),A0
SUBQ.B #1,$126(A0)
BGE.S lbC03F90E
MOVE.W #$C000,$DFF09A
lbC03F90E RTS

lbC03F910 MOVE.L D1,D0
BRA.S lbC03F8FC

lbC03F914 BTST D0,$86(A6)
BEQ.S lbC03F910
MOVEM.L D0-D3/A0-A3/A6,-(SP)
BSR.S lbC03F978
BNE.S lbC03F950
BSR.S lbC03F992
MOVEM.L (SP)+,D0-D3/A0-A3/A6
BRA.S lbC03F8E4

; D0 - input
; A1 - input
; A6 - resource base

RemICRVector MOVEA.L $7C(A6),A0
MOVE.W #$4000,$DFF09A
ADDQ.B #1,$126(A0)
BSR.S lbC03F956
MOVEM.L D0-D3/A0-A3/A6,-(SP)
BSR.S lbC03F978
MOVEM.L 8(A1),D0/D1/A6
CMP.B D1,D3
BLE.S lbC03F950
BSR.S lbC03F956
BSR.S lbC03F992
lbC03F950 MOVEM.L (SP)+,D0-D3/A0-A3/A6
BRA.S lbC03F910

lbC03F956 MOVEQ #0,D1
MOVE.B D0,D1
MULU.W #12,D1
LEA $40(A6,D1.W),A0
CLR.L 8(A0)
MOVEQ #0,D1
BCLR D0,$85(A6)
lbC03F96C BSET D0,D1
MOVE.W D1,D0
; BSR.L AbleICR

bsr.b AbleICR

MOVEQ #0,D0
RTS

lbC03F978 MOVEA.L $80(A6),A1
MOVEM.L (A1),A2/A3
MOVEQ #3,D3
MOVEQ #$40,D2
lbC03F984 EXG A3,A2
LSR.B #3,D2
BTST D2,$85(A2)
DBEQ D3,lbC03F984
RTS

lbC03F992 AND.B #1,D2
MOVEM.L D2/D3/A2,8(A1)
CLR.B $86(A3)
CLR.B $86(A2)
BSET D2,$86(A2)
MOVEA.L $14(A1),A0
JMP (A0)

; D0 - input
; A6 - resource base
; D0 - output

AbleICR
; MOVEA.L $7C(A6),A0
; MOVE.W #$4000,$DFF09A
; ADDQ.B #1,$126(A0)
; MOVEA.L $22(A6),A0 ; timer

bsr.b SetMe

MOVE.B D0,$D00(A0)
MOVEQ #0,D1
MOVE.B $28(A6),D1
TST.B D0
BEQ.S lbC03F85E
BCLR #7,D0
BNE.S lbC03F8BC
NOT.B D0
AND.B D0,$28(A6)
BRA.S lbC03F85E

lbC03F8BC OR.B D0,$28(A6)
BRA.S lbC03F85E

SetMe
move.l $7C(A6),A0
move.w #$4000,$DFF09A
addq.b #1,$126(A0)
move.l $22(A6),A0 ; timer
rts

; D0 - input
; A6 - resource base
; D0 - output

SetICR
; MOVEA.L $7C(A6),A0 ; exec base
; MOVE.W #$4000,$DFF09A
; ADDQ.B #1,$126(A0)
; MOVEA.L $22(A6),A0 ; timer

bsr.b SetMe

MOVE.B $D00(A0),D1
BCLR #7,D1
OR.B D1,$29(A6)
MOVEQ #0,D1
MOVE.B $29(A6),D1
OR.B $84(A6),D1
TST.B D0
BEQ.S lbC03F85E
BCLR #7,D0
BNE.S lbC03F85A
NOT.B D0
AND.B D0,$29(A6)
AND.B D0,$84(A6)
BRA.S lbC03F85E

lbC03F85A OR.B D0,$29(A6)
lbC03F85E MOVE.B $28(A6),D0
AND.B $29(A6),D0
BEQ.S lbC03F876
MOVE.W $26(A6),D0
OR.W #$8000,D0
MOVE.W D0,$DFF09C
lbC03F876 MOVEA.L $7C(A6),A0 ; exec base
SUBQ.B #1,$126(A0)
BGE.S lbC03F888
MOVE.W #$C000,$DFF09A
lbC03F888 MOVE.L D1,D0
RTS

ciaresource.MSG dc.b 'cia.resource',0
; dc.b 0
ciaaresource.MSG1 dc.b 'ciaa.resource',0
ciabresource.MSG0 dc.b 'ciab.resource',0
cia39110392.MSG dc.b 'cia 40.0 (4.1.2013)',$D,$A,0

cnop 0,4
EndSkip

Don_Adan
26 January 2013, 16:03
Could some of you ROM-gurus check this patch (http://eab.abime.net/showpost.php?p=506385&postcount=25) that Toni Wilen has suggested will keep PCMCIA enabled with >4MB Z2-RAM installed?


I don't think that this patch will be works correctly, other method must be used. Z2-RAM and cardresource RAM can used this same memory from $600000 to $A00000 area. Then Z2-RAM check must be used in other place.

fgh
26 January 2013, 16:21
Thanks for having a look at it!

Yes, cardresource RAM would conflict with Z2-RAM above 4MB, but all other PCMCIA equipment (CF/SD-adapters, wifi, ethernet, modems, SCSI, etc) would work, which is a big improvement for anyone with 8MB Z2-RAM and KS3.1.

And I'm sure there are far less people trying to use PCMCIA SRAM with 8MB Z2-RAM, than people trying to use all those other pcmcia cards with 8MB Z2-RAM.

(Of course, if there would be a way to just disable PCMCIA RAM, and not other cards, that would be the ultimate solution..)

Don_Adan
26 January 2013, 16:45
Thanks for having a look at it!

Yes, cardresource RAM would conflict with Z2-RAM above 4MB, but all other PCMCIA equipment (CF/SD-adapters, wifi, ethernet, modems, SCSI, etc) would work, which is a big improvement for anyone with 8MB Z2-RAM and KS3.1.

And I'm sure there are far less people trying to use PCMCIA SRAM with 8MB Z2-RAM, than people trying to use all those other pcmcia cards with 8MB Z2-RAM.

(Of course, if there would be a way to just disable PCMCIA RAM, and not other cards, that would be the ultimate solution..)

I can make test version for support only Z2-RAM, if more than 4MB Z2-RAM is available, pcmcia memory will be ignored, but I can't test this version, due I don't have working Amiga within PCMCIA.

fgh
26 January 2013, 17:09
That would be great!
I don't have an amiga with 8mb z2-RAM anymore, but if such a patch can simply be loaded with loadmodule, I'm sure I can find someone to test it.

Don_Adan
27 January 2013, 14:19
That would be great!
I don't have an amiga with 8mb z2-RAM anymore, but if such a patch can simply be loaded with loadmodule, I'm sure I can find someone to test it.

I made two test versions. Perhaps one can works.

fgh
27 January 2013, 14:49
Great stuff, looking for people to test it...

Turran
27 January 2013, 18:53
Ok. tried card.resourcev1 and card.resourcev2. After LoadModule restarts, the amiga just power cycles over and over with the power light blinking, no matter if I have a PCMCIA card in or not.

I am testing on kickstart 3.0, if that matters.

I have an 8mb memory board in the amiga that configures itself as 2 boards. It works fine without PCMCIA card. When I insert a PCMCIA network card (since I have kickstart 3.0), the amiga complains about "Board error" and I only get 4mb fast in workbench. Network card works fine.

As I understand it. If I have kickstart 3.1, the PCMCIA slot or memory card is disabled totally. This "disable half the memory" is a kickstart 3.0 only thing.

However, would be nice to be able to utilize the full 8mb memory with the PCMCIA network card. TCP stack takes up enough memory as it is =)

kipper2k
28 January 2013, 01:50
Not too sure of exactly what the patch can do...

If i had 8mb fastmem and 2mb chipmem in an A600, then will this patch allow the PCMCIA slot to be active so a CF card in the PCMCIA slot can be read for file transfer etc?

altcomputing
28 January 2013, 21:25
Not too sure of exactly what the patch can do...

If i had 8mb fastmem and 2mb chipmem in an A600, then will this patch allow the PCMCIA slot to be active so a CF card in the PCMCIA slot can be read for file transfer etc?

No patch can guarantee that. It's a hardware limitation - both PCMCIA and upper 4MB FastRAM use the same address space in MC68000 memory map so they can't be used simultanously. Either you have 4MB+PCMCIA active or 8MB with no PCMCIA.

fgh
28 January 2013, 21:44
Altcomputing: You're talking about pcmcia ram. Pcmcia I/O address space does not conflict with z2 ram.

Turran
30 January 2013, 09:00
So, tested with kickstart 3.1 as well. 3.0 did not work (constant reboots). I guess, make sure "version card.resource" says 40.1 before testing.

Both versions show the same signs, namely:

Start with no startup-sequence
LoadModule Devs:card.resourcev1
Restarts.

This is where it differs.

If I have a PCMCIA card in during boot, I get tons of recoverable alerts at
0100 000c 002DB4A8
http://www.grandis.nu/images/card.resource_2.JPG

If I click one million times on them, workbench eventually starts and I can see the CF card and 8 meg memory (I shouldn't normally. It works apparently).

When I restart with keyboard from there, I get a software failure and it reloads the 3.1 kickstart, bringing me back to card.resource 40.1
8100 000C Task: 002E9B88
http://www.grandis.nu/images/card.resource_3.JPG

Cold boot from here.

If I remove the PCMCIA card and restart with the new card.resource (41.1) loaded, all is well. I can then pop in the card and everything works. As long as I do not have the PCMCIA card in during boot, both versions work just fine, without any errors.

This should not have been possible if it did not work =) Pardon my icons. No custom rom maprommed so some libs are missing. If I do not load the new card.resource, the CF card does not show up.
http://www.grandis.nu/images/card.resource_1.JPG


Edit: I plugged a 2MB PCMCIA memory card in for fun. shouldnt work of course and it does not. Amiga just powercycles over and over. Ideal would have been to just ignore it, not restart =)

fgh
30 January 2013, 13:10
Great! Fixes for the recoverable alerts and reboots with sram would be nice, but if a CF works without errors when inserted after booting is completed, this is already very useful for such a configuration!

(I guess simply removing the CF from the PCMCIA-adapter before booting would also work, and be less stressful for the pcmcia connector)

Turran
30 January 2013, 14:21
Not something I'd use personally since I don't want to unplug my pcmcia network card between each boot, but yes. Shows it can be done.

kipper2k
30 January 2013, 15:14
I haven't had a chance to play with this yet, so basically are we saying that if i plug in my 8mb fastmem card, run the patch it should knock the ram down to 6mb and show the PCMCIA card so you can copy files to and from it?

fgh
30 January 2013, 15:31
Yes, but all the ram should remain. (Turran's startup used some ram, that's all)

Don Adan: Well done! Is a similar patch for 2.05 at all possible? (It also disables PCMCIA when there is more than 4mb z2-ram)

kipper2k
30 January 2013, 15:34
Yes, but all the ram should remain. (Turran's startup used some ram, that's all)

Don Adan: Well done! Is a similar patch for 2.05 at all possible? (It also disables PCMCIA when there is more than 4mb z2-ram)

thats great, now we should be able to get the benefit of the 8mb fastmem boards i have made for the A600 without the need to unplug etc :)

Don_Adan
30 January 2013, 18:20
Great! Fixes for the recoverable alerts and reboots with sram would be nice, but if a CF works without errors when inserted after booting is completed, this is already very useful for such a configuration!

(I guess simply removing the CF from the PCMCIA-adapter before booting would also work, and be less stressful for the pcmcia connector)

You must create custom ROM or insert PCMCIA card after new card.device is loaded. If you insert card before new card.device is loaded, then old card.device is used first time and you have recoverable alerts or this is problem related to init routine.

Don_Adan
30 January 2013, 18:27
Yes, but all the ram should remain. (Turran's startup used some ram, that's all)

Don Adan: Well done! Is a similar patch for 2.05 at all possible? (It also disables PCMCIA when there is more than 4mb z2-ram)

Yes, this is possible TaggedOpenLibrary call must be replaced with OpenLibrary call, but I don't want to create this. Anyway from my own test LoadModule don't works under ROM 3.0.

fgh
30 January 2013, 19:51
You must create custom ROM or insert PCMCIA card after new card.device is loaded.
If you insert card before new card.device is loaded, then old card.device is used first time and you have recoverable alerts or this is problem related to init routine.

Ok. This should be possible to confirm by inserting the card after booting, and then do a warm reset.
The patch should be resident, so if it still gives errors it should be the patched version producing them.. Turran? :)

Yes, this is possible TaggedOpenLibrary call must be replaced with OpenLibrary call, but I don't want to create this.
Anyway from my own test LoadModule don't works under ROM 3.0.
Ok, good. Maybe someone else will have a go at it.

Loadmodule should work with 2.04 even, according to the readme (http://aminet.net/package/util/boot/LoadModule), but I cannot confirm it.
Anyway ks3.0 does not disable the PCMCIA like 3.1, so there is no need for such a patch in that case.

Do you know if card.resource for a600 and a1200 ks3.1 are identical, so this patch should work on both?

Don_Adan
31 January 2013, 17:15
Ok. This should be possible to confirm by inserting the card after booting, and then do a warm reset.
The patch should be resident, so if it still gives errors it should be the patched version producing them.. Turran? :)


Ok, good. Maybe someone else will have a go at it.

Loadmodule should work with 2.04 even, according to the readme (http://aminet.net/package/util/boot/LoadModule), but I cannot confirm it.
Anyway ks3.0 does not disable the PCMCIA like 3.1, so there is no need for such a patch in that case.

Do you know if card.resource for a600 and a1200 ks3.1 are identical, so this patch should work on both?


Yes, card.resource from KS 3.1 are identical for A600 and A1200.

You can check cia.resource, if LoadModule works under ROM 2.04

Turran
31 January 2013, 19:33
You must create custom ROM or insert PCMCIA card after new card.device is loaded. If you insert card before new card.device is loaded, then old card.device is used first time and you have recoverable alerts or this is problem related to init routine.

Not really. I dont have any problems with the original card.device. The only thing that happens with it is that the PCMCIA slot is disabled.

The recoverable alerts only happens after I've loaded the new card.device and the computer automatically restarts. Also happen on manual restarts after that where the new card.resource is still loaded.

When I get the software failure though, the original card.resource is loaded back (40.1) and I get no more errors, but PCMCIA port is disabled again (of course).

I guess its something with the init routine then.

Edit:
"Ok. This should be possible to confirm by inserting the card after booting, and then do a warm reset."
Still recoverable alerts as soon as it tries to start up when I do:
No card in.
LoadModule devs:card.resourcev1 (same with v2)
Restart, let it boot. Boots fine.
Insert PCMCIA, it shows up fine.
Soft restart
1 million recoverable alerts.

I've tried a number of combinations but they all show the same thing. As soon as a new card.resource is loaded, a PCMCIA card can not be inserted at boot and/or reboot. A PCMCIA memory card can not be inserted at all (Amiga just reboots repeatedly with blinking power light. This is as expected though as you should not use PCMCIA memory cards with the new card.resource)

Don_Adan
05 February 2013, 20:02
You can check next versions, now auto init card is ignored, if more than 4MB of Z2 RAM is available, perhaps now it can works better.

Turran
06 February 2013, 08:39
Will do. Thanks Don.

Turran
06 February 2013, 20:13
Tested. This turned out to be worse I'm afraid. Both versions show almost the same symptoms.

Kickstart 3.1. 8Mb extra memory.

Amiga boots fine. Insert PCMCIA CF card. Nothing happens (as expected. PCMCIA is turned off at 8Mb memory).

Leave PCMCIA card in, load cardresource3 or 4, amiga restarts and powerlight starts to blink. Comes up with a Software Failure.
Possible codes:
8100 000C - 003E1D60
8000 0003 - 00292710
8000 000B - 003C6110

After 2 reboots, it loads, but its back to original card.resource version.

Power off Amiga. Turn back on. Leave PCMCIA card out.
This is where it differs a bit.

cardresourcev3 = loadmodule. Amiga restarts. Insert PCMCIA card. Icon for the card pops up on the workbench for a split second, but not the title. Amiga reboots with one of the above software failures right after the icon pops up.

cardresourcev4 = loadmodule, Amiga restarts, Insert PCMCIA card, Amiga hangs instantly. Does not recover.

Sandro
15 April 2013, 04:22
You can check next versions, now auto init card is ignored, if more than 4MB of Z2 RAM is available, perhaps now it can works better.

I tested this patch and works correctly on my Tra1200 turboboard +8mb ram
I tested only card.resourcev4
but please note I have roms 3.0 in the A1200....so basically I don't need it
anyways

I softkicked to rom 3.1 using SKICK...then of course PCMCIA is not available anymore
then I used: loadmodule card.resourcev4
and that's all...in the next reboot PCMCIA is available again and working perfect :great