1 /*******************************************************************************
2 Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
4 (c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com) and
5 Jerremy Koot (jkoot@snes9x.com)
7 (c) Copyright 2001 - 2004 John Weidman (jweidman@slip.net)
9 (c) Copyright 2002 - 2004 Brad Jorsch (anomie@users.sourceforge.net),
10 funkyass (funkyass@spam.shaw.ca),
11 Joel Yliluoma (http://iki.fi/bisqwit/)
12 Kris Bleakley (codeviolation@hotmail.com),
14 Nach (n-a-c-h@users.sourceforge.net),
15 Peter Bortas (peter@bortas.org) and
16 zones (kasumitokoduck@yahoo.com)
18 C4 x86 assembler and some C emulation code
19 (c) Copyright 2000 - 2003 zsKnight (zsknight@zsnes.com),
20 _Demo_ (_demo_@zsnes.com), and Nach
23 (c) Copyright 2003 Brad Jorsch
26 (c) Copyright 1998 - 2004 Ivar (ivar@snes9x.com), _Demo_, Gary Henderson,
27 John Weidman, neviksti (neviksti@hotmail.com),
28 Kris Bleakley, Andreas Naive
31 (c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and
32 Lord Nightmare (lord_nightmare@users.sourceforge.net
35 (c) Copyright 2001 - 2004 zsKnight, pagefault (pagefault@zsnes.com) and
37 Ported from x86 assembler to C by sanmaiwashi
39 SPC7110 and RTC C++ emulator code
40 (c) Copyright 2002 Matthew Kendora with research by
41 zsKnight, John Weidman, and Dark Force
44 (c) Copyright 2003 Brad Jorsch with research by
45 Andreas Naive and John Weidman
48 (c) Copyright 2001 John Weidman
50 ST010 C++ emulator code
51 (c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora
53 Super FX x86 assembler emulator code
54 (c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault
56 Super FX C emulator code
57 (c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman
60 SH assembler code partly based on x86 assembler code
61 (c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se)
64 Specific ports contains the works of other authors. See headers in
67 Snes9x homepage: http://www.snes9x.com
69 Permission to use, copy, modify and distribute Snes9x in both binary and
70 source form, for non-commercial purposes, is hereby granted without fee,
71 providing that this license information and copyright notice appear with
72 all copies and any derived work.
74 This software is provided 'as-is', without any express or implied
75 warranty. In no event shall the authors be held liable for any damages
76 arising from the use of this software.
78 Snes9x is freeware for PERSONAL USE only. Commercial users should
79 seek permission of the copyright holders first. Commercial use includes
80 charging money for Snes9x or software derived from Snes9x.
82 The copyright holders request that bug fixes and improvements to the code
83 should be forwarded to them so everyone can benefit from the modifications
86 Super NES and Super Nintendo Entertainment System are trademarks of
87 Nintendo Co., Limited and its subsidiary companies.
88 *******************************************************************************/
102 uint8 S9xGetST011(uint32 Address)
105 uint16 address = (uint16) Address & 0xFFFF;
115 // read directly from s-ram
118 t = Memory.SRAM[address];
123 // printf( "ST011 R: %06X %02X\n", Address, t);
128 void S9xSetST011(uint32 Address, uint8 Byte)
130 uint16 address = (uint16) Address & 0xFFFF;
131 static bool reset = false;
139 ST011.waiting4command = true;
145 // printf( "ST011 W: %06X %02X\n", Address, Byte );
147 Memory.SRAM[address]=Byte;
149 // op commands/data goes through this address
152 // check for new commands
153 if (ST011.waiting4command)
155 ST011.waiting4command = false;
156 ST011.command = Byte;
159 switch(ST011.command)
161 case 0x01: ST011.in_count = 12*10+8; break;
162 case 0x02: ST011.in_count = 4; break;
163 case 0x04: ST011.in_count = 0; break;
164 case 0x05: ST011.in_count = 0; break;
165 case 0x06: ST011.in_count = 0; break;
166 case 0x07: ST011.in_count = 0; break;
167 case 0x0E: ST011.in_count = 0; break;
168 default: ST011.waiting4command=true; break;
173 ST011.parameters [ST011.in_index] = Byte;
178 if (ST011.in_count==ST011.in_index)
180 // Actually execute the command
181 ST011.waiting4command = true;
183 switch (ST011.command)
185 // unknown: download playboard
188 // 9x9 board data: top to bottom, left to right
189 // Values represent piece types and ownership
190 for( int lcv=0; lcv<9; lcv++ )
191 memcpy( board[lcv], ST011.parameters+lcv*10, 9*1 );
202 Memory.SRAM[0x12C] = 0x00;
203 //Memory.SRAM[0x12D] = 0x00;
204 Memory.SRAM[0x12E] = 0x00;
212 Memory.SRAM[0x12C] = 0x00;
213 //Memory.SRAM[0x12D] = 0x00;
214 Memory.SRAM[0x12E] = 0x00;
226 Memory.SRAM[0x12C] = 0x00;
227 Memory.SRAM[0x12D] = 0x00;