View Single Post
Old 14 February 2012, 14:02   #8
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,977
Misc.resource structures optimised by meynaf. Thanks.

Code:
; 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
Don_Adan is offline  
 
Page generated in 0.04289 seconds with 11 queries