English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 23 October 2013, 10:59   #81
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
A joke.
StingRay is offline  
Old 26 October 2013, 13:48   #82
tom256
Registered User
 
Join Date: Dec 2011
Location: Poland
Posts: 166
Just a note:
Looks like 68060.library from Cosmos has bug, because it doesn't work with new mathieeesingbas.library. Phase 5 library is OK.
Tested with A4K + CS MK II 060.
tom256 is offline  
Old 03 November 2013, 13:20   #83
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,957
Gained a few more bytes for init part of mathieeesingbas.library.
Using SBMR V1.0 for recompiling ramlib, gained some bytes, Amiga can be
a few (~1%) fastest now (but it needs more tests to confirm, due it
can be longword aligned code reason too), enhanced stack to 8KB for poor
written in C libs and devs, applied (?) stack signal usage fix, I'm
not sure if correctly, but it seems that works.

Code:
; Resourced version of ramlib (40.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, 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 (Dave Baker, Ed Burnette, Stan Chow,
; Jay Denebeim, Gordon Keener, Jack Rouse, John Toebes, Doug Walker)
; Better than ever.

MatchTag
	ILLEGAL				; match word
	dc.l	MatchTag		; match tag
	dc.l	EndSkip			; end skip
	dc.b	4			; flags
	dc.b	$28+1			; version
	dc.b	0			; type
	dc.b	$9C			; priority
	dc.l	Name			; name
	dc.l	ramlib4025393.MSG	; id string
	dc.l	Init			; init code
;Name	dc.b	'ramlib',0
;ramlib4025393.MSG
;	dc.b	'ramlib 40.2 (5.3.93)',$D,$A,0

MemInterrupt
;	MOVE.L	A2,-(SP)
;	SUBA.L	A1,A1
;	MOVE.L	8(A0),D0
;	BTST	#0,D0

	lea	$162(A6),A1
	move.l	A1,D1
	sub.l	A1,A1
	btst	#0,8+3(A0)

	BNE.S	LoopInterrupt
	BRA.S	lbC07FAFA

lbC07FAF4	BCLR	#4,14(A1)
lbC07FAFA	BSR.S	SubInterrupt
	BNE.S	lbC07FAF4
LoopInterrupt	BSR.S	SubInterrupt
	BEQ.S	QuitInterrupt
	TST.W	$20(A1)
	BNE.S	LoopInterrupt
	BSET	#4,14(A1)
	BNE.S	LoopInterrupt
;	JSR	(A2)			; A1 input

	jsr	(A0)

	MOVEQ	#1,D0
QuitInterrupt
;	MOVEA.L	(SP)+,A2
	RTS

SubInterrupt	MOVE.L	A1,D0
	BNE.S	lbC07FB24
	LEA	$15E(A6),A1
;	LEA	-$1B6(A6),A2		; RemDevice

	lea	-$1B6(A6),A0

lbC07FB24	MOVEA.L	(A1),A1
	TST.L	(A1)
	BNE.S	lbC07FB3E
;	LEA	$162(A6),A0
;	CMPA.L	A1,A0

	cmp.l	A1,D1

	BNE.S	lbC07FB3C
	LEA	$17A(A6),A1
;	LEA	-$192(A6),A2		; RemLibrary

	lea	-$192(A6),A0

	BRA.S	lbC07FB24

lbC07FB3C	SUBA.L	A1,A1
lbC07FB3E	MOVE.L	A1,D0
	RTS

RemDevice
	MOVEQ	#12,D0
	BRA.S	DoIt

RemLibrary
	MOVEQ	#$12,D0
	BRA.S	DoIt

CloseDevice
	MOVEQ	#0,D0
	BRA.S	DoIt

CloseLibrary	MOVEQ	#6,D0
DoIt	MOVEA.L	$234(A6),A0			; ramlib base
	JSR	$1A(A0,D0.W)
	MOVE.L	D0,D1
	BEQ.S	QuitRL
	MOVE.L	A6,-(SP)
	MOVEA.L	$234(A6),A0			; ramlib base
	MOVEA.L	(A0),A6				; dos base
	JSR	-$9C(A6)			; UnLoadSeg
	MOVEA.L	(SP)+,A6
QuitRL	RTS

;SkipPath	MOVEA.L	$234(A6),A5		; ramlib base
;	MOVEA.L	A1,A2				; input for NoName
;	MOVEA.L	A1,A4
;	MOVE.L	A1,D2
;	SUBQ.L	#8,D2
;	BCS.S	lbC07FB8E
;lbC07FB7A	MOVE.B	(A1)+,D2
;	BEQ.S	lbC07FB8E
;	CMP.B	#$2F,D2				; "/"
;	BEQ.S	lbC07FB8A
;	CMP.B	#$3A,D2				; ":"
;	BNE.S	lbC07FB7A
;lbC07FB8A	MOVEA.L	A1,A4
;	BRA.S	lbC07FB7A

;lbC07FB8E	RTS

; dont change A1,D0,D1

SkipPath
	move.l	$234(A6),A5			; ramlib base
	move.l	A0,D3				; input for NoName
	beq.b	QuitFB
	move.l	A0,A4
LoopFB	move.b	(A4)+,D2
	BEQ.S	QuitFB
	CMP.B	#$2F,D2				; "/"
	BEQ.S	FoundFB
	CMP.B	#$3A,D2				; ":"
	BNE.S	LoopFB
FoundFB
	move.l	A4,A0
	bra.b	LoopFB

QuitFB
	move.l	A0,$3E+4(SP)
	rts

OpenDevice
;	MOVEM.L	D0-D2/A1/A2/A4-A6,-(SP)
;	MOVEA.L	A0,A1

	movem.l	D0-D3/A1/A4-A5,-(SP)
	lea	-$15E(SP),SP

	BSR.S	SkipPath
;	MOVEA.L	A4,A0
;	MOVEA.L	12(SP),A1
	JSR	$32(A5)				; A0/A1/D0/D1 OpenDevice
	MOVE.L	D0,D2
;	BEQ.S	Quit

	beq.b	QuitOpen

;	LEA	-$15E(SP),SP
;	MOVE.L	A4,$3E(SP)
	MOVEA.L	SP,A4
	CLR.B	$149(A4)
	MOVE.L	#$44455653,$42(A4)		; DEVS
	LEA	$15E(A6),A0
	MOVE.L	A0,$36(A4)
	BRA.S	NoName

OpenLibrary
;	MOVEM.L	D0-D2/A1/A2/A4-A6,-(SP)

	movem.l	D0-D3/A1/A4-A5,-(SP)
	lea	-$15E(SP),SP
	move.l	A1,A0

	BSR.S	SkipPath
;	MOVEA.L	A4,A1

	move.l	A0,A1

	JSR	$38(A5)				; A1/D0 OpenLibrary
	MOVE.L	D0,D2
;	BNE.S	Quit

	bne.b	QuitOpen

;	LEA	-$15E(SP),SP
;	MOVE.L	A4,$3E(SP)

	MOVEA.L	SP,A4
	ST	$149(A4)
	MOVE.L	#$4C494253,$42(A4)		; LIBS
	LEA	$17A(A6),A0
	MOVE.L	A0,$36(A4)
	BSR.W	FindName
	BEQ.S	NoName
	MOVEA.L	D0,A1
	MOVE.W	$160(A4),D0
	CMP.W	$14(A1),D0
	BLE.S	lbC07FC14
	ADDQ.B	#1,$127(A6)
	TST.W	$20(A1)
	BNE.S	RemLibraryPermit
	JSR	-$8A(A6)			; Permit
lbC07FC14
	MOVE.L	D2,D0
QuitOpen
	LEA	$15E(SP),SP
;Quit
	ADDQ.L	#8,SP
;	MOVEM.L	(SP)+,D2/A1/A2/A4-A6

	movem.l	(SP)+,D2-D3/A1/A4-A5

	RTS

RemLibraryPermit
	JSR	-$192(A6)			; RemLibrary
	JSR	-$8A(A6)			; Permit
NoName
;	MOVE.L	A2,$3A(A4)

	move.l	D3,$3A(A4)

	LEA	$42(A4),A0
;	MOVEA.L	A2,A1

	move.l	D3,A1

	MOVE.L	A0,$14A(A4)
	ADDQ.L	#4,A0
	MOVEQ	#$3A,D2				; ":"
	MOVE.B	D2,(A0)+
	MOVEQ	#0,D0
CopyName	ADDQ.B	#1,D0
	BEQ.S	TooLong
	MOVE.B	(A1)+,D1
	MOVE.B	D1,(A0)+
	BEQ.S	EndName
	CMP.B	D2,D1
	BNE.S	CopyName
;	MOVE.L	A2,$14A(A4)

	move.l	D3,$14A(A4)

EndName	MOVE.L	$114(A6),D0
	CMP.L	$4E(A5),D0
	BNE.S	lbC07FC88
;	BSR.W	Action

	bsr.w	ActionOne

TooLong
	MOVEA.L	$3E(A4),A0

	move.l	$15E(A4),D0

	TST.B	$149(A4)
	BNE.S	Library
;	MOVE.L	$15E(A4),D0
	MOVE.L	$162(A4),D1
;	MOVEA.L	$16A(A4),A1

	move.l	$16A+4(A4),A1

	JSR	$32(A5)				; OpenDevice
	BRA.S	QuitOpen

Library
;	MOVE.L	$15E(A4),D0
	MOVEA.L	A0,A1
	JSR	$38(A5)				; OpenLibrary
	BRA.S	QuitOpen

lbC07FCA0	MOVE.L	$98(A0),$14E(A4)	; code moved
	MOVE.L	$BC(A0),$152(A4)
	MOVE.L	$B8(A0),$15A(A4)
lbC07FCB2	LEA	$14(A4),A1
	MOVE.L	A1,14(A4)
	MOVE.W	#4,14(A1)
	MOVE.L	D0,$10(A1)
	LEA	$14(A1),A1
	MOVE.L	A1,8(A1)
	ADDQ.L	#4,A1
	CLR.L	(A1)
	MOVE.L	A1,-(A1)
	LEA	$3E(A5),A0
	MOVEA.L	A4,A1
	JSR	-$16E(A6)		; PutMsg
	LEA	$14(A4),A0
	JSR	-$180(A6)		; WaitPort
	BRA.b	TooLong

lbC07FC88	MOVEA.L	D0,A0
	CMPI.B	#13,8(A0)
	BEQ.S	lbC07FCA0
	CLR.L	$14E(A4)
	CLR.L	$152(A4)
	CLR.L	$15A(A4)
	BRA.S	lbC07FCB2


Init						; code moved
	MOVEM.L	D2-D4/A2/A3/A5,-(SP)
	MOVEQ	#$60,D0
	MOVE.L	#$10001,D1
	JSR	-$C6(A6)			; AllocMem
	MOVE.L	D0,$234(A6)			; ramlib base
	MOVEA.L	D0,A5
	MOVEQ	#4,D0				; dos.library
	JSR	-$32A(A6)			; TaggedOpenLibrary
	MOVE.L	D0,(A5)				; dos base
	MOVE.L	A6,-(SP)
	MOVEA.L	D0,A6
	LEA	$52(A5),A0
	MOVE.L	A0,8(A0)
	ADDQ.L	#4,A0
	CLR.L	(A0)
	MOVE.L	A0,-(A0)
	LEA	Name(PC),A0

	move.l	A0,10+4(A5)

	MOVE.L	A0,D1				; name
	MOVEQ	#0,D2				; pri
	LEA	SegList(PC),A0
	MOVE.L	A0,D3
	LSR.L	#2,D3				; seglist
;	MOVEQ	#8,D4
;	ROL.L	#8,D4				; stackSize (2048 bytes)

	moveq	#64,D4
	lsl.w	#7,D4				; stackSize (8192 bytes)

; bigger stack size for poor written in C libs and devs

	JSR	-$8A(A6)			; CreateProc
	MOVEA.L	(SP)+,A6
;	TST.L	D0				; ???
	LEA	FuncEntry(PC),A2
	LEA	$1A(A5),A3
LoopIn
	MOVE.W	(A2)+,D0
	BEQ.S	lbC07FAA8
	MOVE.W	#$4EF9,(A3)+			; jmp
	MOVE.L	2(A6,D0.W),(A3)+		; to
	MOVE.W	(A2)+,D1
	LEA	FuncEntry(PC,D1.W),A0
	EXG	D0,A0				; A0.W funcOffset, D0 funcEntry
	MOVEA.L	A6,A1				; library
	JSR	-$1A4(A6)			; SetFunction
	BRA.S	LoopIn

lbC07FAA8
	LEA	4(A5),A1			; memHandler
;	LEA	Name(PC),A0
;	MOVE.L	A0,10(A1)
	LEA	MemInterrupt(PC),A0
	MOVE.L	A0,$12(A1)
	JSR	-$306(A6)			; AddMemHandler
	MOVE.L	A5,D0
	MOVEM.L	(SP)+,D2-D4/A2/A3/A5
	RTS

FuncEntry
	dc.w	$FE3E			; CloseDevice
	dc.w	CloseDevice-FuncEntry
	dc.w	$FE62			; CloseLibrary
	dc.w	CloseLibrary-FuncEntry
	dc.w	$FE4A			; RemDevice
	dc.w	RemDevice-FuncEntry
	dc.w	$FE6E			; RemLibrary
	dc.w	RemLibrary-FuncEntry
	dc.w	$FE44			; OpenDevice
	dc.w	OpenDevice-FuncEntry
	dc.w	$FDD8			; OpenLibrary
	dc.w	OpenLibrary-FuncEntry
;	dc.w	0			; no more
;	dc.w	0

	dc.l	0			; fake structure ???
SegList	dc.l	0

	MOVEA.L	4.W,A6
	MOVEA.L	$234(A6),A5			; ramlib base
	MOVEA.L	$114(A6),A2
	MOVE.L	A2,$4E(A5)

	moveq	#16,D2
	or.l	D2,$12(A2)	; ramlib signal usage ???
	or.l	D2,$16(A2)

	MOVE.W	#4,$4C(A5)

	lea	$3E(A5),A3
	move.l	(A5),D2				; dos base

	BRA.S	GetMsg

WaitPort
;	LEA	$3E(A5),A0

	move.l	A3,A0

	JSR	-$180(A6)			; WaitPort
GetMsg
;	LEA	$3E(A5),A0

	move.l	A3,A0

	JSR	-$174(A6)			; GetMsg
	TST.L	D0
	BEQ.S	WaitPort
;	MOVEA.L	D0,A3				; why ???
;	MOVEA.L	A3,A4

	move.l	D0,A4

	MOVE.L	$14E(A4),$98(A2)
	MOVE.L	$152(A4),$BC(A2)
	MOVE.L	$15A(A4),$B8(A2)
;	BSR.W	Action
;	MOVEA.L	A3,A1

	bsr.b	Action
	move.l	A4,A1

	JSR	-$17A(A6)			; ReplyMsg
	BRA.S	GetMsg

;	dc.w	0

FindNameX
	move.l	$36(A4),A0
FindName
	move.l	$3E(A4),A1			; name
	jsr	-$114(A6)			; FindName
	tst.l	D0
Quit1
	rts

ActionOne
	move.l	(A5),D2				; dos base
Action
;	MOVEM.L	A2/A6,-(SP)
;	MOVEA.L	$36(A4),A0
;	BSR.W	FindName
;	BNE.W	Quit

	bsr.b	FindNameX
	bne.b	Quit1

	CLR.L	$156(A4)
	MOVEA.L	$3E(A4),A1
	JSR	-$60(A6)			; FindResident
	MOVEA.L	D0,A1
	TST.L	D0
	BNE.S	ResidentFound
	MOVE.L	$14A(A4),D1
;	MOVE.L	A6,-(SP)
;	MOVEA.L	(A5),A6				; dos base

	exg	D2,A6				; dos base

	JSR	-$96(A6)			; LoadSeg
	MOVE.L	D0,$156(A4)
	BNE.S	LoadOK
	MOVE.L	$3A(A4),D1
	CMP.L	$14A(A4),D1
	BEQ.b	QuitA6
	MOVE.L	$14E(A4),D0
;	BEQ.S	lbC07FD8A

	beq.b	QuitA6

	JSR	-$96(A6)			; LoadSeg
;lbC07FD8A
	MOVE.L	D0,$156(A4)
	BEQ.S	QuitA6
LoadOK
;	MOVEA.L	(SP)+,A6

	exg	D2,A6				; exec base

Search
	LSL.L	#2,D0
	BEQ.S	CallMe
	MOVEA.L	D0,A0
;	MOVE.L	-4(A0),D1
;	MOVE.L	(A0)+,D0
;	SUB.L	#$20,D1			; minimal hunk size for check ???
;	BLS.S	Search

	move.l	(A0)+,D0
	moveq	#-$22,D1
	add.l	-8(A0),D1
	bmi.b	Search

FindIllegal
	SUBQ.L	#2,D1
	BLS.S	Search
	CMPI.W	#$4AFC,(A0)+
	BNE.S	FindIllegal
	LEA	-2(A0),A1
	CMPA.L	(A0),A1
	BNE.S	FindIllegal
ResidentFound
	TST.B	$149(A4)
	BEQ.S	SkipVersionCheck
	MOVE.L	$15E(A4),D0
	CMP.B	11(A1),D0		; compare version
	BGT.S	UnLoadSeg
SkipVersionCheck
	MOVEA.L	$3E(A4),A0
;	MOVEA.L	14(A1),A2
;CompareName
;	MOVE.B	(A0)+,D0
;	BEQ.S	lbC07FDDA
;	CMP.B	(A2)+,D0
;	BNE.S	InitResident
;	BRA.S	CompareName

;lbC07FDDA	TST.B	(A2)
;InitResident	BNE.S	UnLoadSeg

	move.l	14(A1),D1
	exg	D1,A1
CompareName
	cmpm.b	(A0)+,(A1)+
	bne.b	UnLoadSeg
	tst.b	-1(A1)
	bne.b	CompareName
	move.l	D1,A1

	MOVE.L	$156(A4),D1
	JSR	-$66(A6)			; A1/D1, InitResident
FindName1
;	MOVEA.L	$36(A4),A0
;	BSR.S	FindName
;	BEQ.S	UnLoadSeg

	bsr.w	FindNameX
	bne.b	Quit

UnLoadSeg
	MOVE.L	$156(A4),D1
	BEQ.S	Quit
;	MOVE.L	A6,-(SP)
;	MOVEA.L	(A5),A6				; dos base

	exg	D2,A6				; dos base

	JSR	-$9C(A6)			; UnLoadSeg
QuitA6
;	MOVEA.L	(SP)+,A6

	exg	D2,A6				; exec base

Quit
;	MOVEM.L	(SP)+,A2/A6
	RTS

;UnLoadSeg	MOVE.L	$156(A4),D1
;	BEQ.S	Quit
;	MOVE.L	A6,-(SP)
;	MOVEA.L	(A5),A6				; dos base
;	JSR	-$9C(A6)			; UnLoadSeg
;QuitA6	MOVEA.L	(SP)+,A6
;	BRA.S	Quit

CallMe	MOVEA.L	$156(A4),A0
	MOVE.L	A0,D0
	LSL.L	#2,D0
	MOVEA.L	D0,A1
	JSR	4(A1)
	BRA.S	FindName1

;FindName
;	MOVEA.L	$3E(A4),A1			; name
;	JSR	-$114(A6)			; FindName
;	TST.L	D0
;	RTS

Name	dc.b	'ramlib',0
ramlib4025393.MSG
	dc.b	'ramlib 41.0 (1.1.2014)',$D,$A,0
	cnop	0,4
EndSkip
Don_Adan is offline  
Old 04 November 2013, 18:00   #84
voxel
Amiga Nuts!
 
voxel's Avatar
 
Join Date: Sep 2006
Location: Le Mayet d'Ecole, 03800, FRANCE
Posts: 176
Hello Don

made a custom 3.9 rom with your resourced modules and saw that the "InitArea" bug of Graphic.library is still patched by Blizkick "romFixes2" module...
voxel is offline  
Old 04 November 2013, 18:27   #85
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,957
I added only fixes for bugs, which looks for me as bugs. I don't know if InitArea bug is real bug, due I don't know when this problem occured.
Don_Adan is offline  
Old 04 November 2013, 19:31   #86
voxel
Amiga Nuts!
 
voxel's Avatar
 
Join Date: Sep 2006
Location: Le Mayet d'Ecole, 03800, FRANCE
Posts: 176
Well, from the blizkick manual at "rom bugs" chapter I read :

"graphics/InitArea() doesn't initialise the vector collection matrix to all zeros,
graphics/AreaEllipse() cause enforcer hits"

does your version causing these hits ? (I don't know how to use the enforcer debug tools... so the question)
perhaps Piru can tell us when that bugs shows up ?

BTW, I tried the "card.resource_v43.1" you pointed us and it works !
I have the A1200 with an MTec T1230/28 with 8MB and the compact flash shows up when mounted in the pcmcia without crashes ! was not seeen at all with the original 3.1 "card.resource", and it is faster than before... cool
voxel is offline  
Old 15 December 2013, 14:59   #87
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,957
New Amiga ROM module for Ratte is available for tests. This is icfind,
works (if works) similar like wbfind, but this time for icon.library.
Not tested due custom (no icon.library) ROM is necessary for tests.
Gained a few bytes for cia.resource.
And finally recompiled (using SBMR V1.0) version of disk.resource is
available too.

Code:
; Resourced version of disk.resource (37.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, 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 (Dave Baker, Ed Burnette, Stan Chow,
; Jay Denebeim, Gordon Keener, Jack Rouse, John Toebes, Doug Walker)
; Better than ever.

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

;	dc.w	0			

Vectors	dc.w	$FFFF
	dc.w	AllocUnit-Vectors	;  -6 _LVOAllocUnit
	dc.w	FreeUnit-Vectors	; -12 _LVOFreeUnit
	dc.w	GetUnit-Vectors		; -18 _LVOGetUnit
	dc.w	GiveUnit-Vectors	; -24 _LVOGiveUnit
	dc.w	GetUnitID-Vectors	; -30 _LVOGetUnitID
	dc.w	ReadUnitID-Vectors	; -36 _LVOReadUnitID
	dc.w	$FFFF

InitResource
;	MOVEM.L	D2/D3/A2/A3/A6,-(SP)
;	MOVEA.L	4.W,A6

	movem.l	D3/D7/A2/A5,-(SP)

	LEA	ciabresource.MSG1(PC),A1
	JSR	-$1F2(A6)		; OpenResource
;	MOVE.L	D0,D2
;	BEQ.W	Quit

	move.l	D0,D7
	beq.b	Error

	LEA	Vectors(PC),A0
	LEA	Structure(PC),A1
	SUBA.L	A2,A2
;	MOVEQ	#$25,D0
;	ROL.L	#2,D0

	moveq	#74,D0
	add.w	D0,D0

	JSR	-$54(A6)		; MakeLibrary
	TST.L	D0
	BNE.S	LibraryCreated
;	MOVEM.L	D7/A5/A6,-(SP)
	MOVE.L	#$21020000,D7		; could not make library
;	MOVEA.L	4.W,A6
	JSR	-$6C(A6)		; Alert
;	MOVEM.L	(SP)+,D7/A5/A6
;	BRA.W	Quit

Error
	movem.l	(SP)+,D3/D7/A2/A5
	rts

LibraryCreated	MOVEA.L	D0,A2
	MOVE.L	#diskresource.MSG,D3
	LEA	$4E(A2),A1
	MOVE.L	D3,10(A1)
	MOVE.L	#DSKBLK,$12(A1)
	MOVE.L	A2,14(A1)
	MOVEQ	#1,D0			; Disk Block done
	JSR	-$A2(A6)		; SetIntVector
	LEA	$64(A2),A1
	MOVE.L	D3,10(A1)
	MOVE.L	#DSKSYN,$12(A1)
	MOVE.L	A2,14(A1)
	MOVEQ	#12,D0			; Disk re-SYNChronized
	JSR	-$A2(A6)		; SetIntVector
;	LEA	$BFD000,A1
;	MOVEQ	#-1,D0
;	MOVE.B	D0,$100(A1)
;	MOVE.B	D0,$300(A1)
;	ANDI.B	#$C3,$BFE201

	lea	$BFD100,A1
	st	(A1)
	st	$200(A1)
	and.b	#$C3,$1101(A1)

	MOVE.W	#$4000,$DFF09A
	ADDQ.B	#1,$126(A6)
;	MOVE.L	D2,$2C(A2)

	move.l	D7,$2C(A2)

	LEA	$7A(A2),A1
	MOVE.L	A2,14(A1)
	MOVE.L	#CIAB,$12(A1)
	MOVE.L	D3,10(A1)
	MOVEQ	#4,D0
;	MOVE.L	A6,-(SP)
;	MOVEA.L	D2,A6				; ciab resource base

	exg	D7,A6				; ciab base

	JSR	-6(A6)
;	MOVEA.L	(SP)+,A6
	MOVEQ	#$10,D0
;	MOVE.L	A6,-(SP)
;	MOVEA.L	D2,A6
	JSR	-$12(A6)
;	MOVEA.L	(SP)+,A6

	exg	D7,A6				; exec base
	lea	$DFF000,A0

	SUBQ.B	#1,$126(A6)
	BGE.S	SkipIn
;	MOVE.W	#$C000,$DFF09A

	move.w	#$C000,$9A(A0)
SkipIn
;	LEA	$DFF000,A0
	MOVE.L	A6,$28(A2)			; exec base
	MOVE.W	#$4000,$24(A0)
	MOVE.W	#$8010,$96(A0)
	LEA	$40(A2),A0
	MOVE.L	A0,8(A0)
	ADDQ.L	#4,A0
	CLR.L	(A0)
	MOVE.L	A0,-(A0)
;	MOVEQ	#2,D2
;	MOVE.B	#8,D3
;	LEA	$30(A2),A3

	moveq	#2,D7
	moveq	#8,D3
	lea	$30(A2),A1

	BSR.S	CheckUnit
;	LSL.B	#1,D3

	add.b	D3,D3

	ADDQ.L	#1,D0
	BNE.S	LoopIn
;	MOVE.L	#0,$30(A2)

	move.l	D0,$30(A2)		; null

LoopIn	BSR.S	CheckUnit
;	LSL.B	#1,D3
;	DBRA	D2,LoopIn

	add.b	D3,D3
	dbf	D7,LoopIn

	MOVEA.L	A2,A1
;	JSR	-$1E6(A6)		; AddResource
;Quit	MOVEM.L	(SP)+,D2/D3/A2/A3/A6
;	RTS

	movem.l	(SP)+,D3/D7/A2/A5
	jmp	-$1E6(A6)		; AddResource


CheckUnit	NOT.B	D3
	LEA	$BFD100,A0
;	MOVE.B	#$7F,D0

	moveq	#$7F,D0

	MOVE.B	D0,(A0)
	AND.B	D3,D0
	MOVE.B	D0,(A0)
;	MOVE.B	#$FF,(A0)

	st	(A0)

	MOVE.B	D3,(A0)
;	MOVE.B	#$FF,(A0)

	st	(A0)

	MOVEQ	#$1F,D1
	MOVEQ	#0,D0
lbC04018A
;	LSL.L	#1,D0

	add.l	D0,D0

	MOVE.B	D3,(A0)
;	BTST	#5,$BFE001

	btst	#5,$F01(A0)		; $bfe001-$bfd100

	BEQ.S	lbC04019C
;	BSET	#0,D0

	addq.w	#1,D0

lbC04019C
;	MOVE.B	#$FF,(A0)

	st	(A0)

	DBRA	D1,lbC04018A

;	MOVE.L	D0,(A3)+

	move.l	D0,(A1)+

	NOT.B	D3
	RTS

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

ReadUnitID
;	MOVEM.L	D2/D3/A3,-(SP)		; code moved
;	MOVE.L	D0,D2
;	MOVE.B	#8,D3

	movem.l	D0/D3,-(SP)
	moveq	#8,D3

	LSL.B	D0,D3
;	LEA	$30(A6),A0
;	LSL.L	#2,D0
;	LEA	0(A0,D0.W),A3
;	BSR.W	CheckUnit
;	CMPI.L	#$FFFFFFFF,D0

	lsl.w	#2,D0
	lea	$30(A6,D0.W),A1
	bsr.b	CheckUnit
	moveq	#-1,D1
	cmp.l	D1,D0

	BNE.S	QuitRUI
;	TST.L	D2

	tst.l	(SP)+

	BNE.S	QuitRUI
	MOVEQ	#0,D0
;	MOVE.L	D0,-4(A3)

	move.l	D0,-(A1)

QuitRUI
;	MOVEM.L	(SP)+,D2/D3/A3

	move.l	(SP)+,D3

	RTS

Structure
	dc.w	$A008			; base offset $8
	dc.w	$800			; type
	dc.w	$800A			; base offset $A
	dc.l	diskresource.MSG	; name
	dc.w	$A00E			; base offset $E
	dc.w	$0600			; flags
	dc.w	$9014			; base offset $14
	dc.w	$0025+1			; version
	dc.w	$9016			; base offset $16
	dc.w	$0002-2			; revision
	dc.w	$8022			; base offset $22
	dc.l	-1			; unit status ???
	dc.w	0			; no more

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

;GetUnit	MOVE.L	A5,-(SP)
;	MOVEA.L	A6,A5
;	MOVE.L	$22(A5),D0
;	MOVEA.L	$28(A5),A6		; exec base
;	MOVE.W	#$4000,$DFF09A
;	ADDQ.B	#1,$126(A6)
;	BSET	#7,$26(A5)
;	BNE.S	lbC0401F4
;	MOVE.L	A1,$22(A5)
;	MOVE.L	$114(A6),$90(A5)
;	BRA.S	lbC04020E

;lbC0401F4	LEA	$40(A5),A0
;	ADDQ.L	#4,A0
;	MOVE.L	4(A0),D0
;	MOVE.L	A1,4(A0)
;	MOVE.L	A0,(A1)
;	MOVE.L	D0,4(A1)
;	MOVEA.L	D0,A0
;	MOVE.L	A1,(A0)
;	MOVEQ	#0,D0
;lbC04020E	SUBQ.B	#1,$126(A6)
;	BGE.S	lbC04021C
;	MOVE.W	#$C000,$DFF09A
;lbC04021C	MOVEA.L	A5,A6
;	MOVEA.L	(SP)+,A5
;	RTS

GetUnit
	move.l	$28(A6),A0			; exec base
	move.w	#$4000,$DFF09A
	addq.b	#1,$126(A0)
	bset	#7,$26(A6)
	bne.b	NoGET
	move.l	$22(A6),D0			; output
	move.l	A1,$22(A6)
	move.l	$114(A0),$90(A6)
	bra.b	SkipGET

NoGET
	move.l	A6,D1				; backup A6
	lea	$40+4+4(A6),A6
	move.l	(A6),D0
	subq.l	#4,A6
	move.l	A1,(A6)
	move.l	A6,(A1)
	move.l	D0,4(A1)
	move.l	D0,A6
	move.l	A1,(A6)
	move.l	D1,A6				; restore A6
	moveq	#0,D0				; output
SkipGET
	subq.b	#1,$126(A0)
	bge.b	QuitGET
	move.w	#$C000,$DFF09A
QuitGET
	rts

; A6 - resource base

GiveUnit
;	MOVE.L	A5,-(SP)
;	MOVEA.L	A6,A5

	move.l	A6,-(SP)
	move.l	A6,A0

	MOVEQ	#0,D0
;	MOVEA.L	$28(A5),A6		; exec base

	move.l	$28(A0),A6

	MOVE.L	$114(A6),D1
	MOVE.W	#$4000,$DFF09A
	ADDQ.B	#1,$126(A6)
;	CMP.L	$90(A5),D1

	cmp.l	$90(A0),D1

	BNE.S	lbC040262
;	MOVE.B	#$FF,$BFD100
;	BCLR	#7,$26(A5)
;	LEA	$40(A5),A0

	st	$BFD100
	bclr	#7,$26(A0)
	lea	$40(A0),A0

	MOVEA.L	(A0),A1
	MOVE.L	(A1),D0
	BEQ.S	lbC040262
	MOVE.L	D0,(A0)
	EXG	D0,A1
	MOVE.L	A0,4(A1)
lbC040262	SUBQ.B	#1,$126(A6)
	BGE.S	lbC040270
	MOVE.W	#$C000,$DFF09A
lbC040270	TST.L	D0
	BEQ.S	lbC04027A
	MOVEA.L	D0,A1
	JSR	-$17A(A6)			; ReplyMsg
lbC04027A
;	MOVEA.L	A5,A6
;	MOVEA.L	(SP)+,A5

	move.l	(SP)+,A6

	RTS

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

AllocUnit	BSET	D0,$26(A6)
	SEQ	D0
	RTS

; D0 - input
; A6 - resource base

FreeUnit	BCLR	D0,$26(A6)
	RTS

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

GetUnitID
;	LSL.L	#2,D0

	lsl.w	#2,D0

	MOVE.L	$30(A6,D0.W),D0
	RTS

DSKBLK	MOVE.W	#2,$9C(A0)
	MOVE.L	$22(A1),D0
	BEQ.S	Alert
	MOVEA.L	D0,A1
	MOVEM.L	$22(A1),A1/A5
	JMP	(A5)

DSKSYN	MOVE.W	#$1000,$9C(A0)
	MOVE.L	$22(A1),D0
	BEQ.S	Alert
	MOVEA.L	D0,A1
	MOVEM.L	$38(A1),A1/A5
	JMP	(A5)

CIAB	MOVE.L	$22(A1),D0
	BEQ.S	QuitAlert
	MOVEA.L	D0,A1
	MOVEM.L	$4E(A1),A1/A5
	JMP	(A5)

Alert	MOVEM.L	D7/A5/A6,-(SP)
	MOVE.L	#$21000002,D7			; interrupt, no active unit
	MOVEA.L	4.W,A6
	JSR	-$6C(A6)			; Alert
	MOVEM.L	(SP)+,D7/A5/A6
QuitAlert	RTS

diskresource.MSG	dc.b	'disk.resource',0
ciabresource.MSG1	dc.b	'ciab.resource',0
;disk37221491.MSG	dc.b	'disk 37.2 (21.4.91)',$D,$A,0

disk37221491.MSG	dc.b	'disk 38.0 (9.12.2013)',$D,$A,0

EndSkip
Don_Adan is offline  
Old 16 December 2013, 07:31   #88
Bamiga2002
BlizzardPPC'less
 
Bamiga2002's Avatar
 
Join Date: May 2004
Location: Finland
Age: 46
Posts: 3,210
Send a message via MSN to Bamiga2002
Good! Testing now (all but icfind). What does "disk.resource" do?
Bamiga2002 is offline  
Old 16 December 2013, 10:35   #89
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by Bamiga2002 View Post
Good! Testing now (all but icfind). What does "disk.resource" do?
floppy drive access..
hooverphonique is offline  
Old 16 December 2013, 11:50   #90
voxel
Amiga Nuts!
 
voxel's Avatar
 
Join Date: Sep 2006
Location: Le Mayet d'Ecole, 03800, FRANCE
Posts: 176
cool ^^) will test this asap !

Thanks Don ^^)
voxel is offline  
Old 19 December 2013, 15:03   #91
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,957
New version of disk.resource is available. My bug in ReadUnitID is fixed.
Don_Adan is offline  
Old 22 December 2013, 23:43   #92
copse
Registered User
 
Join Date: Jul 2009
Location: Lala Land
Posts: 520
Is there a resourced exec library? I know there's a 1.2 execdis that's been out there for several decades, but was hoping for other versions.
copse is offline  
Old 21 May 2014, 02:45   #93
zharn
Registered User
 
Join Date: Nov 2012
Location: Brisbane Australia
Posts: 150
Can anyone confirm icfind works with PeterK's icon.library? It will save reburning roms all the time.
zharn is offline  
Old 22 May 2014, 23:32   #94
mfilos
Paranoid Amigoid
 
mfilos's Avatar
 
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
Will check tomorrow and report back mate.
OS3.9 doesn't need it ofc as it can load Workbench.library and Icon.library from LIBS: without the use of wbfind or icfind module.

For WB3.1 is really awesome though so stay tuned
mfilos is offline  
Old 24 May 2014, 19:02   #95
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,957
Quote:
Originally Posted by copse View Post
Is there a resourced exec library? I know there's a 1.2 execdis that's been out there for several decades, but was hoping for other versions.
I received original sources of Amiga ROM's. Perhaps soon I will try to make new version of exec library too, and add more comments to the already available short modules.
Don_Adan is offline  
Old 31 May 2014, 17:12   #96
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,957
Programs for tests math ROM librarries:
Attached Files
File Type: lzx mathtest.lzx (6.3 KB, 192 views)
Don_Adan is offline  
Old 01 June 2014, 01:32   #97
mfilos
Paranoid Amigoid
 
mfilos's Avatar
 
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
Sorry for taking longer than one day

I just tested icfind module in a custom 3.1 kickstart and it works exactly as wbfind.
Putted both these modules in a stock 3.1 installation (deleting icon.library and workbench.library from the ROM - putting them in LIBS instead to save space).

System booted just fine
mfilos is offline  
Old 31 July 2014, 15:24   #98
Minuous
Coder/webmaster/gamer
 
Minuous's Avatar
 
Join Date: Oct 2001
Location: Canberra/Australia
Posts: 2,630
Are there any known compatibility issues with card.resource 40.5 and Artur Pogoda's CardPatch (http://aminet.net/util/boot/CardPatch.lha)? Is CardPatch still useful in this case?
Minuous is online now  
Old 31 July 2014, 22:10   #99
kamelito
Zone Friend
 
kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,801
Quote:
Originally Posted by Don_Adan View Post
I received original sources of Amiga ROM's. Perhaps soon I will try to make new version of exec library too, and add more comments to the already available short modules.
IIRC it was Exec only. Strange that the all thing is harder to find.
Kamelito
kamelito is offline  
Old 26 August 2014, 22:46   #100
pawelek
Registered User
 
Join Date: Aug 2014
Location: Poland
Posts: 49
time to optimize ramdrive.device, gadtools.library, utility.library, expansion.library
pawelek is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open-source scsi device Don_Adan Coders. System 92 05 January 2024 01:48
Open-source dos.library Don_Adan Coders. System 273 02 September 2020 00:42
Realistic Open Source Ports fishyfish Retrogaming General Discussion 1 25 June 2013 08:10
NewsRog goes Open Source Paul News 0 04 December 2004 16:37
BlitzBasic - Is now open source Djay Amiga scene 2 08 February 2003 01:09

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:54.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.12306 seconds with 14 queries