changeset 2984:e6dfbff80f89

mnln.asm: Fix up "move to (x,y)" after last commit There was still a little bug when the motion type is "move to (x.y)". In this case, the location of the formatted message is in reg U, but since I replaced "push u" by "push x" at L0C71, the wrong value is pushed on the stack. So the instruction "tfr u,x" needs to be inserted just before reaching L0C71. But since the code is position dependent, we can't do this. So we add a small patch stub to the end of the module. Analysis and original patch by Guillaume Major. Rewritten patch by Tormod Volden.
author Guillaume Major <guillaume.major@gmail.com>
date Sat, 12 Apr 2014 15:30:52 +0200
parents 9b876d8e765e
children 04022023272f
files 3rdparty/packages/sierra/objs_lsl/mnln.asm
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/3rdparty/packages/sierra/objs_lsl/mnln.asm	Sat Apr 12 15:30:29 2014 +0200
+++ b/3rdparty/packages/sierra/objs_lsl/mnln.asm	Sat Apr 12 15:30:52 2014 +0200
@@ -1460,8 +1460,8 @@
          pshs  x
          leax  >$0132,s
          pshs  x
-         lbsr  L3ED6            format string
-         leas  $08,s
+         lbra  stub1            format string into X
+L0C6F    leas  $08,s
 L0C71    pshs  x
          ldx   >$0192,s
          pshs  x
@@ -10765,6 +10765,12 @@
          tfr   u,d
          rts
 
+* Patch stub to have "format string" return string in X
+* without altering code length in "move to (x,y)"
+stub1    lbsr  L3ED6
+         tfr   u,x
+         lbra  L0C6F
+
          fcb   0,0,0,0,0,0,0,0
 L633D    fcc   /mnln/
          fcb   0