[Scummvm-cvs-logs] SF.net SVN: scummvm:[48110] tools/trunk/sci/scitrace.asm

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Mon Feb 22 14:37:17 CET 2010


Revision: 48110
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48110&view=rev
Author:   m_kiewitz
Date:     2010-02-22 13:37:17 +0000 (Mon, 22 Feb 2010)

Log Message:
-----------
SCI: internal scitrace x86 assembly source for tracing copyrect calls inside sierra sci added

Added Paths:
-----------
    tools/trunk/sci/scitrace.asm

Copied: tools/trunk/sci/scitrace.asm (from rev 47943, tools/trunk/sci/scriptdump.cpp)
===================================================================
--- tools/trunk/sci/scitrace.asm	                        (rev 0)
+++ tools/trunk/sci/scitrace.asm	2010-02-22 13:37:17 UTC (rev 48110)
@@ -0,0 +1,136 @@
+; ScummVM - Graphic Adventure Engine
+;
+; ScummVM is the legal property of its developers, whose names
+; are too numerous to list here. Please refer to the COPYRIGHT
+; file distributed with this source distribution.
+;
+; This program is free software; you can redistribute it and/or
+; modify it under the terms of the GNU General Public License
+; as published by the Free Software Foundation; either version 2
+; of the License, or (at your option) any later version.
+
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.
+
+; You should have received a copy of the GNU General Public License
+; along with this program; if not, write to the Free Software
+; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+;
+; $URL$
+; $Id$
+;
+;---------------------------------------------------------------------------
+;
+; SCITRACE
+;  TSR for logging specific calls inside sierra sci
+;  Written by M. Kiewitz
+;
+;---------------------------------------------------------------------------
+
+; Simply replace 51h 51h 51h 51h in sierra sci with
+;  CDh 90h 90h 90h. This code will then log copyrect calls to scitrace.bin
+
+		.286
+
+code_seg        segment public
+                assume  cs:code_seg, ds:nothing, es:nothing
+                org     00100h
+
+scitrace:       jmp     install_my_prog
+
+;---------------------------------------------------------------------------
+
+filename:       db 'SCITRACE.BIN', 0
+
+inthandler:     push    ax
+                push    bx
+                push    cx
+                push    dx
+                push    ds
+                push    cs
+                pop     ds
+                mov     ah, 3Dh
+                mov     al, 1
+                mov     dx, offset filename
+                xor     cl, cl
+                int     21h
+                pop     ds
+                jc      int_error
+                mov     bx, ax
+                mov     ax, 4202h
+                xor     cx, cx
+                xor     dx, dx
+                int     21h
+                mov     dx, si
+                mov     ah, 40h
+                mov     cx, 8
+                int     21h
+                mov     ah, 3Eh
+                int     21h
+int_error:      pop     dx
+                pop     cx
+                pop     bx
+                pop     ax
+                movsw
+                movsw
+                movsw
+                movsw
+                iret
+
+end_of_tsr:
+
+;---------------------------------------------------------------------------
+
+titlestr:       db 'SCITRACE - written by M. Kiewitz',13,10,'$'
+errorfile:      db 'error creating file',13,10,'$'
+
+;---------------------------------------------------------------------------
+
+install_my_prog:
+                push    cs
+                pop     ds
+                mov     ah, 09h
+                mov     dx, offset titlestr
+                int     21h
+
+                mov     ah, 3Ch
+                mov     cx, 0
+                mov     dx, offset filename
+                int     21h
+                jnc     valid_open
+                mov     ah, 09h
+                mov     dx, offset errorfile
+                int     21h
+                mov     ax, 6200h
+                int     21h
+                mov     es, bx
+                mov     ax, 4C00h
+                int     21h
+
+valid_open:     mov     bx, ax
+                mov     ah, 3Eh
+                int     21h
+
+NowInstallTSR:  
+                mov     ax, 2590h
+                mov     dx, offset inthandler
+                int     21h                     ; int 90h pointer <- ds:dx
+
+                mov     ax, ds:[002ch]          ; get envt segment
+                mov     es, ax
+                mov     ax, 4900h
+                int     21h
+
+                mov     dx, offset end_of_tsr
+                add     dx, 15
+                shr     dx, 4
+                mov     ax, 3100h
+                int     21h
+
+;---------------------------------------------------------------------------
+
+code_seg	ends
+		end	scitrace
+


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list