Port % of execution code to C
This commit is contained in:
@@ -34,7 +34,7 @@ EXTSYM NewEngEnForce
|
|||||||
EXTSYM PrintChar
|
EXTSYM PrintChar
|
||||||
EXTSYM TextFile
|
EXTSYM TextFile
|
||||||
EXTSYM mode7tab
|
EXTSYM mode7tab
|
||||||
EXTSYM per2exec
|
EXTSYM Setper2exec,per2exec
|
||||||
EXTSYM MovieCounter
|
EXTSYM MovieCounter
|
||||||
EXTSYM chaton
|
EXTSYM chaton
|
||||||
EXTSYM JoyRead,JoyReadControl,joy4218,joy4219
|
EXTSYM JoyRead,JoyReadControl,joy4218,joy4219
|
||||||
@@ -204,7 +204,9 @@ NEWSYM init
|
|||||||
call copyexecloop
|
call copyexecloop
|
||||||
call procexecloop
|
call procexecloop
|
||||||
; SNES Init
|
; SNES Init
|
||||||
|
pushad
|
||||||
call Setper2exec
|
call Setper2exec
|
||||||
|
popad
|
||||||
call Makemode7Table
|
call Makemode7Table
|
||||||
call makesprprtable
|
call makesprprtable
|
||||||
cmp byte[fname],0
|
cmp byte[fname],0
|
||||||
@@ -486,62 +488,6 @@ ebm db 166,95,66,223,17,11,103,180,156,68,108,120,138,55,203,205,178,210,39,252,
|
|||||||
|
|
||||||
SECTION .text
|
SECTION .text
|
||||||
|
|
||||||
;*******************************************************
|
|
||||||
; Set percent to execute
|
|
||||||
;*******************************************************
|
|
||||||
NEWSYM Setper2exec
|
|
||||||
cmp byte[per2exec],100
|
|
||||||
jne .not100
|
|
||||||
ret
|
|
||||||
.not100
|
|
||||||
; Decrease standard % of execution by 5% to replace branch and 16bit
|
|
||||||
; cycle deductions
|
|
||||||
xor ax,ax
|
|
||||||
mov al,[opexec268]
|
|
||||||
mov bl,95
|
|
||||||
mul bl
|
|
||||||
mov bl,100
|
|
||||||
div bl
|
|
||||||
mov bl,[per2exec]
|
|
||||||
mul bl
|
|
||||||
mov bl,100
|
|
||||||
div bl
|
|
||||||
mov [opexec268b],al
|
|
||||||
xor ax,ax
|
|
||||||
mov al,[opexec358]
|
|
||||||
mov bl,87 ;82
|
|
||||||
mul bl
|
|
||||||
mov bl,100
|
|
||||||
div bl
|
|
||||||
mov bl,[per2exec]
|
|
||||||
mul bl
|
|
||||||
mov bl,100
|
|
||||||
div bl
|
|
||||||
mov [opexec358b],al
|
|
||||||
xor ax,ax
|
|
||||||
mov al,[opexec268cph]
|
|
||||||
mov bl,95
|
|
||||||
mul bl
|
|
||||||
mov bl,100
|
|
||||||
div bl
|
|
||||||
mov bl,[per2exec]
|
|
||||||
mul bl
|
|
||||||
mov bl,100
|
|
||||||
div bl
|
|
||||||
mov [opexec268cphb],al
|
|
||||||
xor ax,ax
|
|
||||||
mov al,[opexec358cph]
|
|
||||||
mov bl,87 ;82
|
|
||||||
mul bl
|
|
||||||
mov bl,100
|
|
||||||
div bl
|
|
||||||
mov bl,[per2exec]
|
|
||||||
mul bl
|
|
||||||
mov bl,100
|
|
||||||
div bl
|
|
||||||
mov [opexec358cphb],al
|
|
||||||
ret
|
|
||||||
|
|
||||||
;*******************************************************
|
;*******************************************************
|
||||||
; Read Input Device Reads from Keyboard, etc.
|
; Read Input Device Reads from Keyboard, etc.
|
||||||
;*******************************************************
|
;*******************************************************
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
//C++ style code in C
|
//C++ style code in C
|
||||||
#define bool unsigned char
|
#define bool unsigned char
|
||||||
@@ -678,3 +679,12 @@ void headerhack()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern unsigned char per2exec;
|
||||||
|
|
||||||
|
void Setper2exec()
|
||||||
|
{
|
||||||
|
opexec268 = opexec268*(per2exec*0.01);
|
||||||
|
opexec358 = opexec358*(per2exec*0.01);
|
||||||
|
opexec268cph = opexec268cph*(per2exec*0.01);
|
||||||
|
opexec358cph = opexec358cph*(per2exec*0.01);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user