Move zstart from ui.asm to uic.c
This commit is contained in:
@@ -61,75 +61,6 @@ EXTSYM OSPC_Init
|
|||||||
|
|
||||||
SECTION .text
|
SECTION .text
|
||||||
|
|
||||||
NEWSYM zstart
|
|
||||||
call StartUp
|
|
||||||
|
|
||||||
mov edx,mydebug
|
|
||||||
call PrintStr
|
|
||||||
|
|
||||||
mov edx,welcome ;welcome message
|
|
||||||
call PrintStr
|
|
||||||
|
|
||||||
call SystemInit
|
|
||||||
|
|
||||||
cld ;clear direction flag
|
|
||||||
|
|
||||||
%ifdef OPENSPC
|
|
||||||
call OSPC_Init
|
|
||||||
%else
|
|
||||||
call setnoise
|
|
||||||
call InitSPC
|
|
||||||
%endif
|
|
||||||
call allocmem ;allocate memory
|
|
||||||
|
|
||||||
cmp byte[soundon],0
|
|
||||||
jne .yessound
|
|
||||||
cmp byte[SPCDisable],1
|
|
||||||
je .yessound
|
|
||||||
mov byte[soundon],1
|
|
||||||
mov byte[spcon],1
|
|
||||||
mov byte[DSPDisable],1
|
|
||||||
.yessound
|
|
||||||
cmp byte[SPCDisable],1
|
|
||||||
jne .nodissound
|
|
||||||
mov byte[soundon],0
|
|
||||||
mov byte[spcon],0
|
|
||||||
.nodissound
|
|
||||||
cmp byte[frameskip],0
|
|
||||||
jne .nofpsatstart
|
|
||||||
mov al,[FPSAtStart]
|
|
||||||
mov [FPSOn],al
|
|
||||||
xor al,al
|
|
||||||
.nofpsatstart
|
|
||||||
|
|
||||||
mov al,[gammalevel]
|
|
||||||
shr al,1
|
|
||||||
mov [gammalevel16b],al
|
|
||||||
call MMXCheck
|
|
||||||
|
|
||||||
mov edx,.failedalignc
|
|
||||||
mov eax,outofmemory
|
|
||||||
test eax,3h
|
|
||||||
jnz .failalign
|
|
||||||
mov edx,.failedalignd
|
|
||||||
mov eax,xa
|
|
||||||
test eax,3h
|
|
||||||
jnz .failalign
|
|
||||||
jmp init
|
|
||||||
.failalign
|
|
||||||
push eax
|
|
||||||
call PrintStr
|
|
||||||
pop eax
|
|
||||||
and eax,1Fh
|
|
||||||
call printnum
|
|
||||||
call WaitForKey
|
|
||||||
jmp init
|
|
||||||
|
|
||||||
section .data
|
|
||||||
.failedalignd db 'Data Alignment Failure : ',0
|
|
||||||
.failedalignc db 'Code Alignment Failure : ',0
|
|
||||||
section .text
|
|
||||||
|
|
||||||
ALIGN32
|
ALIGN32
|
||||||
NEWSYM outofmemory
|
NEWSYM outofmemory
|
||||||
mov edx,outofmem
|
mov edx,outofmem
|
||||||
|
|||||||
@@ -193,4 +193,61 @@ void cycleinputdevice()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern unsigned char soundon;
|
||||||
|
extern unsigned char SPCDisable;
|
||||||
|
extern unsigned char spcon;
|
||||||
|
extern unsigned char FPSOn;
|
||||||
|
extern unsigned char FPSAtStart;
|
||||||
|
|
||||||
|
const char* ZVERSION = "Pre 1.43";
|
||||||
|
|
||||||
|
void zstart ()
|
||||||
|
{
|
||||||
|
StartUp ();
|
||||||
|
|
||||||
|
// Print welcome message.
|
||||||
|
printf ("ZSNES v%s, (c) 1997-2005, ZSNES Team\n\n", ZVERSION);
|
||||||
|
printf ("Be sure to check http://www.zsnes.com/ for the latest version.\n");
|
||||||
|
printf ("Please report crashes to zsnes-devel@lists.sourceforge.net.\n\n");
|
||||||
|
printf ("ZSNES is written by the ZSNES Team (See AUTHORS.TXT)\n");
|
||||||
|
printf ("ZSNES comes with ABSOLUTELY NO WARRANTY. This is free software,\n");
|
||||||
|
printf ("and you are welcome to redistribute it under certain conditions;\n");
|
||||||
|
printf ("please read 'LICENSE.TXT' thoroughly before doing so.\n\n");
|
||||||
|
printf ("Use ZSNES -? for command line defintitions.\n\n");
|
||||||
|
|
||||||
|
SystemInit ();
|
||||||
|
|
||||||
|
#ifdef OPENSPC
|
||||||
|
OSPC_Init ();
|
||||||
|
#else
|
||||||
|
setnoise ();
|
||||||
|
InitSPC ();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
allocmem ();
|
||||||
|
|
||||||
|
if (!soundon || !SPCDisable)
|
||||||
|
{
|
||||||
|
soundon = 1;
|
||||||
|
spcon = 1;
|
||||||
|
DSPDisable = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SPCDisable)
|
||||||
|
{
|
||||||
|
soundon = 0;
|
||||||
|
spcon = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!frameskip)
|
||||||
|
{
|
||||||
|
FPSOn = FPSAtStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
gammalevel16b = gammalevel * 2;
|
||||||
|
|
||||||
|
MMXCheck ();
|
||||||
|
|
||||||
|
init ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user