View Single Post
Old 15 May 2014, 13:00   #13
move.l #$c0ff33,throat

StingRay's Avatar
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,239
Following slight (untested!) optimisation could be done in the "mt_mastervol" routine:

Instead of

	lea	mt_MasterVolTabs(pc),a0
	add.w	d0,d0
	add.w	d0,d0
	move.l	(a0,d0.w),mt_MasterVolTab-mt_var(a4)
this could be done:
; stingray, since each volume table has a size of 65 bytes
; we simply multiply (optimised of course) by 65 to get the
; offset to the correct table

	lea	MasterVolTab0(pc),a0
	add.w	d0,a0
	lsl.w	#6,d0
	add.w	d0,a0
	move.l	a0,mt_MasterVolTab-mt_var(a4)
Saves one memory access and, much better, all the 65 pointers to the tables can be removed as well which means slightly shorter code, less RELOC32 data and less hassle to make the replayer 100% pc-relative.
StingRay is offline  
Page generated in 0.04250 seconds with 11 queries