# HG changeset patch # User Guillaume Major # Date 1397309403 -7200 # Node ID 9550602c9a0ba291b88e5d5ac59477c93feeff47 # Parent f41c4caac51984e69257df77c75b43ab419088f6 sierra/objs_lsl/mnln.asm: Use division quotient, not remainder It calls a routine twice to make a division (L125C) but doesn't check the right register for the result. The result is returned in reg U and the remainder in reg D but the procedure expect the result to be returned in reg D. The divison routine seems to be correct because it is properly used elsewhere in the code. Patch by Guillaume Major and Robert Gault. diff -r f41c4caac519 -r 9550602c9a0b 3rdparty/packages/sierra/objs_lsl/mnln.asm --- a/3rdparty/packages/sierra/objs_lsl/mnln.asm Sat Apr 12 15:29:49 2014 +0200 +++ b/3rdparty/packages/sierra/objs_lsl/mnln.asm Sat Apr 12 15:30:03 2014 +0200 @@ -28,7 +28,7 @@ * This solves multiple problems with DW3 application. Robert Gault * April 28, 2010 - Adjusting the RS-232 input direction seems to cause other problems, probably at the other * end of the RS-232 connection. I've gone back to masking the bit at $FF20. RG - +* April 4, 2014 - Corrected the set.pri.base routine used in KQ4. GM & RG * >$0154 flag for using extended lookups * >$0541 joystick button status @@ -1993,7 +1993,7 @@ mul ldu #$000A lbsr L125C - std $02,s + stu $02,s * Save the division result clrb stb ,s L1178 subb $01,s @@ -2003,7 +2003,7 @@ L1180 lda #$A8 mul ldu $02,s - lbsr L125C + lbsr L125CB * perform tfr u,d as well addd #$0005 cmpd #$000F bls L1193 @@ -10758,6 +10758,10 @@ bra L6323 L6334 rts +L125CB lbsr L125C + tfr u,d + rts + fcb 0,0,0,0,0,0,0,0 L633D fcc /mnln/ fcb 0