From 57eed11457aa6b83e3cef0c634b78cdbc612f692 Mon Sep 17 00:00:00 2001 From: n-a-c-h <> Date: Thu, 2 Jun 2005 01:05:50 +0000 Subject: [PATCH] Removed unneeded whitespace. --- zsnes/src/asm_call.h | 6 +- zsnes/src/chips/c4emu.c | 12 +- zsnes/src/chips/dsp1emu.c | 286 ++++++------- zsnes/src/chips/dsp4emu.c | 72 ++-- zsnes/src/chips/dsp4proc.asm | 16 +- zsnes/src/chips/fxemu2.asm | 82 ++-- zsnes/src/chips/fxemu2b.asm | 48 +-- zsnes/src/chips/fxemu2c.asm | 70 ++-- zsnes/src/chips/sdd1emu.c | 6 +- zsnes/src/chips/seta10.c | 38 +- zsnes/src/chips/sfxproc.asm | 2 +- zsnes/src/cpu/dspproc.asm | 8 +- zsnes/src/cpu/execute.asm | 12 +- zsnes/src/cpu/spcdef.inc | 2 +- zsnes/src/dos/sound.asm | 2 +- zsnes/src/dos/vesa2.asm | 6 +- zsnes/src/dos/vga.inc | 8 +- zsnes/src/dos/zfile.c | 24 +- zsnes/src/effects/burn.c | 14 +- zsnes/src/effects/fixsin.h | 768 +++++++++++++++++------------------ zsnes/src/effects/smoke.c | 2 +- zsnes/src/effects/water.c | 42 +- zsnes/src/endmem.asm | 182 ++++----- zsnes/src/gblhdr.h | 8 +- zsnes/src/gui/guikeys.inc | 30 +- zsnes/src/gui/guimouse.inc | 18 +- zsnes/src/init.asm | 6 +- zsnes/src/initc.c | 2 +- zsnes/src/jma/ariconst.h | 2 +- zsnes/src/jma/crc32.cpp | 2 +- zsnes/src/jma/iiostrm.cpp | 4 +- zsnes/src/jma/iiostrm.h | 28 +- zsnes/src/jma/inbyte.h | 2 +- zsnes/src/jma/jma.cpp | 184 ++++----- zsnes/src/jma/jma.h | 18 +- zsnes/src/jma/lencoder.h | 2 +- zsnes/src/jma/litcoder.h | 4 +- zsnes/src/jma/lzma.h | 12 +- zsnes/src/jma/lzmadec.cpp | 28 +- zsnes/src/jma/lzmadec.h | 6 +- zsnes/src/jma/rcdefs.h | 4 +- zsnes/src/jma/rngcoder.h | 8 +- zsnes/src/jma/winout.h | 8 +- zsnes/src/jma/zsnesjma.cpp | 132 +++--- zsnes/src/linux/sdllink.c | 36 +- zsnes/src/linux/sw_draw.c | 12 +- zsnes/src/linux/zfilew.c | 56 +-- zsnes/src/macros.mac | 10 +- zsnes/src/net/ztcp.c | 12 +- zsnes/src/objfix.c | 258 ++++++------ zsnes/src/parsegen.cpp | 102 ++--- zsnes/src/patch.c | 42 +- zsnes/src/uic.c | 2 +- zsnes/src/version.c | 8 +- zsnes/src/video/2xsaimmx.inc | 22 +- zsnes/src/video/2xsaiw.asm | 26 +- zsnes/src/video/copyvid.inc | 8 +- zsnes/src/video/mode7.mac | 12 +- zsnes/src/video/mode716.mac | 12 +- zsnes/src/video/mode7cal.inc | 2 +- zsnes/src/video/mode7ext.asm | 2 +- zsnes/src/win/resource.h | 2 +- zsnes/src/win/winlink.cpp | 14 +- zsnes/src/win/zfilew.c | 60 +-- zsnes/src/zip/unzip.c | 122 +++--- zsnes/src/zip/zpng.c | 18 +- zsnes/src/zip/zunzip.h | 22 +- zsnes/src/zloader.c | 8 +- zsnes/src/zmovie.c | 38 +- zsnes/src/zstate.c | 18 +- 70 files changed, 1570 insertions(+), 1570 deletions(-) diff --git a/zsnes/src/asm_call.h b/zsnes/src/asm_call.h index 000bff4e..d19ddd7c 100644 --- a/zsnes/src/asm_call.h +++ b/zsnes/src/asm_call.h @@ -22,17 +22,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. /* -Introducing 'the "DJGPP/MinGW/MSVC/GCC on *nix compatible" call asm function +Introducing 'the "DJGPP/MinGW/MSVC/GCC on *nix compatible" call asm function safely from C/C++' macro function! Usage: asm_call( func_name ); - + That's all there is to it!!! Note: Make sure this is used on a line by itself if the file will ever be -compiled with MSVC, since it's preproccessor won't parse the inline +compiled with MSVC, since it's preproccessor won't parse the inline assembly correctly if other stuff are on the line Note: This will not work with GCC when using the parameter -MASM=intel diff --git a/zsnes/src/chips/c4emu.c b/zsnes/src/chips/c4emu.c index cee5813d..358382c3 100644 --- a/zsnes/src/chips/c4emu.c +++ b/zsnes/src/chips/c4emu.c @@ -289,7 +289,7 @@ void C4Op0D() } #define READ_WORD(s) (*(unsigned short *) (s)) -void C4Op22() +void C4Op22() { extern unsigned char *C4Ram; short angle1 = READ_WORD(C4Ram+0x1f8c) & 0x1ff; @@ -298,7 +298,7 @@ void C4Op22() int tan2 = Tan(angle2); short y = READ_WORD(C4Ram+0x1f83) - READ_WORD(C4Ram+0x1f89); short left, right; - + int j; for (j = 0; j < 225; j++, y++) { @@ -311,11 +311,11 @@ void C4Op22() { left = 1; right = 0; - } + } else if (left < 0) { left = 0; - } + } else if (right < 0) { right = 0; @@ -324,11 +324,11 @@ void C4Op22() { left = 255; right = 254; - } + } else if (left > 255) { left = 255; - } + } else if (right > 255) { right = 255; diff --git a/zsnes/src/chips/dsp1emu.c b/zsnes/src/chips/dsp1emu.c index c9524162..d8988610 100644 --- a/zsnes/src/chips/dsp1emu.c +++ b/zsnes/src/chips/dsp1emu.c @@ -57,7 +57,7 @@ void Log_Message (char *Message, ...) va_start(ap,Message); vsprintf(Msg,Message,ap ); va_end(ap); - + strcat(Msg,"\r\n\0"); fwrite(Msg,strlen(Msg),1,LogFile); fflush (LogFile); @@ -69,7 +69,7 @@ void Start_Log (void) // [4/15/2001] char *p; strcpy(LogFileName,"dsp1emu.log\0"); - + LogFile = fopen(LogFileName,"wb"); } @@ -85,133 +85,133 @@ void Stop_Log (void) #endif const unsigned short DSP1ROM[1024] = { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, - 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, - 0x4000, 0x7fff, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, - 0x0100, 0x0080, 0x0040, 0x0020, 0x0001, 0x0008, 0x0004, 0x0002, - 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x8000, 0xffe5, 0x0100, 0x7fff, 0x7f02, 0x7e08, - 0x7d12, 0x7c1f, 0x7b30, 0x7a45, 0x795d, 0x7878, 0x7797, 0x76ba, - 0x75df, 0x7507, 0x7433, 0x7361, 0x7293, 0x71c7, 0x70fe, 0x7038, - 0x6f75, 0x6eb4, 0x6df6, 0x6d3a, 0x6c81, 0x6bca, 0x6b16, 0x6a64, - 0x69b4, 0x6907, 0x685b, 0x67b2, 0x670b, 0x6666, 0x65c4, 0x6523, - 0x6484, 0x63e7, 0x634c, 0x62b3, 0x621c, 0x6186, 0x60f2, 0x6060, - 0x5fd0, 0x5f41, 0x5eb5, 0x5e29, 0x5d9f, 0x5d17, 0x5c91, 0x5c0c, - 0x5b88, 0x5b06, 0x5a85, 0x5a06, 0x5988, 0x590b, 0x5890, 0x5816, - 0x579d, 0x5726, 0x56b0, 0x563b, 0x55c8, 0x5555, 0x54e4, 0x5474, - 0x5405, 0x5398, 0x532b, 0x52bf, 0x5255, 0x51ec, 0x5183, 0x511c, - 0x50b6, 0x5050, 0x4fec, 0x4f89, 0x4f26, 0x4ec5, 0x4e64, 0x4e05, - 0x4da6, 0x4d48, 0x4cec, 0x4c90, 0x4c34, 0x4bda, 0x4b81, 0x4b28, - 0x4ad0, 0x4a79, 0x4a23, 0x49cd, 0x4979, 0x4925, 0x48d1, 0x487f, - 0x482d, 0x47dc, 0x478c, 0x473c, 0x46ed, 0x469f, 0x4651, 0x4604, - 0x45b8, 0x456c, 0x4521, 0x44d7, 0x448d, 0x4444, 0x43fc, 0x43b4, - 0x436d, 0x4326, 0x42e0, 0x429a, 0x4255, 0x4211, 0x41cd, 0x4189, - 0x4146, 0x4104, 0x40c2, 0x4081, 0x4040, 0x3fff, 0x41f7, 0x43e1, - 0x45bd, 0x478d, 0x4951, 0x4b0b, 0x4cbb, 0x4e61, 0x4fff, 0x5194, - 0x5322, 0x54a9, 0x5628, 0x57a2, 0x5914, 0x5a81, 0x5be9, 0x5d4a, - 0x5ea7, 0x5fff, 0x6152, 0x62a0, 0x63ea, 0x6530, 0x6672, 0x67b0, - 0x68ea, 0x6a20, 0x6b53, 0x6c83, 0x6daf, 0x6ed9, 0x6fff, 0x7122, - 0x7242, 0x735f, 0x747a, 0x7592, 0x76a7, 0x77ba, 0x78cb, 0x79d9, - 0x7ae5, 0x7bee, 0x7cf5, 0x7dfa, 0x7efe, 0x7fff, 0x0000, 0x0324, - 0x0647, 0x096a, 0x0c8b, 0x0fab, 0x12c8, 0x15e2, 0x18f8, 0x1c0b, - 0x1f19, 0x2223, 0x2528, 0x2826, 0x2b1f, 0x2e11, 0x30fb, 0x33de, - 0x36ba, 0x398c, 0x3c56, 0x3f17, 0x41ce, 0x447a, 0x471c, 0x49b4, - 0x4c3f, 0x4ebf, 0x5133, 0x539b, 0x55f5, 0x5842, 0x5a82, 0x5cb4, - 0x5ed7, 0x60ec, 0x62f2, 0x64e8, 0x66cf, 0x68a6, 0x6a6d, 0x6c24, - 0x6dca, 0x6f5f, 0x70e2, 0x7255, 0x73b5, 0x7504, 0x7641, 0x776c, - 0x7884, 0x798a, 0x7a7d, 0x7b5d, 0x7c29, 0x7ce3, 0x7d8a, 0x7e1d, - 0x7e9d, 0x7f09, 0x7f62, 0x7fa7, 0x7fd8, 0x7ff6, 0x7fff, 0x7ff6, - 0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d, 0x7d8a, 0x7ce3, - 0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c, 0x7641, 0x7504, - 0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24, 0x6a6d, 0x68a6, - 0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4, 0x5a82, 0x5842, - 0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a, - 0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de, 0x30fb, 0x2e11, - 0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b, 0x18f8, 0x15e2, - 0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324, 0x7fff, 0x7ff6, - 0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d, 0x7d8a, 0x7ce3, - 0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c, 0x7641, 0x7504, - 0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24, 0x6a6d, 0x68a6, - 0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4, 0x5a82, 0x5842, - 0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a, - 0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de, 0x30fb, 0x2e11, - 0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b, 0x18f8, 0x15e2, - 0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324, 0x0000, 0xfcdc, - 0xf9b9, 0xf696, 0xf375, 0xf055, 0xed38, 0xea1e, 0xe708, 0xe3f5, - 0xe0e7, 0xdddd, 0xdad8, 0xd7da, 0xd4e1, 0xd1ef, 0xcf05, 0xcc22, - 0xc946, 0xc674, 0xc3aa, 0xc0e9, 0xbe32, 0xbb86, 0xb8e4, 0xb64c, - 0xb3c1, 0xb141, 0xaecd, 0xac65, 0xaa0b, 0xa7be, 0xa57e, 0xa34c, - 0xa129, 0x9f14, 0x9d0e, 0x9b18, 0x9931, 0x975a, 0x9593, 0x93dc, - 0x9236, 0x90a1, 0x8f1e, 0x8dab, 0x8c4b, 0x8afc, 0x89bf, 0x8894, - 0x877c, 0x8676, 0x8583, 0x84a3, 0x83d7, 0x831d, 0x8276, 0x81e3, - 0x8163, 0x80f7, 0x809e, 0x8059, 0x8028, 0x800a, 0x6488, 0x0080, - 0x03ff, 0x0116, 0x0002, 0x0080, 0x4000, 0x3fd7, 0x3faf, 0x3f86, - 0x3f5d, 0x3f34, 0x3f0c, 0x3ee3, 0x3eba, 0x3e91, 0x3e68, 0x3e40, - 0x3e17, 0x3dee, 0x3dc5, 0x3d9c, 0x3d74, 0x3d4b, 0x3d22, 0x3cf9, - 0x3cd0, 0x3ca7, 0x3c7f, 0x3c56, 0x3c2d, 0x3c04, 0x3bdb, 0x3bb2, - 0x3b89, 0x3b60, 0x3b37, 0x3b0e, 0x3ae5, 0x3abc, 0x3a93, 0x3a69, - 0x3a40, 0x3a17, 0x39ee, 0x39c5, 0x399c, 0x3972, 0x3949, 0x3920, - 0x38f6, 0x38cd, 0x38a4, 0x387a, 0x3851, 0x3827, 0x37fe, 0x37d4, - 0x37aa, 0x3781, 0x3757, 0x372d, 0x3704, 0x36da, 0x36b0, 0x3686, - 0x365c, 0x3632, 0x3609, 0x35df, 0x35b4, 0x358a, 0x3560, 0x3536, - 0x350c, 0x34e1, 0x34b7, 0x348d, 0x3462, 0x3438, 0x340d, 0x33e3, - 0x33b8, 0x338d, 0x3363, 0x3338, 0x330d, 0x32e2, 0x32b7, 0x328c, - 0x3261, 0x3236, 0x320b, 0x31df, 0x31b4, 0x3188, 0x315d, 0x3131, - 0x3106, 0x30da, 0x30ae, 0x3083, 0x3057, 0x302b, 0x2fff, 0x2fd2, - 0x2fa6, 0x2f7a, 0x2f4d, 0x2f21, 0x2ef4, 0x2ec8, 0x2e9b, 0x2e6e, - 0x2e41, 0x2e14, 0x2de7, 0x2dba, 0x2d8d, 0x2d60, 0x2d32, 0x2d05, - 0x2cd7, 0x2ca9, 0x2c7b, 0x2c4d, 0x2c1f, 0x2bf1, 0x2bc3, 0x2b94, - 0x2b66, 0x2b37, 0x2b09, 0x2ada, 0x2aab, 0x2a7c, 0x2a4c, 0x2a1d, - 0x29ed, 0x29be, 0x298e, 0x295e, 0x292e, 0x28fe, 0x28ce, 0x289d, - 0x286d, 0x283c, 0x280b, 0x27da, 0x27a9, 0x2777, 0x2746, 0x2714, - 0x26e2, 0x26b0, 0x267e, 0x264c, 0x2619, 0x25e7, 0x25b4, 0x2581, - 0x254d, 0x251a, 0x24e6, 0x24b2, 0x247e, 0x244a, 0x2415, 0x23e1, - 0x23ac, 0x2376, 0x2341, 0x230b, 0x22d6, 0x229f, 0x2269, 0x2232, - 0x21fc, 0x21c4, 0x218d, 0x2155, 0x211d, 0x20e5, 0x20ad, 0x2074, - 0x203b, 0x2001, 0x1fc7, 0x1f8d, 0x1f53, 0x1f18, 0x1edd, 0x1ea1, - 0x1e66, 0x1e29, 0x1ded, 0x1db0, 0x1d72, 0x1d35, 0x1cf6, 0x1cb8, - 0x1c79, 0x1c39, 0x1bf9, 0x1bb8, 0x1b77, 0x1b36, 0x1af4, 0x1ab1, - 0x1a6e, 0x1a2a, 0x19e6, 0x19a1, 0x195c, 0x1915, 0x18ce, 0x1887, - 0x183f, 0x17f5, 0x17ac, 0x1761, 0x1715, 0x16c9, 0x167c, 0x162e, - 0x15df, 0x158e, 0x153d, 0x14eb, 0x1497, 0x1442, 0x13ec, 0x1395, - 0x133c, 0x12e2, 0x1286, 0x1228, 0x11c9, 0x1167, 0x1104, 0x109e, - 0x1036, 0x0fcc, 0x0f5f, 0x0eef, 0x0e7b, 0x0e04, 0x0d89, 0x0d0a, - 0x0c86, 0x0bfd, 0x0b6d, 0x0ad6, 0x0a36, 0x098d, 0x08d7, 0x0811, - 0x0736, 0x063e, 0x0519, 0x039a, 0x0000, 0x7fff, 0x0100, 0x0080, - 0x021d, 0x00c8, 0x00ce, 0x0048, 0x0a26, 0x277a, 0x00ce, 0x6488, - 0x14ac, 0x0001, 0x00f9, 0x00fc, 0x00ff, 0x00fc, 0x00f9, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, + 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, + 0x4000, 0x7fff, 0x4000, 0x2000, 0x1000, 0x0800, 0x0400, 0x0200, + 0x0100, 0x0080, 0x0040, 0x0020, 0x0001, 0x0008, 0x0004, 0x0002, + 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x8000, 0xffe5, 0x0100, 0x7fff, 0x7f02, 0x7e08, + 0x7d12, 0x7c1f, 0x7b30, 0x7a45, 0x795d, 0x7878, 0x7797, 0x76ba, + 0x75df, 0x7507, 0x7433, 0x7361, 0x7293, 0x71c7, 0x70fe, 0x7038, + 0x6f75, 0x6eb4, 0x6df6, 0x6d3a, 0x6c81, 0x6bca, 0x6b16, 0x6a64, + 0x69b4, 0x6907, 0x685b, 0x67b2, 0x670b, 0x6666, 0x65c4, 0x6523, + 0x6484, 0x63e7, 0x634c, 0x62b3, 0x621c, 0x6186, 0x60f2, 0x6060, + 0x5fd0, 0x5f41, 0x5eb5, 0x5e29, 0x5d9f, 0x5d17, 0x5c91, 0x5c0c, + 0x5b88, 0x5b06, 0x5a85, 0x5a06, 0x5988, 0x590b, 0x5890, 0x5816, + 0x579d, 0x5726, 0x56b0, 0x563b, 0x55c8, 0x5555, 0x54e4, 0x5474, + 0x5405, 0x5398, 0x532b, 0x52bf, 0x5255, 0x51ec, 0x5183, 0x511c, + 0x50b6, 0x5050, 0x4fec, 0x4f89, 0x4f26, 0x4ec5, 0x4e64, 0x4e05, + 0x4da6, 0x4d48, 0x4cec, 0x4c90, 0x4c34, 0x4bda, 0x4b81, 0x4b28, + 0x4ad0, 0x4a79, 0x4a23, 0x49cd, 0x4979, 0x4925, 0x48d1, 0x487f, + 0x482d, 0x47dc, 0x478c, 0x473c, 0x46ed, 0x469f, 0x4651, 0x4604, + 0x45b8, 0x456c, 0x4521, 0x44d7, 0x448d, 0x4444, 0x43fc, 0x43b4, + 0x436d, 0x4326, 0x42e0, 0x429a, 0x4255, 0x4211, 0x41cd, 0x4189, + 0x4146, 0x4104, 0x40c2, 0x4081, 0x4040, 0x3fff, 0x41f7, 0x43e1, + 0x45bd, 0x478d, 0x4951, 0x4b0b, 0x4cbb, 0x4e61, 0x4fff, 0x5194, + 0x5322, 0x54a9, 0x5628, 0x57a2, 0x5914, 0x5a81, 0x5be9, 0x5d4a, + 0x5ea7, 0x5fff, 0x6152, 0x62a0, 0x63ea, 0x6530, 0x6672, 0x67b0, + 0x68ea, 0x6a20, 0x6b53, 0x6c83, 0x6daf, 0x6ed9, 0x6fff, 0x7122, + 0x7242, 0x735f, 0x747a, 0x7592, 0x76a7, 0x77ba, 0x78cb, 0x79d9, + 0x7ae5, 0x7bee, 0x7cf5, 0x7dfa, 0x7efe, 0x7fff, 0x0000, 0x0324, + 0x0647, 0x096a, 0x0c8b, 0x0fab, 0x12c8, 0x15e2, 0x18f8, 0x1c0b, + 0x1f19, 0x2223, 0x2528, 0x2826, 0x2b1f, 0x2e11, 0x30fb, 0x33de, + 0x36ba, 0x398c, 0x3c56, 0x3f17, 0x41ce, 0x447a, 0x471c, 0x49b4, + 0x4c3f, 0x4ebf, 0x5133, 0x539b, 0x55f5, 0x5842, 0x5a82, 0x5cb4, + 0x5ed7, 0x60ec, 0x62f2, 0x64e8, 0x66cf, 0x68a6, 0x6a6d, 0x6c24, + 0x6dca, 0x6f5f, 0x70e2, 0x7255, 0x73b5, 0x7504, 0x7641, 0x776c, + 0x7884, 0x798a, 0x7a7d, 0x7b5d, 0x7c29, 0x7ce3, 0x7d8a, 0x7e1d, + 0x7e9d, 0x7f09, 0x7f62, 0x7fa7, 0x7fd8, 0x7ff6, 0x7fff, 0x7ff6, + 0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d, 0x7d8a, 0x7ce3, + 0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c, 0x7641, 0x7504, + 0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24, 0x6a6d, 0x68a6, + 0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4, 0x5a82, 0x5842, + 0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a, + 0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de, 0x30fb, 0x2e11, + 0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b, 0x18f8, 0x15e2, + 0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324, 0x7fff, 0x7ff6, + 0x7fd8, 0x7fa7, 0x7f62, 0x7f09, 0x7e9d, 0x7e1d, 0x7d8a, 0x7ce3, + 0x7c29, 0x7b5d, 0x7a7d, 0x798a, 0x7884, 0x776c, 0x7641, 0x7504, + 0x73b5, 0x7255, 0x70e2, 0x6f5f, 0x6dca, 0x6c24, 0x6a6d, 0x68a6, + 0x66cf, 0x64e8, 0x62f2, 0x60ec, 0x5ed7, 0x5cb4, 0x5a82, 0x5842, + 0x55f5, 0x539b, 0x5133, 0x4ebf, 0x4c3f, 0x49b4, 0x471c, 0x447a, + 0x41ce, 0x3f17, 0x3c56, 0x398c, 0x36ba, 0x33de, 0x30fb, 0x2e11, + 0x2b1f, 0x2826, 0x2528, 0x2223, 0x1f19, 0x1c0b, 0x18f8, 0x15e2, + 0x12c8, 0x0fab, 0x0c8b, 0x096a, 0x0647, 0x0324, 0x0000, 0xfcdc, + 0xf9b9, 0xf696, 0xf375, 0xf055, 0xed38, 0xea1e, 0xe708, 0xe3f5, + 0xe0e7, 0xdddd, 0xdad8, 0xd7da, 0xd4e1, 0xd1ef, 0xcf05, 0xcc22, + 0xc946, 0xc674, 0xc3aa, 0xc0e9, 0xbe32, 0xbb86, 0xb8e4, 0xb64c, + 0xb3c1, 0xb141, 0xaecd, 0xac65, 0xaa0b, 0xa7be, 0xa57e, 0xa34c, + 0xa129, 0x9f14, 0x9d0e, 0x9b18, 0x9931, 0x975a, 0x9593, 0x93dc, + 0x9236, 0x90a1, 0x8f1e, 0x8dab, 0x8c4b, 0x8afc, 0x89bf, 0x8894, + 0x877c, 0x8676, 0x8583, 0x84a3, 0x83d7, 0x831d, 0x8276, 0x81e3, + 0x8163, 0x80f7, 0x809e, 0x8059, 0x8028, 0x800a, 0x6488, 0x0080, + 0x03ff, 0x0116, 0x0002, 0x0080, 0x4000, 0x3fd7, 0x3faf, 0x3f86, + 0x3f5d, 0x3f34, 0x3f0c, 0x3ee3, 0x3eba, 0x3e91, 0x3e68, 0x3e40, + 0x3e17, 0x3dee, 0x3dc5, 0x3d9c, 0x3d74, 0x3d4b, 0x3d22, 0x3cf9, + 0x3cd0, 0x3ca7, 0x3c7f, 0x3c56, 0x3c2d, 0x3c04, 0x3bdb, 0x3bb2, + 0x3b89, 0x3b60, 0x3b37, 0x3b0e, 0x3ae5, 0x3abc, 0x3a93, 0x3a69, + 0x3a40, 0x3a17, 0x39ee, 0x39c5, 0x399c, 0x3972, 0x3949, 0x3920, + 0x38f6, 0x38cd, 0x38a4, 0x387a, 0x3851, 0x3827, 0x37fe, 0x37d4, + 0x37aa, 0x3781, 0x3757, 0x372d, 0x3704, 0x36da, 0x36b0, 0x3686, + 0x365c, 0x3632, 0x3609, 0x35df, 0x35b4, 0x358a, 0x3560, 0x3536, + 0x350c, 0x34e1, 0x34b7, 0x348d, 0x3462, 0x3438, 0x340d, 0x33e3, + 0x33b8, 0x338d, 0x3363, 0x3338, 0x330d, 0x32e2, 0x32b7, 0x328c, + 0x3261, 0x3236, 0x320b, 0x31df, 0x31b4, 0x3188, 0x315d, 0x3131, + 0x3106, 0x30da, 0x30ae, 0x3083, 0x3057, 0x302b, 0x2fff, 0x2fd2, + 0x2fa6, 0x2f7a, 0x2f4d, 0x2f21, 0x2ef4, 0x2ec8, 0x2e9b, 0x2e6e, + 0x2e41, 0x2e14, 0x2de7, 0x2dba, 0x2d8d, 0x2d60, 0x2d32, 0x2d05, + 0x2cd7, 0x2ca9, 0x2c7b, 0x2c4d, 0x2c1f, 0x2bf1, 0x2bc3, 0x2b94, + 0x2b66, 0x2b37, 0x2b09, 0x2ada, 0x2aab, 0x2a7c, 0x2a4c, 0x2a1d, + 0x29ed, 0x29be, 0x298e, 0x295e, 0x292e, 0x28fe, 0x28ce, 0x289d, + 0x286d, 0x283c, 0x280b, 0x27da, 0x27a9, 0x2777, 0x2746, 0x2714, + 0x26e2, 0x26b0, 0x267e, 0x264c, 0x2619, 0x25e7, 0x25b4, 0x2581, + 0x254d, 0x251a, 0x24e6, 0x24b2, 0x247e, 0x244a, 0x2415, 0x23e1, + 0x23ac, 0x2376, 0x2341, 0x230b, 0x22d6, 0x229f, 0x2269, 0x2232, + 0x21fc, 0x21c4, 0x218d, 0x2155, 0x211d, 0x20e5, 0x20ad, 0x2074, + 0x203b, 0x2001, 0x1fc7, 0x1f8d, 0x1f53, 0x1f18, 0x1edd, 0x1ea1, + 0x1e66, 0x1e29, 0x1ded, 0x1db0, 0x1d72, 0x1d35, 0x1cf6, 0x1cb8, + 0x1c79, 0x1c39, 0x1bf9, 0x1bb8, 0x1b77, 0x1b36, 0x1af4, 0x1ab1, + 0x1a6e, 0x1a2a, 0x19e6, 0x19a1, 0x195c, 0x1915, 0x18ce, 0x1887, + 0x183f, 0x17f5, 0x17ac, 0x1761, 0x1715, 0x16c9, 0x167c, 0x162e, + 0x15df, 0x158e, 0x153d, 0x14eb, 0x1497, 0x1442, 0x13ec, 0x1395, + 0x133c, 0x12e2, 0x1286, 0x1228, 0x11c9, 0x1167, 0x1104, 0x109e, + 0x1036, 0x0fcc, 0x0f5f, 0x0eef, 0x0e7b, 0x0e04, 0x0d89, 0x0d0a, + 0x0c86, 0x0bfd, 0x0b6d, 0x0ad6, 0x0a36, 0x098d, 0x08d7, 0x0811, + 0x0736, 0x063e, 0x0519, 0x039a, 0x0000, 0x7fff, 0x0100, 0x0080, + 0x021d, 0x00c8, 0x00ce, 0x0048, 0x0a26, 0x277a, 0x00ce, 0x6488, + 0x14ac, 0x0001, 0x00f9, 0x00fc, 0x00ff, 0x00fc, 0x00f9, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff}; /***************************************************************************\ @@ -232,7 +232,7 @@ double SinTable2[INCR]; double Atan(double x) { - if ((x>=1) || (x<=1)) + if ((x>=1) || (x<=1)) return (x/(1+0.28*x*x)); else return (PI/2 - Atan(1/x)); @@ -303,12 +303,12 @@ void DSP1_Inverse(short Coefficient, short Exponent, short *iCoefficient, short // Step Two: Remove Sign if (Coefficient < 0) - { + { if (Coefficient < -32767) Coefficient = -32767; Coefficient = -Coefficient; Sign = -1; } - + // Step Three: Normalize while (Coefficient < 0x4000) { @@ -603,7 +603,7 @@ void DSPOp02() ViewerX1=Sin(Angle(Op02AZS))*Sin(Angle(Op02AAS)); ViewerY1=Sin(Angle(Op02AZS))*Cos(Angle(Op02AAS)); - + #ifdef debug02 printf("\nViewerX1 : %f ViewerY1 : %f ViewerZ1 : %f\n",ViewerX1,ViewerY1, ViewerZ1); @@ -1005,7 +1005,7 @@ void DSPOp06() Log_Message("OP06 H:%d V:%d S:%d",Op06H,Op06V,Op06S); #endif } -#endif +#endif short matrixC[3][3]; @@ -1214,22 +1214,22 @@ short Op14Yrr; void DSPOp14() { short CSec, ESec, CTan, CSin, C, E; - + DSP1_Inverse(DSP1_Cos(Op14Xr), 0, &CSec, &ESec); - + // Rotation Around Z DSP1_NormalizeDouble(Op14U * DSP1_Cos(Op14Yr) - Op14F * DSP1_Sin(Op14Yr), &C, &E); - + E = ESec - E; - + DSP1_Normalize(C * CSec >> 15, &C, &E); - + if (E > 0) { if (C > 0) C = 32767; else if (C < 0) C = -32767; } else { if (E < 0) C = C * DSP1ROM[0x31 + E] >> 15; } - + Op14Zrr = Op14Zr + C; // Rotation Around X @@ -1245,7 +1245,7 @@ void DSPOp14() CTan = CSec * CSin >> 15; DSP1_Normalize(-(C * CTan >> 15), &C, &E); - + if (E > 0) { if (C > 0) C = 32767; else if (C < 0) C = -32767; } else { @@ -1297,7 +1297,7 @@ void DSPOp0B() } void DSPOp1B() -{ +{ Op1BS = (Op1BX * matrixB[0][0] + Op1BY * matrixB[0][1] + Op1BZ * matrixB[0][2]) >> 15; #ifdef DebugDSP1 @@ -1405,7 +1405,7 @@ void DSPOp1C() Op1CX1 = (Op1CXBR * DSP1_Cos(Op1CY) >> 15) - (Op1CZBR * DSP1_Sin(Op1CY) >> 15); Op1CXAR = Op1CX1; Op1CZBR = Op1CZ1; - // Rotate Around Op1CX1 + // Rotate Around Op1CX1 Op1CY1 = (Op1CZBR * DSP1_Sin(Op1CX) >> 15) + (Op1CYBR * DSP1_Cos(Op1CX) >> 15); Op1CZ1 = (Op1CZBR * DSP1_Cos(Op1CX) >> 15) - (Op1CYBR * DSP1_Sin(Op1CX) >> 15); Op1CYAR = Op1CY1; Op1CZAR = Op1CZ1; diff --git a/zsnes/src/chips/dsp4emu.c b/zsnes/src/chips/dsp4emu.c index 9bfc9326..e2c7c556 100644 --- a/zsnes/src/chips/dsp4emu.c +++ b/zsnes/src/chips/dsp4emu.c @@ -50,7 +50,7 @@ Fixed-point math reminder: #define WRITE_WORD(s, d) (*(uint16 *) (s)) = (d) #define WRITE_DWORD(s, d) (*(uint32 *) (s)) = (d) -struct +struct { bool8 waiting4command; bool8 half_command; @@ -428,7 +428,7 @@ void DSP4_OP01() // scan next command DSP4.in_count = 2; - DSP4_WAIT(1) resume1 : + DSP4_WAIT(1) resume1 : // check for termination distance = DSP4_READ_WORD(); @@ -469,7 +469,7 @@ void DSP4_OP01() // already have 2 bytes read DSP4.in_count = 6; - DSP4_WAIT(3) resume3 : + DSP4_WAIT(3) resume3 : // inspect inputs world_ddy = DSP4_READ_WORD(); @@ -662,7 +662,7 @@ void DSP4_OP07() // scan next command DSP4.in_count = 2; - DSP4_WAIT(1) resume1 : + DSP4_WAIT(1) resume1 : // check for opcode termination distance = DSP4_READ_WORD(); @@ -671,7 +671,7 @@ void DSP4_OP07() // already have 2 bytes in queue DSP4.in_count = 10; - DSP4_WAIT(2) resume2 : + DSP4_WAIT(2) resume2 : // inspect inputs view_y2 = DSP4_READ_WORD(); @@ -832,7 +832,7 @@ void DSP4_OP08() // scan next command DSP4.in_count = 2; - DSP4_WAIT(1) resume1 : + DSP4_WAIT(1) resume1 : // terminate op distance = DSP4_READ_WORD(); @@ -842,7 +842,7 @@ void DSP4_OP08() // already have 2 bytes in queue DSP4.in_count = 16; - DSP4_WAIT(2) resume2 : + DSP4_WAIT(2) resume2 : // look at guidelines for both polygon shapes view_x[0] = DSP4_READ_WORD(); @@ -1051,7 +1051,7 @@ void DSP4_OP09() // check for new sprites DSP4.in_count = 4; - DSP4_WAIT(1) resume1 : + DSP4_WAIT(1) resume1 : //////////////////////////////////////////////// // raster overdraw check @@ -1094,7 +1094,7 @@ void DSP4_OP09() // we already have 4 bytes we want DSP4.in_count = 14; - DSP4_WAIT(2) resume2 : + DSP4_WAIT(2) resume2 : // filter inputs energy = DSP4_READ_WORD(); @@ -1127,7 +1127,7 @@ void DSP4_OP09() // grab a few remaining vehicle values DSP4.in_count = 4; - DSP4_WAIT(3) resume3 : + DSP4_WAIT(3) resume3 : // add vertical lift factor sprite_y += DSP4_READ_WORD(); @@ -1140,7 +1140,7 @@ void DSP4_OP09() // we already have 4 bytes we want DSP4.in_count = 10; - DSP4_WAIT(4) resume4 : + DSP4_WAIT(4) resume4 : // sort loop inputs poly_cx[0][0] = DSP4_READ_WORD(); @@ -1170,18 +1170,18 @@ void DSP4_OP09() do { uint16 header; - + int16 sp_x, sp_y, sp_attr, sp_dattr; int16 sp_dx, sp_dy; int16 pixels; bool8 draw; - + DSP4.in_count = 2; - DSP4_WAIT(5) resume5 : + DSP4_WAIT(5) resume5 : draw = TRUE; - + // opcode termination raster = DSP4_READ_WORD(); if (raster == -0x8000) @@ -1212,10 +1212,10 @@ void DSP4_OP09() // read in rest of sprite data DSP4.in_count = 4; - DSP4_WAIT(6) resume6 : + DSP4_WAIT(6) resume6 : draw = TRUE; - + ///////////////////////////////////// // process tile data @@ -1427,7 +1427,7 @@ void DSP4_OP0D() view_yofs2 = (world_yofs * distance >> 15) + poly_bottom[0][0] - view_y2; // 1. World x-location before transformation - // 2. Viewer x-position at the current + // 2. Viewer x-position at the current // 3. World y-location before perspective projection // 4. Viewer y-position below the horizon // 5. Number of raster lines drawn in this iteration @@ -1528,9 +1528,9 @@ void DSP4_OP0D() // scan next command DSP4.in_count = 2; - DSP4_WAIT(1) resume1 : + DSP4_WAIT(1) resume1 : - // inspect input + // inspect input distance = DSP4_READ_WORD(); // terminate op @@ -1539,7 +1539,7 @@ void DSP4_OP0D() // already have 2 bytes in queue DSP4.in_count = 6; - DSP4_WAIT(2) resume2 : + DSP4_WAIT(2) resume2 : // inspect inputs world_ddy = DSP4_READ_WORD(); @@ -1680,7 +1680,7 @@ void DSP4_OP0F() // grab inputs DSP4.in_count = 4; DSP4_WAIT(1); - resume1 : + resume1 : for (;;) { int16 distance; @@ -1763,7 +1763,7 @@ void DSP4_OP0F() // scan next command DSP4.in_count = 2; - DSP4_WAIT(2) resume2 : + DSP4_WAIT(2) resume2 : // check for termination distance = DSP4_READ_WORD(); @@ -1804,7 +1804,7 @@ void DSP4_OP0F() // already have 2 bytes in queue DSP4.in_count = 6; - DSP4_WAIT(4) resume4 : + DSP4_WAIT(4) resume4 : // inspect inputs world_ddy = DSP4_READ_WORD(); @@ -1925,7 +1925,7 @@ void DSP4_OP10() // grab inputs DSP4.in_count = 4; DSP4_WAIT(1); - resume1 : + resume1 : for (;;) { int16 distance; @@ -2006,7 +2006,7 @@ void DSP4_OP10() // scan next command DSP4.in_count = 2; - DSP4_WAIT(2) resume2 : + DSP4_WAIT(2) resume2 : // check for opcode termination distance = DSP4_READ_WORD(); @@ -2015,7 +2015,7 @@ void DSP4_OP10() // already have 2 bytes in queue DSP4.in_count = 10; - DSP4_WAIT(3) resume3 : + DSP4_WAIT(3) resume3 : // inspect inputs @@ -2064,7 +2064,7 @@ void DSP4SetByte() DSP4.out_index++; return; } - + if (DSP4.waiting4command) { if (DSP4.half_command) @@ -2127,14 +2127,14 @@ void DSP4SetByte() DSP4.parameters[DSP4.in_index] = dsp4_byte; DSP4.in_index++; } - + if (!DSP4.waiting4command && DSP4.in_count == DSP4.in_index) { // Actually execute the command DSP4.waiting4command = TRUE; DSP4.out_index = 0; DSP4.in_index = 0; - + switch (DSP4.command) { // 16-bit multiplication @@ -2147,7 +2147,7 @@ void DSP4SetByte() multiplicand = DSP4_READ_WORD(); DSP4_Multiply(multiplicand, multiplier, &product); - + DSP4_CLEAR_OUT(); DSP4_WRITE_WORD(product); DSP4_WRITE_WORD(product >> 16); @@ -2165,7 +2165,7 @@ void DSP4SetByte() // clear OAM case 0x0005: DSP4_OP05(); break; - + // transfer OAM case 0x0006: DSP4_OP06(); break; @@ -2189,9 +2189,9 @@ void DSP4SetByte() int16 in2a = DSP4_READ_WORD(); int16 in3a = DSP4_READ_WORD(); int16 out1a, out2a, out3a, out4a; - + DSP4_OP0A(in2a, &out2a, &out1a, &out4a, &out3a); - + DSP4_CLEAR_OUT(); DSP4_WRITE_WORD(out1a); DSP4_WRITE_WORD(out2a); @@ -2209,7 +2209,7 @@ void DSP4SetByte() bool8 draw = 1; DSP4_CLEAR_OUT(); - + DSP4_OP0B(&draw, sp_x, sp_y, sp_attr, 0, 1); } break; @@ -2242,7 +2242,7 @@ void DSP4SetByte() a = DSP4_READ_WORD(); DSP4_OP11(a, b, c, d, &m); - + DSP4_CLEAR_OUT(); DSP4_WRITE_WORD(m); diff --git a/zsnes/src/chips/dsp4proc.asm b/zsnes/src/chips/dsp4proc.asm index c040c338..97c0e741 100644 --- a/zsnes/src/chips/dsp4proc.asm +++ b/zsnes/src/chips/dsp4proc.asm @@ -21,7 +21,7 @@ %include "macros.mac" EXTSYM dsp4_address,dsp4_byte,DSP4GetByte,DSP4SetByte -EXTSYM regaccessbankr16,regaccessbankr8,regaccessbankw16,regaccessbankw8 +EXTSYM regaccessbankr16,regaccessbankr8,regaccessbankw16,regaccessbankw8 SECTION .text @@ -53,19 +53,19 @@ NEWSYM DSP4Write8b call DSP4SetByte popad ret - + NEWSYM DSP4Read16b - RouteAccess regaccessbankr16 + RouteAccess regaccessbankr16 mov word[dsp4_address],cx pushad call DSP4GetByte - mov al,byte[dsp4_byte] + mov al,byte[dsp4_byte] mov byte[dsp4temp],al inc word[dsp4_address] call DSP4GetByte - popad + popad mov al,byte[dsp4temp] - mov ah,byte[dsp4_byte] + mov ah,byte[dsp4_byte] ret NEWSYM DSP4Write16b @@ -81,6 +81,6 @@ NEWSYM DSP4Write16b call DSP4SetByte popad ret - + SECTION .bss -NEWSYM dsp4temp, resb 1 \ No newline at end of file +NEWSYM dsp4temp, resb 1 diff --git a/zsnes/src/chips/fxemu2.asm b/zsnes/src/chips/fxemu2.asm index 1c8bc537..3d89067a 100644 --- a/zsnes/src/chips/fxemu2.asm +++ b/zsnes/src/chips/fxemu2.asm @@ -58,30 +58,30 @@ NEWSYM SfxR6, dd 0 ; multiplier for fmult and lmult NEWSYM SfxR7, dd 0 ; fixed point texel X position for merge NEWSYM SfxR8, dd 0 ; fixed point texel Y position for merge NEWSYM SfxR9, dd 0 ; -NEWSYM SfxR10, dd 0 ; +NEWSYM SfxR10, dd 0 ; NEWSYM SfxR11, dd 0 ; return address set by link NEWSYM SfxR12, dd 0 ; loop counter NEWSYM SfxR13, dd 0 ; loop point address NEWSYM SfxR14, dd 0 ; rom address for getb, getbh, getbl, getbs -NEWSYM SfxR15, dd 0 ; program counter +NEWSYM SfxR15, dd 0 ; program counter NEWSYM SfxSFR, dd 0 ; status flag register (16bit) ;SFR status flag register bits: -; 0 - +; 0 - ; 1 Z Zero flag ; 2 CY Carry flag ; 3 S Sign flag ; 4 OV Overflow flag ; 5 G Go flag (set to 1 when the GSU is running) ; 6 R Set to 1 when reading ROM using R14 address -; 7 - +; 7 - ; 8 ALT1 Mode set-up flag for the next instruction ; 9 ALT2 Mode set-up flag for the next instruction ;10 IL Immediate lower 8-bit flag ;11 IH Immediate higher 8-bit flag ;12 B Set to 1 when the WITH instruction is executed -;13 - -;14 - +;13 - +;14 - ;15 IRQ Set to 1 when GSU caused an interrupt ; Set to 0 when read by 658c16 @@ -363,29 +363,29 @@ NEWSYM FxOp0F ; BVS branch on overflow set ; Verified. NEWSYM FxOp10 ; TO RN set register n as destination register TORN 0 NEWSYM FxOp11 ; TO RN set register n as destination register - TORN 1 + TORN 1 NEWSYM FxOp12 ; TO RN set register n as destination register - TORN 2 + TORN 2 NEWSYM FxOp13 ; TO RN set register n as destination register - TORN 3 + TORN 3 NEWSYM FxOp14 ; TO RN set register n as destination register - TORN 4 + TORN 4 NEWSYM FxOp15 ; TO RN set register n as destination register - TORN 5 + TORN 5 NEWSYM FxOp16 ; TO RN set register n as destination register - TORN 6 + TORN 6 NEWSYM FxOp17 ; TO RN set register n as destination register - TORN 7 + TORN 7 NEWSYM FxOp18 ; TO RN set register n as destination register - TORN 8 + TORN 8 NEWSYM FxOp19 ; TO RN set register n as destination register - TORN 9 + TORN 9 NEWSYM FxOp1A ; TO RN set register n as destination register - TORN 10 + TORN 10 NEWSYM FxOp1B ; TO RN set register n as destination register - TORN 11 + TORN 11 NEWSYM FxOp1C ; TO RN set register n as destination register - TORN 12 + TORN 12 NEWSYM FxOp1D ; TO RN set register n as destination register TORN 13 NEWSYM FxOp1E ; TO RN set register n as destination register @@ -587,21 +587,21 @@ NEWSYM FxOp4B ; LDW RN load word from RAM LDWRN 11 NEWSYM FxOp40A1 ; LDB RN load byte from RAM - LDBRN 0 + LDBRN 0 NEWSYM FxOp41A1 ; LDB RN load byte from RAM - LDBRN 1 + LDBRN 1 NEWSYM FxOp42A1 ; LDB RN load byte from RAM - LDBRN 2 + LDBRN 2 NEWSYM FxOp43A1 ; LDB RN load byte from RAM - LDBRN 3 + LDBRN 3 NEWSYM FxOp44A1 ; LDB RN load byte from RAM - LDBRN 4 + LDBRN 4 NEWSYM FxOp45A1 ; LDB RN load byte from RAM LDBRN 5 NEWSYM FxOp46A1 ; LDB RN load byte from RAM - LDBRN 6 + LDBRN 6 NEWSYM FxOp47A1 ; LDB RN load byte from RAM - LDBRN 7 + LDBRN 7 NEWSYM FxOp48A1 ; LDB RN load byte from RAM LDBRN 8 NEWSYM FxOp49A1 ; LDB RN load byte from RAM @@ -1036,7 +1036,7 @@ NEWSYM FxOp4CA1 ; RPIX read color of the pixel with R1,R2 as x,y NEWSYM FxOp4D ; SWAP swap upper and lower byte of a register ; V mov eax,[esi] ; Read Source FETCHPIPE - ror ax,8 + ror ax,8 inc ebp ; Increase program counter mov [SfxSignZero],eax mov [edi],eax ; Write Destination @@ -1650,35 +1650,35 @@ NEWSYM FxOp7FA3 ; BICIRN register & ~immediate BICIRN 15 ^ 0FFFFh NEWSYM FxOp80 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 0 + MULTRN 0 NEWSYM FxOp81 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 1 + MULTRN 1 NEWSYM FxOp82 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 2 + MULTRN 2 NEWSYM FxOp83 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 3 + MULTRN 3 NEWSYM FxOp84 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 4 + MULTRN 4 NEWSYM FxOp85 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 5 + MULTRN 5 NEWSYM FxOp86 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 6 + MULTRN 6 NEWSYM FxOp87 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 7 + MULTRN 7 NEWSYM FxOp88 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 8 + MULTRN 8 NEWSYM FxOp89 ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 9 + MULTRN 9 NEWSYM FxOp8A ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 10 + MULTRN 10 NEWSYM FxOp8B ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 11 + MULTRN 11 NEWSYM FxOp8C ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 12 + MULTRN 12 NEWSYM FxOp8D ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 13 + MULTRN 13 NEWSYM FxOp8E ; MULTRN 8 bit to 16 bit signed multiply, register * register - MULTRN 14 + MULTRN 14 NEWSYM FxOp8F ; MULTRN 8 bit to 16 bit signed multiply, register * register FETCHPIPE mov ebx,ebp diff --git a/zsnes/src/chips/fxemu2b.asm b/zsnes/src/chips/fxemu2b.asm index ef24430d..fe273a6f 100644 --- a/zsnes/src/chips/fxemu2b.asm +++ b/zsnes/src/chips/fxemu2b.asm @@ -188,29 +188,29 @@ NEWSYM FxOpb0F ; BVS branch on overflow set ; Verified. NEWSYM FxOpb10 ; TO RN set register n as destination register TORNb 0 NEWSYM FxOpb11 ; TO RN set register n as destination register - TORNb 1 + TORNb 1 NEWSYM FxOpb12 ; TO RN set register n as destination register - TORNb 2 + TORNb 2 NEWSYM FxOpb13 ; TO RN set register n as destination register - TORNb 3 + TORNb 3 NEWSYM FxOpb14 ; TO RN set register n as destination register - TORNb 4 + TORNb 4 NEWSYM FxOpb15 ; TO RN set register n as destination register - TORNb 5 + TORNb 5 NEWSYM FxOpb16 ; TO RN set register n as destination register - TORNb 6 + TORNb 6 NEWSYM FxOpb17 ; TO RN set register n as destination register - TORNb 7 + TORNb 7 NEWSYM FxOpb18 ; TO RN set register n as destination register - TORNb 8 + TORNb 8 NEWSYM FxOpb19 ; TO RN set register n as destination register - TORNb 9 + TORNb 9 NEWSYM FxOpb1A ; TO RN set register n as destination register - TORNb 10 + TORNb 10 NEWSYM FxOpb1B ; TO RN set register n as destination register - TORNb 11 + TORNb 11 NEWSYM FxOpb1C ; TO RN set register n as destination register - TORNb 12 + TORNb 12 NEWSYM FxOpb1D ; TO RN set register n as destination register TORNb 13 NEWSYM FxOpb1E ; TO RN set register n as destination register @@ -504,29 +504,29 @@ NEWSYM FxOpc0F ; BVS branch on overflow set ; Verified. NEWSYM FxOpc10 ; TO RN set register n as destination register TORNc 0 NEWSYM FxOpc11 ; TO RN set register n as destination register - TORNc 1 + TORNc 1 NEWSYM FxOpc12 ; TO RN set register n as destination register - TORNc 2 + TORNc 2 NEWSYM FxOpc13 ; TO RN set register n as destination register - TORNc 3 + TORNc 3 NEWSYM FxOpc14 ; TO RN set register n as destination register - TORNc 4 + TORNc 4 NEWSYM FxOpc15 ; TO RN set register n as destination register - TORNc 5 + TORNc 5 NEWSYM FxOpc16 ; TO RN set register n as destination register - TORNc 6 + TORNc 6 NEWSYM FxOpc17 ; TO RN set register n as destination register - TORNc 7 + TORNc 7 NEWSYM FxOpc18 ; TO RN set register n as destination register - TORNc 8 + TORNc 8 NEWSYM FxOpc19 ; TO RN set register n as destination register - TORNc 9 + TORNc 9 NEWSYM FxOpc1A ; TO RN set register n as destination register - TORNc 10 + TORNc 10 NEWSYM FxOpc1B ; TO RN set register n as destination register - TORNc 11 + TORNc 11 NEWSYM FxOpc1C ; TO RN set register n as destination register - TORNc 12 + TORNc 12 NEWSYM FxOpc1D ; TO RN set register n as destination register TORNc 13 NEWSYM FxOpc1E ; TO RN set register n as destination register diff --git a/zsnes/src/chips/fxemu2c.asm b/zsnes/src/chips/fxemu2c.asm index 3146168b..4a97797f 100644 --- a/zsnes/src/chips/fxemu2c.asm +++ b/zsnes/src/chips/fxemu2c.asm @@ -264,29 +264,29 @@ NEWSYM FxOpd0F ; BVS branch on overflow set ; Verified. NEWSYM FxOpd10 ; TO RN set register n as destination register TORNd 0 NEWSYM FxOpd11 ; TO RN set register n as destination register - TORNd 1 + TORNd 1 NEWSYM FxOpd12 ; TO RN set register n as destination register - TORNd 2 + TORNd 2 NEWSYM FxOpd13 ; TO RN set register n as destination register - TORNd 3 + TORNd 3 NEWSYM FxOpd14 ; TO RN set register n as destination register - TORNd 4 + TORNd 4 NEWSYM FxOpd15 ; TO RN set register n as destination register - TORNd 5 + TORNd 5 NEWSYM FxOpd16 ; TO RN set register n as destination register - TORNd 6 + TORNd 6 NEWSYM FxOpd17 ; TO RN set register n as destination register - TORNd 7 + TORNd 7 NEWSYM FxOpd18 ; TO RN set register n as destination register - TORNd 8 + TORNd 8 NEWSYM FxOpd19 ; TO RN set register n as destination register - TORNd 9 + TORNd 9 NEWSYM FxOpd1A ; TO RN set register n as destination register - TORNd 10 + TORNd 10 NEWSYM FxOpd1B ; TO RN set register n as destination register - TORNd 11 + TORNd 11 NEWSYM FxOpd1C ; TO RN set register n as destination register - TORNd 12 + TORNd 12 NEWSYM FxOpd1D ; TO RN set register n as destination register TORNd 13 NEWSYM FxOpd1E ; TO RN set register n as destination register @@ -488,21 +488,21 @@ NEWSYM FxOpd4B ; LDW RN load word from RAM LDWRNc 11 NEWSYM FxOpd40A1 ; LDB RN load byte from RAM - LDBRNc 0 + LDBRNc 0 NEWSYM FxOpd41A1 ; LDB RN load byte from RAM - LDBRNc 1 + LDBRNc 1 NEWSYM FxOpd42A1 ; LDB RN load byte from RAM - LDBRNc 2 + LDBRNc 2 NEWSYM FxOpd43A1 ; LDB RN load byte from RAM - LDBRNc 3 + LDBRNc 3 NEWSYM FxOpd44A1 ; LDB RN load byte from RAM - LDBRNc 4 + LDBRNc 4 NEWSYM FxOpd45A1 ; LDB RN load byte from RAM LDBRNc 5 NEWSYM FxOpd46A1 ; LDB RN load byte from RAM - LDBRNc 6 + LDBRNc 6 NEWSYM FxOpd47A1 ; LDB RN load byte from RAM - LDBRNc 7 + LDBRNc 7 NEWSYM FxOpd48A1 ; LDB RN load byte from RAM LDBRNc 8 NEWSYM FxOpd49A1 ; LDB RN load byte from RAM @@ -937,7 +937,7 @@ NEWSYM FxOpd4CA1 ; RPIX read color of the pixel with R1,R2 as x,y NEWSYM FxOpd4D ; SWAP swap upper and lower byte of a register ; V mov eax,[esi] ; Read Source FETCHPIPE - ror ax,8 + ror ax,8 inc ebp ; Increase program counter mov [SfxSignZero],eax mov [edi],eax ; Write Destination @@ -1552,35 +1552,35 @@ NEWSYM FxOpd7FA3 ; BICIRNc register & ~immediate BICIRNc 15 ^ 0FFFFh NEWSYM FxOpd80 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 0 + MULTRNc 0 NEWSYM FxOpd81 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 1 + MULTRNc 1 NEWSYM FxOpd82 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 2 + MULTRNc 2 NEWSYM FxOpd83 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 3 + MULTRNc 3 NEWSYM FxOpd84 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 4 + MULTRNc 4 NEWSYM FxOpd85 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 5 + MULTRNc 5 NEWSYM FxOpd86 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 6 + MULTRNc 6 NEWSYM FxOpd87 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 7 + MULTRNc 7 NEWSYM FxOpd88 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 8 + MULTRNc 8 NEWSYM FxOpd89 ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 9 + MULTRNc 9 NEWSYM FxOpd8A ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 10 + MULTRNc 10 NEWSYM FxOpd8B ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 11 + MULTRNc 11 NEWSYM FxOpd8C ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 12 + MULTRNc 12 NEWSYM FxOpd8D ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 13 + MULTRNc 13 NEWSYM FxOpd8E ; MULTRNc 8 bit to 16 bit signed multiply, register * register - MULTRNc 14 + MULTRNc 14 NEWSYM FxOpd8F ; MULTRNc 8 bit to 16 bit signed multiply, register * register FETCHPIPE mov ebx,ebp diff --git a/zsnes/src/chips/sdd1emu.c b/zsnes/src/chips/sdd1emu.c index d4efb143..64e9d6f7 100644 --- a/zsnes/src/chips/sdd1emu.c +++ b/zsnes/src/chips/sdd1emu.c @@ -32,8 +32,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * of thanks and credit for figuring this out. * * Andreas says: - * The author is greatly indebted with The Dumper, without whose help and - * patience providing him with real S-DD1 data the research had never been + * The author is greatly indebted with The Dumper, without whose help and + * patience providing him with real S-DD1 data the research had never been * possible. He also wish to note that in the very beggining of his research, * Neviksti had done some steps in the right direction. By last, the author is * indirectly indebted to all the people that worked and contributed in the @@ -163,7 +163,7 @@ INLINE unsigned char ProbGetBit(unsigned char context){ INLINE unsigned char GetBit(unsigned char cur_bitplane){ unsigned char bit; - + bit=ProbGetBit(((cur_bitplane&1)<<4) | ((prev_bits[cur_bitplane]&high_context_bits)>>5) | (prev_bits[cur_bitplane]&low_context_bits)); diff --git a/zsnes/src/chips/seta10.c b/zsnes/src/chips/seta10.c index 3786e3b0..ede21625 100755 --- a/zsnes/src/chips/seta10.c +++ b/zsnes/src/chips/seta10.c @@ -206,7 +206,7 @@ void ST010_OP01(short x0, short y0, short *x1, short *y1, short *Quadrant, short else { *x1 = x0; - *y1 = y0; + *y1 = y0; *Quadrant = 0x0000; } @@ -238,7 +238,7 @@ void ST010_Rotate(short Theta, short X0, short Y0, short *X1, short *Y1) *Y1 = (Y0 * ST010_Cos(Theta) >> 15) - (X0 * ST010_Sin(Theta) >> 15); } -void ST010_SortDrivers(uint16 Positions, uint16 Places[32], uint16 Drivers[32]) +void ST010_SortDrivers(uint16 Positions, uint16 Places[32], uint16 Drivers[32]) { bool Sorted; uint16 Temp; @@ -251,12 +251,12 @@ void ST010_SortDrivers(uint16 Positions, uint16 Places[32], uint16 Drivers[32]) Sorted = true; for (i = 0; i < Positions - 1; i++) { - if (Places[i] < Places[i + 1]) + if (Places[i] < Places[i + 1]) { Temp = Places[i + 1]; Places[i + 1] = Places[i]; Places[i] = Temp; - + Temp = Drivers[i + 1]; Drivers[i + 1] = Drivers[i]; Drivers[i] = Temp; @@ -278,13 +278,13 @@ void ST010DoCommand(void) { /* Calculate track data based on direction coords - + Input 0x0000-0x0001 : DX (signed) 0x0002-0x0003 : DY (signed) Output 0x0010-0x0011 : Angle (signed) - */ + */ case 0x01: { @@ -295,13 +295,13 @@ void ST010DoCommand(void) break; //Sorts a bunch of values by weight - + case 0x02: { ST010_SortDrivers(*(short*)&SRAM[0x0024], (uint16*)&SRAM[0x0040], (uint16*)&SRAM[0x0080]); } break; - + /* Two Dimensional Coordinate Scale @@ -312,8 +312,8 @@ void ST010DoCommand(void) Output 0x0010-0x0013 : X1 (signed) 0x0014-0x0017 : Y1 (signed) - */ - + */ + case 0x03: { ST010_Scale(*(short*)&SRAM[0x0004], *(short*)&SRAM[0x0000], *(short*)&SRAM[0x0002], (int *)&SRAM[0x10], (int *)&SRAM[0x14]); @@ -344,7 +344,7 @@ void ST010DoCommand(void) //Target (x,y) coordinates int16 ypos_max = ST010_WORD(0x00C0); int16 xpos_max = ST010_WORD(0x00C2); - + //Current coordinates and direction int32 ypos = SRAM[0xC4]|(SRAM[0xC5]<<8)|(SRAM[0xC6]<<16)|(SRAM[0xC7]<<24); int32 xpos = SRAM[0xC8]|(SRAM[0xC9]<<8)|(SRAM[0xCA]<<16)|(SRAM[0xCB]<<24); @@ -395,7 +395,7 @@ void ST010DoCommand(void) { speed = 0x100; } - + //Slow down for sharp curves else if (abs(o1-rot)>=0x1000) { @@ -476,7 +476,7 @@ void ST010DoCommand(void) SRAM[0x00DD]=(uint8)(flags >> 8); } break; - + /* 16-bit Multiplication @@ -493,7 +493,7 @@ void ST010DoCommand(void) } break; - /* + /* Mode 7 Raster Data Calculation Input @@ -503,7 +503,7 @@ void ST010DoCommand(void) 0x0250-0x03af : Mode 7 Matrix B 0x03b0-0x050f : Mode 7 Matrix C 0x0510-0x066f : Mode 7 Matrix D - */ + */ case 0x07: { @@ -519,7 +519,7 @@ void ST010DoCommand(void) SRAM[0x00f0 + offset]=(uint8)(data); SRAM[0x00f1 + offset]=(uint8)(data >> 8); SRAM[0x0510 + offset]=(uint8)(data); - SRAM[0x0511 + offset]=(uint8)(data >> 8); + SRAM[0x0511 + offset]=(uint8)(data >> 8); //Calculate Mode 7 Matrix B/C data data = ST010_M7Scale[line] * ST010_Sin(Theta) >> 15; @@ -527,10 +527,10 @@ void ST010DoCommand(void) SRAM[0x0251 + offset]=(uint8)(data >> 8); if (data) { data = ~data; } - + SRAM[0x03b0 + offset]=(uint8)(data); SRAM[0x03b1 + offset]=(uint8)(data >> 8); - + offset += 2; } @@ -551,7 +551,7 @@ void ST010DoCommand(void) 0x0010-0x0011 : X1 (signed) 0x0012-0x0013 : Y1 (signed) */ - + case 0x08: { ST010_Rotate(*(short*)&SRAM[0x0004], *(short*)&SRAM[0x0000], *(short*)&SRAM[0x0002], (short *)&SRAM[0x10], (short *)&SRAM[0x12]); diff --git a/zsnes/src/chips/sfxproc.asm b/zsnes/src/chips/sfxproc.asm index 1e2184fd..036da479 100644 --- a/zsnes/src/chips/sfxproc.asm +++ b/zsnes/src/chips/sfxproc.asm @@ -438,7 +438,7 @@ NEWSYM reg3010w ret NEWSYM reg3011w mov [SfxR8+1],al - ret + ret NEWSYM reg3012w mov [SfxR9],al ret diff --git a/zsnes/src/cpu/dspproc.asm b/zsnes/src/cpu/dspproc.asm index 14940e01..c072fb21 100644 --- a/zsnes/src/cpu/dspproc.asm +++ b/zsnes/src/cpu/dspproc.asm @@ -590,7 +590,7 @@ NEWSYM AdjustFrequency .fir_mmx mov ebx, DSPInterpolate_8 - + .notgaussian mov [DSPInterpolate],ebx @@ -4876,7 +4876,7 @@ NEWSYM EchoStereo jne near %2 mov ebp,%1 mov dword[powhack],1<<%1 - + mov eax,%1 dec al cmp al,0FFh @@ -5227,10 +5227,10 @@ NEWSYM ProcessSoundBuffer cmp byte[EMUPause],1 jne .nopause ret -.nopause +.nopause ; Process the sound :I - + ProcessVoiceHandler16 0,ProcessVoice116,1,254 NEWSYM ProcessVoice116 ProcessVoiceHandler16 1,ProcessVoice216,2,253 diff --git a/zsnes/src/cpu/execute.asm b/zsnes/src/cpu/execute.asm index 2ebb2dc2..a15e3076 100644 --- a/zsnes/src/cpu/execute.asm +++ b/zsnes/src/cpu/execute.asm @@ -103,7 +103,7 @@ NEWSYM ProcessRewind call BackupPauseFrame popad .notpauserewind - + mov esi,[tempesi] mov edi,[tempedi] mov ebp,[tempebp] @@ -1442,7 +1442,7 @@ NEWSYM cpuover mov ebp,[tempebp] mov edx,[tempedx] .nopauseframemode3 - + cmp byte[EMUPause],1 jne .noemupause @@ -1451,14 +1451,14 @@ NEWSYM cpuover mov [tempedx],edx mov [tempesi],esi mov [tempedi],edi - mov [tempebp],ebp + mov [tempebp],ebp pushad call BackupPauseFrame popad .nopauseframemode1 - + call ProcessRewind - + cmp byte[PauseFrameMode],2 jne .nopauseframemode2 mov byte[PauseFrameMode],3 @@ -1477,7 +1477,7 @@ NEWSYM cpuover call showvideo call cachevideo popad - + jmp .nonewgfx .noemupause diff --git a/zsnes/src/cpu/spcdef.inc b/zsnes/src/cpu/spcdef.inc index c14628cc..fffa3b75 100644 --- a/zsnes/src/cpu/spcdef.inc +++ b/zsnes/src/cpu/spcdef.inc @@ -36,7 +36,7 @@ inc ebp add ebp,ebx ret -%endmacro +%endmacro ; tcall instruction %macro spctcall 1 diff --git a/zsnes/src/dos/sound.asm b/zsnes/src/dos/sound.asm index 64e1f5df..95e83f01 100644 --- a/zsnes/src/dos/sound.asm +++ b/zsnes/src/dos/sound.asm @@ -466,7 +466,7 @@ NEWSYM SBHandler16 inc dword[sbhandexec] cmp byte [vibracard], 1 - je .donotcallcmdapos + je .donotcallcmdapos call GetCDMAPos .donotcallcmdapos diff --git a/zsnes/src/dos/vesa2.asm b/zsnes/src/dos/vesa2.asm index 5094a274..71837e0b 100644 --- a/zsnes/src/dos/vesa2.asm +++ b/zsnes/src/dos/vesa2.asm @@ -208,7 +208,7 @@ NEWSYM InitVesa2 jnc .int1ok mov edx,.noint1message jmp VESA2EXITTODOS - + .int1ok ; Real mode int successful!!! mov eax,[RMREGS.eax] @@ -222,7 +222,7 @@ NEWSYM InitVesa2 jz .vesadetected ; Check for presence of vesa mov edx,.novesamessage jmp VESA2EXITTODOS - + .vesadetected cmp word[fs:0004],200h @@ -608,7 +608,7 @@ NEWSYM InitVesa2 jz .modesetok mov edx,.unableset jmp VESA2EXITTODOS ; Failure!!! - + .modesetok ;******************************* EXTRA BIT **************************** diff --git a/zsnes/src/dos/vga.inc b/zsnes/src/dos/vga.inc index 3783f73e..786f0682 100644 --- a/zsnes/src/dos/vga.inc +++ b/zsnes/src/dos/vga.inc @@ -91,7 +91,7 @@ SECTION .data dw 03d4h,04a04h,03d4h,09a05h,03d4h,00b06h,03d4h,03e07h,03d4h,00008h dw 03d4h,06109h,03d4h,0da10h,03d4h,0ac11h,03d4h,0bf12h,03d4h,02013h dw 03d4h,04014h,03d4h,00715h,03d4h,01a16h,03d4h,0a317h,03c4h,00101h - dw 03c4h,00e04h,03cEh,04005h,03ceh,00506h,03c0h,04110h,03c0h,00013h + dw 03c4h,00e04h,03cEh,04005h,03ceh,00506h,03c0h,04110h,03c0h,00013h dd 0 .Mode256x240c @@ -107,7 +107,7 @@ SECTION .data dw 03d4h,04a04h,03d4h,09a05h,03d4h,02306h,03d4h,0b207h,03d4h,00008h dw 03d4h,06109h,03d4h,00a10h,03d4h,0ac11h,03d4h,0FF12h,03d4h,02013h dw 03d4h,04014h,03d4h,00715h,03d4h,01a16h,03d4h,0a317h,03c4h,00101h - dw 03c4h,00e04h,03ceh,04005h,03ceh,00506h,03c0h,04110h,03c0h,00013h + dw 03c4h,00e04h,03ceh,04005h,03ceh,00506h,03c0h,04110h,03c0h,00013h dd 0 .Mode256x256cs @@ -115,7 +115,7 @@ SECTION .data dw 03d4h,04a04h,03d4h,09a05h,03d4h,02306h,03d4h,01d07h,03d4h,00008h dw 03d4h,06009h,03d4h,00a10h,03d4h,0ac11h,03d4h,0ff12h,03d4h,02013h dw 03d4h,04014h,03d4h,00715h,03d4h,01a16h,03d4h,0a317h,03c4h,00101h - dw 03c4h,00e04h,03ceh,04005h,03cEh,00506h,03c0h,04110h,03c0h,00013h + dw 03c4h,00e04h,03ceh,04005h,03cEh,00506h,03c0h,04110h,03c0h,00013h dd 0 .Mode320x224 @@ -131,7 +131,7 @@ SECTION .data dw 03d4h,05404h,03d4h,08005h,03d4h,00d06h,03d4h,03e07h,03d4h,00008h dw 03d4h,04109h,03d4h,0ea10h,03d4h,0ac11h,03d4h,0df12h,03d4h,02813h dw 03d4h,00014h,03d4h,0e715h,03d4h,00616h,03d4h,0e317h,03c4h,00101h - dw 03c4h,00604h,03ceh,04005h,03ceh,00506h,03c0h,04110h,03c0h,00013h + dw 03c4h,00604h,03ceh,04005h,03ceh,00506h,03c0h,04110h,03c0h,00013h dd 0 .Mode320x256 diff --git a/zsnes/src/dos/zfile.c b/zsnes/src/dos/zfile.c index ca51bfc3..01917f87 100644 --- a/zsnes/src/dos/zfile.c +++ b/zsnes/src/dos/zfile.c @@ -114,7 +114,7 @@ DWORD ZOpenFile() { if(ZOpenMode==0) { - if (TextFile) + if (TextFile) FILEHANDLE[CurrentHandle]=fopen(ZOpenFileName,"rb"); else FILEHANDLE[CurrentHandle]=(FILE *)gzopen(ZOpenFileName,"rb"); @@ -127,11 +127,11 @@ DWORD ZOpenFile() } if(ZOpenMode==1) { - if (TextFile) + if (TextFile) FILEHANDLE[CurrentHandle]=fopen(ZOpenFileName,"wb"); else FILEHANDLE[CurrentHandle]=(FILE *)gzopen(ZOpenFileName,"wb"); - if(FILEHANDLE[CurrentHandle]!=NULL) + if(FILEHANDLE[CurrentHandle]!=NULL) { CurrentHandle+=1; return(CurrentHandle-1); @@ -140,11 +140,11 @@ DWORD ZOpenFile() } if(ZOpenMode==2) { - if (TextFile) + if (TextFile) FILEHANDLE[CurrentHandle]=fopen(ZOpenFileName,"r+b"); else FILEHANDLE[CurrentHandle]=(FILE *)gzopen(ZOpenFileName,"r+b"); - if(FILEHANDLE[CurrentHandle]!=NULL) + if(FILEHANDLE[CurrentHandle]!=NULL) { CurrentHandle+=1; return(CurrentHandle-1); @@ -172,7 +172,7 @@ DWORD ZFileSeek() mode = SEEK_SET; else if (ZFileSeekMode==1) { mode = SEEK_END; - if (TextFile==0) + if (TextFile==0) printf("Warning : gzseek(SEEK_END) not supported"); } else return (0xFFFFFFFF); @@ -194,8 +194,8 @@ DWORD ZFileRead() ZFileReadSize, FILEHANDLE[ZFileReadHandle])); else - return(gzread(FILEHANDLE[ZFileReadHandle], - ZFileReadBlock, + return(gzread(FILEHANDLE[ZFileReadHandle], + ZFileReadBlock, ZFileReadSize)); } @@ -209,11 +209,11 @@ DWORD ZFileWrite() ZFileWriteSize, FILEHANDLE[ZFileWriteHandle]); else - res = gzwrite(FILEHANDLE[ZFileWriteHandle], - ZFileWriteBlock, + res = gzwrite(FILEHANDLE[ZFileWriteHandle], + ZFileWriteBlock, ZFileWriteSize); - - if (res!=ZFileWriteSize) + + if (res!=ZFileWriteSize) return(0xFFFFFFFF); return(0); diff --git a/zsnes/src/effects/burn.c b/zsnes/src/effects/burn.c index d6885c0d..6d790b9d 100644 --- a/zsnes/src/effects/burn.c +++ b/zsnes/src/effects/burn.c @@ -109,7 +109,7 @@ void genpal() { pal[i]=pal[i-1]; { - struct colorvalue *with = &pal[i]; + struct colorvalue *with = &pal[i]; if (with->r<255) with->r += 1; if (with->r<255) with->r += 1; @@ -125,8 +125,8 @@ int started = 0; #if 0 // emulating Turbo Pascal unsigned int randseed; -const unsigned modulus = 2147483647; -const unsigned factor = 397204094; +const unsigned modulus = 2147483647; +const unsigned factor = 397204094; void Randomize() { @@ -136,13 +136,13 @@ void Randomize() unsigned int randint(unsigned range) { randseed = randseed * factor % modulus; - return range ? randseed % range : 0; + return range ? randseed % range : 0; } double randreal() { randseed = randseed * factor % modulus; - return (double)randseed / modulus; + return (double)randseed / modulus; } int rand1(int r) /* Return a random number between -R And R*/ @@ -241,14 +241,14 @@ int v; if ((v==0) || (v=xend)) + (i>=xend)) pt[(j-1)*BUF_WIDTH + i] = 0; else pt[((j-1)*BUF_WIDTH) + (i-(randint(3)-1))] = v - randint(decay); } /*Match?*/ - if (randint(150)==0) + if (randint(150)==0) memset(flamearray + xstart + randint(xend-xstart-5),255,5); /*This loop controls the "root" of the diff --git a/zsnes/src/effects/fixsin.h b/zsnes/src/effects/fixsin.h index 3aab6cae..4bb9230b 100644 --- a/zsnes/src/effects/fixsin.h +++ b/zsnes/src/effects/fixsin.h @@ -26,394 +26,394 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. int FSinTab[2048] = { -0, 201, 402, 603, 804, 1005, 1206, 1407, 1608, 1809, 2010, 2211, 2412, 2613, -2814, 3014, 3215, 3416, 3617, 3818, 4018, 4219, 4420, 4620, 4821, 5021, 5222, -5422, 5622, 5823, 6023, 6223, 6423, 6623, 6823, 7023, 7223, 7423, 7623, 7822, -8022, 8221, 8421, 8620, 8819, 9019, 9218, 9417, 9616, 9814, 10013, 10212, 10410, -10609, 10807, 11006, 11204, 11402, 11600, 11797, 11995, 12193, 12390, 12588, -12785, 12982, 13179, 13376, 13573, 13769, 13966, 14162, 14359, 14555, 14751, -14946, 15142, 15338, 15533, 15728, 15923, 16118, 16313, 16508, 16702, 16897, -17091, 17285, 17479, 17672, 17866, 18059, 18253, 18446, 18638, 18831, 19024, -19216, 19408, 19600, 19792, 19983, 20175, 20366, 20557, 20748, 20938, 21129, -21319, 21509, 21699, 21889, 22078, 22267, 22456, 22645, 22833, 23022, 23210, -23398, 23586, 23773, 23960, 24147, 24334, 24521, 24707, 24893, 25079, 25265, -25450, 25635, 25820, 26005, 26189, 26373, 26557, 26741, 26925, 27108, 27291, -27473, 27656, 27838, 28020, 28201, 28383, 28564, 28745, 28925, 29105, 29285, -29465, 29645, 29824, 30003, 30181, 30360, 30538, 30715, 30893, 31070, 31247, -31424, 31600, 31776, 31952, 32127, 32302, 32477, 32651, 32826, 32999, 33173, -33346, 33519, 33692, 33864, 34036, 34208, 34379, 34550, 34721, 34891, 35061, -35231, 35400, 35569, 35738, 35906, 36074, 36242, 36409, 36576, 36743, 36909, -37075, 37241, 37406, 37571, 37736, 37900, 38064, 38227, 38390, 38553, 38716, -38878, 39039, 39201, 39362, 39522, 39682, 39842, 40002, 40161, 40319, 40478, -40636, 40793, 40950, 41107, 41263, 41419, 41575, 41730, 41885, 42040, 42194, -42347, 42501, 42653, 42806, 42958, 43110, 43261, 43412, 43562, 43712, 43862, -44011, 44160, 44308, 44456, 44603, 44750, 44897, 45043, 45189, 45335, 45480, -45624, 45768, 45912, 46055, 46198, 46340, 46482, 46624, 46765, 46906, 47046, -47186, 47325, 47464, 47602, 47740, 47878, 48015, 48151, 48288, 48423, 48558, -48693, 48828, 48961, 49095, 49228, 49360, 49492, 49624, 49755, 49886, 50016, -50146, 50275, 50403, 50532, 50660, 50787, 50914, 51040, 51166, 51291, 51416, -51541, 51665, 51788, 51911, 52033, 52155, 52277, 52398, 52518, 52639, 52758, -52877, 52996, 53114, 53231, 53348, 53465, 53581, 53696, 53811, 53926, 54040, -54153, 54266, 54379, 54491, 54602, 54713, 54823, 54933, 55043, 55152, 55260, -55368, 55475, 55582, 55688, 55794, 55899, 56004, 56108, 56212, 56315, 56417, -56519, 56621, 56722, 56822, 56922, 57022, 57120, 57219, 57316, 57414, 57510, -57606, 57702, 57797, 57892, 57986, 58079, 58172, 58264, 58356, 58447, 58538, -58628, 58718, 58807, 58895, 58983, 59070, 59157, 59243, 59329, 59414, 59499, -59583, 59666, 59749, 59831, 59913, 59994, 60075, 60155, 60235, 60313, 60392, -60470, 60547, 60624, 60700, 60775, 60850, 60924, 60998, 61071, 61144, 61216, -61288, 61359, 61429, 61499, 61568, 61637, 61705, 61772, 61839, 61905, 61971, -62036, 62100, 62164, 62228, 62291, 62353, 62414, 62475, 62536, 62596, 62655, -62714, 62772, 62829, 62886, 62942, 62998, 63053, 63108, 63162, 63215, 63268, -63320, 63371, 63422, 63473, 63522, 63571, 63620, 63668, 63715, 63762, 63808, -63854, 63899, 63943, 63987, 64030, 64073, 64115, 64156, 64197, 64237, 64276, -64315, 64353, 64391, 64428, 64465, 64501, 64536, 64571, 64605, 64638, 64671, -64703, 64735, 64766, 64796, 64826, 64855, 64884, 64912, 64939, 64966, 64992, -65018, 65043, 65067, 65091, 65114, 65136, 65158, 65179, 65200, 65220, 65239, -65258, 65276, 65294, 65311, 65327, 65343, 65358, 65372, 65386, 65400, 65412, -65424, 65436, 65446, 65457, 65466, 65475, 65483, 65491, 65498, 65505, 65511, -65516, 65520, 65524, 65528, 65531, 65533, 65534, 65535, 65536, 65535, 65534, -65533, 65531, 65528, 65524, 65520, 65516, 65511, 65505, 65498, 65491, 65483, -65475, 65466, 65457, 65446, 65436, 65424, 65412, 65400, 65386, 65372, 65358, -65343, 65327, 65311, 65294, 65276, 65258, 65239, 65220, 65200, 65179, 65158, -65136, 65114, 65091, 65067, 65043, 65018, 64992, 64966, 64939, 64912, 64884, -64855, 64826, 64796, 64766, 64735, 64703, 64671, 64638, 64605, 64571, 64536, -64501, 64465, 64428, 64391, 64353, 64315, 64276, 64237, 64197, 64156, 64115, -64073, 64030, 63987, 63943, 63899, 63854, 63808, 63762, 63715, 63668, 63620, -63571, 63522, 63473, 63422, 63371, 63320, 63268, 63215, 63162, 63108, 63053, -62998, 62942, 62886, 62829, 62772, 62714, 62655, 62596, 62536, 62475, 62414, -62353, 62291, 62228, 62164, 62100, 62036, 61971, 61905, 61839, 61772, 61705, -61637, 61568, 61499, 61429, 61359, 61288, 61216, 61144, 61071, 60998, 60924, -60850, 60775, 60700, 60624, 60547, 60470, 60392, 60313, 60235, 60155, 60075, -59994, 59913, 59831, 59749, 59666, 59583, 59499, 59414, 59329, 59243, 59157, -59070, 58983, 58895, 58807, 58718, 58628, 58538, 58447, 58356, 58264, 58172, -58079, 57986, 57892, 57797, 57702, 57606, 57510, 57414, 57316, 57219, 57120, -57022, 56922, 56822, 56722, 56621, 56519, 56417, 56315, 56212, 56108, 56004, -55899, 55794, 55688, 55582, 55475, 55368, 55260, 55152, 55043, 54933, 54823, -54713, 54602, 54491, 54379, 54266, 54153, 54040, 53926, 53811, 53696, 53581, -53465, 53348, 53231, 53114, 52996, 52877, 52758, 52639, 52518, 52398, 52277, -52155, 52033, 51911, 51788, 51665, 51541, 51416, 51291, 51166, 51040, 50914, -50787, 50660, 50532, 50403, 50275, 50146, 50016, 49886, 49755, 49624, 49492, -49360, 49228, 49095, 48961, 48828, 48693, 48558, 48423, 48288, 48151, 48015, -47878, 47740, 47602, 47464, 47325, 47186, 47046, 46906, 46765, 46624, 46482, -46340, 46198, 46055, 45912, 45768, 45624, 45480, 45335, 45189, 45043, 44897, -44750, 44603, 44456, 44308, 44160, 44011, 43862, 43712, 43562, 43412, 43261, -43110, 42958, 42806, 42653, 42501, 42347, 42194, 42040, 41885, 41730, 41575, -41419, 41263, 41107, 40950, 40793, 40636, 40478, 40319, 40161, 40002, 39842, -39682, 39522, 39362, 39201, 39039, 38878, 38716, 38553, 38390, 38227, 38064, -37900, 37736, 37571, 37406, 37241, 37075, 36909, 36743, 36576, 36409, 36242, -36074, 35906, 35738, 35569, 35400, 35231, 35061, 34891, 34721, 34550, 34379, -34208, 34036, 33864, 33692, 33519, 33346, 33173, 32999, 32826, 32651, 32477, -32302, 32127, 31952, 31776, 31600, 31424, 31247, 31070, 30893, 30715, 30538, -30360, 30181, 30003, 29824, 29645, 29465, 29285, 29105, 28925, 28745, 28564, -28383, 28201, 28020, 27838, 27656, 27473, 27291, 27108, 26925, 26741, 26557, -26373, 26189, 26005, 25820, 25635, 25450, 25265, 25079, 24893, 24707, 24521, -24334, 24147, 23960, 23773, 23586, 23398, 23210, 23022, 22833, 22645, 22456, -22267, 22078, 21889, 21699, 21509, 21319, 21129, 20938, 20748, 20557, 20366, -20175, 19983, 19792, 19600, 19408, 19216, 19024, 18831, 18638, 18446, 18253, -18059, 17866, 17672, 17479, 17285, 17091, 16897, 16702, 16508, 16313, 16118, -15923, 15728, 15533, 15338, 15142, 14946, 14751, 14555, 14359, 14162, 13966, -13769, 13573, 13376, 13179, 12982, 12785, 12588, 12390, 12193, 11995, 11797, -11600, 11402, 11204, 11006, 10807, 10609, 10410, 10212, 10013, 9814, 9616, 9417, -9218, 9019, 8819, 8620, 8421, 8221, 8022, 7822, 7623, 7423, 7223, 7023, 6823, -6623, 6423, 6223, 6023, 5823, 5622, 5422, 5222, 5021, 4821, 4620, 4420, 4219, -4018, 3818, 3617, 3416, 3215, 3014, 2814, 2613, 2412, 2211, 2010, 1809, 1608, -1407, 1206, 1005, 804, 603, 402, 201, 0, -201, -402, -603, -804, -1005, -1206, --1407, -1608, -1809, -2010, -2211, -2412, -2613, -2814, -3014, -3215, -3416, --3617, -3818, -4018, -4219, -4420, -4620, -4821, -5021, -5222, -5422, -5622, --5823, -6023, -6223, -6423, -6623, -6823, -7023, -7223, -7423, -7623, -7822, --8022, -8221, -8421, -8620, -8819, -9019, -9218, -9417, -9616, -9814, -10013, --10212, -10410, -10609, -10807, -11006, -11204, -11402, -11600, -11797, -11995, --12193, -12390, -12588, -12785, -12982, -13179, -13376, -13573, -13769, -13966, --14162, -14359, -14555, -14751, -14946, -15142, -15338, -15533, -15728, -15923, --16118, -16313, -16508, -16702, -16897, -17091, -17285, -17479, -17672, -17866, --18059, -18253, -18446, -18638, -18831, -19024, -19216, -19408, -19600, -19792, --19983, -20175, -20366, -20557, -20748, -20938, -21129, -21319, -21509, -21699, --21889, -22078, -22267, -22456, -22645, -22833, -23022, -23210, -23398, -23586, --23773, -23960, -24147, -24334, -24521, -24707, -24893, -25079, -25265, -25450, --25635, -25820, -26005, -26189, -26373, -26557, -26741, -26925, -27108, -27291, --27473, -27656, -27838, -28020, -28201, -28383, -28564, -28745, -28925, -29105, --29285, -29465, -29645, -29824, -30003, -30181, -30360, -30538, -30715, -30893, --31070, -31247, -31424, -31600, -31776, -31952, -32127, -32302, -32477, -32651, --32826, -32999, -33173, -33346, -33519, -33692, -33864, -34036, -34208, -34379, --34550, -34721, -34891, -35061, -35231, -35400, -35569, -35738, -35906, -36074, --36242, -36409, -36576, -36743, -36909, -37075, -37241, -37406, -37571, -37736, --37900, -38064, -38227, -38390, -38553, -38716, -38878, -39039, -39201, -39362, --39522, -39682, -39842, -40002, -40161, -40319, -40478, -40636, -40793, -40950, --41107, -41263, -41419, -41575, -41730, -41885, -42040, -42194, -42347, -42501, --42653, -42806, -42958, -43110, -43261, -43412, -43562, -43712, -43862, -44011, --44160, -44308, -44456, -44603, -44750, -44897, -45043, -45189, -45335, -45480, --45624, -45768, -45912, -46055, -46198, -46340, -46482, -46624, -46765, -46906, --47046, -47186, -47325, -47464, -47602, -47740, -47878, -48015, -48151, -48288, --48423, -48558, -48693, -48828, -48961, -49095, -49228, -49360, -49492, -49624, --49755, -49886, -50016, -50146, -50275, -50403, -50532, -50660, -50787, -50914, --51040, -51166, -51291, -51416, -51541, -51665, -51788, -51911, -52033, -52155, --52277, -52398, -52518, -52639, -52758, -52877, -52996, -53114, -53231, -53348, --53465, -53581, -53696, -53811, -53926, -54040, -54153, -54266, -54379, -54491, --54602, -54713, -54823, -54933, -55043, -55152, -55260, -55368, -55475, -55582, --55688, -55794, -55899, -56004, -56108, -56212, -56315, -56417, -56519, -56621, --56722, -56822, -56922, -57022, -57120, -57219, -57316, -57414, -57510, -57606, --57702, -57797, -57892, -57986, -58079, -58172, -58264, -58356, -58447, -58538, --58628, -58718, -58807, -58895, -58983, -59070, -59157, -59243, -59329, -59414, --59499, -59583, -59666, -59749, -59831, -59913, -59994, -60075, -60155, -60235, --60313, -60392, -60470, -60547, -60624, -60700, -60775, -60850, -60924, -60998, --61071, -61144, -61216, -61288, -61359, -61429, -61499, -61568, -61637, -61705, --61772, -61839, -61905, -61971, -62036, -62100, -62164, -62228, -62291, -62353, --62414, -62475, -62536, -62596, -62655, -62714, -62772, -62829, -62886, -62942, --62998, -63053, -63108, -63162, -63215, -63268, -63320, -63371, -63422, -63473, --63522, -63571, -63620, -63668, -63715, -63762, -63808, -63854, -63899, -63943, --63987, -64030, -64073, -64115, -64156, -64197, -64237, -64276, -64315, -64353, --64391, -64428, -64465, -64501, -64536, -64571, -64605, -64638, -64671, -64703, --64735, -64766, -64796, -64826, -64855, -64884, -64912, -64939, -64966, -64992, --65018, -65043, -65067, -65091, -65114, -65136, -65158, -65179, -65200, -65220, --65239, -65258, -65276, -65294, -65311, -65327, -65343, -65358, -65372, -65386, --65400, -65412, -65424, -65436, -65446, -65457, -65466, -65475, -65483, -65491, --65498, -65505, -65511, -65516, -65520, -65524, -65528, -65531, -65533, -65534, --65535, -65536, -65535, -65534, -65533, -65531, -65528, -65524, -65520, -65516, --65511, -65505, -65498, -65491, -65483, -65475, -65466, -65457, -65446, -65436, --65424, -65412, -65400, -65386, -65372, -65358, -65343, -65327, -65311, -65294, --65276, -65258, -65239, -65220, -65200, -65179, -65158, -65136, -65114, -65091, --65067, -65043, -65018, -64992, -64966, -64939, -64912, -64884, -64855, -64826, --64796, -64766, -64735, -64703, -64671, -64638, -64605, -64571, -64536, -64501, --64465, -64428, -64391, -64353, -64315, -64276, -64237, -64197, -64156, -64115, --64073, -64030, -63987, -63943, -63899, -63854, -63808, -63762, -63715, -63668, --63620, -63571, -63522, -63473, -63422, -63371, -63320, -63268, -63215, -63162, --63108, -63053, -62998, -62942, -62886, -62829, -62772, -62714, -62655, -62596, --62536, -62475, -62414, -62353, -62291, -62228, -62164, -62100, -62036, -61971, --61905, -61839, -61772, -61705, -61637, -61568, -61499, -61429, -61359, -61288, --61216, -61144, -61071, -60998, -60924, -60850, -60775, -60700, -60624, -60547, --60470, -60392, -60313, -60235, -60155, -60075, -59994, -59913, -59831, -59749, --59666, -59583, -59499, -59414, -59329, -59243, -59157, -59070, -58983, -58895, --58807, -58718, -58628, -58538, -58447, -58356, -58264, -58172, -58079, -57986, --57892, -57797, -57702, -57606, -57510, -57414, -57316, -57219, -57120, -57022, --56922, -56822, -56722, -56621, -56519, -56417, -56315, -56212, -56108, -56004, --55899, -55794, -55688, -55582, -55475, -55368, -55260, -55152, -55043, -54933, --54823, -54713, -54602, -54491, -54379, -54266, -54153, -54040, -53926, -53811, --53696, -53581, -53465, -53348, -53231, -53114, -52996, -52877, -52758, -52639, --52518, -52398, -52277, -52155, -52033, -51911, -51788, -51665, -51541, -51416, --51291, -51166, -51040, -50914, -50787, -50660, -50532, -50403, -50275, -50146, --50016, -49886, -49755, -49624, -49492, -49360, -49228, -49095, -48961, -48828, --48693, -48558, -48423, -48288, -48151, -48015, -47878, -47740, -47602, -47464, --47325, -47186, -47046, -46906, -46765, -46624, -46482, -46340, -46198, -46055, --45912, -45768, -45624, -45480, -45335, -45189, -45043, -44897, -44750, -44603, --44456, -44308, -44160, -44011, -43862, -43712, -43562, -43412, -43261, -43110, --42958, -42806, -42653, -42501, -42347, -42194, -42040, -41885, -41730, -41575, --41419, -41263, -41107, -40950, -40793, -40636, -40478, -40319, -40161, -40002, --39842, -39682, -39522, -39362, -39201, -39039, -38878, -38716, -38553, -38390, --38227, -38064, -37900, -37736, -37571, -37406, -37241, -37075, -36909, -36743, --36576, -36409, -36242, -36074, -35906, -35738, -35569, -35400, -35231, -35061, --34891, -34721, -34550, -34379, -34208, -34036, -33864, -33692, -33519, -33346, --33173, -32999, -32826, -32651, -32477, -32302, -32127, -31952, -31776, -31600, --31424, -31247, -31070, -30893, -30715, -30538, -30360, -30181, -30003, -29824, --29645, -29465, -29285, -29105, -28925, -28745, -28564, -28383, -28201, -28020, --27838, -27656, -27473, -27291, -27108, -26925, -26741, -26557, -26373, -26189, --26005, -25820, -25635, -25450, -25265, -25079, -24893, -24707, -24521, -24334, --24147, -23960, -23773, -23586, -23398, -23210, -23022, -22833, -22645, -22456, --22267, -22078, -21889, -21699, -21509, -21319, -21129, -20938, -20748, -20557, --20366, -20175, -19983, -19792, -19600, -19408, -19216, -19024, -18831, -18638, --18446, -18253, -18059, -17866, -17672, -17479, -17285, -17091, -16897, -16702, --16508, -16313, -16118, -15923, -15728, -15533, -15338, -15142, -14946, -14751, --14555, -14359, -14162, -13966, -13769, -13573, -13376, -13179, -12982, -12785, --12588, -12390, -12193, -11995, -11797, -11600, -11402, -11204, -11006, -10807, --10609, -10410, -10212, -10013, -9814, -9616, -9417, -9218, -9019, -8819, -8620, --8421, -8221, -8022, -7822, -7623, -7423, -7223, -7023, -6823, -6623, -6423, --6223, -6023, -5823, -5622, -5422, -5222, -5021, -4821, -4620, -4420, -4219, --4018, -3818, -3617, -3416, -3215, -3014, -2814, -2613, -2412, -2211, -2010, +0, 201, 402, 603, 804, 1005, 1206, 1407, 1608, 1809, 2010, 2211, 2412, 2613, +2814, 3014, 3215, 3416, 3617, 3818, 4018, 4219, 4420, 4620, 4821, 5021, 5222, +5422, 5622, 5823, 6023, 6223, 6423, 6623, 6823, 7023, 7223, 7423, 7623, 7822, +8022, 8221, 8421, 8620, 8819, 9019, 9218, 9417, 9616, 9814, 10013, 10212, 10410, +10609, 10807, 11006, 11204, 11402, 11600, 11797, 11995, 12193, 12390, 12588, +12785, 12982, 13179, 13376, 13573, 13769, 13966, 14162, 14359, 14555, 14751, +14946, 15142, 15338, 15533, 15728, 15923, 16118, 16313, 16508, 16702, 16897, +17091, 17285, 17479, 17672, 17866, 18059, 18253, 18446, 18638, 18831, 19024, +19216, 19408, 19600, 19792, 19983, 20175, 20366, 20557, 20748, 20938, 21129, +21319, 21509, 21699, 21889, 22078, 22267, 22456, 22645, 22833, 23022, 23210, +23398, 23586, 23773, 23960, 24147, 24334, 24521, 24707, 24893, 25079, 25265, +25450, 25635, 25820, 26005, 26189, 26373, 26557, 26741, 26925, 27108, 27291, +27473, 27656, 27838, 28020, 28201, 28383, 28564, 28745, 28925, 29105, 29285, +29465, 29645, 29824, 30003, 30181, 30360, 30538, 30715, 30893, 31070, 31247, +31424, 31600, 31776, 31952, 32127, 32302, 32477, 32651, 32826, 32999, 33173, +33346, 33519, 33692, 33864, 34036, 34208, 34379, 34550, 34721, 34891, 35061, +35231, 35400, 35569, 35738, 35906, 36074, 36242, 36409, 36576, 36743, 36909, +37075, 37241, 37406, 37571, 37736, 37900, 38064, 38227, 38390, 38553, 38716, +38878, 39039, 39201, 39362, 39522, 39682, 39842, 40002, 40161, 40319, 40478, +40636, 40793, 40950, 41107, 41263, 41419, 41575, 41730, 41885, 42040, 42194, +42347, 42501, 42653, 42806, 42958, 43110, 43261, 43412, 43562, 43712, 43862, +44011, 44160, 44308, 44456, 44603, 44750, 44897, 45043, 45189, 45335, 45480, +45624, 45768, 45912, 46055, 46198, 46340, 46482, 46624, 46765, 46906, 47046, +47186, 47325, 47464, 47602, 47740, 47878, 48015, 48151, 48288, 48423, 48558, +48693, 48828, 48961, 49095, 49228, 49360, 49492, 49624, 49755, 49886, 50016, +50146, 50275, 50403, 50532, 50660, 50787, 50914, 51040, 51166, 51291, 51416, +51541, 51665, 51788, 51911, 52033, 52155, 52277, 52398, 52518, 52639, 52758, +52877, 52996, 53114, 53231, 53348, 53465, 53581, 53696, 53811, 53926, 54040, +54153, 54266, 54379, 54491, 54602, 54713, 54823, 54933, 55043, 55152, 55260, +55368, 55475, 55582, 55688, 55794, 55899, 56004, 56108, 56212, 56315, 56417, +56519, 56621, 56722, 56822, 56922, 57022, 57120, 57219, 57316, 57414, 57510, +57606, 57702, 57797, 57892, 57986, 58079, 58172, 58264, 58356, 58447, 58538, +58628, 58718, 58807, 58895, 58983, 59070, 59157, 59243, 59329, 59414, 59499, +59583, 59666, 59749, 59831, 59913, 59994, 60075, 60155, 60235, 60313, 60392, +60470, 60547, 60624, 60700, 60775, 60850, 60924, 60998, 61071, 61144, 61216, +61288, 61359, 61429, 61499, 61568, 61637, 61705, 61772, 61839, 61905, 61971, +62036, 62100, 62164, 62228, 62291, 62353, 62414, 62475, 62536, 62596, 62655, +62714, 62772, 62829, 62886, 62942, 62998, 63053, 63108, 63162, 63215, 63268, +63320, 63371, 63422, 63473, 63522, 63571, 63620, 63668, 63715, 63762, 63808, +63854, 63899, 63943, 63987, 64030, 64073, 64115, 64156, 64197, 64237, 64276, +64315, 64353, 64391, 64428, 64465, 64501, 64536, 64571, 64605, 64638, 64671, +64703, 64735, 64766, 64796, 64826, 64855, 64884, 64912, 64939, 64966, 64992, +65018, 65043, 65067, 65091, 65114, 65136, 65158, 65179, 65200, 65220, 65239, +65258, 65276, 65294, 65311, 65327, 65343, 65358, 65372, 65386, 65400, 65412, +65424, 65436, 65446, 65457, 65466, 65475, 65483, 65491, 65498, 65505, 65511, +65516, 65520, 65524, 65528, 65531, 65533, 65534, 65535, 65536, 65535, 65534, +65533, 65531, 65528, 65524, 65520, 65516, 65511, 65505, 65498, 65491, 65483, +65475, 65466, 65457, 65446, 65436, 65424, 65412, 65400, 65386, 65372, 65358, +65343, 65327, 65311, 65294, 65276, 65258, 65239, 65220, 65200, 65179, 65158, +65136, 65114, 65091, 65067, 65043, 65018, 64992, 64966, 64939, 64912, 64884, +64855, 64826, 64796, 64766, 64735, 64703, 64671, 64638, 64605, 64571, 64536, +64501, 64465, 64428, 64391, 64353, 64315, 64276, 64237, 64197, 64156, 64115, +64073, 64030, 63987, 63943, 63899, 63854, 63808, 63762, 63715, 63668, 63620, +63571, 63522, 63473, 63422, 63371, 63320, 63268, 63215, 63162, 63108, 63053, +62998, 62942, 62886, 62829, 62772, 62714, 62655, 62596, 62536, 62475, 62414, +62353, 62291, 62228, 62164, 62100, 62036, 61971, 61905, 61839, 61772, 61705, +61637, 61568, 61499, 61429, 61359, 61288, 61216, 61144, 61071, 60998, 60924, +60850, 60775, 60700, 60624, 60547, 60470, 60392, 60313, 60235, 60155, 60075, +59994, 59913, 59831, 59749, 59666, 59583, 59499, 59414, 59329, 59243, 59157, +59070, 58983, 58895, 58807, 58718, 58628, 58538, 58447, 58356, 58264, 58172, +58079, 57986, 57892, 57797, 57702, 57606, 57510, 57414, 57316, 57219, 57120, +57022, 56922, 56822, 56722, 56621, 56519, 56417, 56315, 56212, 56108, 56004, +55899, 55794, 55688, 55582, 55475, 55368, 55260, 55152, 55043, 54933, 54823, +54713, 54602, 54491, 54379, 54266, 54153, 54040, 53926, 53811, 53696, 53581, +53465, 53348, 53231, 53114, 52996, 52877, 52758, 52639, 52518, 52398, 52277, +52155, 52033, 51911, 51788, 51665, 51541, 51416, 51291, 51166, 51040, 50914, +50787, 50660, 50532, 50403, 50275, 50146, 50016, 49886, 49755, 49624, 49492, +49360, 49228, 49095, 48961, 48828, 48693, 48558, 48423, 48288, 48151, 48015, +47878, 47740, 47602, 47464, 47325, 47186, 47046, 46906, 46765, 46624, 46482, +46340, 46198, 46055, 45912, 45768, 45624, 45480, 45335, 45189, 45043, 44897, +44750, 44603, 44456, 44308, 44160, 44011, 43862, 43712, 43562, 43412, 43261, +43110, 42958, 42806, 42653, 42501, 42347, 42194, 42040, 41885, 41730, 41575, +41419, 41263, 41107, 40950, 40793, 40636, 40478, 40319, 40161, 40002, 39842, +39682, 39522, 39362, 39201, 39039, 38878, 38716, 38553, 38390, 38227, 38064, +37900, 37736, 37571, 37406, 37241, 37075, 36909, 36743, 36576, 36409, 36242, +36074, 35906, 35738, 35569, 35400, 35231, 35061, 34891, 34721, 34550, 34379, +34208, 34036, 33864, 33692, 33519, 33346, 33173, 32999, 32826, 32651, 32477, +32302, 32127, 31952, 31776, 31600, 31424, 31247, 31070, 30893, 30715, 30538, +30360, 30181, 30003, 29824, 29645, 29465, 29285, 29105, 28925, 28745, 28564, +28383, 28201, 28020, 27838, 27656, 27473, 27291, 27108, 26925, 26741, 26557, +26373, 26189, 26005, 25820, 25635, 25450, 25265, 25079, 24893, 24707, 24521, +24334, 24147, 23960, 23773, 23586, 23398, 23210, 23022, 22833, 22645, 22456, +22267, 22078, 21889, 21699, 21509, 21319, 21129, 20938, 20748, 20557, 20366, +20175, 19983, 19792, 19600, 19408, 19216, 19024, 18831, 18638, 18446, 18253, +18059, 17866, 17672, 17479, 17285, 17091, 16897, 16702, 16508, 16313, 16118, +15923, 15728, 15533, 15338, 15142, 14946, 14751, 14555, 14359, 14162, 13966, +13769, 13573, 13376, 13179, 12982, 12785, 12588, 12390, 12193, 11995, 11797, +11600, 11402, 11204, 11006, 10807, 10609, 10410, 10212, 10013, 9814, 9616, 9417, +9218, 9019, 8819, 8620, 8421, 8221, 8022, 7822, 7623, 7423, 7223, 7023, 6823, +6623, 6423, 6223, 6023, 5823, 5622, 5422, 5222, 5021, 4821, 4620, 4420, 4219, +4018, 3818, 3617, 3416, 3215, 3014, 2814, 2613, 2412, 2211, 2010, 1809, 1608, +1407, 1206, 1005, 804, 603, 402, 201, 0, -201, -402, -603, -804, -1005, -1206, +-1407, -1608, -1809, -2010, -2211, -2412, -2613, -2814, -3014, -3215, -3416, +-3617, -3818, -4018, -4219, -4420, -4620, -4821, -5021, -5222, -5422, -5622, +-5823, -6023, -6223, -6423, -6623, -6823, -7023, -7223, -7423, -7623, -7822, +-8022, -8221, -8421, -8620, -8819, -9019, -9218, -9417, -9616, -9814, -10013, +-10212, -10410, -10609, -10807, -11006, -11204, -11402, -11600, -11797, -11995, +-12193, -12390, -12588, -12785, -12982, -13179, -13376, -13573, -13769, -13966, +-14162, -14359, -14555, -14751, -14946, -15142, -15338, -15533, -15728, -15923, +-16118, -16313, -16508, -16702, -16897, -17091, -17285, -17479, -17672, -17866, +-18059, -18253, -18446, -18638, -18831, -19024, -19216, -19408, -19600, -19792, +-19983, -20175, -20366, -20557, -20748, -20938, -21129, -21319, -21509, -21699, +-21889, -22078, -22267, -22456, -22645, -22833, -23022, -23210, -23398, -23586, +-23773, -23960, -24147, -24334, -24521, -24707, -24893, -25079, -25265, -25450, +-25635, -25820, -26005, -26189, -26373, -26557, -26741, -26925, -27108, -27291, +-27473, -27656, -27838, -28020, -28201, -28383, -28564, -28745, -28925, -29105, +-29285, -29465, -29645, -29824, -30003, -30181, -30360, -30538, -30715, -30893, +-31070, -31247, -31424, -31600, -31776, -31952, -32127, -32302, -32477, -32651, +-32826, -32999, -33173, -33346, -33519, -33692, -33864, -34036, -34208, -34379, +-34550, -34721, -34891, -35061, -35231, -35400, -35569, -35738, -35906, -36074, +-36242, -36409, -36576, -36743, -36909, -37075, -37241, -37406, -37571, -37736, +-37900, -38064, -38227, -38390, -38553, -38716, -38878, -39039, -39201, -39362, +-39522, -39682, -39842, -40002, -40161, -40319, -40478, -40636, -40793, -40950, +-41107, -41263, -41419, -41575, -41730, -41885, -42040, -42194, -42347, -42501, +-42653, -42806, -42958, -43110, -43261, -43412, -43562, -43712, -43862, -44011, +-44160, -44308, -44456, -44603, -44750, -44897, -45043, -45189, -45335, -45480, +-45624, -45768, -45912, -46055, -46198, -46340, -46482, -46624, -46765, -46906, +-47046, -47186, -47325, -47464, -47602, -47740, -47878, -48015, -48151, -48288, +-48423, -48558, -48693, -48828, -48961, -49095, -49228, -49360, -49492, -49624, +-49755, -49886, -50016, -50146, -50275, -50403, -50532, -50660, -50787, -50914, +-51040, -51166, -51291, -51416, -51541, -51665, -51788, -51911, -52033, -52155, +-52277, -52398, -52518, -52639, -52758, -52877, -52996, -53114, -53231, -53348, +-53465, -53581, -53696, -53811, -53926, -54040, -54153, -54266, -54379, -54491, +-54602, -54713, -54823, -54933, -55043, -55152, -55260, -55368, -55475, -55582, +-55688, -55794, -55899, -56004, -56108, -56212, -56315, -56417, -56519, -56621, +-56722, -56822, -56922, -57022, -57120, -57219, -57316, -57414, -57510, -57606, +-57702, -57797, -57892, -57986, -58079, -58172, -58264, -58356, -58447, -58538, +-58628, -58718, -58807, -58895, -58983, -59070, -59157, -59243, -59329, -59414, +-59499, -59583, -59666, -59749, -59831, -59913, -59994, -60075, -60155, -60235, +-60313, -60392, -60470, -60547, -60624, -60700, -60775, -60850, -60924, -60998, +-61071, -61144, -61216, -61288, -61359, -61429, -61499, -61568, -61637, -61705, +-61772, -61839, -61905, -61971, -62036, -62100, -62164, -62228, -62291, -62353, +-62414, -62475, -62536, -62596, -62655, -62714, -62772, -62829, -62886, -62942, +-62998, -63053, -63108, -63162, -63215, -63268, -63320, -63371, -63422, -63473, +-63522, -63571, -63620, -63668, -63715, -63762, -63808, -63854, -63899, -63943, +-63987, -64030, -64073, -64115, -64156, -64197, -64237, -64276, -64315, -64353, +-64391, -64428, -64465, -64501, -64536, -64571, -64605, -64638, -64671, -64703, +-64735, -64766, -64796, -64826, -64855, -64884, -64912, -64939, -64966, -64992, +-65018, -65043, -65067, -65091, -65114, -65136, -65158, -65179, -65200, -65220, +-65239, -65258, -65276, -65294, -65311, -65327, -65343, -65358, -65372, -65386, +-65400, -65412, -65424, -65436, -65446, -65457, -65466, -65475, -65483, -65491, +-65498, -65505, -65511, -65516, -65520, -65524, -65528, -65531, -65533, -65534, +-65535, -65536, -65535, -65534, -65533, -65531, -65528, -65524, -65520, -65516, +-65511, -65505, -65498, -65491, -65483, -65475, -65466, -65457, -65446, -65436, +-65424, -65412, -65400, -65386, -65372, -65358, -65343, -65327, -65311, -65294, +-65276, -65258, -65239, -65220, -65200, -65179, -65158, -65136, -65114, -65091, +-65067, -65043, -65018, -64992, -64966, -64939, -64912, -64884, -64855, -64826, +-64796, -64766, -64735, -64703, -64671, -64638, -64605, -64571, -64536, -64501, +-64465, -64428, -64391, -64353, -64315, -64276, -64237, -64197, -64156, -64115, +-64073, -64030, -63987, -63943, -63899, -63854, -63808, -63762, -63715, -63668, +-63620, -63571, -63522, -63473, -63422, -63371, -63320, -63268, -63215, -63162, +-63108, -63053, -62998, -62942, -62886, -62829, -62772, -62714, -62655, -62596, +-62536, -62475, -62414, -62353, -62291, -62228, -62164, -62100, -62036, -61971, +-61905, -61839, -61772, -61705, -61637, -61568, -61499, -61429, -61359, -61288, +-61216, -61144, -61071, -60998, -60924, -60850, -60775, -60700, -60624, -60547, +-60470, -60392, -60313, -60235, -60155, -60075, -59994, -59913, -59831, -59749, +-59666, -59583, -59499, -59414, -59329, -59243, -59157, -59070, -58983, -58895, +-58807, -58718, -58628, -58538, -58447, -58356, -58264, -58172, -58079, -57986, +-57892, -57797, -57702, -57606, -57510, -57414, -57316, -57219, -57120, -57022, +-56922, -56822, -56722, -56621, -56519, -56417, -56315, -56212, -56108, -56004, +-55899, -55794, -55688, -55582, -55475, -55368, -55260, -55152, -55043, -54933, +-54823, -54713, -54602, -54491, -54379, -54266, -54153, -54040, -53926, -53811, +-53696, -53581, -53465, -53348, -53231, -53114, -52996, -52877, -52758, -52639, +-52518, -52398, -52277, -52155, -52033, -51911, -51788, -51665, -51541, -51416, +-51291, -51166, -51040, -50914, -50787, -50660, -50532, -50403, -50275, -50146, +-50016, -49886, -49755, -49624, -49492, -49360, -49228, -49095, -48961, -48828, +-48693, -48558, -48423, -48288, -48151, -48015, -47878, -47740, -47602, -47464, +-47325, -47186, -47046, -46906, -46765, -46624, -46482, -46340, -46198, -46055, +-45912, -45768, -45624, -45480, -45335, -45189, -45043, -44897, -44750, -44603, +-44456, -44308, -44160, -44011, -43862, -43712, -43562, -43412, -43261, -43110, +-42958, -42806, -42653, -42501, -42347, -42194, -42040, -41885, -41730, -41575, +-41419, -41263, -41107, -40950, -40793, -40636, -40478, -40319, -40161, -40002, +-39842, -39682, -39522, -39362, -39201, -39039, -38878, -38716, -38553, -38390, +-38227, -38064, -37900, -37736, -37571, -37406, -37241, -37075, -36909, -36743, +-36576, -36409, -36242, -36074, -35906, -35738, -35569, -35400, -35231, -35061, +-34891, -34721, -34550, -34379, -34208, -34036, -33864, -33692, -33519, -33346, +-33173, -32999, -32826, -32651, -32477, -32302, -32127, -31952, -31776, -31600, +-31424, -31247, -31070, -30893, -30715, -30538, -30360, -30181, -30003, -29824, +-29645, -29465, -29285, -29105, -28925, -28745, -28564, -28383, -28201, -28020, +-27838, -27656, -27473, -27291, -27108, -26925, -26741, -26557, -26373, -26189, +-26005, -25820, -25635, -25450, -25265, -25079, -24893, -24707, -24521, -24334, +-24147, -23960, -23773, -23586, -23398, -23210, -23022, -22833, -22645, -22456, +-22267, -22078, -21889, -21699, -21509, -21319, -21129, -20938, -20748, -20557, +-20366, -20175, -19983, -19792, -19600, -19408, -19216, -19024, -18831, -18638, +-18446, -18253, -18059, -17866, -17672, -17479, -17285, -17091, -16897, -16702, +-16508, -16313, -16118, -15923, -15728, -15533, -15338, -15142, -14946, -14751, +-14555, -14359, -14162, -13966, -13769, -13573, -13376, -13179, -12982, -12785, +-12588, -12390, -12193, -11995, -11797, -11600, -11402, -11204, -11006, -10807, +-10609, -10410, -10212, -10013, -9814, -9616, -9417, -9218, -9019, -8819, -8620, +-8421, -8221, -8022, -7822, -7623, -7423, -7223, -7023, -6823, -6623, -6423, +-6223, -6023, -5823, -5622, -5422, -5222, -5021, -4821, -4620, -4420, -4219, +-4018, -3818, -3617, -3416, -3215, -3014, -2814, -2613, -2412, -2211, -2010, -1809, -1608, -1407, -1206, -1005, -804, -603, -402, -201 }; int FCosTab[2048] = { -65536, 65535, 65534, 65533, 65531, 65528, 65524, 65520, 65516, 65511, 65505, -65498, 65491, 65483, 65475, 65466, 65457, 65446, 65436, 65424, 65412, 65400, -65386, 65372, 65358, 65343, 65327, 65311, 65294, 65276, 65258, 65239, 65220, -65200, 65179, 65158, 65136, 65114, 65091, 65067, 65043, 65018, 64992, 64966, -64939, 64912, 64884, 64855, 64826, 64796, 64766, 64735, 64703, 64671, 64638, -64605, 64571, 64536, 64501, 64465, 64428, 64391, 64353, 64315, 64276, 64237, -64197, 64156, 64115, 64073, 64030, 63987, 63943, 63899, 63854, 63808, 63762, -63715, 63668, 63620, 63571, 63522, 63473, 63422, 63371, 63320, 63268, 63215, -63162, 63108, 63053, 62998, 62942, 62886, 62829, 62772, 62714, 62655, 62596, -62536, 62475, 62414, 62353, 62291, 62228, 62164, 62100, 62036, 61971, 61905, -61839, 61772, 61705, 61637, 61568, 61499, 61429, 61359, 61288, 61216, 61144, -61071, 60998, 60924, 60850, 60775, 60700, 60624, 60547, 60470, 60392, 60313, -60235, 60155, 60075, 59994, 59913, 59831, 59749, 59666, 59583, 59499, 59414, -59329, 59243, 59157, 59070, 58983, 58895, 58807, 58718, 58628, 58538, 58447, -58356, 58264, 58172, 58079, 57986, 57892, 57797, 57702, 57606, 57510, 57414, -57316, 57219, 57120, 57022, 56922, 56822, 56722, 56621, 56519, 56417, 56315, -56212, 56108, 56004, 55899, 55794, 55688, 55582, 55475, 55368, 55260, 55152, -55043, 54933, 54823, 54713, 54602, 54491, 54379, 54266, 54153, 54040, 53926, -53811, 53696, 53581, 53465, 53348, 53231, 53114, 52996, 52877, 52758, 52639, -52518, 52398, 52277, 52155, 52033, 51911, 51788, 51665, 51541, 51416, 51291, -51166, 51040, 50914, 50787, 50660, 50532, 50403, 50275, 50146, 50016, 49886, -49755, 49624, 49492, 49360, 49228, 49095, 48961, 48828, 48693, 48558, 48423, -48288, 48151, 48015, 47878, 47740, 47602, 47464, 47325, 47186, 47046, 46906, -46765, 46624, 46482, 46340, 46198, 46055, 45912, 45768, 45624, 45480, 45335, -45189, 45043, 44897, 44750, 44603, 44456, 44308, 44160, 44011, 43862, 43712, -43562, 43412, 43261, 43110, 42958, 42806, 42653, 42501, 42347, 42194, 42040, -41885, 41730, 41575, 41419, 41263, 41107, 40950, 40793, 40636, 40478, 40319, -40161, 40002, 39842, 39682, 39522, 39362, 39201, 39039, 38878, 38716, 38553, -38390, 38227, 38064, 37900, 37736, 37571, 37406, 37241, 37075, 36909, 36743, -36576, 36409, 36242, 36074, 35906, 35738, 35569, 35400, 35231, 35061, 34891, -34721, 34550, 34379, 34208, 34036, 33864, 33692, 33519, 33346, 33173, 32999, -32826, 32651, 32477, 32302, 32127, 31952, 31776, 31600, 31424, 31247, 31070, -30893, 30715, 30538, 30360, 30181, 30003, 29824, 29645, 29465, 29285, 29105, -28925, 28745, 28564, 28383, 28201, 28020, 27838, 27656, 27473, 27291, 27108, -26925, 26741, 26557, 26373, 26189, 26005, 25820, 25635, 25450, 25265, 25079, -24893, 24707, 24521, 24334, 24147, 23960, 23773, 23586, 23398, 23210, 23022, -22833, 22645, 22456, 22267, 22078, 21889, 21699, 21509, 21319, 21129, 20938, -20748, 20557, 20366, 20175, 19983, 19792, 19600, 19408, 19216, 19024, 18831, -18638, 18446, 18253, 18059, 17866, 17672, 17479, 17285, 17091, 16897, 16702, -16508, 16313, 16118, 15923, 15728, 15533, 15338, 15142, 14946, 14751, 14555, -14359, 14162, 13966, 13769, 13573, 13376, 13179, 12982, 12785, 12588, 12390, -12193, 11995, 11797, 11600, 11402, 11204, 11006, 10807, 10609, 10410, 10212, -10013, 9814, 9616, 9417, 9218, 9019, 8819, 8620, 8421, 8221, 8022, 7822, 7623, -7423, 7223, 7023, 6823, 6623, 6423, 6223, 6023, 5823, 5622, 5422, 5222, 5021, -4821, 4620, 4420, 4219, 4018, 3818, 3617, 3416, 3215, 3014, 2814, 2613, 2412, -2211, 2010, 1809, 1608, 1407, 1206, 1005, 804, 603, 402, 201, 0, -201, -402, --603, -804, -1005, -1206, -1407, -1608, -1809, -2010, -2211, -2412, -2613, -2814, --3014, -3215, -3416, -3617, -3818, -4018, -4219, -4420, -4620, -4821, -5021, --5222, -5422, -5622, -5823, -6023, -6223, -6423, -6623, -6823, -7023, -7223, --7423, -7623, -7822, -8022, -8221, -8421, -8620, -8819, -9019, -9218, -9417, --9616, -9814, -10013, -10212, -10410, -10609, -10807, -11006, -11204, -11402, --11600, -11797, -11995, -12193, -12390, -12588, -12785, -12982, -13179, -13376, --13573, -13769, -13966, -14162, -14359, -14555, -14751, -14946, -15142, -15338, --15533, -15728, -15923, -16118, -16313, -16508, -16702, -16897, -17091, -17285, --17479, -17672, -17866, -18059, -18253, -18446, -18638, -18831, -19024, -19216, --19408, -19600, -19792, -19983, -20175, -20366, -20557, -20748, -20938, -21129, --21319, -21509, -21699, -21889, -22078, -22267, -22456, -22645, -22833, -23022, --23210, -23398, -23586, -23773, -23960, -24147, -24334, -24521, -24707, -24893, --25079, -25265, -25450, -25635, -25820, -26005, -26189, -26373, -26557, -26741, --26925, -27108, -27291, -27473, -27656, -27838, -28020, -28201, -28383, -28564, --28745, -28925, -29105, -29285, -29465, -29645, -29824, -30003, -30181, -30360, --30538, -30715, -30893, -31070, -31247, -31424, -31600, -31776, -31952, -32127, --32302, -32477, -32651, -32826, -32999, -33173, -33346, -33519, -33692, -33864, --34036, -34208, -34379, -34550, -34721, -34891, -35061, -35231, -35400, -35569, --35738, -35906, -36074, -36242, -36409, -36576, -36743, -36909, -37075, -37241, --37406, -37571, -37736, -37900, -38064, -38227, -38390, -38553, -38716, -38878, --39039, -39201, -39362, -39522, -39682, -39842, -40002, -40161, -40319, -40478, --40636, -40793, -40950, -41107, -41263, -41419, -41575, -41730, -41885, -42040, --42194, -42347, -42501, -42653, -42806, -42958, -43110, -43261, -43412, -43562, --43712, -43862, -44011, -44160, -44308, -44456, -44603, -44750, -44897, -45043, --45189, -45335, -45480, -45624, -45768, -45912, -46055, -46198, -46340, -46482, --46624, -46765, -46906, -47046, -47186, -47325, -47464, -47602, -47740, -47878, --48015, -48151, -48288, -48423, -48558, -48693, -48828, -48961, -49095, -49228, --49360, -49492, -49624, -49755, -49886, -50016, -50146, -50275, -50403, -50532, --50660, -50787, -50914, -51040, -51166, -51291, -51416, -51541, -51665, -51788, --51911, -52033, -52155, -52277, -52398, -52518, -52639, -52758, -52877, -52996, --53114, -53231, -53348, -53465, -53581, -53696, -53811, -53926, -54040, -54153, --54266, -54379, -54491, -54602, -54713, -54823, -54933, -55043, -55152, -55260, --55368, -55475, -55582, -55688, -55794, -55899, -56004, -56108, -56212, -56315, --56417, -56519, -56621, -56722, -56822, -56922, -57022, -57120, -57219, -57316, --57414, -57510, -57606, -57702, -57797, -57892, -57986, -58079, -58172, -58264, --58356, -58447, -58538, -58628, -58718, -58807, -58895, -58983, -59070, -59157, --59243, -59329, -59414, -59499, -59583, -59666, -59749, -59831, -59913, -59994, --60075, -60155, -60235, -60313, -60392, -60470, -60547, -60624, -60700, -60775, --60850, -60924, -60998, -61071, -61144, -61216, -61288, -61359, -61429, -61499, --61568, -61637, -61705, -61772, -61839, -61905, -61971, -62036, -62100, -62164, --62228, -62291, -62353, -62414, -62475, -62536, -62596, -62655, -62714, -62772, --62829, -62886, -62942, -62998, -63053, -63108, -63162, -63215, -63268, -63320, --63371, -63422, -63473, -63522, -63571, -63620, -63668, -63715, -63762, -63808, --63854, -63899, -63943, -63987, -64030, -64073, -64115, -64156, -64197, -64237, --64276, -64315, -64353, -64391, -64428, -64465, -64501, -64536, -64571, -64605, --64638, -64671, -64703, -64735, -64766, -64796, -64826, -64855, -64884, -64912, --64939, -64966, -64992, -65018, -65043, -65067, -65091, -65114, -65136, -65158, --65179, -65200, -65220, -65239, -65258, -65276, -65294, -65311, -65327, -65343, --65358, -65372, -65386, -65400, -65412, -65424, -65436, -65446, -65457, -65466, --65475, -65483, -65491, -65498, -65505, -65511, -65516, -65520, -65524, -65528, --65531, -65533, -65534, -65535, -65536, -65535, -65534, -65533, -65531, -65528, --65524, -65520, -65516, -65511, -65505, -65498, -65491, -65483, -65475, -65466, --65457, -65446, -65436, -65424, -65412, -65400, -65386, -65372, -65358, -65343, --65327, -65311, -65294, -65276, -65258, -65239, -65220, -65200, -65179, -65158, --65136, -65114, -65091, -65067, -65043, -65018, -64992, -64966, -64939, -64912, --64884, -64855, -64826, -64796, -64766, -64735, -64703, -64671, -64638, -64605, --64571, -64536, -64501, -64465, -64428, -64391, -64353, -64315, -64276, -64237, --64197, -64156, -64115, -64073, -64030, -63987, -63943, -63899, -63854, -63808, --63762, -63715, -63668, -63620, -63571, -63522, -63473, -63422, -63371, -63320, --63268, -63215, -63162, -63108, -63053, -62998, -62942, -62886, -62829, -62772, --62714, -62655, -62596, -62536, -62475, -62414, -62353, -62291, -62228, -62164, --62100, -62036, -61971, -61905, -61839, -61772, -61705, -61637, -61568, -61499, --61429, -61359, -61288, -61216, -61144, -61071, -60998, -60924, -60850, -60775, --60700, -60624, -60547, -60470, -60392, -60313, -60235, -60155, -60075, -59994, --59913, -59831, -59749, -59666, -59583, -59499, -59414, -59329, -59243, -59157, --59070, -58983, -58895, -58807, -58718, -58628, -58538, -58447, -58356, -58264, --58172, -58079, -57986, -57892, -57797, -57702, -57606, -57510, -57414, -57316, --57219, -57120, -57022, -56922, -56822, -56722, -56621, -56519, -56417, -56315, --56212, -56108, -56004, -55899, -55794, -55688, -55582, -55475, -55368, -55260, --55152, -55043, -54933, -54823, -54713, -54602, -54491, -54379, -54266, -54153, --54040, -53926, -53811, -53696, -53581, -53465, -53348, -53231, -53114, -52996, --52877, -52758, -52639, -52518, -52398, -52277, -52155, -52033, -51911, -51788, --51665, -51541, -51416, -51291, -51166, -51040, -50914, -50787, -50660, -50532, --50403, -50275, -50146, -50016, -49886, -49755, -49624, -49492, -49360, -49228, --49095, -48961, -48828, -48693, -48558, -48423, -48288, -48151, -48015, -47878, --47740, -47602, -47464, -47325, -47186, -47046, -46906, -46765, -46624, -46482, --46340, -46198, -46055, -45912, -45768, -45624, -45480, -45335, -45189, -45043, --44897, -44750, -44603, -44456, -44308, -44160, -44011, -43862, -43712, -43562, --43412, -43261, -43110, -42958, -42806, -42653, -42501, -42347, -42194, -42040, --41885, -41730, -41575, -41419, -41263, -41107, -40950, -40793, -40636, -40478, --40319, -40161, -40002, -39842, -39682, -39522, -39362, -39201, -39039, -38878, --38716, -38553, -38390, -38227, -38064, -37900, -37736, -37571, -37406, -37241, --37075, -36909, -36743, -36576, -36409, -36242, -36074, -35906, -35738, -35569, --35400, -35231, -35061, -34891, -34721, -34550, -34379, -34208, -34036, -33864, --33692, -33519, -33346, -33173, -32999, -32826, -32651, -32477, -32302, -32127, --31952, -31776, -31600, -31424, -31247, -31070, -30893, -30715, -30538, -30360, --30181, -30003, -29824, -29645, -29465, -29285, -29105, -28925, -28745, -28564, --28383, -28201, -28020, -27838, -27656, -27473, -27291, -27108, -26925, -26741, --26557, -26373, -26189, -26005, -25820, -25635, -25450, -25265, -25079, -24893, --24707, -24521, -24334, -24147, -23960, -23773, -23586, -23398, -23210, -23022, --22833, -22645, -22456, -22267, -22078, -21889, -21699, -21509, -21319, -21129, --20938, -20748, -20557, -20366, -20175, -19983, -19792, -19600, -19408, -19216, --19024, -18831, -18638, -18446, -18253, -18059, -17866, -17672, -17479, -17285, --17091, -16897, -16702, -16508, -16313, -16118, -15923, -15728, -15533, -15338, --15142, -14946, -14751, -14555, -14359, -14162, -13966, -13769, -13573, -13376, --13179, -12982, -12785, -12588, -12390, -12193, -11995, -11797, -11600, -11402, --11204, -11006, -10807, -10609, -10410, -10212, -10013, -9814, -9616, -9417, --9218, -9019, -8819, -8620, -8421, -8221, -8022, -7822, -7623, -7423, -7223, --7023, -6823, -6623, -6423, -6223, -6023, -5823, -5622, -5422, -5222, -5021, --4821, -4620, -4420, -4219, -4018, -3818, -3617, -3416, -3215, -3014, -2814, --2613, -2412, -2211, -2010, -1809, -1608, -1407, -1206, -1005, -804, -603, -402, --201, 0, 201, 402, 603, 804, 1005, 1206, 1407, 1608, 1809, 2010, 2211, 2412, -2613, 2814, 3014, 3215, 3416, 3617, 3818, 4018, 4219, 4420, 4620, 4821, 5021, -5222, 5422, 5622, 5823, 6023, 6223, 6423, 6623, 6823, 7023, 7223, 7423, 7623, -7822, 8022, 8221, 8421, 8620, 8819, 9019, 9218, 9417, 9616, 9814, 10013, 10212, -10410, 10609, 10807, 11006, 11204, 11402, 11600, 11797, 11995, 12193, 12390, -12588, 12785, 12982, 13179, 13376, 13573, 13769, 13966, 14162, 14359, 14555, -14751, 14946, 15142, 15338, 15533, 15728, 15923, 16118, 16313, 16508, 16702, -16897, 17091, 17285, 17479, 17672, 17866, 18059, 18253, 18446, 18638, 18831, -19024, 19216, 19408, 19600, 19792, 19983, 20175, 20366, 20557, 20748, 20938, -21129, 21319, 21509, 21699, 21889, 22078, 22267, 22456, 22645, 22833, 23022, -23210, 23398, 23586, 23773, 23960, 24147, 24334, 24521, 24707, 24893, 25079, -25265, 25450, 25635, 25820, 26005, 26189, 26373, 26557, 26741, 26925, 27108, -27291, 27473, 27656, 27838, 28020, 28201, 28383, 28564, 28745, 28925, 29105, -29285, 29465, 29645, 29824, 30003, 30181, 30360, 30538, 30715, 30893, 31070, -31247, 31424, 31600, 31776, 31952, 32127, 32302, 32477, 32651, 32826, 32999, -33173, 33346, 33519, 33692, 33864, 34036, 34208, 34379, 34550, 34721, 34891, -35061, 35231, 35400, 35569, 35738, 35906, 36074, 36242, 36409, 36576, 36743, -36909, 37075, 37241, 37406, 37571, 37736, 37900, 38064, 38227, 38390, 38553, -38716, 38878, 39039, 39201, 39362, 39522, 39682, 39842, 40002, 40161, 40319, -40478, 40636, 40793, 40950, 41107, 41263, 41419, 41575, 41730, 41885, 42040, -42194, 42347, 42501, 42653, 42806, 42958, 43110, 43261, 43412, 43562, 43712, -43862, 44011, 44160, 44308, 44456, 44603, 44750, 44897, 45043, 45189, 45335, -45480, 45624, 45768, 45912, 46055, 46198, 46340, 46482, 46624, 46765, 46906, -47046, 47186, 47325, 47464, 47602, 47740, 47878, 48015, 48151, 48288, 48423, -48558, 48693, 48828, 48961, 49095, 49228, 49360, 49492, 49624, 49755, 49886, -50016, 50146, 50275, 50403, 50532, 50660, 50787, 50914, 51040, 51166, 51291, -51416, 51541, 51665, 51788, 51911, 52033, 52155, 52277, 52398, 52518, 52639, -52758, 52877, 52996, 53114, 53231, 53348, 53465, 53581, 53696, 53811, 53926, -54040, 54153, 54266, 54379, 54491, 54602, 54713, 54823, 54933, 55043, 55152, -55260, 55368, 55475, 55582, 55688, 55794, 55899, 56004, 56108, 56212, 56315, -56417, 56519, 56621, 56722, 56822, 56922, 57022, 57120, 57219, 57316, 57414, -57510, 57606, 57702, 57797, 57892, 57986, 58079, 58172, 58264, 58356, 58447, -58538, 58628, 58718, 58807, 58895, 58983, 59070, 59157, 59243, 59329, 59414, -59499, 59583, 59666, 59749, 59831, 59913, 59994, 60075, 60155, 60235, 60313, -60392, 60470, 60547, 60624, 60700, 60775, 60850, 60924, 60998, 61071, 61144, -61216, 61288, 61359, 61429, 61499, 61568, 61637, 61705, 61772, 61839, 61905, -61971, 62036, 62100, 62164, 62228, 62291, 62353, 62414, 62475, 62536, 62596, -62655, 62714, 62772, 62829, 62886, 62942, 62998, 63053, 63108, 63162, 63215, -63268, 63320, 63371, 63422, 63473, 63522, 63571, 63620, 63668, 63715, 63762, -63808, 63854, 63899, 63943, 63987, 64030, 64073, 64115, 64156, 64197, 64237, -64276, 64315, 64353, 64391, 64428, 64465, 64501, 64536, 64571, 64605, 64638, -64671, 64703, 64735, 64766, 64796, 64826, 64855, 64884, 64912, 64939, 64966, -64992, 65018, 65043, 65067, 65091, 65114, 65136, 65158, 65179, 65200, 65220, -65239, 65258, 65276, 65294, 65311, 65327, 65343, 65358, 65372, 65386, 65400, -65412, 65424, 65436, 65446, 65457, 65466, 65475, 65483, 65491, 65498, 65505, +65536, 65535, 65534, 65533, 65531, 65528, 65524, 65520, 65516, 65511, 65505, +65498, 65491, 65483, 65475, 65466, 65457, 65446, 65436, 65424, 65412, 65400, +65386, 65372, 65358, 65343, 65327, 65311, 65294, 65276, 65258, 65239, 65220, +65200, 65179, 65158, 65136, 65114, 65091, 65067, 65043, 65018, 64992, 64966, +64939, 64912, 64884, 64855, 64826, 64796, 64766, 64735, 64703, 64671, 64638, +64605, 64571, 64536, 64501, 64465, 64428, 64391, 64353, 64315, 64276, 64237, +64197, 64156, 64115, 64073, 64030, 63987, 63943, 63899, 63854, 63808, 63762, +63715, 63668, 63620, 63571, 63522, 63473, 63422, 63371, 63320, 63268, 63215, +63162, 63108, 63053, 62998, 62942, 62886, 62829, 62772, 62714, 62655, 62596, +62536, 62475, 62414, 62353, 62291, 62228, 62164, 62100, 62036, 61971, 61905, +61839, 61772, 61705, 61637, 61568, 61499, 61429, 61359, 61288, 61216, 61144, +61071, 60998, 60924, 60850, 60775, 60700, 60624, 60547, 60470, 60392, 60313, +60235, 60155, 60075, 59994, 59913, 59831, 59749, 59666, 59583, 59499, 59414, +59329, 59243, 59157, 59070, 58983, 58895, 58807, 58718, 58628, 58538, 58447, +58356, 58264, 58172, 58079, 57986, 57892, 57797, 57702, 57606, 57510, 57414, +57316, 57219, 57120, 57022, 56922, 56822, 56722, 56621, 56519, 56417, 56315, +56212, 56108, 56004, 55899, 55794, 55688, 55582, 55475, 55368, 55260, 55152, +55043, 54933, 54823, 54713, 54602, 54491, 54379, 54266, 54153, 54040, 53926, +53811, 53696, 53581, 53465, 53348, 53231, 53114, 52996, 52877, 52758, 52639, +52518, 52398, 52277, 52155, 52033, 51911, 51788, 51665, 51541, 51416, 51291, +51166, 51040, 50914, 50787, 50660, 50532, 50403, 50275, 50146, 50016, 49886, +49755, 49624, 49492, 49360, 49228, 49095, 48961, 48828, 48693, 48558, 48423, +48288, 48151, 48015, 47878, 47740, 47602, 47464, 47325, 47186, 47046, 46906, +46765, 46624, 46482, 46340, 46198, 46055, 45912, 45768, 45624, 45480, 45335, +45189, 45043, 44897, 44750, 44603, 44456, 44308, 44160, 44011, 43862, 43712, +43562, 43412, 43261, 43110, 42958, 42806, 42653, 42501, 42347, 42194, 42040, +41885, 41730, 41575, 41419, 41263, 41107, 40950, 40793, 40636, 40478, 40319, +40161, 40002, 39842, 39682, 39522, 39362, 39201, 39039, 38878, 38716, 38553, +38390, 38227, 38064, 37900, 37736, 37571, 37406, 37241, 37075, 36909, 36743, +36576, 36409, 36242, 36074, 35906, 35738, 35569, 35400, 35231, 35061, 34891, +34721, 34550, 34379, 34208, 34036, 33864, 33692, 33519, 33346, 33173, 32999, +32826, 32651, 32477, 32302, 32127, 31952, 31776, 31600, 31424, 31247, 31070, +30893, 30715, 30538, 30360, 30181, 30003, 29824, 29645, 29465, 29285, 29105, +28925, 28745, 28564, 28383, 28201, 28020, 27838, 27656, 27473, 27291, 27108, +26925, 26741, 26557, 26373, 26189, 26005, 25820, 25635, 25450, 25265, 25079, +24893, 24707, 24521, 24334, 24147, 23960, 23773, 23586, 23398, 23210, 23022, +22833, 22645, 22456, 22267, 22078, 21889, 21699, 21509, 21319, 21129, 20938, +20748, 20557, 20366, 20175, 19983, 19792, 19600, 19408, 19216, 19024, 18831, +18638, 18446, 18253, 18059, 17866, 17672, 17479, 17285, 17091, 16897, 16702, +16508, 16313, 16118, 15923, 15728, 15533, 15338, 15142, 14946, 14751, 14555, +14359, 14162, 13966, 13769, 13573, 13376, 13179, 12982, 12785, 12588, 12390, +12193, 11995, 11797, 11600, 11402, 11204, 11006, 10807, 10609, 10410, 10212, +10013, 9814, 9616, 9417, 9218, 9019, 8819, 8620, 8421, 8221, 8022, 7822, 7623, +7423, 7223, 7023, 6823, 6623, 6423, 6223, 6023, 5823, 5622, 5422, 5222, 5021, +4821, 4620, 4420, 4219, 4018, 3818, 3617, 3416, 3215, 3014, 2814, 2613, 2412, +2211, 2010, 1809, 1608, 1407, 1206, 1005, 804, 603, 402, 201, 0, -201, -402, +-603, -804, -1005, -1206, -1407, -1608, -1809, -2010, -2211, -2412, -2613, -2814, +-3014, -3215, -3416, -3617, -3818, -4018, -4219, -4420, -4620, -4821, -5021, +-5222, -5422, -5622, -5823, -6023, -6223, -6423, -6623, -6823, -7023, -7223, +-7423, -7623, -7822, -8022, -8221, -8421, -8620, -8819, -9019, -9218, -9417, +-9616, -9814, -10013, -10212, -10410, -10609, -10807, -11006, -11204, -11402, +-11600, -11797, -11995, -12193, -12390, -12588, -12785, -12982, -13179, -13376, +-13573, -13769, -13966, -14162, -14359, -14555, -14751, -14946, -15142, -15338, +-15533, -15728, -15923, -16118, -16313, -16508, -16702, -16897, -17091, -17285, +-17479, -17672, -17866, -18059, -18253, -18446, -18638, -18831, -19024, -19216, +-19408, -19600, -19792, -19983, -20175, -20366, -20557, -20748, -20938, -21129, +-21319, -21509, -21699, -21889, -22078, -22267, -22456, -22645, -22833, -23022, +-23210, -23398, -23586, -23773, -23960, -24147, -24334, -24521, -24707, -24893, +-25079, -25265, -25450, -25635, -25820, -26005, -26189, -26373, -26557, -26741, +-26925, -27108, -27291, -27473, -27656, -27838, -28020, -28201, -28383, -28564, +-28745, -28925, -29105, -29285, -29465, -29645, -29824, -30003, -30181, -30360, +-30538, -30715, -30893, -31070, -31247, -31424, -31600, -31776, -31952, -32127, +-32302, -32477, -32651, -32826, -32999, -33173, -33346, -33519, -33692, -33864, +-34036, -34208, -34379, -34550, -34721, -34891, -35061, -35231, -35400, -35569, +-35738, -35906, -36074, -36242, -36409, -36576, -36743, -36909, -37075, -37241, +-37406, -37571, -37736, -37900, -38064, -38227, -38390, -38553, -38716, -38878, +-39039, -39201, -39362, -39522, -39682, -39842, -40002, -40161, -40319, -40478, +-40636, -40793, -40950, -41107, -41263, -41419, -41575, -41730, -41885, -42040, +-42194, -42347, -42501, -42653, -42806, -42958, -43110, -43261, -43412, -43562, +-43712, -43862, -44011, -44160, -44308, -44456, -44603, -44750, -44897, -45043, +-45189, -45335, -45480, -45624, -45768, -45912, -46055, -46198, -46340, -46482, +-46624, -46765, -46906, -47046, -47186, -47325, -47464, -47602, -47740, -47878, +-48015, -48151, -48288, -48423, -48558, -48693, -48828, -48961, -49095, -49228, +-49360, -49492, -49624, -49755, -49886, -50016, -50146, -50275, -50403, -50532, +-50660, -50787, -50914, -51040, -51166, -51291, -51416, -51541, -51665, -51788, +-51911, -52033, -52155, -52277, -52398, -52518, -52639, -52758, -52877, -52996, +-53114, -53231, -53348, -53465, -53581, -53696, -53811, -53926, -54040, -54153, +-54266, -54379, -54491, -54602, -54713, -54823, -54933, -55043, -55152, -55260, +-55368, -55475, -55582, -55688, -55794, -55899, -56004, -56108, -56212, -56315, +-56417, -56519, -56621, -56722, -56822, -56922, -57022, -57120, -57219, -57316, +-57414, -57510, -57606, -57702, -57797, -57892, -57986, -58079, -58172, -58264, +-58356, -58447, -58538, -58628, -58718, -58807, -58895, -58983, -59070, -59157, +-59243, -59329, -59414, -59499, -59583, -59666, -59749, -59831, -59913, -59994, +-60075, -60155, -60235, -60313, -60392, -60470, -60547, -60624, -60700, -60775, +-60850, -60924, -60998, -61071, -61144, -61216, -61288, -61359, -61429, -61499, +-61568, -61637, -61705, -61772, -61839, -61905, -61971, -62036, -62100, -62164, +-62228, -62291, -62353, -62414, -62475, -62536, -62596, -62655, -62714, -62772, +-62829, -62886, -62942, -62998, -63053, -63108, -63162, -63215, -63268, -63320, +-63371, -63422, -63473, -63522, -63571, -63620, -63668, -63715, -63762, -63808, +-63854, -63899, -63943, -63987, -64030, -64073, -64115, -64156, -64197, -64237, +-64276, -64315, -64353, -64391, -64428, -64465, -64501, -64536, -64571, -64605, +-64638, -64671, -64703, -64735, -64766, -64796, -64826, -64855, -64884, -64912, +-64939, -64966, -64992, -65018, -65043, -65067, -65091, -65114, -65136, -65158, +-65179, -65200, -65220, -65239, -65258, -65276, -65294, -65311, -65327, -65343, +-65358, -65372, -65386, -65400, -65412, -65424, -65436, -65446, -65457, -65466, +-65475, -65483, -65491, -65498, -65505, -65511, -65516, -65520, -65524, -65528, +-65531, -65533, -65534, -65535, -65536, -65535, -65534, -65533, -65531, -65528, +-65524, -65520, -65516, -65511, -65505, -65498, -65491, -65483, -65475, -65466, +-65457, -65446, -65436, -65424, -65412, -65400, -65386, -65372, -65358, -65343, +-65327, -65311, -65294, -65276, -65258, -65239, -65220, -65200, -65179, -65158, +-65136, -65114, -65091, -65067, -65043, -65018, -64992, -64966, -64939, -64912, +-64884, -64855, -64826, -64796, -64766, -64735, -64703, -64671, -64638, -64605, +-64571, -64536, -64501, -64465, -64428, -64391, -64353, -64315, -64276, -64237, +-64197, -64156, -64115, -64073, -64030, -63987, -63943, -63899, -63854, -63808, +-63762, -63715, -63668, -63620, -63571, -63522, -63473, -63422, -63371, -63320, +-63268, -63215, -63162, -63108, -63053, -62998, -62942, -62886, -62829, -62772, +-62714, -62655, -62596, -62536, -62475, -62414, -62353, -62291, -62228, -62164, +-62100, -62036, -61971, -61905, -61839, -61772, -61705, -61637, -61568, -61499, +-61429, -61359, -61288, -61216, -61144, -61071, -60998, -60924, -60850, -60775, +-60700, -60624, -60547, -60470, -60392, -60313, -60235, -60155, -60075, -59994, +-59913, -59831, -59749, -59666, -59583, -59499, -59414, -59329, -59243, -59157, +-59070, -58983, -58895, -58807, -58718, -58628, -58538, -58447, -58356, -58264, +-58172, -58079, -57986, -57892, -57797, -57702, -57606, -57510, -57414, -57316, +-57219, -57120, -57022, -56922, -56822, -56722, -56621, -56519, -56417, -56315, +-56212, -56108, -56004, -55899, -55794, -55688, -55582, -55475, -55368, -55260, +-55152, -55043, -54933, -54823, -54713, -54602, -54491, -54379, -54266, -54153, +-54040, -53926, -53811, -53696, -53581, -53465, -53348, -53231, -53114, -52996, +-52877, -52758, -52639, -52518, -52398, -52277, -52155, -52033, -51911, -51788, +-51665, -51541, -51416, -51291, -51166, -51040, -50914, -50787, -50660, -50532, +-50403, -50275, -50146, -50016, -49886, -49755, -49624, -49492, -49360, -49228, +-49095, -48961, -48828, -48693, -48558, -48423, -48288, -48151, -48015, -47878, +-47740, -47602, -47464, -47325, -47186, -47046, -46906, -46765, -46624, -46482, +-46340, -46198, -46055, -45912, -45768, -45624, -45480, -45335, -45189, -45043, +-44897, -44750, -44603, -44456, -44308, -44160, -44011, -43862, -43712, -43562, +-43412, -43261, -43110, -42958, -42806, -42653, -42501, -42347, -42194, -42040, +-41885, -41730, -41575, -41419, -41263, -41107, -40950, -40793, -40636, -40478, +-40319, -40161, -40002, -39842, -39682, -39522, -39362, -39201, -39039, -38878, +-38716, -38553, -38390, -38227, -38064, -37900, -37736, -37571, -37406, -37241, +-37075, -36909, -36743, -36576, -36409, -36242, -36074, -35906, -35738, -35569, +-35400, -35231, -35061, -34891, -34721, -34550, -34379, -34208, -34036, -33864, +-33692, -33519, -33346, -33173, -32999, -32826, -32651, -32477, -32302, -32127, +-31952, -31776, -31600, -31424, -31247, -31070, -30893, -30715, -30538, -30360, +-30181, -30003, -29824, -29645, -29465, -29285, -29105, -28925, -28745, -28564, +-28383, -28201, -28020, -27838, -27656, -27473, -27291, -27108, -26925, -26741, +-26557, -26373, -26189, -26005, -25820, -25635, -25450, -25265, -25079, -24893, +-24707, -24521, -24334, -24147, -23960, -23773, -23586, -23398, -23210, -23022, +-22833, -22645, -22456, -22267, -22078, -21889, -21699, -21509, -21319, -21129, +-20938, -20748, -20557, -20366, -20175, -19983, -19792, -19600, -19408, -19216, +-19024, -18831, -18638, -18446, -18253, -18059, -17866, -17672, -17479, -17285, +-17091, -16897, -16702, -16508, -16313, -16118, -15923, -15728, -15533, -15338, +-15142, -14946, -14751, -14555, -14359, -14162, -13966, -13769, -13573, -13376, +-13179, -12982, -12785, -12588, -12390, -12193, -11995, -11797, -11600, -11402, +-11204, -11006, -10807, -10609, -10410, -10212, -10013, -9814, -9616, -9417, +-9218, -9019, -8819, -8620, -8421, -8221, -8022, -7822, -7623, -7423, -7223, +-7023, -6823, -6623, -6423, -6223, -6023, -5823, -5622, -5422, -5222, -5021, +-4821, -4620, -4420, -4219, -4018, -3818, -3617, -3416, -3215, -3014, -2814, +-2613, -2412, -2211, -2010, -1809, -1608, -1407, -1206, -1005, -804, -603, -402, +-201, 0, 201, 402, 603, 804, 1005, 1206, 1407, 1608, 1809, 2010, 2211, 2412, +2613, 2814, 3014, 3215, 3416, 3617, 3818, 4018, 4219, 4420, 4620, 4821, 5021, +5222, 5422, 5622, 5823, 6023, 6223, 6423, 6623, 6823, 7023, 7223, 7423, 7623, +7822, 8022, 8221, 8421, 8620, 8819, 9019, 9218, 9417, 9616, 9814, 10013, 10212, +10410, 10609, 10807, 11006, 11204, 11402, 11600, 11797, 11995, 12193, 12390, +12588, 12785, 12982, 13179, 13376, 13573, 13769, 13966, 14162, 14359, 14555, +14751, 14946, 15142, 15338, 15533, 15728, 15923, 16118, 16313, 16508, 16702, +16897, 17091, 17285, 17479, 17672, 17866, 18059, 18253, 18446, 18638, 18831, +19024, 19216, 19408, 19600, 19792, 19983, 20175, 20366, 20557, 20748, 20938, +21129, 21319, 21509, 21699, 21889, 22078, 22267, 22456, 22645, 22833, 23022, +23210, 23398, 23586, 23773, 23960, 24147, 24334, 24521, 24707, 24893, 25079, +25265, 25450, 25635, 25820, 26005, 26189, 26373, 26557, 26741, 26925, 27108, +27291, 27473, 27656, 27838, 28020, 28201, 28383, 28564, 28745, 28925, 29105, +29285, 29465, 29645, 29824, 30003, 30181, 30360, 30538, 30715, 30893, 31070, +31247, 31424, 31600, 31776, 31952, 32127, 32302, 32477, 32651, 32826, 32999, +33173, 33346, 33519, 33692, 33864, 34036, 34208, 34379, 34550, 34721, 34891, +35061, 35231, 35400, 35569, 35738, 35906, 36074, 36242, 36409, 36576, 36743, +36909, 37075, 37241, 37406, 37571, 37736, 37900, 38064, 38227, 38390, 38553, +38716, 38878, 39039, 39201, 39362, 39522, 39682, 39842, 40002, 40161, 40319, +40478, 40636, 40793, 40950, 41107, 41263, 41419, 41575, 41730, 41885, 42040, +42194, 42347, 42501, 42653, 42806, 42958, 43110, 43261, 43412, 43562, 43712, +43862, 44011, 44160, 44308, 44456, 44603, 44750, 44897, 45043, 45189, 45335, +45480, 45624, 45768, 45912, 46055, 46198, 46340, 46482, 46624, 46765, 46906, +47046, 47186, 47325, 47464, 47602, 47740, 47878, 48015, 48151, 48288, 48423, +48558, 48693, 48828, 48961, 49095, 49228, 49360, 49492, 49624, 49755, 49886, +50016, 50146, 50275, 50403, 50532, 50660, 50787, 50914, 51040, 51166, 51291, +51416, 51541, 51665, 51788, 51911, 52033, 52155, 52277, 52398, 52518, 52639, +52758, 52877, 52996, 53114, 53231, 53348, 53465, 53581, 53696, 53811, 53926, +54040, 54153, 54266, 54379, 54491, 54602, 54713, 54823, 54933, 55043, 55152, +55260, 55368, 55475, 55582, 55688, 55794, 55899, 56004, 56108, 56212, 56315, +56417, 56519, 56621, 56722, 56822, 56922, 57022, 57120, 57219, 57316, 57414, +57510, 57606, 57702, 57797, 57892, 57986, 58079, 58172, 58264, 58356, 58447, +58538, 58628, 58718, 58807, 58895, 58983, 59070, 59157, 59243, 59329, 59414, +59499, 59583, 59666, 59749, 59831, 59913, 59994, 60075, 60155, 60235, 60313, +60392, 60470, 60547, 60624, 60700, 60775, 60850, 60924, 60998, 61071, 61144, +61216, 61288, 61359, 61429, 61499, 61568, 61637, 61705, 61772, 61839, 61905, +61971, 62036, 62100, 62164, 62228, 62291, 62353, 62414, 62475, 62536, 62596, +62655, 62714, 62772, 62829, 62886, 62942, 62998, 63053, 63108, 63162, 63215, +63268, 63320, 63371, 63422, 63473, 63522, 63571, 63620, 63668, 63715, 63762, +63808, 63854, 63899, 63943, 63987, 64030, 64073, 64115, 64156, 64197, 64237, +64276, 64315, 64353, 64391, 64428, 64465, 64501, 64536, 64571, 64605, 64638, +64671, 64703, 64735, 64766, 64796, 64826, 64855, 64884, 64912, 64939, 64966, +64992, 65018, 65043, 65067, 65091, 65114, 65136, 65158, 65179, 65200, 65220, +65239, 65258, 65276, 65294, 65311, 65327, 65343, 65358, 65372, 65386, 65400, +65412, 65424, 65436, 65446, 65457, 65466, 65475, 65483, 65491, 65498, 65505, 65511, 65516, 65520, 65524, 65528, 65531, 65533, 65534, 65535 }; diff --git a/zsnes/src/effects/smoke.c b/zsnes/src/effects/smoke.c index 0536b7cb..a2c89d47 100644 --- a/zsnes/src/effects/smoke.c +++ b/zsnes/src/effects/smoke.c @@ -110,7 +110,7 @@ static void init_fire (void) for (x = 0; x < SCRW; x ++) { pixel = fire_buffer [((y + 1) * SCRW) + x]; - + if (pixel > 0) { diff --git a/zsnes/src/effects/water.c b/zsnes/src/effects/water.c index 6ab9ab95..c8a06907 100644 --- a/zsnes/src/effects/water.c +++ b/zsnes/src/effects/water.c @@ -67,7 +67,7 @@ void DrawWater(void) { // tslast=tscurrent; // tscurrent=time(NULL); - + /* if (NetPlayNoMore == 1) { @@ -95,23 +95,23 @@ void DrawWater(void) y=rand()%(SCRH-2)+1; Height[Hpage][y*SCRW+x]=rand()%(pheight<<2); } - + /* the surfer */ if(mode&1) { int x,y; x = (SCRW/2) + ((((FSin( (xang* 65) >>8) >>8) - * (FSin( (xang*349) >>8) >>8)) + * (FSin( (xang*349) >>8) >>8)) * ((SCRW-8)/2)) >> 16); - + y = (SCRH/2) + ((((FSin( (yang*377) >>8) >>8) *(FSin( (yang* 84) >>8) >>8)) * ((SCRH-8)/2)) >> 16); xang += 13; yang += 12; - + if(mode & 0x4000) { offset = (oy+y)/2*SCRW + (ox+x)/2; @@ -136,10 +136,10 @@ void DrawWater(void) } ox = x; - oy = y; - + oy = y; + } - + if(mode&4) { int x,y; @@ -150,14 +150,14 @@ void DrawWater(void) if(mode & 0x4000) // HeightBlob(-1, -1, radius/2, pheight, Hpage); else -*/ +*/ x=rand()%(SCRW-2)+1; y=rand()%(SCRH-2)+1; SineBlob(x, y, radius, -pheight*6, Hpage); } - } + } CalcWater(Height[Hpage^1], Height[Hpage], density); - Hpage ^= 1; /* flip flop */ + Hpage ^= 1; /* flip flop */ } @@ -169,13 +169,13 @@ void DrawWaterNoLight(int *ptr) int x,y; int c; int p; - + int offset = SCRW+1; if(ptr == NULL) { return; } - + for(y=((SCRH-1)*SCRW); offset < y; offset+=2) { for(x = offset+SCRW-2;offset>light); (c<1) ? c=1 : (c > 31) ? c=31 : 0; vscr[offset]=c; } } - memcpy( vidbuffer,vscr,SCRW*SCRH); + memcpy( vidbuffer,vscr,SCRW*SCRH); // memcpy( VGLDisplay->Bitmap,vscr,SCRW*SCRH); // frames++; @@ -323,7 +323,7 @@ void CalcWater(int *nptr,int *optr,int density) int newh; int count = SCRW+1; int x,y; - + for(y = (SCRH-1) * SCRW;count> 2) - nptr[count]; - + nptr[count] = newh - (newh >> density); } } - + } void SineBlob(int x, int y, int radius, int height, int page) diff --git a/zsnes/src/endmem.asm b/zsnes/src/endmem.asm index b3b98787..6519fb53 100644 --- a/zsnes/src/endmem.asm +++ b/zsnes/src/endmem.asm @@ -32,39 +32,39 @@ SECTION .bss NEWSYM wramdataa, resb 65536 NEWSYM ram7fa, resb 65536 -NEWSYM Inbetweendat, resd 4 -NEWSYM opcjmptab, resd 256 +NEWSYM Inbetweendat, resd 4 +NEWSYM opcjmptab, resd 256 -NEWSYM Bank0datr8 , resd 256 -NEWSYM Bank0datr16, resd 256 -NEWSYM Bank0datw8 , resd 256 -NEWSYM Bank0datw16, resd 256 +NEWSYM Bank0datr8 , resd 256 +NEWSYM Bank0datr16, resd 256 +NEWSYM Bank0datw8 , resd 256 +NEWSYM Bank0datw16, resd 256 -NEWSYM tableA, resd 256 -NEWSYM tableB, resd 256 -NEWSYM tableC, resd 256 -NEWSYM tableD, resd 256 -NEWSYM tableE, resd 256 -NEWSYM tableF, resd 256 -NEWSYM tableG, resd 256 +NEWSYM tableA, resd 256 +NEWSYM tableB, resd 256 +NEWSYM tableC, resd 256 +NEWSYM tableD, resd 256 +NEWSYM tableE, resd 256 +NEWSYM tableF, resd 256 +NEWSYM tableG, resd 256 NEWSYM tableH, resd 256 -NEWSYM tableAb, resd 256 -NEWSYM tableBb, resd 256 -NEWSYM tableCb, resd 256 -NEWSYM tableDb, resd 256 -NEWSYM tableEb, resd 256 -NEWSYM tableFb, resd 256 -NEWSYM tableGb, resd 256 -NEWSYM tableHb, resd 256 +NEWSYM tableAb, resd 256 +NEWSYM tableBb, resd 256 +NEWSYM tableCb, resd 256 +NEWSYM tableDb, resd 256 +NEWSYM tableEb, resd 256 +NEWSYM tableFb, resd 256 +NEWSYM tableGb, resd 256 +NEWSYM tableHb, resd 256 -NEWSYM tableAc, resd 256 -NEWSYM tableBc, resd 256 -NEWSYM tableCc, resd 256 -NEWSYM tableDc, resd 256 -NEWSYM tableEc, resd 256 -NEWSYM tableFc, resd 256 -NEWSYM tableGc, resd 256 +NEWSYM tableAc, resd 256 +NEWSYM tableBc, resd 256 +NEWSYM tableCc, resd 256 +NEWSYM tableDc, resd 256 +NEWSYM tableEc, resd 256 +NEWSYM tableFc, resd 256 +NEWSYM tableGc, resd 256 NEWSYM tableHc, resd 256 NEWSYM SA1tableA, resd 256 @@ -85,9 +85,9 @@ NEWSYM memtabler8, resd 256 NEWSYM memtablew8, resd 256 NEWSYM memtabler16, resd 256 NEWSYM memtablew16, resd 256 -NEWSYM vidmemch2, resb 4096 -NEWSYM vidmemch4, resb 4096 -NEWSYM vidmemch8, resb 4096 +NEWSYM vidmemch2, resb 4096 +NEWSYM vidmemch4, resb 4096 +NEWSYM vidmemch8, resb 4096 NEWSYM snesmmap, resd 256 NEWSYM snesmap2, resd 256 NEWSYM cachebg1, resb 64 @@ -100,8 +100,8 @@ NEWSYM sprleftpr1, resb 256 NEWSYM sprleftpr2, resb 256 NEWSYM sprleftpr3, resb 256 NEWSYM sprpriodata, resb 288 -NEWSYM sprprtabc, resb 64 -NEWSYM sprprtabu, resb 64 +NEWSYM sprprtabc, resb 64 +NEWSYM sprprtabu, resb 64 NEWSYM prevpal, resw 256 ; previous palette buffer NEWSYM winbgdata, resb 288 ; window buffer for backgrounds NEWSYM winspdata, resb 288 ; window buffer for sprites @@ -127,15 +127,15 @@ NEWSYM fxbit01, resd 256 NEWSYM fxbit23, resd 256 NEWSYM fxbit45, resd 256 NEWSYM fxbit67, resd 256 -NEWSYM PLOTJmpa, resd 64 -NEWSYM PLOTJmpb, resd 64 +NEWSYM PLOTJmpa, resd 64 +NEWSYM PLOTJmpb, resd 64 NEWSYM pal16b, resd 256 NEWSYM pal16bcl, resd 256 NEWSYM pal16bclha, resd 256 NEWSYM pal16bxcl, resd 256 -NEWSYM xtravbuf, resb 576 -NEWSYM BG1SXl, resw 256 +NEWSYM xtravbuf, resb 576 +NEWSYM BG1SXl, resw 256 NEWSYM BG2SXl, resw 256 NEWSYM BG3SXl, resw 256 NEWSYM BG4SXl, resw 256 @@ -143,9 +143,9 @@ NEWSYM BG1SYl, resw 256 NEWSYM BG2SYl, resw 256 NEWSYM BG3SYl, resw 256 NEWSYM BG4SYl, resw 256 -NEWSYM BGMA, resb 256 -NEWSYM BGFB, resb 256 -NEWSYM BG3PRI, resb 256 +NEWSYM BGMA, resb 256 +NEWSYM BGFB, resb 256 +NEWSYM BG3PRI, resb 256 NEWSYM BGOPT1, resw 256 NEWSYM BGOPT2, resw 256 NEWSYM BGOPT3, resw 256 @@ -162,25 +162,25 @@ NEWSYM BGPT1Y, resw 256 NEWSYM BGPT2Y, resw 256 NEWSYM BGPT3Y, resw 256 NEWSYM BGPT4Y, resw 256 -NEWSYM BGMS1, resw 1024 -NEWSYM prdata, resb 256 -NEWSYM prdatb, resb 256 -NEWSYM prdatc, resb 256 -NEWSYM ngpalcon2b, resd 20h -NEWSYM ngpalcon4b, resd 20h -NEWSYM ngpalcon8b, resd 20h -NEWSYM tltype2b, resb 4096 -NEWSYM tltype4b, resb 2048 -NEWSYM tltype8b, resb 1024 +NEWSYM BGMS1, resw 1024 +NEWSYM prdata, resb 256 +NEWSYM prdatb, resb 256 +NEWSYM prdatc, resb 256 +NEWSYM ngpalcon2b, resd 20h +NEWSYM ngpalcon4b, resd 20h +NEWSYM ngpalcon8b, resd 20h +NEWSYM tltype2b, resb 4096 +NEWSYM tltype4b, resb 2048 +NEWSYM tltype8b, resb 1024 -NEWSYM ngptrdat, resd 1024 -NEWSYM ngceax, resd 1024 -NEWSYM ngcedi, resd 1024 -NEWSYM bgtxad, resw 1024 +NEWSYM ngptrdat, resd 1024 +NEWSYM ngceax, resd 1024 +NEWSYM ngcedi, resd 1024 +NEWSYM bgtxad, resw 1024 NEWSYM sprtbng, resd 256 -NEWSYM sprtlng, resb 256 -NEWSYM mosszng, resb 256 -NEWSYM mosenng, resb 256 +NEWSYM sprtlng, resb 256 +NEWSYM mosszng, resb 256 +NEWSYM mosenng, resb 256 SECTION .data ALIGN32 @@ -194,47 +194,47 @@ SECTION .bss NEWSYM mode7ab, resd 256 NEWSYM mode7cd, resd 256 NEWSYM mode7xy, resd 256 -NEWSYM mode7st, resb 256 +NEWSYM mode7st, resb 256 -NEWSYM t16x161, resb 256 -NEWSYM t16x162, resb 256 -NEWSYM t16x163, resb 256 -NEWSYM t16x164, resb 256 +NEWSYM t16x161, resb 256 +NEWSYM t16x162, resb 256 +NEWSYM t16x163, resb 256 +NEWSYM t16x164, resb 256 -NEWSYM intrlng, resb 256 -NEWSYM mode7hr, resb 256 +NEWSYM intrlng, resb 256 +NEWSYM mode7hr, resb 256 -NEWSYM scadsng, resb 256 -NEWSYM scadtng, resb 256 +NEWSYM scadsng, resb 256 +NEWSYM scadtng, resb 256 NEWSYM scbcong, resw 256 NEWSYM cpalval, resd 256 -NEWSYM cgfxmod, resb 256 +NEWSYM cgfxmod, resb 256 NEWSYM winboundary, resd 256 -NEWSYM winbg1enval, resb 256 -NEWSYM winbg2enval, resb 256 -NEWSYM winbg3enval, resb 256 -NEWSYM winbg4enval, resb 256 -NEWSYM winbgobjenval, resb 256 -NEWSYM winbgbackenval, resb 256 +NEWSYM winbg1enval, resb 256 +NEWSYM winbg2enval, resb 256 +NEWSYM winbg3enval, resb 256 +NEWSYM winbg4enval, resb 256 +NEWSYM winbgobjenval, resb 256 +NEWSYM winbgbackenval, resb 256 NEWSYM winlogicaval, resw 256 -NEWSYM winbg1envals, resb 256 -NEWSYM winbg2envals, resb 256 -NEWSYM winbg3envals, resb 256 -NEWSYM winbg4envals, resb 256 -NEWSYM winbgobjenvals, resb 256 -NEWSYM winbgbackenvals, resb 256 -NEWSYM winbg1envalm, resb 256 -NEWSYM winbg2envalm, resb 256 -NEWSYM winbg3envalm, resb 256 -NEWSYM winbg4envalm, resb 256 -NEWSYM winbgobjenvalm, resb 256 -NEWSYM winbgbackenvalm, resb 256 +NEWSYM winbg1envals, resb 256 +NEWSYM winbg2envals, resb 256 +NEWSYM winbg3envals, resb 256 +NEWSYM winbg4envals, resb 256 +NEWSYM winbgobjenvals, resb 256 +NEWSYM winbgbackenvals, resb 256 +NEWSYM winbg1envalm, resb 256 +NEWSYM winbg2envalm, resb 256 +NEWSYM winbg3envalm, resb 256 +NEWSYM winbg4envalm, resb 256 +NEWSYM winbgobjenvalm, resb 256 +NEWSYM winbgbackenvalm, resb 256 -NEWSYM FillSubScr, resb 256 +NEWSYM FillSubScr, resb 256 NEWSYM objclineptr, resd 256 ; l1,r1,l2,r2,en,log,ptr @@ -249,11 +249,11 @@ SECTION .bss NEWSYM SpecialLine, resb 256 NEWSYM bgallchange, resb 256 -NEWSYM bg1change, resb 256 -NEWSYM bg2change, resb 256 -NEWSYM bg3change, resb 256 -NEWSYM bg4change, resb 256 -NEWSYM bgwinchange, resb 256 +NEWSYM bg1change, resb 256 +NEWSYM bg2change, resb 256 +NEWSYM bg3change, resb 256 +NEWSYM bg4change, resb 256 +NEWSYM bgwinchange, resb 256 NEWSYM PrevPicture, resb 64*56*2 diff --git a/zsnes/src/gblhdr.h b/zsnes/src/gblhdr.h index af23d5ca..98bdaad0 100644 --- a/zsnes/src/gblhdr.h +++ b/zsnes/src/gblhdr.h @@ -33,7 +33,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "fcntl.h" #include #include - + #include "config.h" // General time.h checking @@ -65,9 +65,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #endif // more standard stuff - + #include - #include + #include #include // unistd.h stuff @@ -92,7 +92,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. however it's a static value that we can just define */ #define getpagesize() 4096 #endif - + #ifdef __LINUX__ #include "SDL.h" #include diff --git a/zsnes/src/gui/guikeys.inc b/zsnes/src/gui/guikeys.inc index dbd67549..519368f4 100644 --- a/zsnes/src/gui/guikeys.inc +++ b/zsnes/src/gui/guikeys.inc @@ -820,16 +820,16 @@ GUISaveKeys: GUIKeyCheckbox PauseLoad,'P' GUIKeyCheckbox PauseRewind,'R' ret - + GUISpeedKeys: cmp dh,'a' ; Setup jb .nocap cmp dh,'z' ja .nocap sub dh,'z'-'Z' -.nocap +.nocap GUIKeyCheckbox FastFwdToggle,'T' ; Checkbox - + cmp dh,'A' ; Framerate Checkboxes jne .noautofr mov byte[FPSOn],0 @@ -886,7 +886,7 @@ GUIGUIOptnsKeys: GUIKeyCheckbox GUIClick,'C' GUIKeyCheckbox JoyPad1Move,'U' GUIKeyCheckbox GUIEnableTransp,'T' - + cmp dh,'F' jne .guioptn8 xor byte[FilteredGUI],1 @@ -1527,7 +1527,7 @@ GUIMovieKeys: ja .nocap sub dh,'z'-'Z' .nocap - + GUIKeyButtonHole CMovieExt,'v','0' ; Select Radio Buttons GUIKeyButtonHole CMovieExt,'1','1' GUIKeyButtonHole CMovieExt,'2','2' @@ -1582,7 +1582,7 @@ GUIComboKeys: ret GUICheatKeys: - cmp dword[GUIcurrentcheatwin],1 + cmp dword[GUIcurrentcheatwin],1 je near .textboxa cmp dword[GUIcurrentcheatwin],2 je near .textboxb @@ -1763,7 +1763,7 @@ GUICheatKeys: ;Enter Code Input Box -.textboxa +.textboxa cmp byte[GUICheatPosA],0 je near .nobacksp cmp dh,9 @@ -2039,7 +2039,7 @@ GUICheatSearchKeys: CompareKeyMacro 'H',CheatSrcByteBase,1 CompareKeyMacro 'E',CheatSrcSearchType,0 CompareKeyMacro 'C',CheatSrcSearchType,1 - + cmp dh,13 ; Start Button je .start cmp dh,'S' @@ -2049,7 +2049,7 @@ GUICheatSearchKeys: ret .notstart ret - + .search ; Shortcuts for Select Comparison cmp byte[CheatSrcSearchType],1 je .compare @@ -2082,7 +2082,7 @@ GUICheatSearchKeys: mov byte[CheatCompareValue],3 .notnotequalthan -%ifdef __LINUX__ ; Select with Arrow Keys +%ifdef __LINUX__ ; Select with Arrow Keys cmp al,90 je .yesmoveup cmp dword[numlockptr],1 @@ -2113,8 +2113,8 @@ GUICheatSearchKeys: cmp byte[CheatCompareValue],3 je .nomovedown inc byte[CheatCompareValue] - - + + .nomovedown ; Restart/View/Search Buttons cmp dh,'R' jne .notrestart @@ -2135,7 +2135,7 @@ GUICheatSearchKeys: call CheatCodeSearchProcess .nosearchprocess ret - + .view ; View cmp dword[NumCheatSrc],0 ; Return Hotkey jne .nozero @@ -2349,7 +2349,7 @@ GUICheatSearchKeys: ; Allows you to use the arrow keys to select a state number, and Enter to pick GUIStateSelKeys: - cmp al,13 + cmp al,13 jne .noenter xor eax,eax mov al,[GUIwinptr] @@ -2519,7 +2519,7 @@ GUIResetKeys: mov [GUIcmenupos],al .notnoreset ret - + ; Allows you to select boxes with the arrow keys, Enter to choose GUIStateKeys: %ifdef __LINUX__ diff --git a/zsnes/src/gui/guimouse.inc b/zsnes/src/gui/guimouse.inc index c8fd2a41..bff51101 100644 --- a/zsnes/src/gui/guimouse.inc +++ b/zsnes/src/gui/guimouse.inc @@ -2200,13 +2200,13 @@ DisplayGUIInputClick: .skipscrol ;x,y,x2,y2,currentwin,vpos,#entries,starty,y/entry,cpos,winval,win#,dclicktick# GUIWinControl 5,36,107,34+5*8,GUIBlankVar,GUIcurrentinputviewloc,GUINumValue,35,8,GUIcurrentinputcursloc,4,3,0 - + GUIPHoldbutton 125,34,155,45,14 ; Buttons %ifdef __MSDOS__ GUIPHoldbutton 125,50,185,61,15 %endif GUIPHoldbutton 125,66,185,77,40 - + mov edi,pl1selk mov dword[keycontrolval],pl1contrl cmp byte[cplayernum],1 @@ -2815,7 +2815,7 @@ DisplayGUIOptnsClick: GUIClickCButton 12,63,byte[GUIClick] GUIClickCButton 12,73,byte[JoyPad1Move] GUIClickCButton 124,23,byte[GUIEnableTransp] - GUIClickCButtonI 124,33,byte[FilteredGUI] + GUIClickCButtonI 124,33,byte[FilteredGUI] GUIClickCButton6 124,43,byte[GUIEffect],1 GUIClickCButton6 124,53,byte[GUIEffect],2 GUIClickCButton6 124,63,byte[GUIEffect],3 @@ -3115,7 +3115,7 @@ DisplayGUICheatSearchClick: je near .view cmp byte[CheatWinMode],3 je near .add - + GUIPHoldbutton 95,140,140,152,50 ; Main Menu GUIPButtonHole 11,28,byte[CheatSrcByteSize],0 GUIPButtonHole 11,38,byte[CheatSrcByteSize],1 @@ -3126,18 +3126,18 @@ DisplayGUICheatSearchClick: GUIPButtonHole 11,113,byte[CheatSrcSearchType],0 GUIPButtonHole 11,123,byte[CheatSrcSearchType],1 ret - + .incheatmode ; Exact Value GUIPHoldbutton 30,140,80,152,51 cmp byte[CheatSearchStatus],1 jne near .cheatsearching jmp .nosearch - + .cheatsearching ; Return and Re-Search cmp byte[CheatSrcSearchType],1 je near .cheatsearchingcomp jmp .searched - + .cheatsearchingcomp ; Select Comparison GUIPButtonHole 11,33,byte[CheatCompareValue],0 GUIPButtonHole 11,43,byte[CheatCompareValue],1 @@ -3162,11 +3162,11 @@ DisplayGUICheatSearchClick: .skipscrol ; x,y,x2,y2,currentwin,vpos,#entries,starty,y/entry,cpos,winval,win#,dclicktick# GUIWinControl 5,23,171,21+12*7,GUIBlankVar,GUIcurrentchtsrcviewloc,NumCheatSrc,22,7,GUIcurrentchtsrccursloc,5,13,30 - + GUIPHoldbutton 70,140,130,152,54 ; Return/Add Buttons GUIPHoldbutton 140,140,180,152,55 ret - + ; DrawSlideBarWin 13,173,28,[GUIcurrentchtsrcviewloc],[NumCheatSrc],12,73,GUICSStA ; DrawGUIWinBox 13,5,20,171,108,167 diff --git a/zsnes/src/init.asm b/zsnes/src/init.asm index 0ec25df9..9b79989f 100644 --- a/zsnes/src/init.asm +++ b/zsnes/src/init.asm @@ -85,7 +85,7 @@ NEWSYM autoloadstate, db 0 ; auto load state slot number NEWSYM autoloadmovie, db 0 NEWSYM ZMVRawDump, db 0 -NEWSYM EndMessage +NEWSYM EndMessage db ' ',13,10,0 SECTION .text @@ -254,9 +254,9 @@ NEWSYM init jne .norawdump call MovieDumpRaw jmp .aftermovieplay -.norawdump +.norawdump call MoviePlay -.aftermovieplay +.aftermovieplay popad .noautloadmovie diff --git a/zsnes/src/initc.c b/zsnes/src/initc.c index 45cd6af3..9a740239 100755 --- a/zsnes/src/initc.c +++ b/zsnes/src/initc.c @@ -1062,7 +1062,7 @@ void loadROM() { bool isCompressed = false, isZip = false; - EMUPause = false; + EMUPause = false; curromspace = 0; maxromspace = 4194304; diff --git a/zsnes/src/jma/ariconst.h b/zsnes/src/jma/ariconst.h index 43852846..8cb0ead6 100644 --- a/zsnes/src/jma/ariconst.h +++ b/zsnes/src/jma/ariconst.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA typedef NCompression::NArithmetic::CRangeDecoder CMyRangeDecoder; -template class CMyBitDecoder: +template class CMyBitDecoder: public NCompression::NArithmetic::CBitDecoder {}; #endif diff --git a/zsnes/src/jma/crc32.cpp b/zsnes/src/jma/crc32.cpp index ef0bcae0..efa92680 100644 --- a/zsnes/src/jma/crc32.cpp +++ b/zsnes/src/jma/crc32.cpp @@ -67,7 +67,7 @@ namespace CRC32lib 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d }; - + //CRC32 for char arrays unsigned int CRC32(const unsigned char *array, size_t size, register unsigned int crc32) { diff --git a/zsnes/src/jma/iiostrm.cpp b/zsnes/src/jma/iiostrm.cpp index 621a85a4..66cefb0c 100644 --- a/zsnes/src/jma/iiostrm.cpp +++ b/zsnes/src/jma/iiostrm.cpp @@ -27,7 +27,7 @@ HRESULT ISequentialInStream_Array::Read(void *aData, UINT32 aSize, UINT32 *aProc if (aSize > size) { aSize = size; - } + } *aProcessedSize = aSize; memcpy(aData, data, aSize); @@ -57,7 +57,7 @@ HRESULT ISequentialInStream_String::Read(void *aData, UINT32 aSize, UINT32 *aPro if (aSize > data.size()) { aSize = data.size(); - } + } *aProcessedSize = aSize; memcpy(aData, data.c_str(), aSize); diff --git a/zsnes/src/jma/iiostrm.h b/zsnes/src/jma/iiostrm.h index 7d066763..e453c848 100644 --- a/zsnes/src/jma/iiostrm.h +++ b/zsnes/src/jma/iiostrm.h @@ -40,7 +40,7 @@ class ISequentialInStream_Array : public ISequentialInStream unsigned int size; public: ISequentialInStream_Array(const char *Adata, unsigned Asize) : data(Adata), size(Asize) { } - + HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); }; @@ -49,7 +49,7 @@ class ISequentialInStream_String : public ISequentialInStream std::string& data; public: ISequentialInStream_String(std::string& Adata) : data(Adata) { } - + HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); }; @@ -58,7 +58,7 @@ class ISequentialInStream_Istream : public ISequentialInStream std::istream& data; public: ISequentialInStream_Istream(std::istream& Adata) : data(Adata) { } - + HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); }; @@ -73,7 +73,7 @@ public: virtual HRESULT Write(const void *, UINT32, UINT32 *) = 0; }; - + class ISequentialOutStream_Array : public ISequentialOutStream { char *data; @@ -120,7 +120,7 @@ public: class ISequentialStreamCRC32 { -protected: +protected: unsigned int crc32; public: ISequentialStreamCRC32() : crc32(0) {} @@ -130,17 +130,17 @@ public: class ISequentialInStreamCRC32_Array : public ISequentialInStream_Array, public ISequentialStreamCRC32 { -public: +public: ISequentialInStreamCRC32_Array(const char *Adata, unsigned Asize) : ISequentialInStream_Array(Adata, Asize) { } - + HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); }; class ISequentialInStreamCRC32_String : public ISequentialInStream_String, public ISequentialStreamCRC32 { -public: +public: ISequentialInStreamCRC32_String(std::string& Adata) : ISequentialInStream_String(Adata) { } - + HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); }; @@ -148,16 +148,16 @@ class ISequentialInStreamCRC32_Istream : public ISequentialInStream_Istream, pub { public: ISequentialInStreamCRC32_Istream(std::istream& Adata) : ISequentialInStream_Istream(Adata) { } - + HRESULT Read(void *aData, UINT32 aSize, UINT32 *aProcessedSize); }; - + class ISequentialOutStreamCRC32_Array : public ISequentialOutStream_Array, public ISequentialStreamCRC32 { public: ISequentialOutStreamCRC32_Array(char *Adata, unsigned Asize) : ISequentialOutStream_Array(Adata, Asize) { } - + HRESULT Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize); }; @@ -165,7 +165,7 @@ class ISequentialOutStreamCRC32_String : public ISequentialOutStream_String, pub { public: ISequentialOutStreamCRC32_String(std::string& Adata) : ISequentialOutStream_String(Adata) { } - + HRESULT Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize); }; @@ -174,7 +174,7 @@ class ISequentialOutStreamCRC32_Ostream : public ISequentialOutStream_Ostream, p { public: ISequentialOutStreamCRC32_Ostream(std::ostream& Adata) : ISequentialOutStream_Ostream(Adata) { } - + HRESULT Write(const void *aData, UINT32 aSize, UINT32 *aProcessedSize); }; diff --git a/zsnes/src/jma/inbyte.h b/zsnes/src/jma/inbyte.h index ece23501..705065fe 100644 --- a/zsnes/src/jma/inbyte.h +++ b/zsnes/src/jma/inbyte.h @@ -39,7 +39,7 @@ class CInByte public: CInByte(UINT32 aBufferSize = 0x100000); ~CInByte(); - + void Init(ISequentialInStream *aStream); bool ReadByte(BYTE &aByte) diff --git a/zsnes/src/jma/jma.cpp b/zsnes/src/jma/jma.cpp index 1a35a26d..be2f00c1 100644 --- a/zsnes/src/jma/jma.cpp +++ b/zsnes/src/jma/jma.cpp @@ -28,80 +28,80 @@ using namespace std; namespace JMA { const char jma_magic[] = { 'J', 'M', 'A', 0, 'N' }; - const unsigned int jma_header_length = 5; + const unsigned int jma_header_length = 5; const unsigned char jma_version = 1; const unsigned int jma_version_length = 1; const unsigned int jma_total_header_length = jma_header_length + jma_version_length + UINT_SIZE; - + //Convert DOS/zip/JMA integer time to to time_t time_t uint_to_time(unsigned short date, unsigned short time) { tm formatted_time; - + formatted_time.tm_mday = date & 0x1F; formatted_time.tm_mon = ((date >> 5) & 0xF) - 1; formatted_time.tm_year = ((date >> 9) & 0x7f) + 80; formatted_time.tm_sec = (time & 0x1F) * 2; formatted_time.tm_min = (time >> 5) & 0x3F; formatted_time.tm_hour = (time >> 11) & 0x1F; - + return(mktime(&formatted_time)); } - - + + //Retreive the file block, what else? void jma_open::retrieve_file_block() throw(jma_errors) { unsigned char uint_buffer[UINT_SIZE]; unsigned char ushort_buffer[USHORT_SIZE]; - + //File block size is the last UINT in the file stream.seekg(-UINT_SIZE,ios::end); stream.read((char *)uint_buffer, UINT_SIZE); size_t file_block_size = charp_to_uint(uint_buffer); - + //Currently at the end of the file, so that's the file size size_t jma_file_size = stream.tellg(); - + //The file block can't be larger than the JMA file without it's header. //This if can probably be improved if (file_block_size >= jma_file_size-jma_total_header_length) { throw(JMA_BAD_FILE); } - + //Seek to before file block so we can read the file block stream.seekg(-((int)file_block_size+UINT_SIZE),ios::end); - + //This is needed if the file block is compressed stringstream decompressed_file_block; //Pointer to where to read file block from (file or decompressed buffer) istream *file_block_stream; - + //Setup file info buffer and byte to read with jma_file_info file_info; - char byte; - + char byte; + stream.get(byte); if (!byte) //If file block is compressed { //Compressed size isn't counting the byte we just read or the UINT for compressed size size_t compressed_size = file_block_size - (1+UINT_SIZE); - + //Read decompressed size / true file block size stream.read((char *)uint_buffer, UINT_SIZE); file_block_size = charp_to_uint(uint_buffer); - + //Setup access methods for decompression ISequentialInStream_Istream compressed_data(stream); ISequentialOutStream_Ostream decompressed_data(decompressed_file_block); - + //Decompress the data if (!decompress_lzma_7z(compressed_data, compressed_size, decompressed_data, file_block_size)) { throw(JMA_DECOMPRESS_FAILED); - } - + } + //Go to beginning, setup pointer to buffer decompressed_file_block.seekg(0, ios::beg); file_block_stream = &decompressed_file_block; @@ -111,8 +111,8 @@ namespace JMA stream.putback(byte); //Putback byte, byte is part of filename, not compressed indicator file_block_stream = &stream; } - - + + //Minimum file name length is 2 bytes, a char and a null //Minimum comment length is 1 byte, a null //There are currently 2 UINTs and 2 USHORTs per file @@ -120,7 +120,7 @@ namespace JMA { //First stored in the file block is the file name null terminated file_info.name = ""; - + file_block_stream->get(byte); while (byte) { @@ -132,8 +132,8 @@ namespace JMA if (!file_info.name.length()) { throw(JMA_BAD_FILE); - } - + } + //Same trick as above for the comment file_info.comment = ""; @@ -143,38 +143,38 @@ namespace JMA file_info.comment += byte; file_block_stream->get(byte); } - + //Next is a UINT representing the file's size file_block_stream->read((char *)uint_buffer, UINT_SIZE); file_info.size = charp_to_uint(uint_buffer); - + //Followed by CRC32 file_block_stream->read((char *)uint_buffer, UINT_SIZE); file_info.crc32 = charp_to_uint(uint_buffer); - + //Special USHORT representation of file's date file_block_stream->read((char *)ushort_buffer, USHORT_SIZE); file_info.date = charp_to_ushort(ushort_buffer); - + //Special USHORT representation of file's time file_block_stream->read((char *)ushort_buffer, USHORT_SIZE); file_info.time = charp_to_ushort(ushort_buffer); - + file_info.buffer = 0; //Pointing to null till we decompress files - + files.push_back(file_info); //Put file info into our structure - + //Subtract size of the file info we just read file_block_size -= file_info.name.length()+file_info.comment.length()+2+UINT_SIZE*2+USHORT_SIZE*2; } } - + //Constructor for opening JMA files for reading - jma_open::jma_open(const char *compressed_file_name) throw (jma_errors) + jma_open::jma_open(const char *compressed_file_name) throw (jma_errors) { decompressed_buffer = 0; compressed_buffer = 0; - + stream.open(compressed_file_name, ios::in | ios::binary); if (!stream.is_open()) { @@ -188,7 +188,7 @@ namespace JMA { throw(JMA_BAD_FILE); } - + //Not the cleanest code but logical stream.read((char *)header, 5); if (*header <= jma_version) @@ -216,7 +216,7 @@ namespace JMA { vector file_info_vector; jma_public_file_info file_info; - + for (vector::iterator i = files.begin(); i != files.end(); i++) { file_info.name = i->name; @@ -226,10 +226,10 @@ namespace JMA file_info.crc32 = i->crc32; file_info_vector.push_back(file_info); } - + return(file_info_vector); } - + //Skip forward a given number of chunks void jma_open::chunk_seek(unsigned int chunk_num) throw(jma_errors) { @@ -238,25 +238,25 @@ namespace JMA { throw(JMA_NO_OPEN); } - + //Clear possible errors so the seek will work stream.clear(); - + //Move forward over header stream.seekg(jma_total_header_length, ios::beg); - unsigned char int4_buffer[UINT_SIZE]; - + unsigned char int4_buffer[UINT_SIZE]; + while (chunk_num--) { //Read in size of chunk stream.read((char *)int4_buffer, UINT_SIZE); - + //Skip chunk plus it's CRC32 - stream.seekg(charp_to_uint(int4_buffer)+UINT_SIZE, ios::cur); + stream.seekg(charp_to_uint(int4_buffer)+UINT_SIZE, ios::cur); } - } - + } + //Return a vector of pointers to each file in the JMA, the buffer to hold all the files //must be initilized outside. vector jma_open::get_all_files(unsigned char *buffer) throw(jma_errors) @@ -266,19 +266,19 @@ namespace JMA { throw(JMA_NO_OPEN); } - + //Seek to the first chunk chunk_seek(0); - + //Set the buffer that decompressed data goes to decompressed_buffer = buffer; - + //If the JMA is not solid if (chunk_size) { - unsigned char int4_buffer[UINT_SIZE]; + unsigned char int4_buffer[UINT_SIZE]; size_t size = get_total_size(files); - + //For each chunk in the file... for (size_t remaining_size = size; remaining_size; remaining_size -= chunk_size) { @@ -299,7 +299,7 @@ namespace JMA //Read all the compressed data in stream.read((char *)compressed_buffer, compressed_size); - + //Read the expected CRC of compressed data from the file stream.read((char *)int4_buffer, UINT_SIZE); @@ -309,17 +309,17 @@ namespace JMA delete[] compressed_buffer; throw(JMA_BAD_FILE); } - + //Decompress the data, cleanup memory on failure - if (!decompress_lzma_7z(compressed_buffer, compressed_size, - decompressed_buffer+size-remaining_size, + if (!decompress_lzma_7z(compressed_buffer, compressed_size, + decompressed_buffer+size-remaining_size, (remaining_size > chunk_size) ? chunk_size : remaining_size)) { delete[] compressed_buffer; throw(JMA_DECOMPRESS_FAILED); } delete[] compressed_buffer; - + if (remaining_size <= chunk_size) //If we just decompressed the remainder { break; @@ -328,25 +328,25 @@ namespace JMA } else //Solidly compressed JMA { - unsigned char int4_buffer[UINT_SIZE]; - + unsigned char int4_buffer[UINT_SIZE]; + //Read the size of the compressed data stream.read((char *)int4_buffer, UINT_SIZE); size_t compressed_size = charp_to_uint(int4_buffer); //Get decompressed size size_t size = get_total_size(files); - + //Setup access methods for decompression ISequentialInStream_Istream compressed_data(stream); ISequentialOutStream_Array decompressed_data(reinterpret_cast(decompressed_buffer), size); - + //Decompress the data if (!decompress_lzma_7z(compressed_data, compressed_size, decompressed_data, size)) { throw(JMA_DECOMPRESS_FAILED); - } - + } + /* //Allocate memory of the right size to hold the compressed data in the JMA try @@ -357,14 +357,14 @@ namespace JMA { throw(JMA_NO_MEM_ALLOC); } - + //Copy the compressed data into memory stream.read((char *)compressed_buffer, compressed_size); size_t size = get_total_size(files); - + //Read the CRC of the compressed data stream.read((char *)int4_buffer, UINT_SIZE); - + //If it doesn't match, complain if (CRC32lib::CRC32(compressed_buffer, compressed_size) != charp_to_uint(int4_buffer)) { @@ -381,10 +381,10 @@ namespace JMA delete[] compressed_buffer; */ } - + vector file_pointers; size_t size = 0; - + //For each file, add it's pointer to the vector, size is pointer offset in the buffer for (vector::iterator i = files.begin(); i != files.end(); i++) { @@ -394,7 +394,7 @@ namespace JMA } //Return the vector of pointers - return(file_pointers); + return(file_pointers); } //Extracts the file with a given name found in the archive to the given buffer @@ -404,10 +404,10 @@ namespace JMA { throw(JMA_NO_OPEN); } - + size_t size_to_skip = 0; size_t our_file_size = 0; - + //Search through the vector of file information for (vector::iterator i = files.begin(); i != files.end(); i++) { @@ -417,11 +417,11 @@ namespace JMA our_file_size = i->size; break; } - + //Keep a running total of size size_to_skip += i->size; } - + if (!our_file_size) //File with the specified name was not found in the archive { throw(JMA_FILE_NOT_FOUND); @@ -433,14 +433,14 @@ namespace JMA get_all_files(buffer); return; } - + if (chunk_size) //we are using non-solid archive.. { unsigned int chunks_to_skip = size_to_skip / chunk_size; - + //skip over requisite number of chunks chunk_seek(chunks_to_skip); - + //Allocate memory for compressed and decompressed data unsigned char *comp_buffer = 0, *decomp_buffer = 0; try @@ -454,7 +454,7 @@ namespace JMA { throw(JMA_NO_MEM_ALLOC); } - + size_t first_chunk_offset = size_to_skip % chunk_size; unsigned char int4_buffer[UINT_SIZE]; for (size_t i = 0; i < our_file_size;) @@ -462,29 +462,29 @@ namespace JMA //Get size stream.read((char *)int4_buffer, UINT_SIZE); size_t compressed_size = charp_to_uint(int4_buffer); - + //Read all the compressed data in stream.read((char *)comp_buffer, compressed_size); //Read the CRC of the compressed data stream.read((char *)int4_buffer, UINT_SIZE); - + //If it doesn't match, complain if (CRC32lib::CRC32(comp_buffer, compressed_size) != charp_to_uint(int4_buffer)) { delete[] comp_buffer; throw(JMA_BAD_FILE); } - + //Decompress chunk if (!decompress_lzma_7z(comp_buffer, compressed_size, decomp_buffer, chunk_size)) { delete[] comp_buffer; throw(JMA_DECOMPRESS_FAILED); } - + size_t copy_amount = our_file_size-i > chunk_size-first_chunk_offset ? chunk_size-first_chunk_offset : our_file_size-i; - + memcpy(buffer+i, decomp_buffer+first_chunk_offset, copy_amount); first_chunk_offset = 0; //Set to zero since this is only for the first iteration i += copy_amount; @@ -502,11 +502,11 @@ namespace JMA { throw(JMA_NO_MEM_ALLOC); } - + get_all_files(decomp_buffer); - + memcpy(buffer, decomp_buffer+size_to_skip, our_file_size); - + delete[] decomp_buffer; } } @@ -515,32 +515,32 @@ namespace JMA { return(chunk_size ? false : true); } - + const char *jma_error_text(jma_errors error) { switch (error) { case JMA_NO_CREATE: return("JMA could not be created"); - + case JMA_NO_MEM_ALLOC: return("Memory for JMA could be allocated"); - + case JMA_NO_OPEN: return("JMA could not be opened"); - + case JMA_BAD_FILE: return("Invalid/Corrupt JMA"); - + case JMA_UNSUPPORTED_VERSION: return("JMA version not supported"); - + case JMA_COMPRESS_FAILED: return("JMA compression failed"); - + case JMA_DECOMPRESS_FAILED: return("JMA decompression failed"); - + case JMA_FILE_NOT_FOUND: return("File not found in JMA"); } diff --git a/zsnes/src/jma/jma.h b/zsnes/src/jma/jma.h index 3cd9783b..d5268721 100644 --- a/zsnes/src/jma/jma.h +++ b/zsnes/src/jma/jma.h @@ -27,10 +27,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. namespace JMA { - enum jma_errors { JMA_NO_CREATE, JMA_NO_MEM_ALLOC, JMA_NO_OPEN, JMA_BAD_FILE, + enum jma_errors { JMA_NO_CREATE, JMA_NO_MEM_ALLOC, JMA_NO_OPEN, JMA_BAD_FILE, JMA_UNSUPPORTED_VERSION, JMA_COMPRESS_FAILED, JMA_DECOMPRESS_FAILED, JMA_FILE_NOT_FOUND }; - + struct jma_file_info_base { std::string name; @@ -38,12 +38,12 @@ namespace JMA size_t size; unsigned int crc32; }; - + struct jma_public_file_info : jma_file_info_base { time_t datetime; }; - + struct jma_file_info : jma_file_info_base { unsigned short date; @@ -59,7 +59,7 @@ namespace JMA { size += i->size; //We do have a problem if this wraps around } - + return(size); } @@ -68,23 +68,23 @@ namespace JMA public: jma_open(const char *) throw(jma_errors); ~jma_open(); - + std::vector get_files_info(); std::vector get_all_files(unsigned char *) throw(jma_errors); void extract_file(std::string& name, unsigned char *) throw(jma_errors); bool is_solid(); - + private: std::ifstream stream; std::vector files; size_t chunk_size; unsigned char *decompressed_buffer; unsigned char *compressed_buffer; - + void chunk_seek(unsigned int) throw(jma_errors); void retrieve_file_block() throw(jma_errors); }; - + const char *jma_error_text(jma_errors); } #endif diff --git a/zsnes/src/jma/lencoder.h b/zsnes/src/jma/lencoder.h index 215f6e9e..5fe9cc63 100644 --- a/zsnes/src/jma/lencoder.h +++ b/zsnes/src/jma/lencoder.h @@ -52,7 +52,7 @@ class CDecoder CBitTreeDecoder m_LowCoder[kNumPosStatesMax]; CMyBitDecoder m_Choice2; CBitTreeDecoder m_MidCoder[kNumPosStatesMax]; - CBitTreeDecoder m_HighCoder; + CBitTreeDecoder m_HighCoder; UINT32 m_NumPosStates; public: void Create(UINT32 aNumPosStates) diff --git a/zsnes/src/jma/litcoder.h b/zsnes/src/jma/litcoder.h index d0e71e26..c5ad476f 100644 --- a/zsnes/src/jma/litcoder.h +++ b/zsnes/src/jma/litcoder.h @@ -63,7 +63,7 @@ public: // UINT32 aBit = m_Decoders[1 + aMatchBit][aSymbol].Decode(aRangeDecoder); // aSymbol = (aSymbol << 1) | aBit; UINT32 aBit; - RC_GETBIT2(kNumMoveBits, m_Decoders[1 + aMatchBit][aSymbol].m_Probability, aSymbol, + RC_GETBIT2(kNumMoveBits, m_Decoders[1 + aMatchBit][aSymbol].m_Probability, aSymbol, aBit = 0, aBit = 1) if (aMatchBit != aBit) { @@ -91,7 +91,7 @@ public: CDecoder(): m_Coders(0) {} ~CDecoder() { Free(); } void Free() - { + { delete []m_Coders; m_Coders = 0; } diff --git a/zsnes/src/jma/lzma.h b/zsnes/src/jma/lzma.h index 4e20cd1e..fc6a2fd7 100644 --- a/zsnes/src/jma/lzma.h +++ b/zsnes/src/jma/lzma.h @@ -68,16 +68,16 @@ protected: } }; -const int kNumPosSlotBits = 6; -const int kDicLogSizeMax = 28; -const int kDistTableSizeMax = kDicLogSizeMax * 2; +const int kNumPosSlotBits = 6; +const int kDicLogSizeMax = 28; +const int kDistTableSizeMax = kDicLogSizeMax * 2; extern UINT32 kDistStart[kDistTableSizeMax]; -const BYTE kDistDirectBits[kDistTableSizeMax] = +const BYTE kDistDirectBits[kDistTableSizeMax] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, - 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, - 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26 + 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, + 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26 }; const UINT32 kNumLenToPosStates = 4; diff --git a/zsnes/src/jma/lzmadec.cpp b/zsnes/src/jma/lzmadec.cpp index 118fad04..2cc75a03 100644 --- a/zsnes/src/jma/lzmadec.cpp +++ b/zsnes/src/jma/lzmadec.cpp @@ -30,7 +30,7 @@ HRESULT CDecoder::SetDictionarySize(UINT32 aDictionarySize) { if (aDictionarySize > (1 << kDicLogSizeMax)) return E_INVALIDARG; - + UINT32 aWindowReservSize = MyMax(aDictionarySize, UINT32(1 << 21)); if (m_DictionarySize != aDictionarySize) @@ -100,9 +100,9 @@ HRESULT CDecoder::Init(ISequentialInStream *anInStream, m_MatchRep1ChoiceDecoders[i].Init(); m_MatchRep2ChoiceDecoders[i].Init(); } - + m_LiteralDecoder.Init(); - + // m_RepMatchLenDecoder.Init(); for (i = 0; (UINT32) i < kNumLenToPosStates; i++) @@ -110,7 +110,7 @@ HRESULT CDecoder::Init(ISequentialInStream *anInStream, for(i = 0; i < kNumPosModels; i++) m_PosDecoders[i].Init(); - + m_LenDecoder.Init(); m_RepMatchLenDecoder.Init(); @@ -120,7 +120,7 @@ HRESULT CDecoder::Init(ISequentialInStream *anInStream, } HRESULT CDecoder::CodeReal(ISequentialInStream *anInStream, - ISequentialOutStream *anOutStream, + ISequentialOutStream *anOutStream, const UINT64 *anInSize, const UINT64 *anOutSize) { if (anOutSize == NULL) @@ -151,21 +151,21 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *anInStream, if(aPeviousIsMatch) { BYTE aMatchByte = m_OutWindowStream.GetOneByte(0 - aRepDistances[0] - 1); - aPreviousByte = m_LiteralDecoder.DecodeWithMatchByte(&m_RangeDecoder, + aPreviousByte = m_LiteralDecoder.DecodeWithMatchByte(&m_RangeDecoder, UINT32(aNowPos64), aPreviousByte, aMatchByte); aPeviousIsMatch = false; } else - aPreviousByte = m_LiteralDecoder.DecodeNormal(&m_RangeDecoder, + aPreviousByte = m_LiteralDecoder.DecodeNormal(&m_RangeDecoder, UINT32(aNowPos64), aPreviousByte); m_OutWindowStream.PutOneByte(aPreviousByte); aNowPos64++; } - else + else { aPeviousIsMatch = true; UINT32 aDistance, aLen; - if(m_MatchChoiceDecoders[aState.m_Index].Decode(&m_RangeDecoder) == + if(m_MatchChoiceDecoders[aState.m_Index].Decode(&m_RangeDecoder) == (UINT32) kMatchChoiceRepetitionIndex) { if(m_MatchRepChoiceDecoders[aState.m_Index].Decode(&m_RangeDecoder) == 0) @@ -190,7 +190,7 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *anInStream, aRepDistances[1] = aRepDistances[0]; // aCounts[3 + 1]++; } - else + else { if (m_MatchRep2ChoiceDecoders[aState.m_Index].Decode(&m_RangeDecoder) == 0) { @@ -225,7 +225,7 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *anInStream, aDistance += m_PosDecoders[aPosSlot - kStartPosModelIndex].Decode(&m_RangeDecoder); else { - aDistance += (m_RangeDecoder.DecodeDirectBits(kDistDirectBits[aPosSlot] - + aDistance += (m_RangeDecoder.DecodeDirectBits(kDistDirectBits[aPosSlot] - kNumAlignBits) << kNumAlignBits); aDistance += m_PosAlignDecoder.Decode(&m_RangeDecoder); } @@ -233,11 +233,11 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *anInStream, else aDistance = aPosSlot; - + aRepDistances[3] = aRepDistances[2]; aRepDistances[2] = aRepDistances[1]; aRepDistances[1] = aRepDistances[0]; - + aRepDistances[0] = aDistance; // UpdateStat(aLen, aPosSlot); } @@ -285,7 +285,7 @@ HRESULT CDecoder::ReadCoderProperties(ISequentialInStream *anInStream) UINT8 uint_buffer[UINT_SIZE]; RETURN_IF_NOT_S_OK(anInStream->Read(uint_buffer, sizeof(aDictionarySize), &aProcessesedSize)); aDictionarySize = charp_to_uint(uint_buffer); - + if (aProcessesedSize != sizeof(aDictionarySize)) return E_INVALIDARG; diff --git a/zsnes/src/jma/lzmadec.h b/zsnes/src/jma/lzmadec.h index 90799f36..88234448 100644 --- a/zsnes/src/jma/lzmadec.h +++ b/zsnes/src/jma/lzmadec.h @@ -48,14 +48,14 @@ class CDecoder CReverseBitTreeDecoder m_PosAlignDecoder; // CBitTreeDecoder2 m_PosDecoders[kNumPosModels]; // CBitTreeDecoder m_PosAlignDecoder; - + NLength::CDecoder m_LenDecoder; NLength::CDecoder m_RepMatchLenDecoder; NLiteral::CDecoder m_LiteralDecoder; UINT32 m_DictionarySize; - + UINT32 m_PosStateMask; HRESULT Create(); @@ -69,7 +69,7 @@ class CDecoder public: CDecoder(); - + HRESULT Code(ISequentialInStream *anInStream, ISequentialOutStream *anOutStream, const UINT64 *anInSize, const UINT64 *anOutSize); HRESULT ReadCoderProperties(ISequentialInStream *anInStream); diff --git a/zsnes/src/jma/rcdefs.h b/zsnes/src/jma/rcdefs.h index 0383460e..46df11f9 100644 --- a/zsnes/src/jma/rcdefs.h +++ b/zsnes/src/jma/rcdefs.h @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #define RC_INIT_VAR \ UINT32 aRange = aRangeDecoder->m_Range; \ - UINT32 aCode = aRangeDecoder->m_Code; + UINT32 aCode = aRangeDecoder->m_Code; #define RC_FLUSH_VAR \ aRangeDecoder->m_Range = aRange; \ @@ -56,6 +56,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA }} \ RC_NORMALIZE -#define RC_GETBIT(aNumMoveBits, aProb, aModelIndex) RC_GETBIT2(aNumMoveBits, aProb, aModelIndex, ; , ;) +#define RC_GETBIT(aNumMoveBits, aProb, aModelIndex) RC_GETBIT2(aNumMoveBits, aProb, aModelIndex, ; , ;) #endif diff --git a/zsnes/src/jma/rngcoder.h b/zsnes/src/jma/rngcoder.h index 0916f23e..59118580 100644 --- a/zsnes/src/jma/rngcoder.h +++ b/zsnes/src/jma/rngcoder.h @@ -43,7 +43,7 @@ public: m_Range <<= 8; } } - + void Init(ISequentialInStream *aStream) { m_Stream.Init(aStream); @@ -71,7 +71,7 @@ public: m_Range >>= aNumTotalBits; UINT32 aThreshold = m_Code / m_Range; m_Code -= aThreshold * m_Range; - + Normalize(); return aThreshold; } @@ -88,7 +88,7 @@ public: UINT32 DecodeDirectBits(UINT32 aNumTotalBits) { UINT32 aRange = m_Range; - UINT32 aCode = m_Code; + UINT32 aCode = m_Code; UINT32 aResult = 0; for (UINT32 i = aNumTotalBits; i > 0; i--) { @@ -109,7 +109,7 @@ public: if (aRange < kTopValue) { aCode = (aCode << 8) | m_Stream.ReadByte(); - aRange <<= 8; + aRange <<= 8; } } m_Range = aRange; diff --git a/zsnes/src/jma/winout.h b/zsnes/src/jma/winout.h index 240ee891..1e64e2e8 100644 --- a/zsnes/src/jma/winout.h +++ b/zsnes/src/jma/winout.h @@ -27,7 +27,7 @@ namespace NWindow { // m_KeepSizeBefore: how mach BYTEs must be in buffer before m_Pos; // m_KeepSizeAfter: how mach BYTEs must be in buffer after m_Pos; -// m_KeepSizeReserv: how mach BYTEs must be in buffer for Moving Reserv; +// m_KeepSizeReserv: how mach BYTEs must be in buffer for Moving Reserv; // must be >= aKeepSizeAfter; // test it class COut @@ -55,14 +55,14 @@ public: void Init(ISequentialOutStream *aStream, bool aSolid = false); HRESULT Flush(); - + UINT32 GetCurPos() const { return m_Pos; } const BYTE *GetPointerToCurrentPos() const { return m_Buffer + m_Pos;}; void CopyBackBlock(UINT32 aDistance, UINT32 aLen) { if (m_Pos >= m_PosLimit) - MoveBlockBackward(); + MoveBlockBackward(); BYTE *p = m_Buffer + m_Pos; aDistance++; for(UINT32 i = 0; i < aLen; i++) @@ -73,7 +73,7 @@ public: void PutOneByte(BYTE aByte) { if (m_Pos >= m_PosLimit) - MoveBlockBackward(); + MoveBlockBackward(); m_Buffer[m_Pos++] = aByte; } diff --git a/zsnes/src/jma/zsnesjma.cpp b/zsnes/src/jma/zsnesjma.cpp index f96a4a90..07a28d94 100644 --- a/zsnes/src/jma/zsnesjma.cpp +++ b/zsnes/src/jma/zsnesjma.cpp @@ -1,66 +1,66 @@ -/* -Copyright (C) 2004 NSRT Team ( http://nsrt.edgeemu.com ) - -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., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include -using namespace std; - -#include "zsnesjma.h" -#include "jma.h" - -extern "C" { -extern unsigned char *romdata; -extern unsigned int curromspace; -extern unsigned int maxromspace; -} - -void load_jma_file(const char *filename) -{ - try - { - JMA::jma_open JMAFile(filename); - vector file_info = JMAFile.get_files_info(); - - string our_file_name; - size_t our_file_size = 0; - - for (vector::iterator i = file_info.begin(); i != file_info.end(); i++) - { - //Check for valid ROM based on size - if ((i->size <= maxromspace+512) && (i->size > our_file_size)) - { - our_file_name = i->name; - our_file_size = i->size; - } - } - - if (!our_file_size) - { - return; - } - - JMAFile.extract_file(our_file_name, romdata); - - curromspace = our_file_size; - } - catch (JMA::jma_errors jma_error) - { - //No need to do anything - } -} - +/* +Copyright (C) 2004 NSRT Team ( http://nsrt.edgeemu.com ) + +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., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include +using namespace std; + +#include "zsnesjma.h" +#include "jma.h" + +extern "C" { +extern unsigned char *romdata; +extern unsigned int curromspace; +extern unsigned int maxromspace; +} + +void load_jma_file(const char *filename) +{ + try + { + JMA::jma_open JMAFile(filename); + vector file_info = JMAFile.get_files_info(); + + string our_file_name; + size_t our_file_size = 0; + + for (vector::iterator i = file_info.begin(); i != file_info.end(); i++) + { + //Check for valid ROM based on size + if ((i->size <= maxromspace+512) && (i->size > our_file_size)) + { + our_file_name = i->name; + our_file_size = i->size; + } + } + + if (!our_file_size) + { + return; + } + + JMAFile.extract_file(our_file_name, romdata); + + curromspace = our_file_size; + } + catch (JMA::jma_errors jma_error) + { + //No need to do anything + } +} + diff --git a/zsnes/src/linux/sdllink.c b/zsnes/src/linux/sdllink.c index f26095a6..2ae3611d 100644 --- a/zsnes/src/linux/sdllink.c +++ b/zsnes/src/linux/sdllink.c @@ -960,7 +960,7 @@ void UpdateSound(void *userdata, Uint8 * stream, int len) { return; } - + if (left <= len) { memcpy(stream, &Buffer[Buffer_head], left); @@ -970,7 +970,7 @@ void UpdateSound(void *userdata, Uint8 * stream, int len) Buffer_fill -= left; } - if (len) + if (len) { memcpy(stream, &Buffer[Buffer_head], len); Buffer_head += len; @@ -1262,28 +1262,28 @@ void spc_sanitize_files() { pid_t spc_fork() { pid_t childpid; - + if ((childpid = fork()) == -1) return -1; - + //If this us the parent proccess nothing more to do if (childpid != 0) return childpid; - + //This is the child proccess - + spc_sanitize_files(); - + /* There actually is a bug here which I submitted to the authors of the book -Nach - + The bug is as follows: - The parent returns the child proccess ID in event of success. + The parent returns the child proccess ID in event of success. The child returns 0 on success if and only if it's spc_drop_privileges() call is successful. - It is possible that the parent will return with a pid > 0, while the child never returns + It is possible that the parent will return with a pid > 0, while the child never returns from spc_fork thus causing a programming error. - The function should be rewritten that the parent doesn't return till it knows if the + The function should be rewritten that the parent doesn't return till it knows if the child is able to return or not. And then return -1 or the child pid. - + For out purposes in ZSNES to launch a browser, this bug does not effect us. But be careful if you copy this code to use somewhere else. */ @@ -1291,7 +1291,7 @@ pid_t spc_fork() { { exit(0); } - + return 0; } @@ -1304,21 +1304,21 @@ void LaunchBrowser(char *browser) void ZsnesPage() { if (spc_fork()) //If fork failed, or we are the parent - { + { MouseX = 0; - MouseY = 0; + MouseY = 0; return; } - + //We are now the child proccess - + //If any of these LaunchBrowser() calls return that means it failed and we should try the next one LaunchBrowser("mozilla"); LaunchBrowser("mozilla-firefox"); LaunchBrowser("konqueror"); LaunchBrowser("lynx"); LaunchBrowser("links"); - + exit(0); //All browser launches failed, oh well } diff --git a/zsnes/src/linux/sw_draw.c b/zsnes/src/linux/sw_draw.c index 4abcf672..8a407cfd 100644 --- a/zsnes/src/linux/sw_draw.c +++ b/zsnes/src/linux/sw_draw.c @@ -48,17 +48,17 @@ BOOL sw_start(int width, int height, int req_depth, int FullScreen) //int i; Uint32 flags = SDL_DOUBLEBUF | SDL_SWSURFACE; DWORD GBitMask; - + flags |= (FullScreen ? SDL_FULLSCREEN : 0); - + SurfaceX = width; SurfaceY = height; surface = SDL_SetVideoMode(SurfaceX, SurfaceY, req_depth, flags); if (surface == NULL) { fprintf (stderr, "Could not set %dx%d video mode: %s\n", SurfaceX, SurfaceY, SDL_GetError ()); return FALSE; - + } - + SurfaceLocking = SDL_MUSTLOCK(surface); SDL_WarpMouse(SurfaceX/4,SurfaceY/4); @@ -173,7 +173,7 @@ void sw_drawwin() break; default: break; - } + } } else { copy640x480x16bwin(); } @@ -195,7 +195,7 @@ void sw_drawwin() break; default: break; - } + } } else { copy640x480x16bwin(); } diff --git a/zsnes/src/linux/zfilew.c b/zsnes/src/linux/zfilew.c index 1b4cf43b..47fbd045 100644 --- a/zsnes/src/linux/zfilew.c +++ b/zsnes/src/linux/zfilew.c @@ -127,7 +127,7 @@ DWORD ZOpenFile() { if(ZOpenMode==0) { - if (TextFile) + if (TextFile) FILEHANDLE[CurrentHandle]=fopen(ZOpenFileName,"rb"); else FILEHANDLE[CurrentHandle]=(FILE *)gzopen(ZOpenFileName,"rb"); @@ -140,11 +140,11 @@ DWORD ZOpenFile() } if(ZOpenMode==1) { - if (TextFile) + if (TextFile) FILEHANDLE[CurrentHandle]=fopen(ZOpenFileName,"wb"); else FILEHANDLE[CurrentHandle]=(FILE *)gzopen(ZOpenFileName,"wb"); - if(FILEHANDLE[CurrentHandle]!=NULL) + if(FILEHANDLE[CurrentHandle]!=NULL) { CurrentHandle+=1; return(CurrentHandle-1); @@ -153,11 +153,11 @@ DWORD ZOpenFile() } if(ZOpenMode==2) { - if (TextFile) + if (TextFile) FILEHANDLE[CurrentHandle]=fopen(ZOpenFileName,"r+b"); else FILEHANDLE[CurrentHandle]=gzopen(ZOpenFileName,"r+b"); - if(FILEHANDLE[CurrentHandle]!=NULL) + if(FILEHANDLE[CurrentHandle]!=NULL) { CurrentHandle+=1; return(CurrentHandle-1); @@ -184,7 +184,7 @@ DWORD ZFileSeek() mode = SEEK_SET; else if (ZFileSeekMode==1) { mode = SEEK_END; - if (TextFile==0) + if (TextFile==0) printf("Warning : gzseek(SEEK_END) not supported"); } else return (0xFFFFFFFF); @@ -206,8 +206,8 @@ DWORD ZFileRead() ZFileReadSize, FILEHANDLE[ZFileReadHandle])); else - return(gzread(FILEHANDLE[ZFileReadHandle], - ZFileReadBlock, + return(gzread(FILEHANDLE[ZFileReadHandle], + ZFileReadBlock, ZFileReadSize)); } @@ -221,11 +221,11 @@ DWORD ZFileWrite() ZFileWriteSize, FILEHANDLE[ZFileWriteHandle]); else - res = gzwrite(FILEHANDLE[ZFileWriteHandle], - ZFileWriteBlock, + res = gzwrite(FILEHANDLE[ZFileWriteHandle], + ZFileWriteBlock, ZFileWriteSize); - - if (res!=ZFileWriteSize) + + if (res!=ZFileWriteSize) return(0xFFFFFFFF); return(0); @@ -262,7 +262,7 @@ DWORD ZFileMKDir() { #ifdef __LINUX__ return(mkdir(MKPath, (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH))); -#else +#else return(mkdir(MKPath)); #endif } @@ -315,30 +315,30 @@ DWORD ZFileFindNext() if (globcur == -1) return -1; - + globcur++; if (globcur > globbuf.gl_pathc) /* >= */ return -1; - + if (globcur == globbuf.gl_pathc) { /* this is the end, so just add it ourselves */ *(char *)(DTALocPos + 0x15) = 0x10; strcpy((char *)DTALocPos + 0x1E, ".."); return 0; } - + *(char *)(DTALocPos + 0x15) = 0; stat ( globbuf.gl_pathv[globcur], &filetype ); - + if(ZFileFindATTRIB&0x10 && !S_ISDIR ( filetype.st_mode )) return(ZFileFindNext()); if(((ZFileFindATTRIB&0x10)==0) && S_ISDIR ( filetype.st_mode )) return(ZFileFindNext()); - + if ( S_ISDIR ( filetype.st_mode )) *(char *)(DTALocPos + 0x15) = 0x10; strcpy((char *)DTALocPos + 0x1E, globbuf.gl_pathv[globcur]); - + #else TempFind=_findnext(FindFirstHandle,&FindDataStruct); if(TempFind==-1) return(-1); @@ -365,7 +365,7 @@ DWORD ZFileFindFirst() globfree(&globbuf); globcur = -1; } - + if (glob(ZFileFindPATH, 0, NULL, &globbuf)) return -1; globcur = 0; @@ -378,10 +378,10 @@ DWORD ZFileFindFirst() #endif stat ( globbuf.gl_pathv[globcur], &filetype ); - + if(ZFileFindATTRIB&0x10 && !S_ISDIR ( filetype.st_mode )) return(ZFileFindNext()); if(((ZFileFindATTRIB&0x10)==0) && S_ISDIR ( filetype.st_mode )) return(ZFileFindNext()); - + if ( S_ISDIR ( filetype.st_mode )) *(char *)(DTALocPos + 0x15) = 0x10; @@ -482,12 +482,12 @@ void obtaindir() } strcat(zcfgdir, ZCFG_DIR); tmp = opendir(zcfgdir); - if (tmp == NULL) + if (tmp == NULL) { MKPath = zcfgdir; ZFileMKDir(); - } - else + } + else { closedir(tmp); } @@ -495,7 +495,7 @@ void obtaindir() { strcpy(SRAMDir, zcfgdir); } - if (*LoadDir == 0) + if (*LoadDir == 0) { getcwd(LoadDir, 512); } @@ -515,7 +515,7 @@ void GetFilename() strcpy(&fnamest, tmp); fnamest = size; statefileloc-=(tmp-&fnamest); - + tmp = &fnames; *tmp = '/'; while (*tmp!=0) tmp++; @@ -532,7 +532,7 @@ void pushdir() { olddir = (char *)malloc(128); getcwd(olddir, 128); -} +} void popdir() { diff --git a/zsnes/src/macros.mac b/zsnes/src/macros.mac index ab9bbcc3..0f2cd0c6 100644 --- a/zsnes/src/macros.mac +++ b/zsnes/src/macros.mac @@ -76,14 +76,14 @@ section .text ; macro more or less similar to STUB_FUNCTION -; you can call it without argument, +; you can call it without argument, ; or with a string arg which will be displayed %macro STUB_ASM 0-1 "STUB_ASM" %ifndef __PRINTF__ %define __PRINTF__ EXTSYM printf %endif -[section .data] +[section .data] %%string: db %1, 0 %%strformat: db '%s in %s line %u',13, 10,0 %%filename: db __FILE__, 0 @@ -111,7 +111,7 @@ popad %define __PRINTF__ EXTSYM printf %endif -[section .data] +[section .data] %%strformat: db '%s in %s line %u',13, 10,0 %%filename: db __FILE__, 0 __SECT__ @@ -126,7 +126,7 @@ push eax mov eax, %%strformat push eax call printf -add esp, 16 +add esp, 16 popad %endmacro @@ -136,7 +136,7 @@ popad %define __PRINTF__ EXTSYM printf %endif -[section .data] +[section .data] %%strformat: db '%x in %s line %u',13, 10,0 %%filename: db __FILE__, 0 __SECT__ diff --git a/zsnes/src/net/ztcp.c b/zsnes/src/net/ztcp.c index 57d1378a..11846005 100644 --- a/zsnes/src/net/ztcp.c +++ b/zsnes/src/net/ztcp.c @@ -50,7 +50,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. // that packet will be re-sent and reset the timer value back to 60. // If the local side receives the reply packet, it will set the timer // counter to -1. -// +// // Gameplay Packets: // Note: Gameplay counter is separate from normal packet counter. // Note2: When referring to TCP/IP, it refers to the Normal Packets above. @@ -264,7 +264,7 @@ void GetUDPStatus() { int isipval(char *name){ int i=0; - + while(name[i]!=0){ if (!((name[i]=='.') || ((name[i]>='0') && (name[i]<='9')))) return(0); @@ -388,7 +388,7 @@ int ConnectServer(char *servername, unsigned int port) // MessageBox(NULL,blah, // "Error", // MB_SYSTEMMODAL|MB_OK); - + return(0); // retval = send(gamesocket,blah,1,0); @@ -653,7 +653,7 @@ int ServerCheckNewClient() return(1); } return(0); - } + } if(serversocket == INVALID_SOCKET) { @@ -1056,7 +1056,7 @@ char SendBufferSize[256];*/ return(-1); } } - return(0); + return(0); } /* send data with the socket */ @@ -1146,7 +1146,7 @@ int GetData(int dsize,unsigned char *dptr) retval = packetreceivesize[i]; packetreceived[(i+128) & 0xFF]=0; packetrecvhead=(packetrecvhead+1) & 0xFF; - return(retval); + return(retval); } i=RecvPtr; diff --git a/zsnes/src/objfix.c b/zsnes/src/objfix.c index d7d69432..7135b7e2 100755 --- a/zsnes/src/objfix.c +++ b/zsnes/src/objfix.c @@ -1,129 +1,129 @@ -/* -Copyright (c) 1998-2005 Charles Bilyue'. - -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., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include -#include - -int open_error(const char *filename, const char *mode) -{ - printf("Failure opening %s for %s\n"); - return 1; -} - -int main(int argc, char **argv) -{ - int c; - int section_count; - FILE *in, *out; - unsigned char section_header[40]; - - if (argc < 2 || argc > 3) - { - printf("Fixes MS Win32 object files to be compatible with the incorrect\n"); - printf(" implementation in MinGW32.\n"); - printf("Usage: objfix infile [outfile]\n"); - return 1; - } - - in = fopen(argv[1], (argc == 2 ? "rb+" : "rb")); - if (!in) return open_error(argv[1], (argc == 2 ? "read" : "update")); - - if (argc == 3) - { - out = fopen(argv[2], "wb"); - if (!out) return open_error(argv[1], (argc == 2 ? "read" : "update")); - } - else - { - out = NULL; - } - - if (out) - { - fputc(fgetc(in), out); - fputc(fgetc(in), out); - - fputc(section_count = fgetc(in), out); - fputc(c = fgetc(in), out); - section_count += c << 8; - - for (c = 4; c < 0x14; c++) - { - fputc(fgetc(in), out); - } - - for (c = 0; c < section_count; c++) - { - fread(section_header, 1, 40, in); - - if (!strncmp(section_header, ".bss", 8)) - { - memcpy(section_header + 8, section_header + 16, 4); - memset(section_header + 16, 0, 4); - } - else - { - memset(section_header + 8, 0, 4); - } - - fwrite(section_header, 1, 40, out); - } - - while ((c = fgetc(in)) != EOF) - { - fputc(c, out); - } - } - else - { - fgetc(in); - fgetc(in); - - section_count = fgetc(in); - section_count += fgetc(in) << 8; - - fseek(in, 0x14, SEEK_SET); - - for (c = 0; c < section_count; c++) - { - fread(section_header, 1, 40, in); - - fseek(in, -40, SEEK_CUR); - - if (!strncmp(section_header, ".bss", 8)) - { - memcpy(section_header + 8, section_header + 16, 4); - memset(section_header + 16, 0, 4); - } - else - { - memset(section_header + 8, 0, 4); - } - - fwrite(section_header, 1, 40, in); - - fseek(in, 0, SEEK_CUR); - } - } - - fclose(in); - if (out) fclose(out); - - return 0; -} +/* +Copyright (c) 1998-2005 Charles Bilyue'. + +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., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include +#include + +int open_error(const char *filename, const char *mode) +{ + printf("Failure opening %s for %s\n"); + return 1; +} + +int main(int argc, char **argv) +{ + int c; + int section_count; + FILE *in, *out; + unsigned char section_header[40]; + + if (argc < 2 || argc > 3) + { + printf("Fixes MS Win32 object files to be compatible with the incorrect\n"); + printf(" implementation in MinGW32.\n"); + printf("Usage: objfix infile [outfile]\n"); + return 1; + } + + in = fopen(argv[1], (argc == 2 ? "rb+" : "rb")); + if (!in) return open_error(argv[1], (argc == 2 ? "read" : "update")); + + if (argc == 3) + { + out = fopen(argv[2], "wb"); + if (!out) return open_error(argv[1], (argc == 2 ? "read" : "update")); + } + else + { + out = NULL; + } + + if (out) + { + fputc(fgetc(in), out); + fputc(fgetc(in), out); + + fputc(section_count = fgetc(in), out); + fputc(c = fgetc(in), out); + section_count += c << 8; + + for (c = 4; c < 0x14; c++) + { + fputc(fgetc(in), out); + } + + for (c = 0; c < section_count; c++) + { + fread(section_header, 1, 40, in); + + if (!strncmp(section_header, ".bss", 8)) + { + memcpy(section_header + 8, section_header + 16, 4); + memset(section_header + 16, 0, 4); + } + else + { + memset(section_header + 8, 0, 4); + } + + fwrite(section_header, 1, 40, out); + } + + while ((c = fgetc(in)) != EOF) + { + fputc(c, out); + } + } + else + { + fgetc(in); + fgetc(in); + + section_count = fgetc(in); + section_count += fgetc(in) << 8; + + fseek(in, 0x14, SEEK_SET); + + for (c = 0; c < section_count; c++) + { + fread(section_header, 1, 40, in); + + fseek(in, -40, SEEK_CUR); + + if (!strncmp(section_header, ".bss", 8)) + { + memcpy(section_header + 8, section_header + 16, 4); + memset(section_header + 16, 0, 4); + } + else + { + memset(section_header + 8, 0, 4); + } + + fwrite(section_header, 1, 40, in); + + fseek(in, 0, SEEK_CUR); + } + } + + fclose(in); + if (out) fclose(out); + + return 0; +} diff --git a/zsnes/src/parsegen.cpp b/zsnes/src/parsegen.cpp index 6660113b..7b85a859 100644 --- a/zsnes/src/parsegen.cpp +++ b/zsnes/src/parsegen.cpp @@ -106,7 +106,7 @@ char *find_next_match(char *str, char match_char) if (str[1]) { str++; - } + } else { break; @@ -115,8 +115,8 @@ char *find_next_match(char *str, char match_char) str++; } return(pos); -} - +} + //This is like strtok(), except this understands quoted characters and updates error locations char *get_token(char *str, char *delim) { @@ -127,14 +127,14 @@ char *get_token(char *str, char *delim) { pos = str; } - + if (pos) { - //Skip delimiters + //Skip delimiters while (*pos && strchr(delim, *pos)) { pos++; - } + } if (*pos) { token = pos; @@ -152,7 +152,7 @@ char *get_token(char *str, char *delim) } } pos++; - } + } if (*pos) { *pos++ = '\0'; @@ -187,7 +187,7 @@ char *find_chr(char *str, char match_char) } str++; } - return(pos); + return(pos); } @@ -204,7 +204,7 @@ string hex_convert(string str) { str.erase(0, 1); } - + size_t h_pos; while ((h_pos = str.find_first_of("hH")) != string::npos) { @@ -230,7 +230,7 @@ ssize_t enhanced_atoi(const char *str) { cerr << "Error: Can not get accurate value information (eatio.res)." << endl; } - + //Biggest cheat of all time ofstream out_stream("eatio.c"); if (out_stream) @@ -248,12 +248,12 @@ ssize_t enhanced_atoi(const char *str) << "}\n\n"; out_stream.close(); -#ifdef MSC_VER +#ifdef MSC_VER system("cl /Foeatio.exe eatio.c"); -#else +#else system("gcc -o eatio.exe eatio.c -s"); #endif - + system("."SLASH_STR"eatio.exe"); remove("eatio.c"); @@ -269,10 +269,10 @@ ssize_t enhanced_atoi(const char *str) { cerr << "Error: Can not get accurate value information (eatio.res)." << endl; } - + remove("eatio.res"); } - + return(num); } @@ -317,7 +317,7 @@ char *get_comment() } void output_comment(ostream& c_stream, const char *comment) -{ +{ if (comment) { c_stream << " //" << comment; @@ -328,7 +328,7 @@ void output_comment(ostream& c_stream, const char *comment) bool all_spaces(const char *str) { while (*str) - { + { if (!isspace(*str)) { return(false); } str++; } @@ -360,7 +360,7 @@ char *convert_asm_type(const char *str, bool unsigned_var = true) { var_type += strlen("unsigned "); } - + return(var_type); } @@ -379,7 +379,7 @@ void output_parser_start(ostream& c_stream) << "#define LINE_LENGTH " << LINE_LENGTH << "\n" << "static char line[LINE_LENGTH];\n" << "\n" - << "\n" + << "\n" << "static char *encode_string(const char *str)\n" << "{\n" << " size_t i = 0;\n" @@ -515,7 +515,7 @@ void output_write_var(ostream& c_stream) output_array_write(c_stream, "char"); output_array_write(c_stream, "short"); output_array_write(c_stream, "int"); - + c_stream << "\n" << "unsigned char write_cfg_vars(const char *file)\n" << "{\n" @@ -533,7 +533,7 @@ void output_write_var(ostream& c_stream) << "_array(fp, \"" << i->name << "\", " << i->name << ", " << i->size << ");\n"; } else - { + { c_stream << " fprintf(fp, \"" << i->name << "="; if (i->type == single_value) { @@ -702,7 +702,7 @@ void handle_directive(char *instruction, char *label) else if (!strcasecmp(instruction, "elifdef") || !strcasecmp(instruction, "elseifdef")) { if (label) - { + { if (ifs.top()) { ifs.pop(); @@ -711,14 +711,14 @@ void handle_directive(char *instruction, char *label) else if (defines.find(label) != defines.end()) { ifs.pop(); - ifs.push(true); + ifs.push(true); } } else { show_error_loc("Could not get elseifdef label"); } - + } else if (!strcasecmp(instruction, "endif")) { @@ -737,7 +737,7 @@ void handle_directive(char *instruction, char *label) ifs.pop(); } } - } + } else { show_error_loc("Unknown processor directive"); @@ -745,14 +745,14 @@ void handle_directive(char *instruction, char *label) } void parser_generate(istream& psr_stream, ostream& c_stream) -{ +{ output_parser_start(c_stream); - + while (!psr_stream.eof()) { char *token; - char *comment; - + char *comment; + psr_stream.getline(line, LINE_LENGTH); current_line_number++; @@ -763,7 +763,7 @@ void parser_generate(istream& psr_stream, ostream& c_stream) output_comment(c_stream, comment); continue; } - + if ((token = get_token(line, " ")) && (strcasecmp(token, "NEWSYM") || (token = get_token(0, " ,")))) { @@ -777,7 +777,7 @@ void parser_generate(istream& psr_stream, ostream& c_stream) { continue; } - + string varname = token; if ((token = get_token(0, " ,"))) @@ -788,23 +788,23 @@ void parser_generate(istream& psr_stream, ostream& c_stream) { char *asm_type = token; char *var_type = convert_asm_type(asm_type); - + if (var_type) { string initial_value = get_token(0, " ,\n"); - + if (((initial_value[0] == '\"') && (initial_value[initial_value.length()-1] == '\"')) || ((initial_value[0] == '\'') && (initial_value[initial_value.length()-1] == '\''))) { //Make sure it's double quoted initial_value[0] = '\"'; initial_value[initial_value.length()-1] = '\"'; - + if (!array) { array = initial_value.length()-1; //Size minus quotes plus null } - + c_stream << "char " << varname << "[" << array << "];"; ostringstream memset_line; @@ -819,13 +819,13 @@ void parser_generate(istream& psr_stream, ostream& c_stream) << varname << "[" << array << "] = 0;"; } memsets.push_back(memset_line.str()); - + add_config_var(varname, asm_type, quoted_value, 0); } else { ssize_t init_value_num = safe_atoi(initial_value); - + if (init_value_num < 0) { var_type += strlen("unsigned "); @@ -840,7 +840,7 @@ void parser_generate(istream& psr_stream, ostream& c_stream) ostringstream memset_line; memset_line << "memset(" << varname << ", " << init_value_num << ", " << array; - + if (var_type_is_short(var_type)) { memset_line << short_scale; @@ -891,11 +891,11 @@ void parser_generate(istream& psr_stream, ostream& c_stream) } } //Else already handled - } + } else { show_error_loc("Could not get array size"); - } + } } else { @@ -906,14 +906,14 @@ void parser_generate(istream& psr_stream, ostream& c_stream) { show_error_loc("Could not get variable name"); } - + output_comment(c_stream, comment); } output_init_var(c_stream); - output_write_var(c_stream); + output_write_var(c_stream); output_read_var(c_stream); - + c_stream << "\n"; if (!ifs.empty()) @@ -934,7 +934,7 @@ int main(size_t argc, const char **argv) else { break; - } + } } if ((argc-param_pos) != 2) @@ -947,10 +947,10 @@ int main(size_t argc, const char **argv) << " -Ddefine Define a processor director. Example: -D__LINUX__\n" << " Can specify multiple defines.\n" << endl; - + return(1); } - + const char *psr_file = argv[param_pos+1], *c_file = argv[param_pos]; int ret_val = 0; @@ -961,7 +961,7 @@ int main(size_t argc, const char **argv) if (c_stream) { parser_generate(psr_stream, c_stream); - + c_stream.close(); } else @@ -969,7 +969,7 @@ int main(size_t argc, const char **argv) cerr << "Error opening " << c_file << " for writing." << endl; ret_val |= 2; } - + psr_stream.close(); } else @@ -977,7 +977,7 @@ int main(size_t argc, const char **argv) cerr << "Error opening " << psr_file << " for reading." << endl; ret_val |= 4; } - + return(0); -} - +} + diff --git a/zsnes/src/patch.c b/zsnes/src/patch.c index 04fecfdc..905cc5ae 100644 --- a/zsnes/src/patch.c +++ b/zsnes/src/patch.c @@ -73,7 +73,7 @@ bool reloadBuffer() if (IPSPatch.proccessed == IPSPatch.file_size) { return(false); } IPSPatch.buffer_total = IPSPatch.fp ? - /* Regular Files */ fread(IPSPatch.data, 1, BUFFER_SIZE, IPSPatch.fp) : + /* Regular Files */ fread(IPSPatch.data, 1, BUFFER_SIZE, IPSPatch.fp) : /* Zip Files */ unzReadCurrentFile(IPSPatch.zipfile, IPSPatch.data, BUFFER_SIZE); IPSPatch.current = IPSPatch.data; @@ -113,20 +113,20 @@ bool initPatch() IPSPatch.fp = 0; IPSPatch.fp = fopen(patchfile, "rb"); if (!IPSPatch.fp) { return(false); } - + return(reloadBuffer()); } void deinitPatch() { if (IPSPatch.data) - { + { free(IPSPatch.data); IPSPatch.data = 0; } if (IPSPatch.fp) - { + { fclose(IPSPatch.fp); IPSPatch.fp = 0; } @@ -145,7 +145,7 @@ void PatchUsingIPS() unsigned char *ROM = (unsigned char *)romdata; int location = 0, length = 0, last = 0; int sub = Header512 ? 512 : 0; - + IPSPatched = false; if (!AutoPatch) @@ -153,11 +153,11 @@ void PatchUsingIPS() deinitPatch(); //Needed if the call to this function was done from findZipIPS() return; } - + if (patchfile) //Regular file, not Zip - { - if (!initPatch()) - { + { + if (!initPatch()) + { deinitPatch(); //Needed because if it didn't fully init, some things could have return; } @@ -177,7 +177,7 @@ void PatchUsingIPS() int inloc = (IPSget() << 16) | (IPSget() << 8) | IPSget(); if (inloc == 0x454f46) //EOF - { + { break; } @@ -187,7 +187,7 @@ void PatchUsingIPS() //Length is a 2 byte value (max 64KB) length = (IPSget() << 8) | IPSget(); - if (length) // Not RLE + if (length) // Not RLE { int i; for (i = 0; i < length; i++, location++) @@ -208,7 +208,7 @@ void PatchUsingIPS() { int i; unsigned char newVal; - length = (IPSget() << 8) | IPSget(); + length = (IPSget() << 8) | IPSget(); newVal = (unsigned char)IPSget(); for (i = 0; i < length; i++, location++) { @@ -221,16 +221,16 @@ void PatchUsingIPS() } } } - + //We use gotos to break out of the nested loops, //as well as a simple way to check for 'PATCH' in //some cases like this one, goto is the way to go. IPSDone: - + deinitPatch(); - + IPSPatched = true; - + //Adjust size values if the ROM was expanded if (last > curromspace) { @@ -268,10 +268,10 @@ void findZipIPS(char *compressedfile) //Gets info on current file, and places it in cFileInfo unzGetCurrentFileInfo(IPSPatch.zipfile, &cFileInfo, cFileName, 256, NULL, 0, NULL, 0); - //Find IPS file + //Find IPS file if (strlen(cFileName) >= 5) //Char + ".IPS" { - char *ext = cFileName+strlen(cFileName)-4; + char *ext = cFileName+strlen(cFileName)-4; if (!strncasecmp(ext, ".IPS", 4)) { FoundIPS = true; @@ -279,12 +279,12 @@ void findZipIPS(char *compressedfile) } } - //Go to next file in zip file - cFile = unzGoToNextFile(IPSPatch.zipfile); + //Go to next file in zip file + cFile = unzGoToNextFile(IPSPatch.zipfile); } if (!FoundIPS) - { + { unzClose(IPSPatch.zipfile); IPSPatch.zipfile = 0; return; diff --git a/zsnes/src/uic.c b/zsnes/src/uic.c index 30a4e6c6..625fea2f 100644 --- a/zsnes/src/uic.c +++ b/zsnes/src/uic.c @@ -244,7 +244,7 @@ void zstart () asm_call(setnoise); asm_call(InitSPC); #endif - + asm_call(allocmem); if (!soundon && (SPCDisable != 1)) diff --git a/zsnes/src/version.c b/zsnes/src/version.c index 2f180665..cd95540b 100644 --- a/zsnes/src/version.c +++ b/zsnes/src/version.c @@ -27,16 +27,16 @@ char *VERSION_STR; //Place compilation date at the end of VERSION_STR void placedate() { - strcpy(VERSION_STR + - strlen(VERSION_STR) - + strcpy(VERSION_STR + + strlen(VERSION_STR) - strlen(__DATE__), __DATE__); } //Place compilation time at the end of VERSION_STR void placetime() { - strcpy(VERSION_STR + - strlen(VERSION_STR) - + strcpy(VERSION_STR + + strlen(VERSION_STR) - strlen(__TIME__), __TIME__); } diff --git a/zsnes/src/video/2xsaimmx.inc b/zsnes/src/video/2xsaimmx.inc index 068928d6..188f99f3 100644 --- a/zsnes/src/video/2xsaimmx.inc +++ b/zsnes/src/video/2xsaimmx.inc @@ -117,7 +117,7 @@ NEWSYM _2xSaISuper2xSaILine mov ebx, [ebp+srcPitch] ;ebx contains the source pitch mov ecx, [ebp+width] ;ecx contains the number of pixels to process ; eax now points to colorB1 - sub eax, ebx ;eax points to B1 which is the base + sub eax, ebx ;eax points to B1 which is the base ; Main Loop .Loop: push ecx @@ -168,7 +168,7 @@ NEWSYM _2xSaISuper2xSaILine packsswb mm7, mm7 movd ecx, mm7 - test ecx, ecx + test ecx, ecx jz near .SKIP_PROCESS ;no, so we can skip ;End Delta @@ -455,7 +455,7 @@ NEWSYM _2xSaISuper2xSaILine ;Start the ASSEMBLY !!! eh... compose all the results together to form the final image... - + movq mm0, [eax+ebx+color5] movq mm1, [eax+ebx+ebx+color2] movq mm2, mm0 @@ -531,7 +531,7 @@ NEWSYM _2xSaISuper2xSaILine pand mm6, mm2 por mm7, mm6 - + movq mm6, mm7 pcmpeqw mm6, mm5 pand mm7, mm0 @@ -542,8 +542,8 @@ NEWSYM _2xSaISuper2xSaILine movq [final1a], mm7 ;finished 1a - - ;-------------------------------- + + ;-------------------------------- movq mm7, [Mask35] push eax @@ -583,7 +583,7 @@ NEWSYM _2xSaISuper2xSaILine pand mm6, mm2 por mm7, mm6 - + movq mm6, mm7 pcmpeqw mm6, mm5 pand mm7, mm0 @@ -595,7 +595,7 @@ NEWSYM _2xSaISuper2xSaILine ;-------------------------------------------- - + %ifdef dfhsdfhsdahdsfhdsfh if (color6 == color3 && color3 == colorA1 && color2 != colorA2 && color3 != colorA0) @@ -675,7 +675,7 @@ NEWSYM _2xSaISuper2xSaILine movq [final2b], mm0 ;----------------------------------- - + pxor mm7, mm7 movq mm0, [eax+colorB0] @@ -732,7 +732,7 @@ NEWSYM _2xSaISuper2xSaILine por mm0, mm3 por mm0, mm2 movq [final1b], mm0 - + ;--------- movq mm0, [final1a] @@ -2023,7 +2023,7 @@ Bits565: mov [eax+4], edx mov eax, 0 jmp end1 -end1: +end1: pop edx mov esp, ebp pop ebp diff --git a/zsnes/src/video/2xsaiw.asm b/zsnes/src/video/2xsaiw.asm index 614a19c3..3823609e 100644 --- a/zsnes/src/video/2xsaiw.asm +++ b/zsnes/src/video/2xsaiw.asm @@ -95,7 +95,7 @@ NEWSYM _2xSaISuper2xSaILineW mov ebx, [ebp+srcPitch] ;ebx contains the source pitch mov ecx, [ebp+width] ;ecx contains the number of pixels to process ; eax now points to colorB1 - sub eax, ebx ;eax points to B1 which is the base + sub eax, ebx ;eax points to B1 which is the base ; Main Loop .Loop: push ecx @@ -146,7 +146,7 @@ NEWSYM _2xSaISuper2xSaILineW packsswb mm7, mm7 movd ecx, mm7 - test ecx, ecx + test ecx, ecx jz near .SKIP_PROCESS ;no, so we can skip ;End Delta @@ -432,7 +432,7 @@ NEWSYM _2xSaISuper2xSaILineW ;Start the ASSEMBLY !!! eh... compose all the results together to form the final image... - + movq mm0, [eax+ebx+color5] movq mm1, [eax+ebx+ebx+color2] movq mm2, mm0 @@ -507,7 +507,7 @@ NEWSYM _2xSaISuper2xSaILineW pand mm6, mm2 por mm7, mm6 - + movq mm6, mm7 pcmpeqw mm6, mm5 pand mm7, mm0 @@ -518,8 +518,8 @@ NEWSYM _2xSaISuper2xSaILineW movq [final1a], mm7 ;finished 1a - - ;-------------------------------- + + ;-------------------------------- movq mm7, [Mask35] push eax @@ -559,7 +559,7 @@ NEWSYM _2xSaISuper2xSaILineW pand mm6, mm2 por mm7, mm6 - + movq mm6, mm7 pcmpeqw mm6, mm5 pand mm7, mm0 @@ -571,7 +571,7 @@ NEWSYM _2xSaISuper2xSaILineW ;-------------------------------------------- - + %ifdef dfhsdfhsdahdsfhdsfh if (color6 == color3 && color3 == colorA1 && color2 != colorA2 && color3 != colorA0) @@ -637,7 +637,7 @@ NEWSYM _2xSaISuper2xSaILineW movq mm4, [Mask35] movq mm3, [Mask26] - + movq mm6, mm4 pand mm6, mm7 pxor mm4, mm6 @@ -669,7 +669,7 @@ NEWSYM _2xSaISuper2xSaILineW movq [final2b], mm0 ;----------------------------------- - + pxor mm7, mm7 movq mm0, [eax+colorB0] @@ -711,7 +711,7 @@ NEWSYM _2xSaISuper2xSaILineW movq mm4, [Mask35] movq mm3, [Mask26] - + movq mm6, mm4 pand mm6, mm7 pxor mm4, mm6 @@ -741,7 +741,7 @@ NEWSYM _2xSaISuper2xSaILineW por mm0, mm3 por mm0, mm2 movq [final1b], mm0 - + ;--------- movq mm0, [final1a] @@ -2032,7 +2032,7 @@ Bits565: mov [eax+4], edx mov eax, 0 jmp end1 -end1: +end1: pop edx mov esp, ebp pop ebp diff --git a/zsnes/src/video/copyvid.inc b/zsnes/src/video/copyvid.inc index 14d42173..74234a5a 100644 --- a/zsnes/src/video/copyvid.inc +++ b/zsnes/src/video/copyvid.inc @@ -341,7 +341,7 @@ PreTripleBuffer: .failed mov byte[Triplebufen],0 ret -%endif +%endif SECTION .data ; Please don't break this again. :) @@ -405,7 +405,7 @@ ScreenShow: je near copyvesa2320x480x8b cmp byte[cvidmode],10 je near copyvesa2320x480x16b - cmp byte[cvidmode],11 + cmp byte[cvidmode],11 je near copyvesa2512x384x8b cmp byte[cvidmode],12 je near copyvesa2512x384x16b @@ -1015,7 +1015,7 @@ NEWSYM copyvesa2320x480x8b ret -;copyvesa2320x480x8ng: +;copyvesa2320x480x8ng: ; jmp .mode7hires ; mov ebx,1 ;.loopa @@ -1289,7 +1289,7 @@ NEWSYM copyvesa2800x600x16b add edi,144*2+800*2+144*2 dec dl jnz near .interpolate - + .done pop es ret diff --git a/zsnes/src/video/mode7.mac b/zsnes/src/video/mode7.mac index 7f108b1a..a62a7d6b 100644 --- a/zsnes/src/video/mode7.mac +++ b/zsnes/src/video/mode7.mac @@ -34,8 +34,8 @@ EXTSYM ScrDispl and bx,0001111111111111b ; 13 -> 16 bit signed value test bx,0001000000000000b jz .nonega - or bx,1110000000000000b - or word[mode7X0],1110000000000000b + or bx,1110000000000000b + or word[mode7X0],1110000000000000b .nonega mov [.cxloc],bx mov bx,dx @@ -58,7 +58,7 @@ EXTSYM ScrDispl test bx,0001000000000000b jz .nonegd or bx,1110000000000000b - or word[mode7Y0],1110000000000000b + or word[mode7Y0],1110000000000000b .nonegd sub word[.cyloc],bx @@ -117,8 +117,8 @@ EXTSYM ScrDispl and bx,0001111111111111b ; 13 -> 16 bit signed value test bx,0001000000000000b jz .nonega - or bx,1110000000000000b - or word[mode7X0],1110000000000000b + or bx,1110000000000000b + or word[mode7X0],1110000000000000b .nonega mov [.cxloc],bx mov bx,dx @@ -141,7 +141,7 @@ EXTSYM ScrDispl test bx,0001000000000000b jz .nonegd or bx,1110000000000000b - or word[mode7Y0],1110000000000000b + or word[mode7Y0],1110000000000000b .nonegd add bx,bx sub word[.cyloc],bx diff --git a/zsnes/src/video/mode716.mac b/zsnes/src/video/mode716.mac index 570a5312..77db8894 100644 --- a/zsnes/src/video/mode716.mac +++ b/zsnes/src/video/mode716.mac @@ -108,8 +108,8 @@ EXTSYM pesimpng,ScrDispl and bx,0001111111111111b ; 13 -> 16 bit signed value test bx,0001000000000000b jz .nonega - or bx,1110000000000000b - or word[mode7X0],1110000000000000b + or bx,1110000000000000b + or word[mode7X0],1110000000000000b .nonega mov [mcxloc],bx mov bx,dx @@ -132,7 +132,7 @@ EXTSYM pesimpng,ScrDispl test bx,0001000000000000b jz .nonegd or bx,1110000000000000b - or word[mode7Y0],1110000000000000b + or word[mode7Y0],1110000000000000b .nonegd sub word[mcyloc],bx @@ -191,8 +191,8 @@ EXTSYM pesimpng,ScrDispl and bx,0001111111111111b ; 13 -> 16 bit signed value test bx,0001000000000000b jz .nonegacb - or word[mode7X0],1110000000000000b - or bx,1110000000000000b + or word[mode7X0],1110000000000000b + or bx,1110000000000000b .nonegacb mov [mcxloc],bx mov bx,dx @@ -213,7 +213,7 @@ EXTSYM pesimpng,ScrDispl and bx,0001111111111111b ; 13 -> 16 bit signed value test bx,0001000000000000b jz .nonegdcb - or word[mode7Y0],1110000000000000b + or word[mode7Y0],1110000000000000b or bx,1110000000000000b .nonegdcb add bx,bx diff --git a/zsnes/src/video/mode7cal.inc b/zsnes/src/video/mode7cal.inc index 38bc1486..a90e4d4f 100644 --- a/zsnes/src/video/mode7cal.inc +++ b/zsnes/src/video/mode7cal.inc @@ -35,7 +35,7 @@ and bx,0001111111111111b ; 13 -> 16 bit signed value test bx,0001000000000000b jz .nonega - or bx,1110000000000000b + or bx,1110000000000000b .nonega mov [.cxloc],bx mov bx,dx diff --git a/zsnes/src/video/mode7ext.asm b/zsnes/src/video/mode7ext.asm index 8763f3c8..1dde276b 100644 --- a/zsnes/src/video/mode7ext.asm +++ b/zsnes/src/video/mode7ext.asm @@ -51,7 +51,7 @@ NEWSYM drawmode7extbg and bx,0001111111111111b ; 13 -> 16 bit signed value test bx,0001000000000000b jz .nonega - or bx,1110000000000000b + or bx,1110000000000000b .nonega mov [.cxloc],bx mov bx,dx diff --git a/zsnes/src/win/resource.h b/zsnes/src/win/resource.h index b5c5ad86..6054c218 100644 --- a/zsnes/src/win/resource.h +++ b/zsnes/src/win/resource.h @@ -15,7 +15,7 @@ #define IDC_EDITPASS 1084 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 121 diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 928310a7..08be14ff 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -473,7 +473,7 @@ BOOL InputRead(void) HRESULT hr; aquireagain:; hr=MouseInput->GetDeviceState(sizeof(DIMOUSESTATE),&dims); - + if (hr==DIERR_INPUTLOST) { hr=MouseInput->Acquire(); @@ -860,7 +860,7 @@ BOOL InitSound() return FALSE; } } - + SoundEnabled=1; FirstSound=0; return TRUE; @@ -989,7 +989,7 @@ BOOL ReInitSound() return FALSE; } } - + SoundEnabled=1; FirstSound=0; return TRUE; @@ -1285,7 +1285,7 @@ bool InitInput() hr=KeyboardInput->SetDataFormat(&c_dfDIKeyboard); if (FAILED(hr)) {DInputError();return FALSE;} - + hr=KeyboardInput->SetCooperativeLevel(hMainWindow,DISCL_NONEXCLUSIVE | DISCL_FOREGROUND ); hr=DInput->CreateDevice(GUID_SysMouse, &MouseInput,NULL); @@ -1293,7 +1293,7 @@ bool InitInput() hr=MouseInput->SetDataFormat(&c_dfDIMouse); if (FAILED(hr)) {DInputError();return FALSE;} - + hr=MouseInput->SetCooperativeLevel(hMainWindow,DISCL_EXCLUSIVE|DISCL_FOREGROUND); if (FAILED(hr)) {DInputError();return FALSE;} @@ -1614,7 +1614,7 @@ int InitDirectDraw() MessageBox(NULL, "IDirectDrawSurface7::GetPixelFormat failed.", "DirectDraw Error", MB_ICONERROR); return FALSE; } - + BitDepth=format.dwRGBBitCount; GBitMask=format.dwGBitMask; // 0x07E0 or not @@ -2514,7 +2514,7 @@ void drawscreenwin(void) break; } case 32: - { + { DrawWin256x224x32(); break; } diff --git a/zsnes/src/win/zfilew.c b/zsnes/src/win/zfilew.c index dd9a1e00..91594782 100644 --- a/zsnes/src/win/zfilew.c +++ b/zsnes/src/win/zfilew.c @@ -54,7 +54,7 @@ void ZLog_Message (char *Message, ...) va_start(ap,Message); vsprintf(Msg,Message,ap ); va_end(ap); - + strcat(Msg,"\r\n\0"); fwrite(Msg,strlen(Msg),1,ZFILELog); fflush(ZFILELog); @@ -67,7 +67,7 @@ void ZStart_Log (void) // [4/15/2001] char *p; strcpy(LogFileName,"zfile.log\0"); - + ZFILELog = fopen(LogFileName,"wb"); } @@ -179,7 +179,7 @@ int InitTCPFile() /* Verify version number and exit on wrong version */ if (wsadata.wVersion != versionneeded) - { + { return(-1); } gameServerSocket=INVALID_SOCKET; @@ -320,7 +320,7 @@ LPTHREAD_START_ROUTINE MonitorThreadProc(SOCKET s) hwndNCD = CreateDialog(hModule, MAKEINTRESOURCE (IDD_NO_CONNECT), NULL, NULL); while(destruct > 0) - { + { if (destruct == 10) clockstart = timeGetTime(); @@ -399,15 +399,15 @@ OpenConnection(char *User, char *Password, char *FileName) if(!strstr(temp,"ok")) { ZLog_Message("Sending user name"); - + sprintf(temp,"%s",User); sendCommand(temp,strlen(temp)); receiveData(temp,512); - + if(!strstr(temp,"ok")) return 0; - + ZLog_Message("Sending password"); - + sprintf(temp,"%s",Password); sendCommand(temp,strlen(temp)); receiveData(temp,512); @@ -518,7 +518,7 @@ LRESULT CALLBACK UPDialogMain(HWND hDlg, UINT message, WPARAM wParam, DWORD ZFileSystemInit() { - ZStart_Log(); + ZStart_Log(); #ifdef __GZIP__ TextFile = 0; #else @@ -552,7 +552,7 @@ DWORD ZOpenFile() UPDialogDone=0; hwndNCD = DialogBox(hModule, MAKEINTRESOURCE (IDD_USERPASS), NULL, UPDialogMain); - + while(!UPDialogDone) { Sleep(1000); @@ -560,7 +560,7 @@ DWORD ZOpenFile() DestroyWindow(hwndNCD); - ZLog_Message("User : %s Pass : %s",user,pass); + ZLog_Message("User : %s Pass : %s",user,pass); } else { @@ -569,14 +569,14 @@ DWORD ZOpenFile() for(i=0;i512) return 0xFFFFFFFF; for(i=0;iuSizeFile) uMaxBack = uSizeFile; @@ -305,13 +305,13 @@ local uLong unzlocal_SearchCentralDir(fin) { uLong uReadSize,uReadPos ; int i; - if (uBackRead+BUFREADCOMMENT>uMaxBack) + if (uBackRead+BUFREADCOMMENT>uMaxBack) uBackRead = uMaxBack; else uBackRead+=BUFREADCOMMENT; uReadPos = uSizeFile-uBackRead ; - - uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? (BUFREADCOMMENT+4) : (uSizeFile-uReadPos); if (fseek(fin,uReadPos,SEEK_SET)!=0) break; @@ -320,7 +320,7 @@ local uLong unzlocal_SearchCentralDir(fin) break; for (i=(int)uReadSize-3; (i--)>0;) - if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) { uPosFound = uReadPos+i; @@ -351,12 +351,12 @@ extern unzFile ZEXPORT unzOpen (path) uLong central_pos,uL; FILE * fin ; - uLong number_disk; /* number of the current dist, used for + uLong number_disk; /* number of the current dist, used for spaning ZIP, unsupported, always 0*/ uLong number_disk_with_CD; /* number the the disk with central dir, used for spaning ZIP, unsupported, always 0*/ uLong number_entry_CD; /* total number of entries in - the central dir + the central dir (same than number_entry on nospan) */ int err=UNZ_OK; @@ -404,7 +404,7 @@ extern unzFile ZEXPORT unzOpen (path) if (unzlocal_getLong(fin,&us.size_central_dir)!=UNZ_OK) err=UNZ_ERRNO; - /* offset of start of central directory with respect to the + /* offset of start of central directory with respect to the starting disk number */ if (unzlocal_getLong(fin,&us.offset_central_dir)!=UNZ_OK) err=UNZ_ERRNO; @@ -413,7 +413,7 @@ extern unzFile ZEXPORT unzOpen (path) if (unzlocal_getShort(fin,&us.gi.size_comment)!=UNZ_OK) err=UNZ_ERRNO; - if ((central_posfile,&uData) != UNZ_OK) /* size uncompr */ err=UNZ_ERRNO; - else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0)) err=UNZ_BADZIPFILE; @@ -899,7 +899,7 @@ local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar, return err; } - + /* Open for reading data the current file in the zipfile. If there is no error and the file is opened, the return value is UNZ_OK. @@ -945,7 +945,7 @@ extern int ZEXPORT unzOpenCurrentFile (file) } pfile_in_zip_read_info->stream_initialised=0; - + if ((s->cur_file_info.compression_method!=0) && (s->cur_file_info.compression_method!=Z_DEFLATED)) err=UNZ_BADZIPFILE; @@ -964,29 +964,29 @@ extern int ZEXPORT unzOpenCurrentFile (file) { pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; pfile_in_zip_read_info->stream.zfree = (free_func)0; - pfile_in_zip_read_info->stream.opaque = (voidpf)0; - + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); if (err == Z_OK) pfile_in_zip_read_info->stream_initialised=1; /* windowBits is passed < 0 to tell that there is no zlib header. * Note that in this case inflate *requires* an extra "dummy" byte * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. - * In unzip, i don't wait absolutely Z_STREAM_END because I known the + * return Z_STREAM_END. + * In unzip, i don't wait absolutely Z_STREAM_END because I known the * size of both compressed and uncompressed data */ } - pfile_in_zip_read_info->rest_read_compressed = + pfile_in_zip_read_info->rest_read_compressed = s->cur_file_info.compressed_size ; - pfile_in_zip_read_info->rest_read_uncompressed = + pfile_in_zip_read_info->rest_read_uncompressed = s->cur_file_info.uncompressed_size ; - - pfile_in_zip_read_info->pos_in_zipfile = - s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + + + pfile_in_zip_read_info->pos_in_zipfile = + s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + iSizeVar; - + pfile_in_zip_read_info->stream.avail_in = (uInt)0; @@ -1031,9 +1031,9 @@ extern int ZEXPORT unzReadCurrentFile (file, buf, len) pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; pfile_in_zip_read_info->stream.avail_out = (uInt)len; - + if (len>pfile_in_zip_read_info->rest_read_uncompressed) - pfile_in_zip_read_info->stream.avail_out = + pfile_in_zip_read_info->stream.avail_out = (uInt)pfile_in_zip_read_info->rest_read_uncompressed; while (pfile_in_zip_read_info->stream.avail_out>0) @@ -1047,7 +1047,7 @@ extern int ZEXPORT unzReadCurrentFile (file, buf, len) if (uReadThis == 0) return UNZ_EOF; if (fseek(pfile_in_zip_read_info->file, - pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->pos_in_zipfile + pfile_in_zip_read_info->byte_before_the_zipfile,SEEK_SET)!=0) return UNZ_ERRNO; if (fread(pfile_in_zip_read_info->read_buffer,uReadThis,1, @@ -1056,8 +1056,8 @@ extern int ZEXPORT unzReadCurrentFile (file, buf, len) pfile_in_zip_read_info->pos_in_zipfile += uReadThis; pfile_in_zip_read_info->rest_read_compressed-=uReadThis; - - pfile_in_zip_read_info->stream.next_in = + + pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->read_buffer; pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; } @@ -1065,16 +1065,16 @@ extern int ZEXPORT unzReadCurrentFile (file, buf, len) if (pfile_in_zip_read_info->compression_method==0) { uInt uDoCopy,i ; - if (pfile_in_zip_read_info->stream.avail_out < + if (pfile_in_zip_read_info->stream.avail_out < pfile_in_zip_read_info->stream.avail_in) uDoCopy = pfile_in_zip_read_info->stream.avail_out ; else uDoCopy = pfile_in_zip_read_info->stream.avail_in ; - + for (i=0;istream.next_out+i) = *(pfile_in_zip_read_info->stream.next_in+i); - + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, pfile_in_zip_read_info->stream.next_out, uDoCopy); @@ -1106,8 +1106,8 @@ extern int ZEXPORT unzReadCurrentFile (file, buf, len) uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; uOutThis = uTotalOutAfter-uTotalOutBefore; - - pfile_in_zip_read_info->crc32 = + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis)); @@ -1115,10 +1115,10 @@ extern int ZEXPORT unzReadCurrentFile (file, buf, len) uOutThis; iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); - + if (err==Z_STREAM_END) return (iRead==0) ? UNZ_EOF : iRead; - if (err!=Z_OK) + if (err!=Z_OK) break; } } @@ -1150,7 +1150,7 @@ extern z_off_t ZEXPORT unztell (file) /* - return 1 if the end of file was reached, 0 elsewhere + return 1 if the end of file was reached, 0 elsewhere */ extern int ZEXPORT unzeof (file) unzFile file; @@ -1164,7 +1164,7 @@ extern int ZEXPORT unzeof (file) if (pfile_in_zip_read_info==NULL) return UNZ_PARAMERROR; - + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) return 1; else @@ -1182,7 +1182,7 @@ extern int ZEXPORT unzeof (file) if buf!=NULL, len is the size of the buffer, the extra header is copied in buf. - the return value is the number of bytes copied in buf, or (if <0) + the return value is the number of bytes copied in buf, or (if <0) the error code */ extern int ZEXPORT unzGetLocalExtrafield (file,buf,len) @@ -1203,12 +1203,12 @@ extern int ZEXPORT unzGetLocalExtrafield (file,buf,len) if (pfile_in_zip_read_info==NULL) return UNZ_PARAMERROR; - size_to_read = (pfile_in_zip_read_info->size_local_extrafield - + size_to_read = (pfile_in_zip_read_info->size_local_extrafield - pfile_in_zip_read_info->pos_local_extrafield); if (buf==NULL) return (int)size_to_read; - + if (len>size_to_read) read_now = (uInt)size_to_read; else @@ -1216,9 +1216,9 @@ extern int ZEXPORT unzGetLocalExtrafield (file,buf,len) if (read_now==0) return 0; - + if (fseek(pfile_in_zip_read_info->file, - pfile_in_zip_read_info->offset_local_extrafield + + pfile_in_zip_read_info->offset_local_extrafield + pfile_in_zip_read_info->pos_local_extrafield,SEEK_SET)!=0) return UNZ_ERRNO; diff --git a/zsnes/src/zip/zpng.c b/zsnes/src/zip/zpng.c index 005a6b3b..45def033 100644 --- a/zsnes/src/zip/zpng.c +++ b/zsnes/src/zip/zpng.c @@ -5,7 +5,7 @@ #ifdef __WIN32__ #include #include - + #ifdef __WIN32DBG__ #include #endif @@ -42,7 +42,7 @@ int Png_Dump(const char * filename, unsigned short width, unsigned short height, { return (-1); } - + fake_pal.red = 0; fake_pal.green = 0; fake_pal.blue = 0; @@ -52,14 +52,14 @@ int Png_Dump(const char * filename, unsigned short width, unsigned short height, user_error_fn*/NULL, NULL/*user_warning_fn*/); if (!png_ptr) return (-1); - + /*set png I/O source.*/ png_init_io(png_ptr, fp); - + /* set the zlib compression level */ png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); - + /* set other zlib parameters */ png_set_compression_mem_level(png_ptr, 8); png_set_compression_strategy(png_ptr, @@ -77,12 +77,12 @@ int Png_Dump(const char * filename, unsigned short width, unsigned short height, return (-1); } - + /*set a lot of image info (code adapted from libpng documentation!)*/ png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB_ALPHA, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); - + info_ptr->color_type=PNG_COLOR_TYPE_RGB_ALPHA; /*Allocate an array of scanline pointers*/ @@ -107,10 +107,10 @@ int Png_Dump(const char * filename, unsigned short width, unsigned short height, /*close file*/ fclose(fp); - + /*Destroy PNG structs*/ png_destroy_write_struct(&png_ptr, &info_ptr); - + /*clean up dynamically allocated RAM.*/ free(row_pointers); diff --git a/zsnes/src/zip/zunzip.h b/zsnes/src/zip/zunzip.h index 2f0c4599..fb35f7ad 100644 --- a/zsnes/src/zip/zunzip.h +++ b/zsnes/src/zip/zunzip.h @@ -1,4 +1,4 @@ -/* unzip.h -- IO for uncompress .zip files using zlib +/* unzip.h -- IO for uncompress .zip files using zlib Version 0.15 beta, Mar 19th, 1998, Copyright (C) 1998 Gilles Vollant @@ -33,7 +33,7 @@ */ -/* for more info about .ZIP format, see +/* for more info about .ZIP format, see ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip PkWare has also a specification at : ftp://ftp.pkware.com/probdesc.zip */ @@ -50,7 +50,7 @@ extern "C" { #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) /* like the STRICT of WIN32, we define a pointer that cannot be converted from (void*) without cast */ -typedef struct TagunzFile__ { int unused; } unzFile__; +typedef struct TagunzFile__ { int unused; } unzFile__; typedef unzFile__ *unzFile; #else typedef voidp unzFile; @@ -67,7 +67,7 @@ typedef voidp unzFile; #define UNZ_CRCERROR (-105) /* tm_unz contain date/time info */ -typedef struct tm_unz_s +typedef struct tm_unz_s { uInt tm_sec; /* seconds after the minute - [0,59] */ uInt tm_min; /* minutes after the hour - [0,59] */ @@ -96,8 +96,8 @@ typedef struct unz_file_info_s uLong compression_method; /* compression method 2 bytes */ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ uLong crc; /* crc-32 4 bytes */ - uLong compressed_size; /* compressed size 4 bytes */ - uLong uncompressed_size; /* uncompressed size 4 bytes */ + uLong compressed_size; /* compressed size 4 bytes */ + uLong uncompressed_size; /* uncompressed size 4 bytes */ uLong size_filename; /* filename length 2 bytes */ uLong size_file_extra; /* extra field length 2 bytes */ uLong size_file_comment; /* file comment length 2 bytes */ @@ -174,7 +174,7 @@ extern int ZEXPORT unzGoToNextFile OF((unzFile file)); return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. */ -extern int ZEXPORT unzLocateFile OF((unzFile file, +extern int ZEXPORT unzLocateFile OF((unzFile file, const char *szFileName, int iCaseSensitivity)); /* @@ -225,8 +225,8 @@ extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); Return UNZ_CRCERROR if all the file was read but the CRC is not good */ - -extern int ZEXPORT unzReadCurrentFile OF((unzFile file, + +extern int ZEXPORT unzReadCurrentFile OF((unzFile file, voidp buf, unsigned len)); /* @@ -247,7 +247,7 @@ extern z_off_t ZEXPORT unztell OF((unzFile file)); extern int ZEXPORT unzeof OF((unzFile file)); /* - return 1 if the end of file was reached, 0 elsewhere + return 1 if the end of file was reached, 0 elsewhere */ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, @@ -262,7 +262,7 @@ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, if buf!=NULL, len is the size of the buffer, the extra header is copied in buf. - the return value is the number of bytes copied in buf, or (if <0) + the return value is the number of bytes copied in buf, or (if <0) the error code */ diff --git a/zsnes/src/zloader.c b/zsnes/src/zloader.c index 02709d89..ea6c35ce 100644 --- a/zsnes/src/zloader.c +++ b/zsnes/src/zloader.c @@ -195,13 +195,13 @@ static void display_help() put_line(" C = C (Chat first), L (load game first)"); put_line(" D = N (Stay in ZSNES after disconnect), Q (Quit after disconnect)"); put_line(" E = # of connections (Keep it 2 for now)"); -#ifdef __WIN32__ +#ifdef __WIN32__ put_line(" eg: ZSNESW /UCCN2 nickname d:\\snesroms 202.36.124.28"); #else put_line(" eg: zsnes /UCCN2 nickname /home/zuser/snesroms 202.36.124.28"); #endif #endif - + exit(1); } @@ -488,7 +488,7 @@ static void handle_params(int argc, char *argv[]) { ZMVRawDump = 1; } - + else if (tolower(argv[i][1]) == 'o' && tolower(argv[i][2]) == 'm') //Enable MMX support { MMXSupport = 1; @@ -533,7 +533,7 @@ static void handle_params(int argc, char *argv[]) exit(1); } } - + else { display_help(); diff --git a/zsnes/src/zmovie.c b/zsnes/src/zmovie.c index 93937c67..993187f0 100644 --- a/zsnes/src/zmovie.c +++ b/zsnes/src/zmovie.c @@ -649,7 +649,7 @@ static size_t pad_bit_encoder(unsigned char pad, unsigned char *buffer, size_t s case 1: last_state = zmv_vars.last_joy_state.A; break; - + case 2: last_state = zmv_vars.last_joy_state.B; break; @@ -664,7 +664,7 @@ static size_t pad_bit_encoder(unsigned char pad, unsigned char *buffer, size_t s case 5: last_state = zmv_vars.last_joy_state.E; - break; + break; } switch (pad) @@ -674,15 +674,15 @@ static size_t pad_bit_encoder(unsigned char pad, unsigned char *buffer, size_t s { unsigned int xdata = (zmv_vars.last_joy_state.latchx - 40) & 0xFF; unsigned int ydata = zmv_vars.last_joy_state.latchy & 0xFF; - + skip_bits = bit_encoder(last_state, SCOPE_MASK, buffer, skip_bits); skip_bits = bit_encoder(xdata, 0x000000FF, buffer, skip_bits); skip_bits = bit_encoder(ydata, 0x000000FF, buffer, skip_bits); break; } - - case 1: + + case 1: if ((zmv_vars.inputs_enabled & ((pad == 1) ? BIT(0xA) : BIT(0x9)))) //Mouse ? { skip_bits = bit_encoder(last_state, MOUSE_MASK, buffer, skip_bits); @@ -715,7 +715,7 @@ static size_t pad_bit_decoder(unsigned char pad, unsigned char *buffer, size_t s last_state = &zmv_vars.last_joy_state.A; input_enable_mask = BIT(0xF); break; - + case 2: last_state = &zmv_vars.last_joy_state.B; input_enable_mask = BIT(0xE); @@ -734,7 +734,7 @@ static size_t pad_bit_decoder(unsigned char pad, unsigned char *buffer, size_t s case 5: last_state = &zmv_vars.last_joy_state.E; input_enable_mask = BIT(0xB); - break; + break; } switch (pad) @@ -743,7 +743,7 @@ static size_t pad_bit_decoder(unsigned char pad, unsigned char *buffer, size_t s if ((zmv_vars.inputs_enabled & BIT(0x8))) //Super Scope { unsigned int xdata, ydata; - + skip_bits = bit_decoder(last_state, SCOPE_MASK, buffer, skip_bits); skip_bits = bit_decoder(&xdata, 0x000000FF, buffer, skip_bits); skip_bits = bit_decoder(&ydata, 0x000000FF, buffer, skip_bits); @@ -752,10 +752,10 @@ static size_t pad_bit_decoder(unsigned char pad, unsigned char *buffer, size_t s zmv_vars.last_joy_state.latchx = (unsigned short)(xdata + 40); zmv_vars.last_joy_state.latchy = (unsigned short)ydata; - break; + break; } - case 1: + case 1: if (zmv_vars.inputs_enabled & ((pad == 1) ? BIT(0xA) : BIT(0x9))) //Mouse ? { skip_bits = bit_decoder(last_state, MOUSE_MASK, buffer, skip_bits); @@ -971,7 +971,7 @@ static void record_pad(unsigned char pad, unsigned char *flag, unsigned char *bu current_state = JoyAOrig; bit_mask = BIT(7); break; - + case 2: last_state = &zmv_vars.last_joy_state.B; current_state = JoyBOrig; @@ -994,16 +994,16 @@ static void record_pad(unsigned char pad, unsigned char *flag, unsigned char *bu last_state = &zmv_vars.last_joy_state.E; current_state = JoyEOrig; bit_mask = BIT(3); - break; + break; } - + if ((current_state != *last_state) || ((zmv_vars.inputs_enabled & BIT(0x8)) && ((zmv_vars.last_joy_state.latchx != latchx) || (zmv_vars.last_joy_state.latchy != latchy)))) { zmv_vars.last_joy_state.latchx = latchx; zmv_vars.last_joy_state.latchy = latchy; - + *last_state = current_state; *flag |= bit_mask; *skip_bits = pad_bit_encoder(pad, buffer, *skip_bits); @@ -1024,13 +1024,13 @@ static void zmv_record(bool pause, unsigned char combos_used, unsigned char slow zmv_vars.header.key_combos += combos_used; debug_input; - + record_pad(1, &flag, press_buf, &skip_bits); record_pad(2, &flag, press_buf, &skip_bits); record_pad(3, &flag, press_buf, &skip_bits); record_pad(4, &flag, press_buf, &skip_bits); record_pad(5, &flag, press_buf, &skip_bits); - + if (flag) { unsigned char buffer_used = skip_bits/8 + ((skip_bits&7) ? 1 : 0); @@ -1225,7 +1225,7 @@ static void replay_pad(unsigned char pad, unsigned char flag, unsigned char *buf current_state = &JoyAOrig; bit_mask = BIT(7); break; - + case 2: last_state = &zmv_vars.last_joy_state.B; current_state = &JoyBOrig; @@ -1248,7 +1248,7 @@ static void replay_pad(unsigned char pad, unsigned char flag, unsigned char *buf last_state = &zmv_vars.last_joy_state.E; current_state = &JoyEOrig; bit_mask = BIT(3); - break; + break; } if (flag & bit_mask) @@ -1256,7 +1256,7 @@ static void replay_pad(unsigned char pad, unsigned char flag, unsigned char *buf size_t bits_needed = pad_bit_decoder(pad, buffer, 0); size_t leftover_bits = (8 - (*skip_bits&7)) & 7; bits_needed -= leftover_bits; - + fread(buffer + (*skip_bits>>3), 1, (bits_needed>>3) + ((bits_needed&7) ? 1 : 0), zmv_vars.fp); *skip_bits = pad_bit_decoder(pad, buffer, *skip_bits); } diff --git a/zsnes/src/zstate.c b/zsnes/src/zstate.c index 7afc599f..431d8319 100755 --- a/zsnes/src/zstate.c +++ b/zsnes/src/zstate.c @@ -299,13 +299,13 @@ void RestoreCVFrame() if (PauseRewind || EMUPause) { PauseFrameMode = EMUPause = true; - } + } } copy_state_data(RewindBufferPos, memcpyrinc, csm_load_rewind); ClearCacheCheck(); - + RewindTimer = ActualRewindFrames; } @@ -601,7 +601,7 @@ void statesaver() INSERT_POSITION_NUMBER(txtsavemsg, txtsavenum); INSERT_POSITION_NUMBER(txtrrsvmsg, txtrrsvnum); - + //Save State code #ifdef __LINUX__ SRAMChdir(); @@ -856,14 +856,14 @@ void stateloader (unsigned char *statename, unsigned char keycheck, unsigned cha static unsigned char *txtconvnum = 0; static unsigned char *txtnfndnum = 0; static unsigned char *txtrrldnum = 0; - + //Get the state number INSERT_POSITION_NUMBER(txtloadmsg, txtloadnum); INSERT_POSITION_NUMBER(txtconvmsg, txtconvnum); INSERT_POSITION_NUMBER(txtnfndmsg, txtnfndnum); INSERT_POSITION_NUMBER(txtrrldmsg, txtrrldnum); - + #ifdef __LINUX__ SRAMChdir(); #endif @@ -895,20 +895,20 @@ void stateloader (unsigned char *statename, unsigned char keycheck, unsigned cha case 2: if (mzt_load(statename, false)) { - + Msgptr = txtrrldmsg; MessageOn = MsgCount; if (PauseLoad || EMUPause) { PauseFrameMode = EMUPause = true; - } + } } else { Msgptr = txtnfndmsg; } - MessageOn = MsgCount; + MessageOn = MsgCount; return; } @@ -922,7 +922,7 @@ void stateloader (unsigned char *statename, unsigned char keycheck, unsigned cha if (zst_load(fhandle, 0)) { Msgptr = txtloadmsg; // 'STATE X LOADED.' - + if (PauseLoad || EMUPause) { PauseFrameMode = EMUPause = true;