diff --git a/DATA/time.blp b/DATA/time.blp index 70e90fe..35bc5db 100644 --- a/DATA/time.blp +++ b/DATA/time.blp @@ -1 +1 @@ -CheckTime = 64 Memory = 2147483647 +CheckTime = 50 Memory = 2147483647 diff --git a/Debug/Speedy Eggbert 2 Source.exe b/Debug/Speedy Eggbert 2 Source.exe index 35abeef..86e2f39 100644 Binary files a/Debug/Speedy Eggbert 2 Source.exe and b/Debug/Speedy Eggbert 2 Source.exe differ diff --git a/Debug/Speedy Eggbert 2 Source.pdb b/Debug/Speedy Eggbert 2 Source.pdb index d61bdc6..d64bda3 100644 Binary files a/Debug/Speedy Eggbert 2 Source.pdb and b/Debug/Speedy Eggbert 2 Source.pdb differ diff --git a/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.command.1.tlog b/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.command.1.tlog index 8e77d10..e4ee63a 100644 Binary files a/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.command.1.tlog and b/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.command.1.tlog differ diff --git a/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.read.1.tlog b/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.read.1.tlog index 57e64df..371550c 100644 Binary files a/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.read.1.tlog and b/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.read.1.tlog differ diff --git a/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.write.1.tlog b/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.write.1.tlog index a3a728c..cb744ef 100644 Binary files a/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.write.1.tlog and b/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/CL.write.1.tlog differ diff --git a/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/link.read.1.tlog b/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/link.read.1.tlog index 4d77871..4d0df7b 100644 Binary files a/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/link.read.1.tlog and b/Speedy E.e424a3cb/Debug/Speedy E.e424a3cb.tlog/link.read.1.tlog differ diff --git a/Speedy E.e424a3cb/Debug/Speedy Eggbert 2 Source.log b/Speedy E.e424a3cb/Debug/Speedy Eggbert 2 Source.log index 2d5d435..19d4386 100644 --- a/Speedy E.e424a3cb/Debug/Speedy Eggbert 2 Source.log +++ b/Speedy E.e424a3cb/Debug/Speedy Eggbert 2 Source.log @@ -1,63 +1,206 @@ - event.cpp + blupi.cpp C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(241,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(480,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\resource.h(106,9): warning C4005: 'TX_SHOWNEXT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(481,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\resource.h(107,9): warning C4005: 'TX_SHOWNEXT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.h(29,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.h(90,1): warning C4091: 'typedef ': ignored on left of '' when no variable is declared +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(249,25): warning C4101: 'targetlevel': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(245,24): warning C4101: 'rcRect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(245,18): warning C4101: 'clip': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(249,9): warning C4101: 'i': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(248,10): warning C4101: 'posMouse': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(353,8): warning C4101: 'test': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(352,8): warning C4101: 'posMouse': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(619,11): warning C4101: 'dest': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(617,13): warning C4101: 'i': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(618,10): warning C4101: 'rect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(655,11): warning C4101: 'rcRect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(817,17): warning C4101: 'timeStep': unreferenced local variable + button.cpp +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(241,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(481,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\pixmap.h(12,9): warning C4005: 'DIRECTDRAW_VERSION': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.h(29,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\button.cpp(52,12): warning C4101: 'icon': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\button.cpp(52,9): warning C4101: 'i': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\button.cpp(107,6): warning C4101: 'toolTips': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\button.cpp(130,8): warning C4101: 'rect': unreferenced local variable + decor.cpp +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(241,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(481,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\resource.h(107,9): warning C4005: 'TX_SHOWNEXT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\pixmap.h(12,9): warning C4005: 'DIRECTDRAW_VERSION': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.h(29,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.h(90,1): warning C4091: 'typedef ': ignored on left of '' when no variable is declared +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(25,9): warning C4005: 'DIRECTDRAW_VERSION': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(119,8): warning C4101: 'door': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(118,8): warning C4101: 'i': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(129,9): warning C4101: 'i': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(540,16): warning C4554: '&': check operator precedence for possible error; use parentheses to clarify precedence +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(565,10): warning C4101: 'text': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(1051,18): warning C4553: '==': result of expression not used; did you intend '='? +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(1286,39): warning C4553: '==': result of expression not used; did you intend '='? +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(1539,9): warning C4553: '==': result of expression not used; did you intend '='? +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(6540,8): warning C4101: 'type2': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(6573,94): warning C4244: '=': conversion from 'LONG' to 'short', possible loss of data +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(6596,6): warning C4101: 'players': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(6711,7): warning C4101: 'rect2': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(6710,10): warning C4101: 'rect1': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(6712,7): warning C4101: 'rect3': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(6728,26): warning C4309: '=': truncation of constant value +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(6729,26): warning C4309: '=': truncation of constant value +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(6742,25): warning C4309: '=': truncation of constant value +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(6743,25): warning C4309: '=': truncation of constant value +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(6823,13): warning C4101: 'moveObject': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(8145,9): warning C4101: 'tinyRect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(8200,7): warning C4101: 'tinyRect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(8222,9): warning C4101: 'tinyRect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(8258,9): warning C4101: 'src3': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(8288,9): warning C4101: 'tinyRect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(8316,9): warning C4101: 'tinyRect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(8344,9): warning C4101: 'tinyRect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(8825,9): warning C4553: '==': result of expression not used; did you intend '='? +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(9058,16): warning C4129: '%': unrecognized character escape sequence +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(9062,15): warning C4129: 'w': unrecognized character escape sequence + event.cpp +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(241,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(481,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\resource.h(107,9): warning C4005: 'TX_SHOWNEXT': macro redefinition C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\pixmap.h(12,9): warning C4005: 'DIRECTDRAW_VERSION': macro redefinition C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.h(29,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.h(90,1): warning C4091: 'typedef ': ignored on left of '' when no variable is declared C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1240,7): warning C4101: 'menuIndex': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1317,13): warning C4101: 'pos': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1466,13): warning C4101: 'i': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1494,13): warning C4101: 'toolTips': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1569,10): warning C4552: '!=': result of expression not used -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1774,9): warning C4101: 'data': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1861,8): warning C4101: 'element': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1859,8): warning C4101: 'stream': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1908,57): warning C4101: 'icon': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1908,17): warning C4101: 'world': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1906,17): warning C4101: 'levels': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1908,42): warning C4101: 'volume': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1908,24): warning C4101: 'time': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1907,17): warning C4101: 'types': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1905,17): warning C4101: 'i': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1917,17): warning C4101: 'bEnable': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1908,50): warning C4101: 'pente': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1908,34): warning C4101: 'button': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2296,10): warning C4101: 'sound': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2556,21): warning C4101: 'sound': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2726,7): warning C4101: 'bUser': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2751,7): warning C4101: 'bUser': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2797,20): warning C4778: 'sprintf' : unterminated format string '% ' -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2797,58): warning C4474: 'sprintf' : too many arguments passed for format string -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2789,15): warning C4101: 'world': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2789,28): warning C4101: 'total': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2794,8): warning C4101: 'pTerm': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2789,45): warning C4101: 'max': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2789,35): warning C4101: 'music': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2790,18): warning C4101: 'iconDim': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2790,8): warning C4101: 'totalDim': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2789,22): warning C4101: 'time': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2789,8): warning C4101: 'index': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2792,8): warning C4101: 'pButtonExist': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2789,42): warning C4101: 'i': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2793,8): warning C4101: 'bEnable': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2793,17): warning C4101: 'bHide': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2928,23): warning C4101: 'icon': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2928,14): warning C4101: 'channel': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2927,8): warning C4101: 'cel': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3086,8): warning C4101: 'pDest': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3087,8): warning C4101: 'indic': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3085,8): warning C4101: 'pText': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3088,12): warning C4101: 'h1': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3088,16): warning C4101: 'h2': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3088,8): warning C4101: 'nb': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3197,12): warning C4101: 'world': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3197,25): warning C4101: 'total': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3197,32): warning C4101: 'mission': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3197,19): warning C4101: 'time': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3335,8): warning C4101: 'doors': unreferenced local variable -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2897,1): warning C4715: 'CEvent::ChangePhase': not all control paths return a value -C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2943,1): warning C4715: 'CEvent::BuildDown': not all control paths return a value +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1319,13): warning C4101: 'pos': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1468,13): warning C4101: 'i': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1561,10): warning C4552: '!=': result of expression not used +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1766,9): warning C4101: 'data': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1853,8): warning C4101: 'element': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1851,8): warning C4101: 'stream': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1904,8): warning C4101: 'textLeft': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1900,57): warning C4101: 'icon': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1900,17): warning C4101: 'world': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1898,17): warning C4101: 'levels': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1910,11): warning C4101: 'phase': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1900,42): warning C4101: 'volume': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1900,24): warning C4101: 'time': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1899,17): warning C4101: 'types': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1909,17): warning C4101: 'bEnable': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1900,50): warning C4101: 'pente': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(1900,34): warning C4101: 'button': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2515,12): warning C4552: '|': result of expression not used +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2517,12): warning C4552: '|': result of expression not used +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2520,12): warning C4552: '|': result of expression not used +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2523,12): warning C4552: '|': result of expression not used +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2526,12): warning C4552: '|': result of expression not used +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2542,12): warning C4552: '|': result of expression not used +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2357,10): warning C4101: 'sound': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2797,21): warning C4101: 'sound': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2922,8): warning C4101: 'pTerm': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2918,29): warning C4101: 'max': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2918,14): warning C4101: 'state': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2918,21): warning C4101: 'volume': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2920,8): warning C4101: 'pButtonExist': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(2918,6): warning C4101: 'button': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3018,7): warning C4101: 'bUser': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3043,7): warning C4101: 'bUser': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3086,8): warning C4101: 'pTerm': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3081,15): warning C4101: 'music': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3090,8): warning C4101: 'res': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3082,18): warning C4101: 'iconDim': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3082,8): warning C4101: 'totalDim': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3083,8): warning C4101: 'filename': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3088,8): warning C4101: 'doors': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3084,8): warning C4101: 'pButtonExist': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3081,25): warning C4101: 'j': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3081,22): warning C4101: 'i': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3085,8): warning C4101: 'bEnable': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3089,8): warning C4101: 'text': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3085,17): warning C4101: 'bHide': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3081,28): warning C4101: 'nb': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3262,23): warning C4101: 'icon': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3262,14): warning C4101: 'channel': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3261,8): warning C4101: 'cel': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3393,8): warning C4101: 'pDest': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3394,8): warning C4101: 'indic': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3392,8): warning C4101: 'pText': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3395,12): warning C4101: 'h1': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3395,16): warning C4101: 'h2': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3395,8): warning C4101: 'nb': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3504,12): warning C4101: 'world': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3504,25): warning C4101: 'total': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3504,32): warning C4101: 'mission': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3504,19): warning C4101: 'time': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3642,8): warning C4101: 'doors': unreferenced local variable + jauge.cpp +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(241,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(481,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\pixmap.h(12,9): warning C4005: 'DIRECTDRAW_VERSION': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.h(29,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\jauge.cpp(78,26): warning C4293: '<<': shift count negative or too big, undefined behavior + menu.cpp +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(241,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(481,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\resource.h(107,9): warning C4005: 'TX_SHOWNEXT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\pixmap.h(12,9): warning C4005: 'DIRECTDRAW_VERSION': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.h(29,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition + misc.cpp +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(241,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(481,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition + movie.cpp +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(241,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(481,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition + pixmap.cpp +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(241,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(481,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\pixmap.h(12,9): warning C4005: 'DIRECTDRAW_VERSION': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\resource.h(107,9): warning C4005: 'TX_SHOWNEXT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.h(29,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.h(90,1): warning C4091: 'typedef ': ignored on left of '' when no variable is declared +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(249,25): warning C4101: 'targetlevel': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(245,24): warning C4101: 'rcRect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(245,18): warning C4101: 'clip': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(249,9): warning C4101: 'i': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(248,10): warning C4101: 'posMouse': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(353,8): warning C4101: 'test': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(352,8): warning C4101: 'posMouse': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(619,11): warning C4101: 'dest': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(617,13): warning C4101: 'i': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(618,10): warning C4101: 'rect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(655,11): warning C4101: 'rcRect': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\blupi.cpp(817,17): warning C4101: 'timeStep': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\pixmap.cpp(954,7): warning C4101: 'image': unreferenced local variable + sound.cpp +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(241,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(481,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\resource.h(107,9): warning C4005: 'TX_SHOWNEXT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(69,5): warning C4002: too many arguments for function-like macro invocation 'TRY_DS' +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(259,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(260,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(261,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(262,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(263,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(264,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(265,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(266,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(267,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(268,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(269,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(270,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\sound.cpp(271,3): warning C4838: conversion from 'unsigned int' to 'int' requires a narrowing conversion + text.cpp +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(241,9): warning C4005: 'MAXMOVEOBJECT': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\def.h(481,9): warning C4005: 'WM_PHASE_PRIVATE': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\pixmap.h(12,9): warning C4005: 'DIRECTDRAW_VERSION': macro redefinition +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\text.cpp(120,6): warning C4101: 'width': unreferenced local variable +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\text.cpp(119,8): warning C4101: 'pos1': unreferenced local variable + Generating Code... +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\pixmap.cpp(654,1): warning C4700: uninitialized local variable 'hErr' used +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\event.cpp(3277,1): warning C4715: 'CEvent::BuildDown': not all control paths return a value +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(865,1): warning C4700: uninitialized local variable 'thing' used +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(5315,1): warning C4715: 'CDecor::BlupiIsGround': not all control paths return a value +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(7888,1): warning C4700: uninitialized local variable 'tinyPoint' used +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(8266,1): warning C4715: 'CDecor::MoveObjectDetect': not all control paths return a value +C:\Users\JonAd\source\repos\HMVocaloid\Speedy-Eggbert-2-Source-Code-Decomp\decor.cpp(8411,1): warning C4700: uninitialized local variable 'moveObject' used LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification Starting pass 1 Processed /DEFAULTLIB:winmm.lib @@ -109,7 +252,7 @@ pixmap.obj : warning LNK4006: "unsigned long * * g_threadID" (?g_threadID@@3PAPA pixmap.obj : warning LNK4006: "int g_objectMax" (?g_objectMax@@3HA) already defined in blupi.obj; second definition ignored pixmap.obj : warning LNK4006: "int g_elementMax" (?g_elementMax@@3HA) already defined in blupi.obj; second definition ignored pixmap.obj : warning LNK4006: "int g_blupiMax" (?g_blupiMax@@3HA) already defined in blupi.obj; second definition ignored -pixmap.obj : warning LNK4006: "int g_exploMax" (?g_exploMax@@3HA) already defined in blupi.obj; second definition ignored +pixmap.obj : warning LNK4006: "int * g_exploMax" (?g_exploMax@@3PAHA) already defined in blupi.obj; second definition ignored pixmap.obj : warning LNK4006: "short * g_object" (?g_object@@3PAFA) already defined in blupi.obj; second definition ignored pixmap.obj : warning LNK4006: "short * g_element" (?g_element@@3PAFA) already defined in blupi.obj; second definition ignored pixmap.obj : warning LNK4006: "short * g_blupiCh" (?g_blupiCh@@3PAFA) already defined in blupi.obj; second definition ignored @@ -487,10 +630,12 @@ pixmap.obj : warning LNK4006: "unsigned int g_lastPhase" (?g_lastPhase@@3IA) alr Searching C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\lib\x86\MSVCRTD.lib: Found "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) Referenced in blupi.obj + Referenced in event.obj Referenced in pixmap.obj Loaded MSVCRTD.lib(new_scalar.obj) Found "void __cdecl operator delete(void *,unsigned int)" (??3@YAXPAXI@Z) Referenced in blupi.obj + Referenced in event.obj Referenced in pixmap.obj Loaded MSVCRTD.lib(delete_scalar_size.obj) Found ___report_rangecheckfailure @@ -755,17 +900,6 @@ pixmap.obj : warning LNK4006: "unsigned int g_lastPhase" (?g_lastPhase@@3IA) alr Referenced in dsound.lib(DSOUND.dll) Loaded dsound.lib(DSOUND.dll) Searching C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.40.33807\lib\x86\vcruntimed.lib: - Found _memset - Referenced in MSVCRTD.lib(utility_desktop.obj) - Referenced in network.obj - Referenced in pixmap.obj - Referenced in sound.obj - Referenced in wave.obj - Referenced in blupi.obj - Referenced in ddutil.obj - Referenced in decor.obj - Referenced in event.obj - Loaded vcruntimed.lib(VCRUNTIME140D.dll) Found _strstr Referenced in blupi.obj Referenced in event.obj @@ -782,6 +916,16 @@ pixmap.obj : warning LNK4006: "unsigned int g_lastPhase" (?g_lastPhase@@3IA) alr Referenced in event.obj Referenced in movie.obj Loaded vcruntimed.lib(VCRUNTIME140D.dll) + Found _memset + Referenced in pixmap.obj + Referenced in sound.obj + Referenced in wave.obj + Referenced in MSVCRTD.lib(utility_desktop.obj) + Referenced in ddutil.obj + Referenced in decor.obj + Referenced in event.obj + Referenced in network.obj + Loaded vcruntimed.lib(VCRUNTIME140D.dll) Found _memcpy Referenced in decor.obj Referenced in event.obj @@ -1327,26 +1471,26 @@ pixmap.obj : warning LNK4006: "unsigned int g_lastPhase" (?g_lastPhase@@3IA) alr /v /x /fo - "C:\Users\JonAd\AppData\Local\Temp\lnk{1CC531A7-6BE1-4795-9A13-AFBA69E25027}.tmp" - "C:\Users\JonAd\AppData\Local\Temp\lnk{8AA96EE1-1CFA-4510-9DF9-D84B7AAE67B7}.tmp" + "C:\Users\JonAd\AppData\Local\Temp\lnk{98FD0423-99C1-4BE8-9E33-D4451369DDD9}.tmp" + "C:\Users\JonAd\AppData\Local\Temp\lnk{B03E132D-6905-4640-8933-5A00B1FC93C2}.tmp" Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384 Copyright (C) Microsoft Corporation. All rights reserved. Using codepage 1252 as default - Creating C:\Users\JonAd\AppData\Local\Temp\lnk{1CC531A7-6BE1-4795-9A13-AFBA69E25027}.tmp + Creating C:\Users\JonAd\AppData\Local\Temp\lnk{98FD0423-99C1-4BE8-9E33-D4451369DDD9}.tmp - C:\Users\JonAd\AppData\Local\Temp\lnk{8AA96EE1-1CFA-4510-9DF9-D84B7AAE67B7}.tmp. + C:\Users\JonAd\AppData\Local\Temp\lnk{B03E132D-6905-4640-8933-5A00B1FC93C2}.tmp. Writing 24:1, lang:0x409, size 381 Invoking cvtres.exe: /machine:x86 /verbose - /out:"C:\Users\JonAd\AppData\Local\Temp\lnk{1F3B9A1E-D8E0-438E-9FB4-716384BB5EA7}.tmp" + /out:"C:\Users\JonAd\AppData\Local\Temp\lnk{1166C1B4-9E29-4466-B17C-3FFB54577887}.tmp" /readonly "Speedy E.e424a3cb\Debug\Eggbert2.res" - "C:\Users\JonAd\AppData\Local\Temp\lnk{1CC531A7-6BE1-4795-9A13-AFBA69E25027}.tmp" + "C:\Users\JonAd\AppData\Local\Temp\lnk{98FD0423-99C1-4BE8-9E33-D4451369DDD9}.tmp" Microsoft (R) Windows Resource To Object Converter Version 14.40.33811.0 Copyright (C) Microsoft Corporation. All rights reserved. diff --git a/Speedy E.e424a3cb/Debug/blupi.obj b/Speedy E.e424a3cb/Debug/blupi.obj index b625864..36f440f 100644 Binary files a/Speedy E.e424a3cb/Debug/blupi.obj and b/Speedy E.e424a3cb/Debug/blupi.obj differ diff --git a/Speedy E.e424a3cb/Debug/button.obj b/Speedy E.e424a3cb/Debug/button.obj index 6955d4d..0a9b906 100644 Binary files a/Speedy E.e424a3cb/Debug/button.obj and b/Speedy E.e424a3cb/Debug/button.obj differ diff --git a/Speedy E.e424a3cb/Debug/decor.obj b/Speedy E.e424a3cb/Debug/decor.obj index 917b352..b44abee 100644 Binary files a/Speedy E.e424a3cb/Debug/decor.obj and b/Speedy E.e424a3cb/Debug/decor.obj differ diff --git a/Speedy E.e424a3cb/Debug/event.obj b/Speedy E.e424a3cb/Debug/event.obj index 6a95388..406a705 100644 Binary files a/Speedy E.e424a3cb/Debug/event.obj and b/Speedy E.e424a3cb/Debug/event.obj differ diff --git a/Speedy E.e424a3cb/Debug/jauge.obj b/Speedy E.e424a3cb/Debug/jauge.obj index 629458e..1be8dfd 100644 Binary files a/Speedy E.e424a3cb/Debug/jauge.obj and b/Speedy E.e424a3cb/Debug/jauge.obj differ diff --git a/Speedy E.e424a3cb/Debug/menu.obj b/Speedy E.e424a3cb/Debug/menu.obj index 0b9ae70..fc781ab 100644 Binary files a/Speedy E.e424a3cb/Debug/menu.obj and b/Speedy E.e424a3cb/Debug/menu.obj differ diff --git a/Speedy E.e424a3cb/Debug/misc.obj b/Speedy E.e424a3cb/Debug/misc.obj index 2bfa3f3..b0731f0 100644 Binary files a/Speedy E.e424a3cb/Debug/misc.obj and b/Speedy E.e424a3cb/Debug/misc.obj differ diff --git a/Speedy E.e424a3cb/Debug/movie.obj b/Speedy E.e424a3cb/Debug/movie.obj index f0bb470..bcea0be 100644 Binary files a/Speedy E.e424a3cb/Debug/movie.obj and b/Speedy E.e424a3cb/Debug/movie.obj differ diff --git a/Speedy E.e424a3cb/Debug/pixmap.obj b/Speedy E.e424a3cb/Debug/pixmap.obj index 1af28c5..6b6fb77 100644 Binary files a/Speedy E.e424a3cb/Debug/pixmap.obj and b/Speedy E.e424a3cb/Debug/pixmap.obj differ diff --git a/Speedy E.e424a3cb/Debug/sound.obj b/Speedy E.e424a3cb/Debug/sound.obj index aa984f4..adbbb7c 100644 Binary files a/Speedy E.e424a3cb/Debug/sound.obj and b/Speedy E.e424a3cb/Debug/sound.obj differ diff --git a/Speedy E.e424a3cb/Debug/text.obj b/Speedy E.e424a3cb/Debug/text.obj index a55f203..c7bfd62 100644 Binary files a/Speedy E.e424a3cb/Debug/text.obj and b/Speedy E.e424a3cb/Debug/text.obj differ diff --git a/Speedy E.e424a3cb/Debug/vc143.idb b/Speedy E.e424a3cb/Debug/vc143.idb index 5e0cce5..2ed3039 100644 Binary files a/Speedy E.e424a3cb/Debug/vc143.idb and b/Speedy E.e424a3cb/Debug/vc143.idb differ diff --git a/Speedy E.e424a3cb/Debug/vc143.pdb b/Speedy E.e424a3cb/Debug/vc143.pdb index dddc1f3..65e0987 100644 Binary files a/Speedy E.e424a3cb/Debug/vc143.pdb and b/Speedy E.e424a3cb/Debug/vc143.pdb differ diff --git a/blupi.cpp b/blupi.cpp index f55152a..9ad911a 100644 --- a/blupi.cpp +++ b/blupi.cpp @@ -73,7 +73,7 @@ LPDWORD* g_threadID; int g_objectMax; int g_elementMax; int g_blupiMax; -int g_exploMax; +int g_exploMax[100]; short g_object[6]; short g_element[6]; short g_blupiCh[6]; @@ -375,7 +375,6 @@ void SetDecor() g_pEvent->DrawButtons(); g_lastPhase = phase; g_pPixmap->MouseBackDraw(); - return; } BOOL RestoreGame() @@ -724,7 +723,7 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) ChangeSprite(SPRITE_WAIT); - ZeroMemory(&g_pPixmap, sizeof(7068)); + //ZeroMemory(&g_pPixmap, sizeof(7068)); if (!bOK) { @@ -757,7 +756,7 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) g_pPixmap->SetTrueColor(TRUE); g_pPixmap->SetTrueColorDecor(TRUE); - ZeroMemory(&g_pSound, sizeof(644)); + //ZeroMemory(&g_pSound, sizeof(644)); g_pSound = new CSound; if (g_pSound == NULL) return InitFail("New sound", TRUE); @@ -766,21 +765,21 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) g_pSound->CacheAll(); g_pSound->SetState(TRUE); - ZeroMemory(&g_pMovie, sizeof(164)); + //ZeroMemory(&g_pMovie, sizeof(164)); g_pMovie = new CMovie; if (g_pMovie == NULL) return InitFail("New movie", FALSE); g_pMovie->Create(); - ZeroMemory(&g_pDecor, sizeof(156448)); + //ZeroMemory(&g_pDecor, sizeof(156448)); g_pDecor = new CDecor; if (g_pDecor == NULL) return InitFail("New decor", FALSE); g_pDecor->Create(g_hWnd, g_pSound, g_pPixmap, g_pNetwork); - ZeroMemory(&g_pEvent, sizeof(39904)); + //ZeroMemory(&g_pEvent, sizeof(39904)); g_pEvent = new CEvent; if (g_pEvent == NULL) return InitFail("New event", FALSE); @@ -790,7 +789,7 @@ static BOOL DoInit(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) g_pEvent->SetMouseType(g_mouseType); g_pEvent->ChangePhase(WM_PHASE_INIT); - ZeroMemory(&g_pNetwork, sizeof(20)); + //ZeroMemory(&g_pNetwork, sizeof(20)); g_pNetwork = new CNetwork; if (g_pNetwork == NULL) return InitFail("New network", FALSE); diff --git a/button.cpp b/button.cpp index 947cc60..ae0ffb4 100644 --- a/button.cpp +++ b/button.cpp @@ -46,7 +46,7 @@ CButton::~CButton() // Create a new Button BOOL CButton::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, - POINT pos, int type, int* pMenu, int nbMenu, int *pToolTips, int nbToolTips, BOOL bMinimizeRedraw, int region, UINT message) + POINT pos, int type, BOOL bMinimizeRedraw, UINT message) { POINT iconDim; int i, icon; @@ -57,110 +57,66 @@ BOOL CButton::Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, }; if ( type < 0 || type > 0 ) return FALSE; + - iconDim.x = ttypes[type*2+0]; - iconDim.y = ttypes[type*2+1]; + iconDim.x = ttypes[type * 2 + 0]; + iconDim.y = ttypes[type * 2 + 1]; - m_hWnd = hWnd; - m_pPixmap = pPixmap; - m_pSound = pSound; - m_type = type; - m_bMinimizeRedraw = bMinimizeRedraw; - m_bEnable = TRUE; - m_bHide = FALSE; - m_bSomething = FALSE; - m_message = message; - m_pos.x = pos.x; - m_pos.y = pos.y; - m_dim.x = iconDim.x; - m_dim.y = iconDim.y; - m_nbMenu = nbMenu; - m_nbToolTips = nbToolTips; - m_selMenu = 0; - m_state = 0; - m_mouseState = 0; - m_bMouseDown = FALSE; - m_bRedraw = TRUE; - -/* Do we need this yet? -/////////////////////////////////////////////////// - for ( i=0 ; i 0) + if (0 < iconMenu) { - for (i = 0; i < somethingMenu; i++) + iconMenu2 = m_iconMenu; + for (i = 0; i < iconMenu; i++) { icon++; - m_iconMenu[i] = (int)icon; + m_iconMenu[i] = icon[i]; } } - m_nbMenu = somethingMenu; + m_nbMenu = iconMenu; } -void CButton::MenuToolTips(int* menu, int menuTooltips) +void CButton::SetToolTips(int* menu, int menuTooltips) { int toolTips; int* menuTool; int i; - if (menuTooltips > 0) + if (0 < menuTooltips) { menuTool = m_toolTips; i = menuTooltips; - do + for (i = 0; i < menuTooltips; i++) { - toolTips = *menu++; - *menuTool++ = toolTips; - --i; - } while (i); + menu++; + m_toolTips[i] = menu[i]; + } } m_nbToolTips = menuTooltips; } diff --git a/button.h b/button.h index 38544a3..926e7a2 100644 --- a/button.h +++ b/button.h @@ -15,9 +15,9 @@ public: ~CButton(); BOOL Create(HWND hWnd, CPixmap *pPixmap, CSound *pSound, - POINT pos, int type, int* pMenu, int nbMenu, int* pToolTips, int nbToolTips, BOOL bMinimizeRedraw, int region, UINT message); - void SetSomethingMenu(int* icon, int somethingMenu); - void MenuToolTips(int* menu, int menuTooltips); + POINT pos, int type, BOOL bMinimizeRedraw, UINT message); + void SetIconMenu(int* icon, int iconMenu); + void SetToolTips(int* menu, int menuTooltips); void Draw(); void Redraw(); diff --git a/decor.cpp b/decor.cpp index c8e6724..d9af4d3 100644 --- a/decor.cpp +++ b/decor.cpp @@ -1162,6 +1162,7 @@ void CDecor::AdaptDoors(BOOL bPrivate, int mission) POINT pos; POINT pos2; int i; + int p; m_bPrivate = bPrivate; m_mission = mission; @@ -1170,12 +1171,13 @@ void CDecor::AdaptDoors(BOOL bPrivate, int mission) pos.y = 0; pos2.x = 0; pos2.y = 0; + p = bPrivate; if (bPrivate == FALSE) { if (mission == 1) { - do + for (p = 0; p < 20; p++) { if ((SearchDoor(bPrivate, pos2, pos) != FALSE) && ((*(char*)((int)m_lastDecorIcon + bPrivate + 0xFFFFFF) == '\0' || (m_bCheatDoors != FALSE)))) @@ -1199,7 +1201,7 @@ void CDecor::AdaptDoors(BOOL bPrivate, int mission) PlaySoundB(SOUND_33_DOOR, m_moveObject[i]->posStart, 0); } bPrivate = bPrivate + TRUE; - } while ((int)bPrivate < 20); + } } } } @@ -6610,7 +6612,7 @@ void CDecor::NotifPop() notifText = m_notifText; i = 3; - do + for (i = 0; i < 3; i++) { string = strlen((const char*)(i + 100)) + 1; num = (int)notifText + 100 + string++; @@ -6619,7 +6621,7 @@ void CDecor::NotifPop() string += 100; memcpy(num3, num2, string - 1); --i; - } while (i); + } if (i == 0) { m_notifText[3][0] = '\0'; @@ -6721,9 +6723,7 @@ void CDecor::NetDataFlush() playerPackets = m_netPlayerPacketsRecieved; net = (LONG*)m_netVitesses[0].y; - i = 4; - - while (i != 0) + for (i = 0; i < 4; i++) { m_netPacketIcon.icon = 65535; m_netPacketIcon.type = 65535; @@ -9091,50 +9091,12 @@ BOOL CDecor::CurrentRead(int gamer, int mission, BOOL bUser) /* BOOL CDecor::MissionStart(int gamer, int rank, BOOL bUser) { - char filename[MAX_PATH]; - int* pBuffer; - FILE* stream; - int num; - Cellule(*pDecor)[100]; + char filename[MAX_PATH]; + FILE* file = NULL; + DescFile* pBuffer = NULL; + int majRev, minRev; + int nb, i, x, y; - pBuffer = NULL; - sprintf(filename, "data\\s%.3d-%.3d.blp", gamer, rank); - AddUserPath(filename); - stream = fopen(filename, "wb"); - - if (!stream) - { - pBuffer = (int*)malloc(57008); - if (pBuffer == NULL) if (stream != NULL) fclose(stream); - } - - if (pBuffer) - { - memset(pBuffer, 0, 57008); - *pBuffer = 57008; - pBuffer[1] = 1; - pBuffer[2] = 4; - pBuffer[3] = 0; - memcpy(pBuffer + 53, m_decor, 20000); - memcpy(pBuffer + 5053, m_bigDecor, 20000); - memcpy(pBuffer + 10053, m_balleTraj, 1300); - memcpy(pBuffer + 10378, m_moveTraj, 1300); - memcpy(pBuffer + 10703, m_moveObject, 9600); - pBuffer[13153] = m_posDecor.x; - pBuffer[13154] = m_posDecor.y; - pBuffer[13155] = m_dimDecor.x; - pBuffer[13156] = m_dimDecor.y; - pBuffer[13157] = m_phase; - pBuffer[13158] = m_term; - pBuffer[13159] = m_music; - pBuffer[13160] = m_region; - pBuffer[13161] = m_time; - memcpy(pBuffer + 13162, m_missionTitle, 100); - pBuffer[13237] = m_nbRankCaisse; - memcpy(pBuffer + 13238, m_rankCaisse, 804); - pBuffer[13438] = m_nbLinkCaisse; - memcpy(pBuffer + 13439, m_linkCaisse, 800); - } } */ @@ -9182,7 +9144,7 @@ BOOL CDecor::Read(int gamer, int rank, BOOL* pbMission, BOOL* pbPrivate) m_posDecor.y = ptr[13154]; m_dimDecor.x = ptr[13155]; m_dimDecor.y = ptr[13156]; - m_phase = (WMessage)ptr[13157]; + m_phase = ptr[13157]; m_term = ptr[13158]; m_music = ptr[13159]; m_region = ptr[13160]; diff --git a/decor.h b/decor.h index 64cbeaa..4f1b686 100644 --- a/decor.h +++ b/decor.h @@ -297,16 +297,17 @@ typedef struct { short majRev; short minRev; - short reserve1[100]; + BOOL bDemo; + short reserve1[98]; POINT posDecor; - POINT dimDecor; - short world; + POINT dimDecor; + short world; short music; short region; - short reserve2[51]; - POINT blupiPos[4]; - int blupiDir[4]; - char name[100]; + short reserve2[50]; + POINT blupiPos[100]; + int blupiDir[100]; + char libelle[100]; short reserve3[196]; } DescFile; @@ -789,7 +790,7 @@ protected: BOOL m_blupiRestart; POINT m_worldDims; POINT m_selectedCelPos; - WMessage m_phase; + int m_phase; int m_voyagePhase; POINT m_sucettePos; int m_sucetteType; diff --git a/def.h b/def.h index c4117f6..3b771f0 100644 --- a/def.h +++ b/def.h @@ -252,6 +252,7 @@ #define WM_DECOR3 (WM_USER+22) #define WM_DECOR4 (WM_USER+23) #define WM_DECOR5 (WM_USER+24) +#define WM_DECOR11 1054 #define WM_ACTION_GO (WM_USER+30) @@ -429,7 +430,7 @@ #define WM_PHASE_TERM (WM_USER+507) #define WM_PHASE_WIN (WM_USER+508) #define WM_PHASE_LOST (WM_USER+509) -#define WM_PHASE_STOP (WM_USER+510) + #define WM_PHASE_MUSIC (WM_USER+512) #define WM_PHASE_PLAYMOVIE (WM_USER+513) @@ -443,7 +444,7 @@ #define WM_PHASE_INSERT (WM_USER+521) #define WM_PHASE_HISTORY0 (WM_USER+522) #define WM_PHASE_HISTORY1 (WM_USER+523) -#define WM_PHASE_HELP (WM_USER+524) +#define WM_PHASE_HELP 1583 #define WM_PHASE_H0MOVIE (WM_USER+525) #define WM_PHASE_H1MOVIE (WM_USER+526) #define WM_PHASE_H2MOVIE (WM_USER+527) @@ -454,7 +455,7 @@ #define WM_PHASE_BYE (WM_USER+532) #define WM_PHASE_SKILL1 (WM_USER+533) #define WM_PHASE_SKILL2 (WM_USER+534) -#define WM_PHASE_DEMO (WM_USER+535) +#define WM_PHASE_DEMO 1557 #define WM_PHASE_INTRO1 (WM_USER+536) #define WM_PHASE_INTRO2 (WM_USER+537) #define WM_PHASE_PLAYTEST (WM_USER+538) @@ -479,9 +480,12 @@ #define WM_PHASE_WINMOVIEm 1551 #define WM_PHASE_PRIVATE 1554 #define WM_PHASE_NAMEd 1558 +#define WM_PHASE_WRITEd 1559 #define WM_PHASE_READd 1560 #define WM_PHASE_CONFIRM 1562 #define WM_PHASE_YES 1563 +#define WM_PHASE_61C 1564 +#define WM_PHASE_61F 1567 #define WM_PHASE_SERVICE 1568 #define WM_PHASE_DPLAY_DO_SERVICE 1569 #define WM_PHASE_DPLAY_CANCEL_SERVICE 1570 @@ -491,7 +495,11 @@ #define WM_PHASE_DPLAY_REFRESH 1574 #define WM_PHASE_DPLAY_CANCEL_SESSION 1575 #define WM_PHASE_MULTI 1576 +#define WM_PHASE_DPLAY_START_GAME_2 1577 +#define WM_PHASE_DPLAY_CANCEL_MULTI 1578 #define WM_PHASE_DPLAY_CREATE 1580 +#define WM_PHASE_DPLAY_CANCEL_CREATE 1581 +#define WM_PHASE_STOP 1582 #define WM_PHASE_634 1588 #define WM_PHASE_GWRITE 1584 #define WM_PHASE_GREADp 1585 diff --git a/event.cpp b/event.cpp index 9a3fe84..a6ead71 100644 --- a/event.cpp +++ b/event.cpp @@ -117,23 +117,23 @@ static Phase table[] = FALSE, { { - WM_PHASE_DEMO, + WM_PHASE_GAMER, 0, {1,48}, 86, 410, + {1,TX_BUTTON_APPRENDRE}, + }, + { + WM_PHASE_DEMO, + 0, {1,84}, + 128, 410, {1,TX_BUTTON_DEMO}, }, { WM_PHASE_BYE, //? WM_CLOSE, - 0, {1,84}, - 128, 410, - {1,TX_BUTTON_QUITTER}, - }, - { - WM_PHASE_SCHOOL, 0, {1,6}, - 21, 410, - {1,TX_BUTTON_APPRENDRE}, + 540, 410, + {1,TX_BUTTON_QUITTER}, }, { 0 @@ -450,7 +450,7 @@ static Phase table[] = { WM_PHASE_SETUPp, - "image16\\setup.blp", + "setup.blp", FALSE, { { @@ -517,7 +517,7 @@ static Phase table[] = { WM_PHASE_READ, - "image16\\read.blp", + "read.blp", FALSE, { { @@ -594,7 +594,7 @@ static Phase table[] = { WM_PHASE_WRITE, - "image16\\write.blp", + "write.blp", FALSE, { { @@ -671,7 +671,7 @@ static Phase table[] = { WM_PHASE_WRITEp, - "image16\\write.blp", + "write.blp", FALSE, { { @@ -748,7 +748,7 @@ static Phase table[] = { WM_PHASE_LOST, - "image16\\lost.blp", + "lost.blp", TRUE, { { @@ -860,7 +860,7 @@ static Phase table[] = { WM_PHASE_BUTTON, - "image16\\button00.blp", + "button00.blp", TRUE, { { @@ -1206,7 +1206,7 @@ static Phase table[] = { WM_PHASE_INSERT, - "image\\insert.blp", + "insert.blp", FALSE, { //? { @@ -1242,6 +1242,8 @@ CEvent::CEvent() CMenu(m_menu); + new CButton; + m_somethingJoystick = 0; m_bFullScreen = TRUE; m_mouseType = MOUSETYPEGRA; @@ -1488,46 +1490,36 @@ void CEvent::FlushInput() BOOL CEvent::CreateButtons() { - int i = 0, message, num = 0, size; - int num3 = 0; - int* iconMenu; - POINT pos, toolTips; - BOOL bMinimizeRedraw = FALSE; - CButton* button; + int i = 0, message, nb; + POINT pos; + BOOL bMinimizeRedraw = FALSE; - size = m_phase * sizeof(Phase); - button = m_buttons; - - - if (table[m_index].buttons[0].message != 0) + while (table[m_index].buttons[i].message != 0) { + pos.x = table[m_index].buttons[i].x; + pos.y = table[m_index].buttons[i].y; + message = table[m_index].buttons[i].message; - while (table[m_index].buttons[1].iconMenu + -8 != 0) + m_buttons[i].Create(m_hWnd, m_pPixmap, m_pSound, pos, + table[m_index].buttons[i].type, + bMinimizeRedraw, + message); + + nb = table[m_index].buttons[i].iconMenu[0]; + if (!m_bAccessBuild && + m_phase == WM_PHASE_BUILD && + message == WM_DECOR11) { - pos.x = table[m_index].buttons[i].x; - pos.y = table[m_index].buttons[i].y; - - message = table[m_index].buttons[i].message; - - m_buttons[i].Create(m_hWnd, m_pPixmap, m_pSound, pos, - table[m_index].buttons[i].type, - table[m_index].buttons[i].iconMenu + size, - table[m_index].buttons[i].iconMenu[0], - table[m_index].buttons[i].toolTips + size, - table[m_index].buttons[i].toolTips[0], - bMinimizeRedraw, m_pDecor->GetRegion(), message); - - iconMenu = table[m_index].buttons[i].iconMenu + (m_phase * sizeof(Phase)); - if (((m_bAccessBuild == FALSE) && (m_phase == WM_PHASE_BUILD)) && (message == 1054)) - { - iconMenu++; - } - m_buttons->SetSomethingMenu(table[m_index].buttons[i].iconMenu + i + 4, *(int*)iconMenu); - m_buttons->MenuToolTips(table[m_index].buttons[i].toolTips + i + 4, *(int*)table[m_index].buttons[i].toolTips + i); + nb -= 6; // voir (*+) } - + m_buttons[i].SetIconMenu(table[m_index].buttons[i].iconMenu + 1, nb); + m_buttons[i].SetToolTips(table[m_index].buttons[i].toolTips + 1, + table[m_index].buttons[i].toolTips[0]); + i++; } + return TRUE; + } void CEvent::ReadInput() @@ -1805,27 +1797,27 @@ void CEvent::ChatSend() void CEvent::ChatMessageSound(char* data) { int num; + int i = 0; char (*chatZone); char(*chat)[5]; POINT pos; num = 3; chatZone = m_chatZone[0]; - do + for (i = 0; i < 6; i++) { - if (chatZone = '\0') + if (chatZone == '\0') { - chat = m_chatZone + num * 20; - goto error; + chat = m_chatZone + i * 20; + goto LABEL; } - num++; chatZone = chatZone + 100; - } while (num < 6); + } HandleChatBuffer(); chat = (char(*) [5])m_text; return; -error: +LABEL: strcpy((char*)chat, data); pos.x = 320; pos.y = 240; @@ -1949,9 +1941,9 @@ BOOL CEvent::DrawButtons() } m_pDecor->OutputNetDebug(text); - phase = m_phase; - if (((phase != WM_PHASE_PLAY) && (phase != WM_PHASE_PLAYTEST)) && (phase != WM_PHASE_BUILD)) + + if (((m_phase != WM_PHASE_PLAY) && (m_phase != WM_PHASE_PLAYTEST)) && (m_phase != WM_PHASE_BUILD)) { rect.right = 302; rect.left = 2; @@ -1961,13 +1953,24 @@ BOOL CEvent::DrawButtons() pos.y = 2; m_pPixmap->DrawPart(-1, 0, pos, rect, 1, FALSE); } - DrawTextLeft(m_pPixmap, pos, textLeft, 10); + pos.x = 2; + pos.y = 2; + DrawTextLeft(m_pPixmap, pos, text, 10); if (m_phase == WM_PHASE_INIT) { + pos.x = 158; + pos.y = 446; DrawTextB(m_pPixmap, pos, (char*)"Version 2.0", FONTLITTLE); } + i = 0; + while (table[m_index].buttons[i].message != 0) + { + m_buttons[i].Draw(); + i++; + } + if (m_phase == WM_PHASE_GAMER) { LoadString(TX_CHOOSEGAMER, res, 100); @@ -2004,6 +2007,64 @@ BOOL CEvent::DrawButtons() pos.y = 190; DrawTextLeft(m_pPixmap, pos, res, FONTSLIM); } + + if (m_phase == WM_PHASE_NAMEg) + { + LoadString(TX_CHOOSEPLAYER, res, 100); + lg = GetTextWidth(res, 0); + pos.x = 320 - lg / 2; + pos.y = 102; + DrawTextLeft(m_pPixmap, pos, res, 1); + LoadString(TX_WRITENAME, res, 100); + pos.x = 320 - lg / 2; + pos.y = 190; + DrawTextLeft(m_pPixmap, pos, res, 0); + pos.x = 320; + pos.y = 232; + PutTextInputBox(pos); + } + + if (m_phase == WM_PHASE_CLEARg) + { + LoadString(TX_CHOOSEGAMER, res, 100); + lg = GetTextWidth(res, 0); + pos.x = 320 - lg / 2; + pos.y = 102; + DrawTextLeft(m_pPixmap, pos, res, 1); + LoadString(TX_DISCARDGAME, res, 100); + pos.x = 320 - lg / 2; + pos.y = 210; + DrawTextLeft(m_pPixmap, pos, res, 0); + strcpy(res, m_gamerName); + strcat(res, " ?"); + pos.x = 320 - lg / 2; + pos.y = 230; + DrawTextLeft(m_pPixmap, pos, res, 0); + } + + if (m_phase == WM_PHASE_CLEARd) + { + LoadString(TX_DESIGNMISSION, res, 100); + lg = GetTextWidth(res, 0); + pos.x = 320 - lg / 2; + pos.y = 104; + DrawTextLeft(m_pPixmap, pos, res, 1); + LoadString(TX_DELETEMISSION, res, 100); + GetWorld(); + sprintf(text, res); + lg = GetTextWidth(text, 0); + pos.x = 320 - lg / 2; + pos.y = 210; + DrawTextLeft(m_pPixmap, pos, text, 0); + strcpy(res, m_pDecor->GetMissionTitle()); + if (res[0] == '\0') LoadString(TX_NONAME, res, 100); + strcat(res, " ?"); + lg = GetTextWidth(res, 0); + pos.x = 320 - lg / 2; + pos.y = 230; + DrawTextLeft(m_pPixmap, pos, res, 0); + } + if (m_phase == WM_PHASE_SETUP || m_phase == WM_PHASE_SETUPp) { sound = m_pSound->GetAudioVolume(); @@ -2308,7 +2369,7 @@ BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam) if (m_posCheat == 0) { m_rankCheat = -1; - + for (i = 0; i < 9; i++) { if ((char)wParam == cheat_code[i][0]) @@ -2363,87 +2424,267 @@ BOOL CEvent::TreatEventBase(UINT message, WPARAM wParam, LPARAM lParam) switch (wParam) { - case VK_END: - DemoRecStop(); + case VK_END: + DemoRecStop(); + return TRUE; + case VK_ESCAPE: + if (m_bRunMovie) + { + StopMovie(); + m_pSound->SetSuspendSkip(1); return TRUE; - case VK_ESCAPE: - if (m_bRunMovie) + } + if (m_phase = WM_PHASE_PLAY) + { + if ((m_bPrivate == FALSE) && (m_bMulti == FALSE)) { - StopMovie(); - m_pSound->SetSuspendSkip(1); + if (m_mission == 1) + { + return ChangePhase(WM_PHASE_GAMER); + } + if ((m_mission % 10 == 0) && (m_mission != 10)) + { + SetMission(1); + m_phase = WM_PHASE_PLAY; + return ChangePhase(WM_PHASE_PLAY); + } + } + } + else if ((m_phase != WM_PHASE_GREADp) && (m_phase != WM_PHASE_GWRITE)) + { + if ((m_phase == WM_PHASE_SETUP) || + (((m_phase == WM_PHASE_NAMEg || (m_phase == WM_PHASE_HELP)) || (m_phase == WM_PHASE_GREAD)))) + { + ChangePhase(WM_PHASE_GAMER); + return TRUE; + } + if (((m_phase == WM_PHASE_SETUPp) || (m_phase == WM_PHASE_HELP)) || (m_phase == WM_PHASE_STOP)) + { + ChangePhase(WM_PHASE_PLAY); return TRUE; } if (m_phase != WM_PHASE_PLAYTEST) { - if (m_phase != WM_PHASE_SETUP) + if (((m_phase != WM_PHASE_LOST) && (m_phase != WM_PHASE_LOSTd)) && + ((m_phase != WM_PHASE_BUILD && + ((((m_phase != WM_PHASE_REGION && (m_phase != WM_PHASE_NAMEd)) && (m_phase != WM_PHASE_MUSIC)) + && ((m_phase != WM_PHASE_READd && (m_phase != WM_PHASE_WRITEd)))))))) { - if (m_phase != WM_PHASE_NAMEg) + if ((m_phase == WM_PHASE_INFO) || (m_phase == WM_PHASE_WINm)) { - if (m_phase == WM_PHASE_NAMEd) - { - m_pDecor->SetGamerName(m_textInput); - ChangePhase(WM_PHASE_INFO); - return TRUE; - } - if ((m_phase == WM_PHASE_INIT) || (m_phase == WM_PHASE_WINm)) ChangePhase(WM_PHASE_GAMER); return TRUE; - if ((m_phase == WM_PHASE_BUILD) || ((m_phase == WM_PHASE_LOSTd || m_phase == WM_PHASE_LOST))) ChangePhase(WM_PHASE_INFO); return TRUE; - if (((m_phase != WM_PHASE_INFO) && (m_phase != WM_PHASE_STOP)) && (m_phase != WM_PHASE_HELP)) - { - if (m_phase == WM_PHASE_SERVICE) - { - ChangePhase(WM_PHASE_DPLAY_DO_SERVICE); - return TRUE; - } - if (m_phase == WM_PHASE_CREATE) - { - ChangePhase(WM_PHASE_DPLAY_CREATE); - return TRUE; - } - if (m_phase == WM_PHASE_MULTI) - { - ChatSend(); - return TRUE; - } - if (((m_phase != WM_PHASE_GREAD) && (m_phase != WM_PHASE_GREADp)) || ((m_fileIndex < 0 || LoadState(m_fileIndex) == FALSE))) - { - if (m_phase != WM_PHASE_GWRITE) return TRUE; - - if (m_fileIndex < 0) return TRUE; - - if (SaveState(m_fileIndex) == FALSE) return TRUE; - } - } + ChangePhase(WM_PHASE_GAMER); + return TRUE; } + if (m_phase == WM_PHASE_GAMER) + { + ChangePhase(WM_PHASE_INIT); + return TRUE; + } + if (m_phase == WM_PHASE_SERVICE) + { + ChangePhase(WM_PHASE_DPLAY_CANCEL_SERVICE); + return TRUE; + } + if (m_phase == WM_PHASE_SESSION) + { + ChangePhase(WM_PHASE_DPLAY_CANCEL_SESSION); + return TRUE; + } + if (m_phase == WM_PHASE_CREATE) + { + ChangePhase(WM_PHASE_DPLAY_CANCEL_MULTI); + return TRUE; + } + if (m_phase == WM_PHASE_BYE) + { + PostMessageA(m_hWnd, WM_CLOSE, 0, 0); + return FALSE; + } + return TRUE; } - strcpy(m_gamerName, m_textInput); + ChangePhase(WM_PHASE_INFO); + return TRUE; } + ChangePhase(WM_PHASE_608); + return TRUE; + } + + ChangePhase(WM_PHASE_STOP); + return TRUE; + case VK_SHIFT: + m_input | KEY_FIRE; + case VK_LEFT: + m_input | KEY_LEFT; + break; + case VK_UP: + m_input | KEY_UP; + break; + case VK_RIGHT: + m_input | KEY_RIGHT; + break; + case VK_DOWN: + m_input | KEY_DOWN; + break; + case VK_HOME: + return TRUE; + case VK_SPACE: + if (m_bRunMovie) + { + StopMovie(); + m_pSound->SetSuspendSkip(1); + return TRUE; + } + case VK_PAUSE: + m_bPause = !m_bPause; + NetSetPause((m_pDecor->GetPause()), m_bPause); + return TRUE; + case VK_CONTROL: + m_input | KEY_JUMP; + break; + case VK_F1: + if (m_phase == WM_PHASE_PLAY) + { + ChangePhase(WM_PHASE_HELP); + return TRUE; + } + return TRUE; + case VK_F2: + if (m_phase == WM_PHASE_PLAY) + { + ChangePhase(WM_PHASE_SETUPp); + return TRUE; + } + return TRUE; + case VK_F3: + if (m_phase == WM_PHASE_PLAY) + { + ChangePhase(WM_PHASE_GWRITE); + return TRUE; + } + return TRUE; + case VK_F4: + if (m_phase == WM_PHASE_PLAY) + { + ChangePhase(WM_PHASE_GREADp); + return TRUE; + } + return TRUE; } - - } - - if (m_phase != WM_PHASE_PLAY && m_phase != WM_PHASE_PLAYTEST) - { - return 0; - } - // Unknown Function - - switch (wParam) - { - case WM_RBUTTONDOWN: - m_bMouseDown = TRUE; - MouseSprite(pos); - if (EventButtons(message, wParam, lParam)) return TRUE; - if (m_phase == WM_PHASE_BUILD) + case WM_KEYUP: + switch (wParam) { - if (BuildDown(pos, fwKeys)) return TRUE; - } - if (m_phase == WM_PHASE_PLAY) - { - // if (PlayDown(pos, fwKeys)) return TRUE; + case VK_CONTROL: + m_bCtrlDown = FALSE; + m_bFillMouse = FALSE; + MouseSprite(GetMousePos()); + return TRUE; } break; - } + case WM_LBUTTONDOWN: + case WM_RBUTTONDOWN: + m_bMousePress = TRUE; + MouseSprite(pos); + if (EventButtons(message, wParam, lParam)) return TRUE; + break; + case WM_MOUSEMOVE: + if (m_mouseType == MOUSETYPEGRA) + { + if (m_bShowMouse) + { + ShowCursor(FALSE); + m_pPixmap->MouseShow(TRUE); + m_bShowMouse = FALSE; + } + } + if (m_mouseType == MOUSETYPEWINPOS && + (pos.x != m_oldMousePos.x || + pos.y != m_oldMousePos.y)) + { + m_oldMousePos = pos; + ClientToScreen(m_hWnd, &m_oldMousePos); + SetCursorPos(m_oldMousePos.x, m_oldMousePos.y); + } + m_oldMousePos = pos; + MouseSprite(pos); + if (EventButtons(message, wParam, lParam)) return TRUE; + break; + + case WM_NCMOUSEMOVE: + if (m_mouseType == MOUSETYPEGRA) + { + if (!m_bShowMouse) + { + ShowCursor(TRUE); + m_pPixmap->MouseShow(FALSE); + m_bShowMouse = TRUE; + } + } + break; + case WM_RBUTTONUP: + m_bMousePress = FALSE; + if (EventButtons(message, wParam, lParam)) return TRUE; + break; + case WM_PHASE_INIT: + case WM_PHASE_PLAY: + case WM_PHASE_BUILD: + case WM_PHASE_NAMEg: + case WM_PHASE_CLEARg: + case WM_PHASE_INFO: + case WM_PHASE_PLAYTEST: + case WM_PHASE_SETUP: + case WM_PHASE_MUSIC: + case WM_PHASE_PLAYMOVIE: + case WM_PHASE_WINMOVIE: + case WM_PHASE_SETUPp: + case WM_PHASE_REGION: + case WM_PHASE_GAMER: + case WM_PHASE_WINMOVIEd: + case WM_PHASE_WINMOVIEm: + case WM_PHASE_BYE: + case WM_PHASE_NAMEd: + case WM_PHASE_WRITEd: + case WM_PHASE_READd: + case WM_PHASE_CLEARd: + case WM_PHASE_SERVICE: + case WM_PHASE_DPLAY_DO_SERVICE: + case WM_PHASE_DPLAY_CANCEL_SERVICE: + case WM_PHASE_SESSION: + case WM_PHASE_JOINGAME: + case WM_PHASE_DPLAY_CREATE_LOBBY: + case WM_PHASE_DPLAY_REFRESH: + case WM_PHASE_DPLAY_CANCEL_SESSION: + case WM_PHASE_MULTI: + case WM_PHASE_DPLAY_START_GAME_2: + case WM_PHASE_DPLAY_CANCEL_MULTI: + case WM_PHASE_CREATE: + case WM_PHASE_DPLAY_CREATE: + case WM_PHASE_DPLAY_CANCEL_CREATE: + case WM_PHASE_STOP: + case WM_PHASE_HELP: + case WM_PHASE_GWRITE: + case WM_PHASE_GREADp: + case WM_PHASE_GREAD: + case WM_PHASE_DOQUIT: + case WM_PHASE_634: + if (ChangePhase(message) != FALSE) + { + return TRUE; + } + return FALSE; + case WM_PHASE_PRIVATE: + m_bPrivate = TRUE; + if (ChangePhase(WM_PHASE_INFO) != FALSE) + { + return TRUE; + } + return FALSE; + case WM_PHASE_DEMO: + m_demoNumber = 0; + DemoPlayStart(); + return FALSE; + + } return FALSE; } @@ -2672,6 +2913,57 @@ BOOL CEvent::IsMulti() return m_bMulti; } +void CEvent::ChangeButtons(int message) +{ + int button, state, volume, max; + int i; + char* pButtonExist; + char playerName[260]; + Term* pTerm; + + if (((m_phase == WM_PHASE_GAMER) && (WM_BUTTON0 < message)) && (WM_BUTTON11 > message)) + { + m_gamer = message + 0x4c8; + for (i = 0; i < 10; i++) + { + SetState(i + WM_BUTTON1, m_gamer + -1 == i); + } + ReadInfo(m_gamer); + } + if ((m_phase == WM_PHASE_NAMEg) && (message == WM_PHASE_CONFIRM)) + { + strcpy(m_gamerName, m_textInput); + WriteInfo(m_gamer, playerName); + } + if ((m_phase == WM_PHASE_NAMEd) && (message == WM_PHASE_61C)) + { + m_pDecor->SetGamerName(m_textInput); + ChangePhase(WM_PHASE_INFO); + } + if ((m_phase == WM_PHASE_CLEARg) && (message == WM_PHASE_YES)) + { + ReadPlayer(m_gamer); + ChangePhase(WM_PHASE_GAMER); + } + if ((m_phase == WM_PHASE_CLEARd) && (message == WM_PHASE_61F)) + { + m_pDecor->SomethingMissionPath(m_gamer, GetWorld(), m_bAccessBuild == FALSE); + ChangePhase(WM_PHASE_INFO); + } + if (m_phase == WM_PHASE_MUSIC) + { + m_pDecor->SetMusic(message + ~WM_BUTTON0); + ChangePhase(m_phase); + } + if (m_phase == WM_PHASE_REGION) + { + if ((WM_BUTTON0 < message) && (WM_BUTTON33 > message)) + { + m_pDecor->SetRegion(message + ~WM_BUTTON0); + ChangePhase(m_phase); + } + } +} int CEvent::GetWorldGroup() { int mission; @@ -2786,26 +3078,30 @@ void CEvent::SomethingUserMissions(char* lpFilename, LPCSTR fileSomething) BOOL CEvent::ChangePhase(UINT phase) { - int index, world, time, total, music, i, max, mission; + int index, music, i, j, nb, oldPhase; POINT totalDim, iconDim; char filename[MAX_PATH]; char* pButtonExist; BOOL bEnable, bHide; Term* pTerm; char* playerName; + char doors[200]; + char text[100]; + char res[100]; - sprintf(filename, "CEvent::ChangePhase [Begin] --- % ", phase); - OutputNetDebug(filename); + +// sprintf(filename, "CEvent::ChangePhase [Begin] --- % ", phase - WM_USER); +// OutputNetDebug(filename); if (phase == WM_PHASE_634) { - PostMessageA(m_hWnd, 16, 0, 0); + PostMessageA(m_hWnd, 16, 0, 0); return TRUE; } m_pDecor->SetSpeedY(m_bDemoPlay); - if (m_mouseType == MOUSETYPEGRA && m_bFullScreen != 0) + if (m_mouseType == MOUSETYPEGRA && m_bFullScreen) { - ShowCursor(FALSE); - m_bShowMouse = FALSE; + ShowCursor(TRUE); + m_bShowMouse = TRUE; } if (phase == WM_PHASE_608) { @@ -2813,9 +3109,9 @@ BOOL CEvent::ChangePhase(UINT phase) phase = WM_PHASE_BUILD; } - if (m_bDemoPlay == 0 && + if (m_bDemoPlay == FALSE && + phase == WM_PHASE_PLAY || phase == WM_PHASE_PLAY || - m_phase == WM_PHASE_PLAY || phase == WM_PHASE_STOP || phase == WM_PHASE_SETUP || phase == WM_PHASE_HELP || @@ -2828,19 +3124,29 @@ BOOL CEvent::ChangePhase(UINT phase) m_textToolTips[0] = 0; m_posToolTips.x = -1; + m_pDecor->SetPause(FALSE); m_bPause = FALSE; m_bCtrlDown = FALSE; m_bMouseDown = FALSE; m_bInfoHelp = FALSE; + m_bHiliInfoButton = FALSE; + m_bHiliHelpButton = FALSE; + if ((((((m_bMulti != FALSE) && (phase != WM_PHASE_PLAY)) && (phase != WM_PHASE_DOQUIT)) && ((phase != WM_PHASE_STOP && (phase != WM_PHASE_SETUPp)))) && ((phase != WM_PHASE_HELP && ((phase != WM_PHASE_GREAD && (phase != WM_PHASE_GREADp)))))) && (phase != WM_PHASE_GWRITE)) + { + //m_pNetwork->Close(); + m_bMulti = FALSE; + m_pDecor->SetMulti(FALSE); + } - if (phase == WM_PHASE_INIT) + if (m_phase == WM_PHASE_INIT) { m_demoTime = 0; } + if (phase == WM_PHASE_PLAY) { - if (((m_bDemoPlay == FALSE) && (mission = GetWorld(), 299 < mission)) && (mission = GetWorld(), mission < LXIMAGE / 2)) + if (((m_bDemoPlay == FALSE) && (index = GetWorld(), 299 < index)) && (index = GetWorld(), index < LXIMAGE / 2)) { DemoRecStart(); } @@ -2854,6 +3160,7 @@ BOOL CEvent::ChangePhase(UINT phase) { if (m_bPrivate == FALSE) { + int mission; mission = m_mission; if (mission != 1) { @@ -2866,24 +3173,36 @@ BOOL CEvent::ChangePhase(UINT phase) mission = (mission / 10) * 10; } SetMission(m_mission); - m_phase = (WMessage)WM_PHASE_PLAY; + m_phase = WM_PHASE_PLAY; return ChangePhase(WM_PHASE_PLAY); } return ChangePhase(WM_PHASE_GAMER); } } - else if (m_bMulti == 0) + + + if (phase == WM_PHASE_DPLAY_DO_SERVICE) { - return ChangePhase(WM_PHASE_INFO); + if (NetCreate(m_fileIndex) != FALSE) + { + m_pNetwork->FreeProviderList(); + if (NetEnumSessions() != FALSE) + return ChangePhase(WM_PHASE_SESSION); + } + m_pNetwork->FreeProviderList(); + return ChangePhase(WM_PHASE_SERVICE); } - CreateButtons(); - - if (SearchPhase(phase) < 0) + if (phase == WM_PHASE_DPLAY_CANCEL_SERVICE) { - return 0; + m_pNetwork->FreeProviderList(); + return ChangePhase(WM_PHASE_GAMER); } + + index = SearchPhase(phase); + if (index < 0) return FALSE; + m_pPixmap->MouseInvalidate(); HideMouse(FALSE); WaitMouse(TRUE); @@ -2894,6 +3213,21 @@ BOOL CEvent::ChangePhase(UINT phase) WriteInfo(m_gamer, playerName); } + oldPhase = m_phase; + m_phase = phase; + m_index = index; + + if ((((oldPhase == WM_PHASE_BUILD) && (phase == WM_PHASE_INFO)) || (oldPhase == WM_PHASE_REGION)) || ((oldPhase == WM_PHASE_NAMEd || (oldPhase == WM_PHASE_MUSIC)))) + { + //m_pDecor->CurrentWrite(m_gamer, GetWorld(), (m_bAccessBuild == FALSE)); + } + + CreateButtons(); + m_bMenu = FALSE; + m_menu.Delete(); + + WaitMouse(FALSE); + return TRUE; } UINT CEvent::GetPhase() @@ -2991,7 +3325,6 @@ BOOL CEvent::BuildUp(POINT pos, int fwKeys) return TRUE; } -/* void CEvent::TryPhase() { m_tryPhase = 1; @@ -3009,32 +3342,6 @@ int CEvent::GetTryPhase() return m_tryPhase; } -void CEvent::GetDoors(int doors) -{ - for (int i = 0; i < 200; i++) - { - doors[i] = (int)data[Gamer]; - } -} - - -void CEvent::TableSomething() -{ - char filename[MAX_PATH]; - - if (strstr(filename, table[m_index].backName)) - { - AddCDPath(filename); - } - if (!m_pPixmap->CacheAll(CHBACK, filename, totalDim, iconDim, FALSE, GetRegion())) - { - return; - } -} -*/ - - - BOOL CEvent::StartMovie(char* pFilename) { RECT rect; @@ -3428,13 +3735,13 @@ error: return FALSE; } -BOOL CEvent::ReadPlayer() +BOOL CEvent::ReadPlayer(int gamer) { char filename[MAX_PATH]; m_playerIndex = 0; - strcpy(filename, "data\\info%.3d.blp"); + sprintf(filename, "data\\info%.3d.blp", gamer); AddUserPath(filename); remove(filename); return TRUE; diff --git a/event.h b/event.h index d6cb8ca..9ec2630 100644 --- a/event.h +++ b/event.h @@ -215,7 +215,7 @@ protected: void TryPhase(); void UnTryPhase(); int GetTryPhase(); - BOOL ReadPlayer(); + BOOL ReadPlayer(int gamer); void PutTextInputBox(POINT pos); diff --git a/ping.asm b/ping.asm new file mode 100644 index 0000000..e4e9e41 --- /dev/null +++ b/ping.asm @@ -0,0 +1 @@ + .TITLE PING ; -------------------------------------- ; (C) 1987 - Daniel Roux ; -------------------------------------- .PROC M680002 .REF SMAKY .REF GRA .REV 1,0 .CODE 800,2,B'1111,600,2000,300,2000,2,'N,'R,'F,09 .TEXT "(C) Daniel ROUX et EPSITEC-system sa" IFSMILE = 0 ; 1 => assemblage pour SMILE2 ; En-tte d'un fichier .IMAGE ; --------------------------- .LOC 0 OIMTYP: .BLKB 1 ; H'01 = indique type image OIMCOD: .BLKB 1 ; H'00 = indique pas de codage OIMBIP: .BLKB 1 ; H'01 = 1 bit par point OIMDIR: .BLKB 1 ; H'02 = coord. X-Y comme cran OIMDLX: .BLKB 2 ; largeur image en points OIMDLY: .BLKB 2 ; hauteur image en points OIMNBB: .BLKB 4 ; nb de byte pour l'image .BLKB 20 ; rserve LGHIMA: ; Dfinition de l'entte d'un gnrateur de caractres ; ---------------------------------------------------- OGCMSB = H'04 ; matrix size in bytes OGCMHD = H'06 ; matrix height in dots OGCMWB = H'08 ; matrix width in bytes OGCFCA = H'0A ; ASCII code of first character OGCLCA = H'0B ; ASCII code of last character OGCLMA = H'0C ; left margin of matrix OGCBLI = H'0E ; bottom of matrix to baseline OGCISP = H'16 ; interline space in dots OGCWID = 256 ; 128 x width OGCH1 = 256+128*1 ; 128 x h1 OGCH2 = 256+128*2 ; 128 x h2 OGCMAT = 256+128*3 ; 128 x matrix ; Constantes ; ---------- MAXPOINT= 21 ; nb de points pour gagner VIT1 = 50/8 ; vitesse 1: 8 images/seconde VIT2 = 50/14 ; vitesse 1: 14 images/seconde VIT3 = 50/25 ; vitesse 1: 25 images/seconde MAXVITX = 30 ; vitesse maximale en X MAXVITY = 30 ; vitesse maximale en Y MAXVITS = 10 ; vitesse maximale raquette SMAKY MAXIRAQ = 7 ; inclinaison maximale (45 degrs) ; Caractres standard ; ------------------- GCTXF = 'N ; fonte (N) GCTXS = 'R!2^7 ; style/chasse (RF) GCTXT = 09 ; taille (09) ; Icnes des IPP64 ; ---------------- GCICF = 'I ; fonte (I) GCICS = 'P ; style/chasse (PP) GCICT = 64 ; taille (64) VTANIME = 2 ; vitesse de l'animation de fin NBANIME = 5+1 ; nb d'icnes d'animation (+1 vide) ICOBALLE1= 32 ; balle 1 IDXBALLE1= 17 IDYBALLE1= 17 ICORAQJ = 71 ; raquette horizontale du joueur ICORAQS = 71+16 ; raquette horizontale du SMAKY IDXRAQ = 64 IDYRAQ = 64 ICXRAQ = 31 ICYRAQ = 20 NBABRI = 8 ; nb d'icnes d'animation des briques casses ICOBRIQUE= 96 ; brique du mur de sparation IDXBRI = 35 IDYBRI = 20 ; Positions dans l'image ; ---------------------- LXWDO = 640 ; largeur de l'cran LYWDO = 340 ; hauteur de l'cran MARGH = 41 ; marge en haut MARGB = 33 ; marge en bas MARGG = 9 ; marge  gauche MARGD = 10 ; marge  droite FRONTX = MARGG+((LXWDO-MARGG-MARGD)/2)-1 ; frontire entre les deux camps POSYRAQ = LYWDO-IDYRAQ-33 ; position Y de la raquette POSXRAQ = 133 ; position X de la raquette fixe RAQEL = 10 ; lvation pour le bouton du milieu MAXBRI = 8 ; nb max de briques POSXBRI = FRONTX-(IDXBRI/2) ; position X d'une brique POSYBRI = LYWDO-57 ; position Y d'une brique tout en bas POSYCJ = LYWDO-316 ; position du compteur du joueur POSXCJ = 265 POSYCS = LYWDO-316 ; position du compteur du SMAKY POSXCS = 357 POSYSJ = LYWDO-327 ; position service du joueur POSXSJ = 26 POSYSS = LYWDO-327 ; position service du SMAKY POSXSS = 600 ; Description d'une raquette ; -------------------------- .LOC 0 ORAQPO: .BLKB 4 ; raquette: position (y;x) ORAQIN: .BLKB 2 ; raquette: inclinaison ORAQEL: .BLKB 2 ; raquette: lvation pour tir ORAQIC: .BLKB 1 ; raquette: icne ORAQET: .BLKB 1 ; raquette: tat BRAQL = 0 ; bouton gauche press BRAQR = 1 ; bouton droite press BRAQG = 2 ; clavier pour avancer  gauche BRAQD = 3 ; clavier pour avancer  droite BRAQS = 7 ; service (on lance la balle) .EVEN ORAQDX: .BLKB 2 ; raquette: minimum en X ORAQFX: .BLKB 2 ; raquette: maximum en X LRAQ: ; Descripteur d'un objet en chute libre ; ------------------------------------- .LOC 0 OOBPOS: .BLKB 4 ; position (y;x) au temps t OOBPOO: .BLKB 4 ; position (y;x) au temps t-1 OOBDIM: .BLKB 4 ; dimensions (dy;dx) OOBVIT: .BLKB 4 ; vitesses (vy;vx) OOBCHO: .BLKB 4 ; amortissement en cas de choc (ay;ax) OOBACC: .BLKB 2 ; pesanteur (py) OOBVIM: .BLKB 2 ; dure de vie maximale OOBVIE: .BLKB 2 ; dure de vie de l'objet OOBFIN: .BLKB 2 ; dure de fin de l'objet OOBVIF: .BLKB 2 ; compteur de vitesse de fin OOBICO: .BLKB 1 ; code de l'icne OOBNEW: .BLKB 1 ; 1 => nouvel objet OOBOLD: .BLKB 1 ; 1 => objet mort .EVEN OOBMU1: .BLKB 2 ; bruit: choc avec un bord OOBMU2: .BLKB 2 ; bruit: choc avec la raquette OOBMU3: .BLKB 2 ; bruit: mort de l'objet LOBJ: ; Variables ; --------- .LOC 0 OMACHINE:.BLKB 1 ; type de la machine (SMAKY8/SMAKY100) OINV: .BLKB 1 ; 1 => fond de l'cran blanc .EVEN OPDDIS: .BLKB 4 ; ^descripteur de la fentre OPGICO: .BLKB 4 ; ^gencar des icnes (IPP64) OADRASTER: .BLKB 4 ; adresse de GRA_RASTER OADMATRIX: .BLKB 4 ; adresse de GRA_MATRIX OADDOT: .BLKB 4 ; adresse de GRA_DOT OADTRAME: .BLKB 4 ; adresse de GRA_TRAME OADLINE: .BLKB 4 ; adresse de GRA_LINE OADELLIPSE: .BLKB 4 ; adresse de GRA_ELLIPSE OADFILLO: .BLKB 4 ; adresse de GRA_FILLO OADFILLC: .BLKB 4 ; adresse de GRA_FILLC OADCLEAR: .BLKB 4 ; adresse de GRA_CLEAR OADSET: .BLKB 4 ; adresse de GRA_SET OADINV: .BLKB 4 ; adresse de GRA_INV OADQXDOT: .BLKB 4 ; adresse de GRA_QXDOT OBUDIS: .BLKB 100 ; buffer write-display OPIMA: .BLKB 4 ; ^image principale du jeu ODIMA: .BLKB 4 ; dimensions image OMOUPO: .BLKB 4 ; souris: position ORAQJ: .BLKB LRAQ ; raquette du joueur ORAQS: .BLKB LRAQ ; raquette du SMAKY OBALLE: .BLKB LOBJ ; balle principale OSIMBA: .BLKB LOBJ ; balle de simulation OBRIQUE:.BLKB 2*(MAXBRI+1) ; tat des briques OBRINB: .BLKB 2 ; nb de briques OTIMING:.BLKB 2 ; dure d'une image (unit 20ms) OMODE: .BLKB 1 ; mode gnral BVIT1 = 0 ; vitesse lente BVIT2 = 1 ; vitesse moyenne BVIT3 = 2 ; vitesse rapide BFACILE= 4 ; pour dbutants OFIXE: .BLKB 1 ; 1 => raquette fixe OBEGIN: .BLKB 1 ; 1 => dbut du jeu OEND: .BLKB 1 ; 1 => fin de la partie OHELP: .BLKB 1 ; 1 => appel  l'aide OGAGNE: .BLKB 1 ; 1 => partie gagne OPERDU: .BLKB 1 ; 1 => partie perdue OSTRAT: .BLKB 1 ; stratgie du SMAKY .EVEN OFONCT: .BLKB 2 ; fond: compteur pour le frottement OSERV: .BLKB 1 ; indicateurs de servide OCOMP: .BLKB 1 ; compteurs allums .EVEN OCOMPF: .BLKW 1 ; frquence de clignottement des compteurs OCONJ: .BLKB 2 ; compteur du joueur OCONS: .BLKB 2 ; compteur du SMAKY OHAZA: .BLKB 8 ; registre 63 bits pour gnrateur alatoire OTIME: .BLKB 4 ; marque le temps de dbut LGVAR: ; Programme principal ; ------------------- .LOC 0 START: .IF ~IFSMILE LIB ?OPELIB .ENDIF LOAD.L D4,#LGVAR LOAD.W D1,#MTYPCP GESMEM ?GETMEM ; demande mmoire pour variables JUMP,NE ERFAT LOAD.L A6,A4 ; A6 <-- ^variables 10$: CLR.B (A4+) ; met toutes les variables  zro DEC.W D4 JUMP,NE 10$ LOAD.W D3,#3 LIB ?MOUSE ; souris par le clavier LOAD.W D4,#1 LIB ?WAITMOUSE ; souris reprsente par une flche NTREL ?GETMACHINE ; D4/A3 <-- paramtres RL.L D4,#8 ; D4 <-- type de la machine LOAD.B (A6)+OMACHINE,D4 LIB ?GCHDIS ; D6 <-- canal cran LOAD.W D3,#TYPWDO ; D3 <-- type fentre cran LOAD.L D4,#4 ; D4 <-- longueur demande LOAD.L A4,#(A6)+OPDDIS ; A4 <-- ^buffer FOS ?RSTATUS ; demande le ^rel ! JUMP,NE ERFAT LOAD.L A0,(A6)+OPDDIS ; A0 <-- ^descripteur de la fentre <> LOAD.W D3,#GRA_RASTER LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADRASTER,A3 LOAD.W D3,#GRA_MATRIX LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADMATRIX,A3 LOAD.W D3,#GRA_DOT LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADDOT,A3 LOAD.W D3,#GRA_TRAME LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADTRAME,A3 LOAD.W D3,#GRA_LINE LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADLINE,A3 LOAD.W D3,#GRA_ELLIPSE LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADELLIPSE,A3 LOAD.W D3,#GRA_FILLO LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADFILLO,A3 LOAD.W D3,#GRA_FILLC LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADFILLC,A3 LOAD.W D3,#GRA_CLEAR LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADCLEAR,A3 LOAD.W D3,#GRA_SET LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADSET,A3 LOAD.W D3,#GRA_INV LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADINV,A3 LOAD.W D3,#GRA_QXDOT LIB_ GETAD JUMP,NE ERFAT LOAD.L (A6)+OADQXDOT,A3 LIB ?AFTIM .B NOCURS ; pas de curseur ! .B AFCCMO ; pas de flche-souris .B LOADGC ; charge les caractres standards .B GCTXF .B GCTXS .B GCTXT .B 0 .EVEN JUMP,NE ERFAT LIB ?AFTIM .B LOADGC ; charge les icnes IPP64 .B GCICF .B GCICS .B GCICT .B 0 .EVEN JUMP,NE ERFAT LIB ?AFTIM .B USEGC ; utilise les icnes IPP64 .B GCICF .B GCICS .B GCICT .B 0 .EVEN LOAD.L (A6)+OPGICO,(A0)+ODFPGC LIB ?AFTIM .B USEGC ; charge les caractres standard .B GCTXF .B GCTXS .B GCTXT .B 0 .EVEN LOAD.B D3,#ICOBRIQUE LOAD.W D4,#NBABRI 40$: CALL PREPBRI ; prpare les briques de IMP64 INC.B D3 DEC.W D4 JUMP,NE 40$ SET.B (A6)+OINV ; le fond de l'cran est blanc LOAD.B (A6)+OMODE,#2^BVIT2 LOAD.W (A6)+OTIMING,#VIT2 LOAD.L A3,#R16"NMIMA CALL LOADIMAGE ; charge l'image principale de fond JUMP,NE ERFAT LOAD.L (A6)+OPIMA,A4 LOAD.L (A6)+ODIMA,D4 LOAD.W D4,#LYWDO LOAD.W D3,(A0)+ODFDY SUB.W D3,D4 SR.W D3,#1 SWAP.W D3 SWAP.W D4 LOAD.W D4,#LXWDO LOAD.W D3,(A0)+ODFDX SUB.W D3,D4 SR.W D3,#1 LIB ?CREWDO ; cre swdo (utile pour SMAKY 8) LIB ?USEWDO LOAD.L A4,#(A6)+ORAQJ ; A4 <-- ^description raquette joueur LOAD.B (A4)+ORAQIC,#ICORAQJ LOAD.W (A4)+ORAQDX,#MARGG+2 LOAD.W (A4)+ORAQFX,#FRONTX-32-IDXRAQ LOAD.L A4,#(A6)+ORAQS ; A4 <-- ^description raquette SMAKY LOAD.B (A4)+ORAQIC,#ICORAQS LOAD.W (A4)+ORAQDX,#FRONTX+32 LOAD.W (A4)+ORAQFX,#LXWDO-MARGD-IDXRAQ-2 ; Affiche la premire image d'aide, totalement statique. AIDE: LOAD.L A3,#R16"TXMENU0 LIB ?AFMENU ; affiche les soft-keys LOAD.L A3,#R16"NAIMA CALL AFIMAGE ; affiche l'image d'aide 60$: LIB ?GETCAR COMP.W D3,#END JUMP,EQ FINI COMP.W D3,#F0 JUMP,EQ FINI COMP.W D3,#F0+SHIFT JUMP,EQ FINI COMP.W D3,#F1 JUMP,EQ 65$ COMP.W D3,#F1+SHIFT JUMP,EQ 65$ COMP.W D3,#F2 JUMP,EQ 65$ COMP.W D3,#F2+SHIFT JUMP,EQ 65$ COMP.W D3,#F3 JUMP,EQ 65$ COMP.W D3,#F3+SHIFT JUMP,EQ 65$ COMP.W D3,#SPACE JUMP,NE 60$ ; Affiche la deuxime image d'aide, o il est possible d'incliner ; la raquette pour s'y habituer. 65$: CLR.B (A6)+OEND CLR.B (A6)+OHELP CLR.B (A6)+OBEGIN LOAD.L A3,#R16"TXMENU1 LIB ?AFMENU ; affiche les soft-keys PUSH.B (A6)+OMODE PUSH.W (A6)+OTIMING LOAD.B (A6)+OMODE,#2^BVIT2 LOAD.W (A6)+OTIMING,#VIT2 SET.B (A6)+OFIXE ; raquette immobile LOAD.L A3,#R16"NRIMA CALL AFIMAGE ; affiche l'image d'aide LOAD.L (A6)+ORAQJ+ORAQPO,#H'10000*POSYRAQ+POSXRAQ CLR.W (A6)+ORAQJ+ORAQIN LOAD.L D4,(A4)+ORAQPO SWAP.W D4 LOAD.W D4,#POSYRAQ SWAP.W D4 CALL PMOUSE ; met la souris en place 70$: CALL ACTION ; actionne la raquette ... TEST.B (A6)+OEND ; fin de la partie ? JUMP,T 75$ TEST.B (A6)+OBEGIN ; dbut de la partie ? JUMP,F 70$ 75$: CLR.B (A6)+OFIXE ; raquette mobile POP.W (A6)+OTIMING POP.B (A6)+OMODE TEST.B (A6)+OEND ; fin de la partie ? JUMP,T FINI ; Nouvelle partie. Remet toutes les briques et redonne 10 balles. NEWPARTIE: LOAD.L A3,#R16"TXMENU2 LIB ?AFMENU ; affiche les soft-keys LOAD.L A4,(A6)+OPIMA ; A4 <-- ^image principale LOAD.L D4,(A6)+ODIMA ; D4 <-- dimensions CALL SHOWIMAGE ; affiche l'image de fond CLR.B (A6)+OSERV ; indicateurs de services teints CLR.B (A6)+OCOMP ; compteurs teints CLR.W (A6)+OBRINB ; toutes les briques absentes CLR.L (A6)+ORAQJ+ORAQPO ; la raquette n'existe pas CLR.L (A6)+ORAQS+ORAQPO ; la raquette n'existe pas CALL COUPSAC ; gnrateur alatoire: coup de sac LOAD.L A4,#(A6)+ORAQJ ; A4 <-- descripteur raquette joueur CLR.L (A4)+ORAQPO CLR.W (A4)+ORAQIN CLR.W (A4)+ORAQEL LOAD.L D4,#H'10000*POSYRAQ+(FRONTX-200) CLR.W D3 CALL MOVERAQ ; dessine la premire raquette du joueur LOAD.L D4,(A4)+ORAQPO CALL PMOUSE ; et met la souris en place LOAD.L A4,#(A6)+ORAQS ; A4 <-- descripteur raquette SMAKY CLR.L (A4)+ORAQPO CLR.W (A4)+ORAQIN CLR.W (A4)+ORAQEL LOAD.L D4,#H'10000*POSYRAQ+(FRONTX+100) CLR.W D3 CALL MOVERAQ ; dessine la premire raquette du SMAKY CLR.W (A6)+OCONJ ; zro .. CLR.W (A6)+OCONS ; ..  zro ! ; Nouvelle balle. Laisse les briques dans l'tat o elles sont. NEWBALLE: CLR.B (A6)+OBEGIN CLR.B (A6)+OEND CLR.B (A6)+OHELP CLR.B (A6)+OGAGNE CLR.B (A6)+OPERDU CALL JCOMPTE ; affiche le compteur du joueur CALL SCOMPTE ; affiche le compteur du SMAKY CALL ALLBRIQUE ; dessine toutes les briques CALL HAZARD ; D4 <-- nombre alatoire LOAD.B (A6)+OSTRAT,D4 ; choix de la stratgie du SMAKY LOAD.L A5,#(A6)+OBALLE CALL NEWOBJET ; A5 <-- nouvelle balle CALL NEWSERVICE ; D4 <--  qui le service ? TEST.L D4:#0 ; service  faire par le SMAKY ? JUMP,BS 30$ ; oui => 30$ ; Service effectu par le joueur. ; Attend que l'on bouge la souris pour choisir l'emplacement de ; dpart de la balle. CALL JSERVICE LOAD.L A3,#R16"TXMENU3 LIB ?AFMENU ; affiche les soft-keys LOAD.L A4,#(A6)+ORAQJ ; A4 <-- ^description raquette joueur TSET.B (A4)+ORAQET:#BRAQS ; dbut du service LOAD.L D4,(A4)+ORAQPO ; D4 <-- position DEC.W D4 ; D4 <-- pour redessiner avec la balle !! SWAP.W D4 LOAD.W D4,#POSYRAQ SWAP.W D4 LOAD.W D3,(A4)+ORAQIN ; D3 <-- inclinaison CALL MOVERAQ ; dessine la raquette avec la balle LOAD.L D4,(A4)+ORAQPO CALL PMOUSE ; met la souris o est la raquette ! 21$: CALL ACTION ; effectue une action ... CALL VIECOMPTE ; clignottement des compteurs TEST.B (A6)+OHELP ; appel  l'aide ? JUMP,T AIDE TEST.B (A6)+OEND ; fin de la partie ? JUMP,T FINI TEST.B (A6)+OBEGIN ; tir de la balle ? JUMP,F 21$ LOAD.L A5,#(A6)+OBALLE ;;? CALL INVOBJ SUB.W (A5)+OOBPOS+0,#RAQEL ; lve la balle ;;? CALL INVOBJ JUMP 38$ ; Service effectu par le SMAKY. 30$: CALL SSERVICE LOAD.L A4,#(A6)+ORAQS ; A4 <-- ^description raquette SMAK TSET.B (A4)+ORAQET:#BRAQS ; dbut du service LOAD.W D3,(A4)+ORAQDX LOAD.W D4,(A4)+ORAQFX SUB.W D4,#100 CALL MMHAZARD ; D4 <-- position de lancement LOAD.W D0,D4 ; D0 <-- position  atteindre 31$: CALL ACTION ; effectue une action ... CALL VIECOMPTE ; clignottement des compteurs TEST.B (A6)+OHELP ; appel  l'aide ? JUMP,T AIDE TEST.B (A6)+OEND ; fin de la partie ? JUMP,T FINI LOAD.W D4,(A4)+ORAQPO+2 COMP.W D4,D0 JUMP,EQ 34$ JUMP,HI 33$ ; avance vers la gauche => ADD.W D4,#4 COMP.W D4,D0 JUMP,LS 34$ LOAD.W D4,D0 JUMP 34$ 33$: ; avance vers la droite => SUB.W D4,#4 COMP.W D4,D0 JUMP,HS 34$ LOAD.W D4,D0 34$: LOAD.W D3,D4 SUB.W D3,(A4)+ORAQDX MUL.WU D3,#MAXIRAQ LOAD.W D2,(A4)+ORAQFX SUB.W D2,(A4)+ORAQDX DIV.WU D3,D2 ADD.W D3,#3 COMP.W D3,#MAXIRAQ JUMP,LS 35$ LOAD.W D3,#MAXIRAQ 35$: NEG.W D3 ; D3 <-- inclinaison choisie CALL MOVERAQ ; dplace la raquette du SMAKY COMP.W D0,(A4)+ORAQPO+2 JUMP,NE 31$ LOAD.L A5,#(A6)+OBALLE CALL INVOBJ SUB.W (A5)+OOBPOS+0,#RAQEL ; lve la balle CALL INVOBJ ; Lance la balle servie par le joueur ou le SMAKY. 38$: LOAD.L A3,#R16"TMUSSERVICE CALL PATATRA ; banza, c'est parti ! CALL ESERVICE ; efface les indicateurs de service LOAD.L A3,#R16"TXMENU2 LIB ?AFMENU ; affiche les soft-keys CALL MAJOBJET ; A5 <-- met  jour l'objet TCLR.B (A4)+ORAQET:#BRAQS ; fin du service ; Joue avec la balle jusqu' ce qu'elle tombe. CLR.B (A6)+OBEGIN CLR.B (A6)+OEND CLR.B (A6)+OHELP 40$: CALL BEGINTIME ; enregistre le temps systme absolu 41$: TEST.B (A6)+OHELP ; appel  l'aide ? JUMP,T AIDE TEST.B (A6)+OEND ; fin de la partie ? JUMP,T FINI LOAD.L A5,#(A6)+OBALLE TEST.B (A5)+OOBOLD ; objet mort ? JUMP,T 50$ ; oui => 50$ CALL ACTION ; effectue une action ... JUMP,NE 45$ ; si pas d'action effectue => 45$ CALL DELTATIME ; D4 <-- temps coul COMP.W D4,(A6)+OTIMING JUMP,LO 41$ 45$: LOAD.L A5,#(A6)+OBALLE CALL SMAKY ; dplace la raquette du SMAKY CALL MOVEOBJ ; dplace la balle CALL VIEBRIQUE ; volution des briques dtruites CALL VIECOMPTE ; clignottement des compteurs JUMP 40$ ; La balle est casse. Le joueur ou le SMAKY a gagn. 50$: LOAD.W D4,#20 51$: CALL ACTION ; attend encore un peu ... LOAD.L A5,#(A6)+OBALLE CALL SMAKY ; dplace la raquette du SMAKY CALL MOVEOBJ ; dplace la balle CALL VIEBRIQUE ; volution des briques dtruites CALL VIECOMPTE ; clignottement des compteurs DEC.W D4 JUMP,NE 51$ CALL INVOBJ ; efface le rsidu de balle casse INC.W (A6)+OCONJ TEST.B (A6)+OGAGNE JUMP,T 60$ DEC.W (A6)+OCONJ INC.W (A6)+OCONS 60$: LOAD.W D4,(A6)+OCONJ SUB.W D4,(A6)+OCONS JUMP,NC 62$ NEG.W D4 ; D4 <-- |cart| 62$: COMP.W D4,#2 ; au moins 2 points d'cart ? JUMP,LO NEWBALLE ; non => joue encore COMP.W (A6)+OCONJ,#MAXPOINT ; est-ce que le joueur a gagn ? JUMP,HS 70$ COMP.W (A6)+OCONS,#MAXPOINT ; est-ce que le SMAKY a gagn ? JUMP,HS 70$ JUMP NEWBALLE 70$: CALL GAGNE ; affiche gagn/perdu ... COMP.W D3,#F0 JUMP,EQ FINI JUMP NEWPARTIE ; Fin de ce (trs) joli jeu. Libre la mmoire pour SMILE ! FINI: TEST.L (A6)+OPIMA JUMP,EQ 20$ LOAD.L A4,(A6)+OPIMA CALL KILLIMAGE ; libre l'image 20$: LOAD.L A4,A6 LOAD.W D1,#MTYPCP GESMEM ?GIVMEM ; libre la mmoire des variables ERFAT: LIB ?AFTIM .B AFSCMO ; remet la flche-souris .B KILLGC ; libre les icnes IPP64 .B GCICF .B GCICS .B GCICT .B 0 .EVEN .IF ~IFSMILE LIB ?CLOLIB FOS ?STOP .ELSE EXIT .ENDIF ;--------\\ ; GAGNE > ;========/ ; Affiche "gagn ..." ; in - ; out D3.W dernire touche presse (F0/F1) ; mod D3.L, D7.W GAGNE: PUSHM.L D0..D2,D4,A3 LOAD.L A3,#R16"TXMENU1 LIB ?AFMENU ; affiche les soft-keys LOAD.L A3,#R16"NFIMA LOAD.W D3,#F0 CALL AFIMAGE ; affiche l'image de fin JUMP,NE 90$ LOAD.L A3,#R16"01$ CLR.W D0 ; D0 <-- c'est le joueur qui a gagn CLR.L D3 LOAD.W D3,(A6)+OCONJ SUB.W D3,(A6)+OCONS JUMP,NC 03$ NEG.W D3 INC.W D0 ; D0 <-- c'est le SMAKY qui a gagn LOAD.L A3,#R16"02$ 03$: DIV.WU D3,#4 COMP.W D3,#3 JUMP,LS 04$ LOAD.W D3,#3 04$: DEC.W D3 JUMP,NS 08$ 06$: TEST.B (A3+) ; A3 <-- ^le bon texte JUMP,NE 06$ JUMP 04$ 08$: TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,F 10$ ; non => 10$ LOAD.B D3,#AFINV ; oui => LIB ?AFCAR ; affiche un inverse vido 10$: LOAD.L D4,#H'10000*(LYWDO-242)+306 11$: LOAD.L D3,D4 LIB ?SETCURS ; met le curseur au dbut de la ligne 12$: LOAD.B D3,(A3+) JUMP,EQ 16$ COMP.B D3,#CR JUMP,EQ 14$ LIB ?AFCAR ; affiche une ligne JUMP 12$ 14$: SWAP.W D4 ADD.W D4,(A0)+ODFCY ; D4 <-- position ligne en dessous SWAP.W D4 JUMP 11$ 16$: LOAD.L A3,#R16"TMUSYOUPIE TEST.W D0 JUMP,EQ 17$ LOAD.L A3,#R16"TMUSPERDU 17$: CALL PATATRA ; jolie/vilaine musique 20$: LIB ?GETCAR ; attend clavier/souris ... LOAD.W D2,#F0 ; D2 <-- F0 COMP.W D3,#F0 JUMP,EQ 60$ COMP.W D3,#F0+SHIFT JUMP,EQ 60$ COMP.W D3,#END JUMP,EQ 60$ LOAD.W D2,#F1 ; D2 <-- F1 COMP.W D3,#F1 JUMP,EQ 60$ COMP.W D3,#F1+SHIFT JUMP,EQ 60$ COMP.W D3,#F2 JUMP,EQ 60$ COMP.W D3,#F2+SHIFT JUMP,EQ 60$ COMP.W D3,#F3 JUMP,EQ 60$ COMP.W D3,#F3+SHIFT JUMP,EQ 60$ COMP.W D3,#KEYMGR JUMP,EQ 20$ COMP.W D3,#KEYMMR JUMP,EQ 20$ COMP.W D3,#KEYMDR JUMP,EQ 20$ 30$: ; petit bruit => LOAD.B D3,#BIPLIT LIB ?BEEP JUMP 20$ 60$: LOAD.W D3,D2 ; D3 <-- dernire touche 90$: LIB ?AFTIM .B AFDIR,0 ; remet la vido normale .EVEN POPM.L D0..D2,D4,A3 RET 01$: .ASCII " BRAVO, vous avez battu" .ASCII " le SMAKY, mais c'tait" .ASCII " de peu ..." .ASCIZ " C'EST BIEN !" ; ; .ASCII " BRAVO, vous avez gagn" .ASCII " contre le SMAKY haut la" .ASCII " main." .ASCIZ " C'EST TRES BIEN !!" ; ; .ASCII " BRAVO, vous avez largement" .ASCII " vaincu le SMAKY." .ASCII "" .ASCIZ " CHAMPION !!!" ; ; .ASCII " BRAVO, vous avez ridiculis" .ASCII " votre adversaire (le SMAKY)." .ASCII "" .ASCIZ " SUPER-CHAMPION !!!" ; ; 02$: .ASCII " DESOLE, mais le SMAKY vous" .ASCII " a battu (de peu c'est vrai)." .ASCII "" .ASCIZ " RECOMMENCEZ ..." ; ; .ASCII " DESOLE, mais c'est le SMAKY" .ASCII " qui a gagn cette partie !" .ASCII "" .ASCIZ " ESSAYEZ ENCORE UNE FOIS ..." ; ; .ASCII " DESOLE, mais le SMAKY vous" .ASCII " a largement battu !" .ASCII " Il reste beaucoup de progrs" .ASCIZ "  faire ..." ; ; .ASCII " DESOLE, mais le SMAKY vous" .ASCII " a littralement aplati !" .ASCII " Recommencez si vous tes" .ASCIZ " trs courrageux ... " ; ; .EVEN ;--------\\ ; ACTION > ;========/ ; Agit selon un vnement clavier/souris. ; in - ; out D7.W EQ => action effectue ; NE => pas d'action (timeout) ; mod D7.W ACTION: PUSHM.L D0..D6,A0..A5 LOAD.L A4,#(A6)+ORAQJ ; A4 <-- description raquette joueur LOAD.W D4,(A6)+OTIMING NTREL ?SETTIM ; met timeout pour 25 images/seconde LIB ?GETKEY ; attend clavier/souris ... LOAD.W D0,D7 LOAD.W D4,#-1 NTREL ?SETTIM ; remet timeout infini TEST.W D0 JUMP,NE MOREPEAT TEST.L D3:#BKPSEUDO JUMP,BC 20$ TEST.L D3:#BKRELEAS JUMP,BC ENDACTION ; touche relche => SWAP.W D3 AND.B D3,#H'7F ; D3 <-- pseudo code (toujours majuscule) COMP.B D3,#'E JUMP,EQ MORIGHTR COMP.B D3,#'T JUMP,EQ MOLEFTR COMP.W D3,#'S JUMP,EQ KEYLEFTR COMP.W D3,#'D JUMP,EQ KEYLEFTR COMP.W D3,#'G JUMP,EQ KEYRIGHTR COMP.W D3,#'F JUMP,EQ KEYRIGHTR JUMP ENDACTION 20$: ; touche presse => COMP.W D3,#'E JUMP,EQ MORIGHTP COMP.W D3,#'e JUMP,EQ MORIGHTP COMP.W D3,#'T JUMP,EQ MOLEFTP COMP.W D3,#'t JUMP,EQ MOLEFTP COMP.W D3,#'S JUMP,EQ KEYLEFTP COMP.W D3,#'s JUMP,EQ KEYLEFTP COMP.W D3,#'D JUMP,EQ KEYLEFTP COMP.W D3,#'d JUMP,EQ KEYLEFTP COMP.W D3,#'G JUMP,EQ KEYRIGHTP COMP.W D3,#'g JUMP,EQ KEYRIGHTP COMP.W D3,#'F JUMP,EQ KEYRIGHTP COMP.W D3,#'f JUMP,EQ KEYRIGHTP COMP.W D3,#KEYMPO JUMP,EQ MOMOVE COMP.W D3,#KEYMDP JUMP,EQ MOLEFTP COMP.W D3,#KEYMDR JUMP,EQ MOLEFTR COMP.W D3,#KEYMGP JUMP,EQ MORIGHTP COMP.W D3,#KEYMGR JUMP,EQ MORIGHTR COMP.W D3,#END JUMP,EQ DOEND COMP.W D3,#F0 JUMP,EQ DOEND COMP.W D3,#F0+SHIFT JUMP,EQ DOEND COMP.W D3,#F1 JUMP,EQ DOBEGIN COMP.W D3,#F1+SHIFT JUMP,EQ DOBEGIN COMP.W D3,#F2 JUMP,EQ DOBEGIN COMP.W D3,#F2+SHIFT JUMP,EQ DOBEGIN COMP.W D3,#F3 JUMP,EQ DOBEGIN COMP.W D3,#F3+SHIFT JUMP,EQ DOBEGIN COMP.W D3,#SPACE JUMP,EQ DOBEGIN COMP.W D3,#KEYMMP JUMP,EQ DOBEGIN1 COMP.W D3,#'R JUMP,EQ DOBEGIN1 COMP.W D3,#'r JUMP,EQ DOBEGIN1 COMP.W D3,#F13 JUMP,EQ DOHELP COMP.W D3,#F13+SHIFT JUMP,EQ DOHELP COMP.W D3,#F14 JUMP,EQ DOHELP COMP.W D3,#F14+SHIFT JUMP,EQ DOHELP COMP.W D3,#F15 JUMP,EQ DOHELP COMP.W D3,#F15+SHIFT JUMP,EQ DOHELP COMP.W D3,#HELP JUMP,EQ DOHELP JUMP ENDACTION MOREPEAT: ; rpte ventuellement qq chose => TEST.B (A4)+ORAQET:#BRAQL JUMP,BS MOLEFTP TEST.B (A4)+ORAQET:#BRAQR JUMP,BS MORIGHTP TEST.B (A4)+ORAQET:#BRAQG JUMP,BS KEYLEFTP TEST.B (A4)+ORAQET:#BRAQD JUMP,BS KEYRIGHTP ;;? TEST.W (A4)+ORAQEL ; raquette leve ? ;;? JUMP,EQ ENDACTION ; non => ENDACTION LOAD.L D4,(A4)+ORAQPO ; D4 <-- position LOAD.W D3,(A4)+ORAQIN ; D3 <-- inclinaison CALL MOVERAQ ; dplace la raquette JUMP ENDACTION MOMOVE: ; souris dplace => CALL IFMOUSE ; D4 <-- position de la souris JUMP,NE ENDACTION MOMOVE1: LOAD.L D3,D4 SWAP.W D3 SUB.W D3,#POSYRAQ ; brusque dplacement contre le haut ? JUMP,HS 40$ ; non => 40$ COMP.W D3,#-10 ; assez brusque ? JUMP,GT 40$ ; non => 40$ LOAD.W (A4)+ORAQEL,#RAQEL ; lve brusquement la raquette 40$: LOAD.W D3,(A4)+ORAQIN ; D3 <-- inclinaison CALL MOVERAQ ; dplace la raquette LOAD.L D4,(A4)+ORAQPO CALL PMOUSE ; met la souris o est la raquette ! JUMP MOREPEAT MOLEFTP: ; [GAUCHE] press => TSET.B (A4)+ORAQET:#BRAQL LOAD.L D4,(A4)+ORAQPO LOAD.W D3,(A4)+ORAQIN ADD.W D3,#+1 COMP.W D3,#+MAXIRAQ JUMP,LT 50$ LOAD.W D3,#+MAXIRAQ TCLR.B (A4)+ORAQET:#BRAQL 50$: CALL MOVERAQ ; dplace la raquette JUMP ENDACTION MOLEFTR: ; [GAUCHE] relch => TCLR.B (A4)+ORAQET:#BRAQL JUMP ENDACTION MORIGHTP: ; [DROITE] press => TSET.B (A4)+ORAQET:#BRAQR LOAD.L D4,(A4)+ORAQPO LOAD.W D3,(A4)+ORAQIN ADD.W D3,#-1 COMP.W D3,#-MAXIRAQ JUMP,GT 50$ LOAD.W D3,#-MAXIRAQ TCLR.B (A4)+ORAQET:#BRAQR 50$: CALL MOVERAQ ; dplace la raquette JUMP ENDACTION MORIGHTR: ; [DROITE] relch => TCLR.B (A4)+ORAQET:#BRAQR JUMP ENDACTION KEYLEFTP: TSET.B (A4)+ORAQET:#BRAQG LOAD.L D4,(A4)+ORAQPO ADD.W D4,#-10 LOAD.W D3,(A4)+ORAQIN ; D3 <-- inclinaison CALL MOVERAQ ; dplace la raquette LOAD.L D4,(A4)+ORAQPO CALL PMOUSE ; met la souris o est la raquette ! JUMP ENDACTION KEYLEFTR: TCLR.B (A4)+ORAQET:#BRAQG JUMP ENDACTION KEYRIGHTP: TSET.B (A4)+ORAQET:#BRAQD LOAD.L D4,(A4)+ORAQPO ADD.W D4,#+10 LOAD.W D3,(A4)+ORAQIN ; D3 <-- inclinaison CALL MOVERAQ ; dplace la raquette LOAD.L D4,(A4)+ORAQPO CALL PMOUSE ; met la souris o est la raquette ! JUMP ENDACTION KEYRIGHTR: TCLR.B (A4)+ORAQET:#BRAQD JUMP ENDACTION DOEND: SET.B (A6)+OEND ; signal la fin de la partie JUMP ENDACTION DOBEGIN: LOAD.W (A4)+ORAQEL,#RAQEL ; lve brusquement la raquette SET.B (A6)+OBEGIN ; signal le dbut de la partie JUMP ENDACTION DOBEGIN1: LOAD.W (A4)+ORAQEL,#RAQEL ; lve brusquement la raquette TEST.B (A6)+OFIXE ; raquette fixe ? JUMP,T ENDACTION ; oui => ENDACTION SET.B (A6)+OBEGIN ; non => signal le dbut de la partie JUMP ENDACTION DOHELP: SET.B (A6)+OHELP ; signal un appel  l'aide SET.B (A6)+OEND ; signal la fin de la partie JUMP ENDACTION ENDACTION: LOAD.W D7,D0 ; D7 <-- action ou pas POPM.L D0..D6,A0..A5 TEST.W D7 ; retour EQ/NE RET ;--------\\ ; SMAKY > ;========/ ; Dplace la raquette du SMAKY. ; in A5.L ^description de l'objet ; out - ; mod D7.W SMAKY: PUSHM.L D0..D4,A4 LOAD.L A4,#(A6)+ORAQS ; A4 <-- ^description raquette SMAKY COMP.W (A5)+OOBPOS+2,#FRONTX JUMP,HS 20$ ; Si la balle est dans le camp du joueur, adopte une stratgie ; dfensive (raquette au fond), d'attaque (raquette au filet) ; ou collante (suiveuse) de faon alatoire. TEST.B (A6)+OSTRAT:#1 JUMP,BS 15$ ; stratgie suiveuse => LOAD.W D4,(A6)+ORAQJ+ORAQFX SUB.W D4,(A6)+ORAQJ+ORAQPO+2 ADD.W D4,(A4)+ORAQDX ; D4 <-- miroir de la raquette du joueur JUMP 40$ 15$: LOAD.W D4,(A4)+ORAQDX ; D4 <-- raquette au filet TEST.B (A6)+OSTRAT:#2 JUMP,BS 40$ LOAD.W D4,(A4)+ORAQFX ; D4 <-- raquette au fond JUMP 40$ 20$: TEST.W (A5)+OOBVIT+0 ; balle monte ? JUMP,NS 30$ ; oui => 30$ ; Si la balle descend, calcul une estimation linaire du point ; de chute de la balle. LOAD.L D1,(A5)+OOBPOO ; D1 <-- position balle  t-1 LOAD.L D2,(A5)+OOBPOS ; D2 <-- position balle  t LOAD.L D3,(A5)+OOBDIM SR.W D3,#1 ADD.W D1,D3 ADD.W D2,D3 SWAP.W D1 SWAP.W D2 SWAP.W D3 SR.W D3,#1 ADD.W D1,D3 ADD.W D2,D3 SWAP.W D1 SWAP.W D2 ; SWAP.W D3 LOAD.W D3,#POSYRAQ+22 LOAD.W D4,D3 SWAP.W D3 SWAP.W D4 LOAD.W D3,#IDXRAQ LOAD.W D4,#10000 CALL GAINTERHV ; D0 <-- point d'intersection P1-P2 et P3-P4 JUMP,NE 90$ LOAD.W D4,D0 SUB.W D4,#IDXRAQ/2 JUMP 40$ ; Si la balle monte, met la raquette juste dessous. 30$: LOAD.W D4,(A5)+OOBPOS+2 LOAD.W D3,(A5)+OOBDIM+2 SR.W D3,#1 ADD.W D4,D3 SUB.W D4,#IDXRAQ/2 ; Avance ou recule sur le point de chute prsum, mais sans ; dpasser une vitesse maximale. 40$: COMP.W D4,(A4)+ORAQPO+2 JUMP,EQ 60$ JUMP,LO 50$ ; avance vers la droite => LOAD.W D2,(A4)+ORAQPO+2 ADD.W D2,#MAXVITS COMP.W D4,D2 JUMP,LS 60$ LOAD.W D4,D2 JUMP 60$ 50$: ; avance vers la gauche => LOAD.W D2,(A4)+ORAQPO+2 SUB.W D2,#MAXVITS COMP.W D4,D2 JUMP,HS 60$ LOAD.W D4,D2 60$: CALL SIMRAQIN ; D3 <-- inclinaison de la raquette CALL MOVERAQ ; dplace la raquette du SMAKY 90$: POPM.L D0..D4,A4 RET ;---------\\ ; SIMRAQIN > ;---------/ ; Cherche la meilleure inclinaison pour la raquette du SMAKY. ; Cette routine contient en quelque sorte la "stratgie" de ; jeu du SMAKY ! ; in A5.L ^description de l'objet ; A4.L ^description de la raquette ; out D3.W inclinaison de la raquette du SMAKY ; mod D3.L, D7.W SIMRAQIN: PUSHM.L D2,D4 ; Si la balle touche la raquette et qu'il reste beaucoup de ; briques, smash systmatique ! ; S'il reste peu de briques, ne smash que si la balle ne va ; vraiment pas assez vite. CLR.W D2 ; D2 <-- pas de smash TEST.W (A5)+OOBVIT+0 ; balle descend ? JUMP,NS 20$ ; non => 20$ COMP.W (A6)+OBRINB,#MAXBRI/2 ; reste beaucoup de briques ? JUMP,HS 10$ ; oui => 10$ COMP.W (A5)+OOBVIT+0,#15 ; balle descend rapidement ? JUMP,HS 20$ ; oui => 20$ 10$: COMP.W (A5)+OOBVIT+0,#MAXVITY-2 ; balle descend trs rapidement ? JUMP,HS 20$ ; oui => 20$ LOAD.L D3,(A4)+ORAQPO LOAD.L D4,#H'10000*IDYRAQ+IDXRAQ CALL DETOBJ ; est-ce que la balle arrive sur la raquette ? JUMP,EQ 20$ ; non => 20$ ; oui => INC.W D2 ; D2 <-- smash LOAD.W (A4)+ORAQEL,#RAQEL ; lve brusquement la raquette ; Calcul une inclinaison qui tient compte de la position ; de la raquette. Plus elle est  droite et plus elle ; est incline. 20$: LOAD.W D3,(A4)+ORAQPO+2 SUB.W D3,(A4)+ORAQDX MUL.WU D3,#MAXIRAQ LOAD.W D4,(A4)+ORAQFX SUB.W D4,(A4)+ORAQDX DIV.WU D3,D4 ; Plus la balle avance vite (Vx), plus il faut incliner la ; raquette. CLR.L D4 LOAD.W D4,(A5)+OOBVIT+2 JUMP,NS 30$ DIV.WU D4,#3 ADD.W D3,D4 30$: TEST.W D2 ; smash ? JUMP,EQ 70$ ; non => 70$ ; oui => ADD.W D3,#4 ; D3 <-- incline plus la raquette ; Si la raquette est trop incline, il faut la ramener dans ; une position possible ! 70$: COMP.W D3,#MAXIRAQ ; trop inclin ? JUMP,LS 75$ LOAD.W D3,#MAXIRAQ 75$: TEST.W D3 ; raquette horizontale ? JUMP,NE 80$ INC.W D3 80$: NEG.W D3 POPM.L D2,D4 RET ;----------\\ ; BEGINTIME > ;==========/ ; Mmorise le temps actuel. ; in - ; out - ; mod D7.W BEGINTIME: PUSHM.L D2..D5 NTREL ?GETSYTIME LOAD.L (A6)+OTIME,D4 ; OTIME <-- temps processeur total POPM.L D2..D5 RET ;----------\\ ; DELTATIME > ;==========/ ; Donne l'cart entre l'appel BEGINTIME et cet appel-l. ; in - ; out D4.W cart (unit 20ms) ; mod D4.L, D7.W DELTATIME: PUSHM.L D2,D3,D5 NTREL ?GETSYTIME ; D4 <-- temps processeur total SUB.L D4,(A6)+OTIME ; D4 <-- temps coul (unit 128us) DIV.WU D4,#20000/128 ; D4 <-- temps coul (unit 20ms) POPM.L D2,D3,D5 RET ;----------\\ ; VIEBRIQUE > ;==========/ ; Anime les briques dtruites. ; in - ; out - ; mod D7.W VIEBRIQUE: PUSHM.L D2..D4,A4 CLR.W D4 ; D4 <-- rang initial 20$: CALL PETBRIQUE ; A4 <-- ^tat de la brique LOAD.B D3,(A4)+0 ; D3 <-- tat de la brique JUMP,EQ 50$ COMP.B D3,#-1 JUMP,EQ 50$ DEC.B D3 LOAD.B (A4),D3 SR.B D3,#1 JUMP,CS 50$ SUB.B D3,#NBABRI NEG.B D3 ADD.B D3,(A4)+1 ; D3 <-- code de l'icne LOAD.W D2,#INVDOT CALL DESBRIQUE ; efface un bout de brique 50$: INC.W D4 ; D4 <-- rang suivant COMP.W D4,#MAXBRI JUMP,LO 20$ POPM.L D2..D4,A4 RET ;----------\\ ; ALLBRIQUE > ;==========/ ; Dessine toutes les briques. ; in - ; out - ; mod D7.W ALLBRIQUE: PUSHM.L D2..D4,A3,A4 LOAD.L A3,#R16"00$ ; A3 <-- ^notes de la gamme CLR.W D4 ; D4 <-- rang initial 20$: TEST.W (A6)+OBRINB JUMP,EQ 30$ DEC.W (A6)+OBRINB JUMP 50$ 30$: LOAD.B D3,#ICOBRIQUE LOAD.W D2,#SETDOT CALL DESBRIQUE ; dessine une brique CALL PETBRIQUE ; A4 <-- ^tat de la brique LOAD.B (A4)+0,#-1 PUSHM.L D3..D6 LOAD.W D3,(A3) LOAD.W D4,#SILENCE LOAD.W D5,#SILENCE LOAD.W D6,#H'100*10+0 LIB ?ACCORD POPM.L D3..D6 PUSH.W D4 LOAD.W D4,#50/10 NTREL ?DELMS ; attend trs peu ... POP.W D4 50$: ADD.L A3,#2 ; A3 <-- ^note suivante INC.W D4 ; D4 <-- rang suivant COMP.W D4,#MAXBRI JUMP,LO 20$ LOAD.W (A6)+OBRINB,#MAXBRI POPM.L D2..D4,A3,A4 RET 00$: .W NOTE+OCTAVE*5+SGDO .W NOTE+OCTAVE*5+SGRE .W NOTE+OCTAVE*5+SGMI .W NOTE+OCTAVE*5+SGFA .W NOTE+OCTAVE*5+SGSOL .W NOTE+OCTAVE*5+SGLA .W NOTE+OCTAVE*5+SGSI .W NOTE+OCTAVE*6+SGDO ;----------\\ ; DESBRIQUE > ;==========/ ; Dessine une brique. ; in D4.W rang (0..n) ; D3.B code de l'icne ; D2.W mode ; out - ; mod D7.W DESBRIQUE: PUSHM.L D1..D5 LOAD.B D1,D3 CALL POSBRIQUE ; D3/D4 <-- position/dimensions LOAD.L D5,D4 ; D5 <-- dimensions LOAD.L D4,D3 ; D4 <-- position LOAD.B D3,D1 ; D3 <-- code de l'icne CALL DRICONE POPM.L D1..D5 RET ;----------\\ ; PETBRIQUE > ;----------/ ; Donne le pointeur sur l'tat d'une brique. ; in D4.W rang (0..n) ; out A4.L ^tat ; mod D7.W, A4.L PETBRIQUE: PUSH.L D4 LOAD.L A4,#(A6)+OBRIQUE SL.W D4,#1 ADD.W A4,D4 POP.L D4 RET ;----------\\ ; POSBRIQUE > ;----------/ ; Calcul la position et les dimensions d'une brique. ; Rang: n-1 brique tout en haut ; 0 brique tout en bas ; -1 plus de brique (support) ; in D4.W rang (-1,0..n) ; out D3.L position (y;x) ; D4.L dimensions (dy;dx) ; mod D3.L, D4.L, D7.W POSBRIQUE: LOAD.W D3,D4 INC.W D3 MUL.WU D3,#IDYBRI SUB.W D3,#POSYBRI NEG.W D3 SWAP.W D3 LOAD.W D3,#POSXBRI LOAD.L D4,#H'10000*IDYBRI+IDXBRI RET ;---------\\ ; NEWOBJET > ;=========/ ; Initialise un nouvel objet. ; in A5.L ^descripteur de l'objet ; out - ; mod D7.W NEWOBJET: PUSHM.L D3,D4 LOAD.B (A5)+OOBICO,#ICOBALLE1 LOAD.W (A5)+OOBDIM+2,#IDXBALLE1 LOAD.W (A5)+OOBDIM+0,#IDYBALLE1 LOAD.W (A5)+OOBPOS+2,#LXWDO/2 LOAD.W (A5)+OOBCHO+2,#3 LOAD.W (A5)+OOBCHO+0,#3 LOAD.W (A5)+OOBACC,#2 LOAD.W (A5)+OOBVIM,#-1 ; balle immortelle (pour le temps) LOAD.W (A5)+OOBVIE,(A5)+OOBVIM LOAD.W (A5)+OOBMU1,#TMUSCOLB1-TMUS LOAD.W (A5)+OOBMU2,#TMUSCOLR1-TMUS LOAD.W (A5)+OOBMU3,#TMUSENDB1-TMUS CLR.W (A5)+OOBFIN CLR.W (A5)+OOBVIF SET.B (A5)+OOBNEW ; nouvel objet CLR.B (A5)+OOBOLD ; pas encore mort POPM.L D3,D4 RET ;---------\\ ; MAJOBJET > ;=========/ ; Met  jour un nouvel objet selon la raquette. ; in A5.L ^descripteur de l'objet ; A4.L ^description de la raquette ; out - ; mod D7.W MAJOBJET: PUSHM.L D3,D4,A3 LOAD.W D4,(A4)+ORAQIN ASL.W D4,#1 LOAD.W (A5)+OOBVIT+2,D4 LOAD.L A3,#R16"00$ LOAD.W D3,(A6)+OBRINB ; D3 <-- nb de briques restantes SL.W D3,#1 ADD.W A3,D3 LOAD.W (A5)+OOBVIT+0,(A3) POPM.L D3,D4,A3 RET ; Cette table donne la vitesse d'engagement (Vy) en fonction ; du nombre de briques restantes. 00$: .W -7 ; 0 .W -10 ; 1 .W -12 ; 2 .W -14 ; 3 .W -16 ; 4 .W -18 ; 5 .W -20 ; 6 .W -22 ; 7 .W -23 ; 8 .W -24 ; 9 .W -25 ; 10 ;--------\\ ; MOVEOBJ > ;========/ ; Dplace un objet. ; in A5.L ^descripteur de l'objet ; out - ; mod D7.W MOVEOBJ: PUSHM.L D2..D5,A4 LOAD.L (A5)+OOBPOO,(A5)+OOBPOS LOAD.L D4,(A5)+OOBPOS ; D4 <-- position actuelle LOAD.L D2,D4 ADD.W D4,(A5)+OOBVIT+2 SWAP.W D4 ADD.W D4,(A5)+OOBVIT+0 SWAP.W D4 CALL BORDOBJ ; choc (oh l) avec un bord ? COMP.W (A5)+OOBVIE,#1 ; objet presque mort ? JUMP,LS 30$ ; oui => 30$ CALL BRIOBJ ; choc avec des briques ? LOAD.L A4,#(A6)+ORAQJ ; A4 <-- ^description raquette joueur CALL RAQOBJ ; choc avec la raquette du joueur ? LOAD.L A4,#(A6)+ORAQS ; A4 <-- ^description raquette SMAKY CALL RAQOBJ ; choc avec la raquette du SMAKY ? 30$: TEST.W (A5)+OOBVIE ; objet en vie ? JUMP,NE 40$ ; oui => 40$ ; non => LOAD.L D4,D2 ; D4 <-- ne le dplace plus du tout 40$: LOAD.L D3,(A5)+OOBPOS ; D3 <-- ancienne position LOAD.L D5,(A5)+OOBDIM ; D5 <-- dimensions CALL MOVEIICONE ; dplace l'objet LOAD.L (A5)+OOBPOS,D4 ; mm. nouvelle position LOAD.W D4,(A5)+OOBACC ADD.W (A5)+OOBVIT+0,D4 ; tient compte de la pesanteur ! CALL MAXVIT ; ne va quand mme pas trop vite 90$: POPM.L D2..D5,A4 RET ;--------\\ ; BORDOBJ > ;--------/ ; Teste une collision avec un bord de la fentre. ; in A5.L ^descripteur de l'objet ; D4.L position (y;x) ; out D4.L position (y;x) ; mod D4.L, D7.W BORDOBJ: PUSHM.L D2,D3 CLR.W D2 ; D2 <-- pas de collision SWAP.W D4 ; Teste une collision avec le sol. LOAD.W D3,(A0)+ODFFDY SUB.W D3,#MARGB SUB.W D3,(A5)+OOBDIM+0 COMP.W D4,D3 ; collision avec le sol ? JUMP,LT 20$ LOAD.W D4,D3 COMP.W D4,(A5)+OOBPOS+0 JUMP,NE 14$ DEC.W D2 ; D2 <-- ne fait pas de bruit ! 14$: NEG.W (A5)+OOBVIT+0 ; inverse la vitesse Vy LOAD.W D3,(A5)+OOBCHO+0 CALL UPVIT ; diminue la vitesse contre en haut INC.W D2 ; D2 <-- une collision TEST.W (A5)+OOBVIE ; objet dj mort ? JUMP,EQ 20$ ; oui => 20$ ; non => LOAD.W (A5)+OOBVIE,#1 ; mort de l'objet ! SWAP.W D4 COMP.W D4,#FRONTX JUMP,LT 16$ ; c'est gagn => SET.B (A6)+OGAGNE LOAD.W D3,#FRONTX+30 COMP.W D4,D3 JUMP,HS 18$ LOAD.W D4,D3 JUMP 18$ 16$: ; c'est perdu => SET.B (A6)+OPERDU LOAD.W D3,(A5)+OOBDIM+2 SR.W D3,#1 NEG.W D3 ADD.W D3,#FRONTX-32 COMP.W D4,D3 JUMP,LS 18$ LOAD.W D4,D3 18$: SWAP.W D4 ; Teste une collision avec le plafond. 20$: LOAD.W D3,#MARGH COMP.W D4,D3 ; collision avec le plafond ? JUMP,GT 30$ LOAD.W D4,D3 COMP.W D4,(A5)+OOBPOS+0 JUMP,NE 24$ DEC.W D2 ; D2 <-- ne fait pas de bruit ! 24$: NEG.W (A5)+OOBVIT+0 ; inverse la vitesse Vy LOAD.W D3,(A5)+OOBCHO+0 CALL DOWNVIT ; diminue la vitesse contre en bas INC.W D2 ; D2 <-- une collision ; Teste une collision avec le bord droite. 30$: SWAP.W D4 LOAD.W D3,(A0)+ODFFDX SUB.W D3,#MARGD SUB.W D3,(A5)+OOBDIM+2 COMP.W D4,D3 ; collision avec le bord droite ? JUMP,LT 40$ LOAD.W D4,D3 COMP.W D4,(A5)+OOBPOS+2 JUMP,NE 34$ DEC.W D2 ; D2 <-- ne fait pas de bruit ! 34$: NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,(A5)+OOBCHO+2 CALL LEFTVIT ; diminue la vitesse vers la gauche INC.W D2 ; D2 <-- une collision ; Teste une collision avec le bord gauche. 40$: LOAD.W D3,#MARGG COMP.W D4,D3 ; collision avec le bord gauche ? JUMP,GT 50$ LOAD.W D4,D3 COMP.W D4,(A5)+OOBPOS+2 JUMP,NE 44$ DEC.W D2 ; D2 <-- ne fait pas de bruit ! 44$: NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,(A5)+OOBCHO+2 CALL RIGHTVIT ; diminue la vitesse vers la droite INC.W D2 ; D2 <-- une collision ; Fait un bruit en cas de collision. 50$: TEST.W D2 ; une collision ? JUMP,EQ 90$ ; non => 90$ ; oui => TEST.W (A5)+OOBVIE ; objet en vie ? JUMP,EQ 90$ ; non => 90$ ; oui => CALL MUS1OBJ ; bruit de collision avec un bord 90$: CALL MAXVIT ; ne va quand mme pas trop vite POPM.L D2,D3 RET ;-------\\ ; BRIOBJ > ;-------/ ; Choc de la balles avec une ou plusieures briques. ; Supprime ventuellement la premire brique (tout en haut). ; in A5.L ^description de l'objet ; D4.L position (y;x) ; out D4.L position (y;x) ; mod D4.L, D7.W BRIOBJ: PUSHM.L D0..D3,D5,A3,A4 LOAD.L D5,D4 ; D5 <-- nouvelle position LOAD.W D4,(A6)+OBRINB DEC.W D4 ; D4 <-- rang de la brique tout en haut LOAD.W D2,D4 PUSH.L (A5)+OOBPOS LOAD.L (A5)+OOBPOS,D5 PUSH.L D4 CALL POSBRIQUE ; D3/D4 <-- position/dimensions CALL DETOBJ ; collision avec la brique ? POP.L D4 POP.L (A5)+OOBPOS TEST.W D7 JUMP,EQ 90$ ; non => 90$ ; oui => COMP.W D2,#-1 ; plus de briques ? JUMP,EQ 50$ ; oui => 50$ CALL PETBRIQUE ; A4 <-- ^tat de la brique COMP.B (A4)+0,#-1 ; brique existe ? JUMP,NE 90$ ; non => 90$ ; oui => LOAD.B (A4)+0,#NBABRI*2 ; enlve la brique LOAD.B (A4)+1,#ICOBRIQUE DEC.W (A6)+OBRINB ; une brique de moins 50$: CALL COUPEBRIQUE ; rebond sur la brique LOAD.L A3,#R16"TMUSCOLBRI1 COMP.W D2,#-1 ; plus de briques ? JUMP,EQ 80$ ; oui => 80$ LOAD.L A3,#R16"TMUSCOLBRI2 80$: CALL PATATRA ; fait un bruit 90$: CALL COUPEMUR ; collision avec le mur ? LOAD.L D4,D5 ; D4 <-- nouvelle position POPM.L D0..D3,D5,A3,A4 RET ;------------\\ ; COUPEBRIQUE > ;------------/ ; Regarde comment une balle coupe une brique, et simule ; un rebond correct sur les 4 faces possibles. ; in A5.L ^description de l'objet ; D5.L nouvelle position de l'objet ; D4.W rang de la brique (-1,0..n) ; out D5.L nouvelle position de l'objet ; mod D5.L, D7.W COUPEBRIQUE: PUSHM.L D0..D4,D6 LOAD.L D1,(A5)+OOBPOS ; D1 <-- position au temps t LOAD.L D2,D5 ; D2 <-- position au temps t+1 CALL POSBRIQUE ; D3/D4 <-- position/dimensions LOAD.L D5,D3 ; D5 <-- position brique LOAD.L D6,D4 ; D6 <-- dimensions brique LOAD.L D4,(A5)+OOBDIM SUB.W D5,D4 ADD.W D6,D4 SWAP.W D4 SWAP.W D5 SWAP.W D6 SUB.W D5,D4 ADD.W D6,D4 SWAP.W D5 SWAP.W D6 LOAD.L D3,D1 LOAD.L D4,D2 SWAP.W D3 SWAP.W D4 COMP.W D3,D4 JUMP,EQ 40$ ; trajectoire horizontale => 40$ JUMP,HI 20$ ; la balle descend => LOAD.L D3,D5 ; D3 <-- position brique LOAD.L D4,D6 ; D4 <-- dimensions brique ADD.W D4,D3 SWAP.W D3 SWAP.W D4 LOAD.W D4,D3 SWAP.W D4 SWAP.W D3 CALL GAINTERHV JUMP,NE 40$ LOAD.L D2,D0 TEST.W (A5)+OOBVIT+0 JUMP,NS 40$ NEG.W (A5)+OOBVIT+0 ; inverse la vitesse Vy LOAD.W D3,#1 CALL UPVIT ; diminue la vitesse contre le haut JUMP 40$ 20$: ; la balle monte => LOAD.L D3,D5 ; D3 <-- position brique LOAD.L D4,D6 ; D4 <-- dimensions brique ADD.W D4,D3 SWAP.W D3 SWAP.W D4 ADD.W D3,D4 LOAD.W D4,D3 SWAP.W D4 SWAP.W D3 CALL GAINTERHV JUMP,NE 40$ LOAD.L D2,D0 TEST.W (A5)+OOBVIT+0 JUMP,NC 40$ NEG.W (A5)+OOBVIT+0 ; inverse la vitesse Vy LOAD.W D3,#5 CALL DOWNVIT ; diminue la vitesse contre le bas 40$: COMP.W D1,D2 JUMP,EQ 90$ ; trajectoire verticale => 90$ JUMP,HI 60$ ; la balle va  droite => LOAD.L D3,D5 ; D3 <-- position brique LOAD.L D4,D6 ; D4 <-- dimensions brique LOAD.W D4,D3 SWAP.W D3 SWAP.W D4 ADD.W D4,D3 SWAP.W D4 SWAP.W D3 CALL GAINTERHV JUMP,NE 90$ LOAD.L D2,D0 TEST.W (A5)+OOBVIT+2 JUMP,NS 90$ NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,#1 CALL LEFTVIT ; diminue la vitesse contre la gauche JUMP 90$ 60$: ; la balle va  gauche => LOAD.L D3,D5 ; D3 <-- position brique LOAD.L D4,D6 ; D4 <-- dimensions brique ADD.W D3,D4 LOAD.W D4,D3 SWAP.W D3 SWAP.W D4 ADD.W D4,D3 SWAP.W D4 SWAP.W D3 CALL GAINTERHV JUMP,NE 90$ LOAD.L D2,D0 TEST.W (A5)+OOBVIT+2 JUMP,NC 90$ NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,#1 CALL RIGHTVIT ; diminue la vitesse contre la droite 90$: CALL MAXVIT ; ne va quand mme pas trop vite LOAD.L D5,D2 ; D5 <-- nouvelle position POPM.L D0..D4,D6 RET ;---------\\ ; COUPEMUR > ;---------/ ; Regarde comment une balle coupe le mur constitu de toutes ; les briques, sauf celle tout en haut. ; in A5.L ^description de l'objet ; D5.L nouvelle position de l'objet ; out D5.L nouvelle position de l'objet ; mod D5.L, D7.W COUPEMUR: PUSHM.L D0..D4,D6,A3 LOAD.L D1,(A5)+OOBPOS ; D1 <-- position au temps t LOAD.L D2,D5 ; D2 <-- position au temps t+1 LOAD.W D4,(A6)+OBRINB SUB.W D4,#2 JUMP,LO 90$ CALL POSBRIQUE ; D3/D4 <-- position/dimensions SWAP.W D3 LOAD.W D4,(A5)+OOBDIM+0 SR.W D4,#1 SUB.W D3,D4 SWAP.W D3 LOAD.L D5,D3 LOAD.L D6,D3 SUB.W D5,(A5)+OOBDIM+2 ; D5 <-- position mur gauche ADD.W D6,#IDXBRI ; D6 <-- position mur droite COMP.W D2,D5 ; position au temps t+1 dans le mur ? JUMP,LO 90$ ; non => 90$ COMP.W D2,D6 JUMP,HS 90$ LOAD.L D3,D2 SWAP.W D3 SWAP.W D5 COMP.W D3,D5 JUMP,LO 90$ SWAP.W D5 COMP.W D1,D2 JUMP,EQ 90$ ; trajectoire verticale => 90$ JUMP,HI 60$ ; la balle va  droite => LOAD.L D3,D5 ; D3 <-- position mur gauche LOAD.W D4,#LYWDO SWAP.W D4 LOAD.W D4,D3 CALL GAINTERHV JUMP,NE 90$ LOAD.L D2,D0 SUB.W D2,#2 TEST.W (A5)+OOBVIT+2 JUMP,NS 80$ NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,#1 CALL LEFTVIT ; diminue la vitesse contre la gauche JUMP 80$ 60$: ; la balle va  gauche => LOAD.L D3,D6 ; D3 <-- position mur droite LOAD.W D4,#LYWDO SWAP.W D4 LOAD.W D4,D3 CALL GAINTERHV JUMP,NE 90$ LOAD.L D2,D0 ADD.W D2,#2 TEST.W (A5)+OOBVIT+2 JUMP,NC 80$ NEG.W (A5)+OOBVIT+2 ; inverse la vitesse Vx LOAD.W D3,#1 CALL RIGHTVIT ; diminue la vitesse contre la droite 80$: LOAD.L A3,#R16"TMUSCOLBRI1 CALL PATATRA ; fait un bruit 90$: CALL MAXVIT ; ne va quand mme pas trop vite LOAD.L D5,D2 ; D5 <-- nouvelle position POPM.L D0..D4,D6,A3 RET ;--------\\ ; RAQOBJ > ;--------/ ; Teste une collision avec la raquette. ; in A5.L ^descripteur de l'objet ; A4.L ^description de la raquette ; D4.L nouvelle position (y;x) ; out D4.L nouvelle position (y;x) ; mod D4.L, D7.W RAQOBJ: PUSHM.L D0..D3,D5 LOAD.L D5,D4 ; D5 <-- nouvelle position JUMP,EQ 90$ TEST.L (A5)+OOBPOS JUMP,EQ 90$ TEST.L (A4)+ORAQPO JUMP,EQ 90$ ;;? TEST.W (A5)+OOBVIT+0 ; est-ce que l'objet descend ? ;;? JUMP,NS 90$ ; non => 90$ CALL RAQDEDANS ; balle heurte la raquette ? JUMP,EQ 90$ ; non => 90$ ; Modifie la position pour tenir compte ( peu prt) du rebond. CALL RAQDESSUS ; D4 <-- ramne dessus la raquette ! ; Modifie la vitesse verticale. NEG.W (A5)+OOBVIT+0 ; inverse la vitesse Vy LOAD.W D3,(A5)+OOBCHO+0 SUB.W D3,(A4)+ORAQEL ; D3 <-- tient compte de l'lvation de la raquette SUB.W D3,(A4)+ORAQEL CALL UPVIT ; diminue/augmente la vitesse contre le haut ; Modifie la vitesse horizontale. ; Lors d'un smash, Vy est augment seulement pour la raquette du joueur. ; Cel lui donne un petit avantage ! CLR.W D3 COMP.B (A4)+ORAQIC,#ICORAQS ; raquette du SMAKY ? JUMP,EQ 50$ ; oui => 50$ LOAD.W D3,(A4)+ORAQEL JUMP,NC 50$ NEG.W D3 50$: LOAD.W D4,(A4)+ORAQIN MUL.WA D4,#3 ADD.W D4,D3 ;;? ADD.W D4,D3 ADD.W (A5)+OOBVIT+2,D4 ; Fait un bruit de collision avec la raquette. TEST.W (A5)+OOBVIE ; objet en vie ? JUMP,EQ 90$ ; non => 90$ ; oui => LOAD.W D3,(A5)+OOBVIT+0 JUMP,NC 70$ NEG.W D3 ; D3 <-- vitesse verticale absolue 70$: COMP.W D3,#4 ; petite vitesse ? JUMP,LO 90$ ; oui => 90$ ; non => CALL MUS2OBJ ; bruit de collision avec la raquette 90$: CALL MAXVIT ; ne va quand mme pas trop vite LOAD.L D4,D5 ; D4 <-- nouvelle position POPM.L D0..D3,D5 RET ;----------\\ ; RAQDEDANS > ;----------/ ; Regarde si la balle touche la raquette. ; in D5.L position de la balle ; out D7.W EQ => pas de collision avec la raquette ; mod D7.W RAQDEDANS: PUSHM.L D3,D4 PUSH.L (A5)+OOBPOS LOAD.L (A5)+OOBPOS,D5 LOAD.L D3,(A4)+ORAQPO SWAP.W D3 ADD.W D3,#22 SWAP.W D3 LOAD.L D4,#H'10000*(IDYRAQ-22)+IDXRAQ CALL DETOBJ ; nouvel objet dans la raquette ? POP.L (A5)+OOBPOS POPM.L D3,D4 TEST.W D7 ; retour EQ/NE RET ;----------\\ ; RAQDESSUS > ;----------/ ; Remne la balle sur la raquette si par hazard elle est descendue ; en dessous ! ; in D5.L position de la balle ; out D5.L position toujours dessus la raquette ; mod D5.L, D7.W RAQDESSUS: PUSHM.L D0..D4 CALL RAQP1P2 ; D1/D2 <-- points P1/P2 de la raquette LOAD.W D0,(A5)+OOBDIM+2 SR.W D0,#1 SUB.W D1,D0 SUB.W D2,D0 SWAP.W D1 SWAP.W D2 LOAD.W D0,(A5)+OOBDIM+0 SUB.W D1,D0 SUB.W D2,D0 SWAP.W D1 SWAP.W D2 LOAD.L D3,D5 LOAD.L D4,D5 SWAP.W D3 SUB.W D3,#100 SWAP.W D3 SWAP.W D4 ADD.W D4,#100 SWAP.W D4 CALL GAINTERHV ; D0 <-- point d'intersection JUMP,NE 90$ SWAP.W D0 SWAP.W D5 COMP.W D5,D0 ; en dessus de la raquette ? JUMP,LO 50$ ; oui => 50$ LOAD.W D5,D0 ; D4 <-- ramne dessus la raquette (en Y) SUB.W D5,#2 50$: SWAP.W D5 90$: POPM.L D0..D4 RET ;--------\\ ; RAQP1P2 > ;--------/ ; Donne les points P1(y,x) et P2(y,x) qui sont les extrmits ; gauche et droite de la raquette (variable selon l'inclinaison). ; in A4.L ^description de la raquette ; out D1.L point P1(y,x) ; D2.L point P2(y,x) ; mod D1.L, D2.L, D7.W RAQP1P2: PUSHM.L D3,A3 LOAD.L A3,#R16"TAIRAQ LOAD.W D3,(A4)+ORAQIN NEG.W D3 ADD.W D3,#MAXIRAQ SL.W D3,#3 ; D3 <-- *8 car table de 4x .W LOAD.L D1,(A3)+(D3.W)+0 ; D1 <-- P1(y,x) LOAD.L D2,(A3)+(D3.W)+4 ; D2 <-- P2(y,x) ADD.W D1,(A4)+ORAQPO+2 SWAP.W D1 SUB.W D1,#IDYRAQ NEG.W D1 ADD.W D1,(A4)+ORAQPO+0 SWAP.W D1 ADD.W D2,(A4)+ORAQPO+2 SWAP.W D2 SUB.W D2,#IDYRAQ NEG.W D2 ADD.W D2,(A4)+ORAQPO+0 SWAP.W D2 POPM.L D3,A3 RET ; Cette table donne les extrmits de la raquette, qui ; varie selon son inclinaison. ; P1 P2 ; y,x y,x TAIRAQ: .W 62,13 18,57 ; raquette \ .W 59,10 21,60 .W 56,07 24,62 .W 55,06 27,63 .W 52,03 31,62 .W 49,03 34,63 .W 46,01 37,62 .W 41,00 41,63 ; raquette - .W 07,01 45,63 .W 34,01 48,61 .W 31,02 51,60 .W 28,01 54,58 .W 25,02 56,56 .W 22,04 59,53 .W 18,06 62,50 ; raquette / ;--------\\ ; DOWNVIT > ;========/ ; Diminue la vitesse de descente. ; in A5.L ^descripteur de l'objet ; D3.W de combien diminuer ; out - ; mod D7.W DOWNVIT: PUSH.L D4 LOAD.W D4,(A5)+OOBVIT+0 SUB.W D4,D3 JUMP,NC 20$ CLR.W D4 20$: LOAD.W (A5)+OOBVIT+0,D4 POP.L D4 RET ;--------\\ ; UPVIT > ;========/ ; Diminue la vitesse de monte. ; in A5.L ^descripteur de l'objet ; D3.W de combien diminuer ; out - ; mod D7.W UPVIT: PUSH.L D4 LOAD.W D4,(A5)+OOBVIT+0 ADD.W D4,D3 JUMP,NS 20$ CLR.W D4 20$: LOAD.W (A5)+OOBVIT+0,D4 POP.L D4 RET ;---------\\ ; RIGHTVIT > ;=========/ ; Diminue la vitesse vers la droite. ; in A5.L ^descripteur de l'objet ; D3.W de combien diminuer ; out - ; mod D7.W RIGHTVIT: PUSH.L D4 LOAD.W D4,(A5)+OOBVIT+2 SUB.W D4,D3 JUMP,NC 20$ CLR.W D4 20$: LOAD.W (A5)+OOBVIT+2,D4 POP.L D4 RET ;--------\\ ; LEFTVIT > ;========/ ; Diminue la vitesse vers la gauche. ; in A5.L ^descripteur de l'objet ; D3.W de combien diminuer ; out - ; mod D7.W LEFTVIT: PUSH.L D4 LOAD.W D4,(A5)+OOBVIT+2 ADD.W D4,D3 JUMP,NS 20$ CLR.W D4 20$: LOAD.W (A5)+OOBVIT+2,D4 POP.L D4 RET ;--------\\ ; MAXVIT > ;========/ ; Tronque les vitesses pour ne pas aller trop vite ! ; in A5.L ^description de l'objet ; out - ; mod D7.W MAXVIT: PUSH.L D4 LOAD.W D4,(A5)+OOBVIT+2 COMP.W D4,#-MAXVITX JUMP,GE 10$ LOAD.W D4,#-MAXVITX 10$: COMP.W D4,#+MAXVITX JUMP,LE 15$ LOAD.W D4,#+MAXVITX 15$: LOAD.W (A5)+OOBVIT+2,D4 LOAD.W D4,(A5)+OOBVIT+0 COMP.W D4,#-MAXVITY JUMP,GE 20$ LOAD.W D4,#-MAXVITY 20$: COMP.W D4,#+MAXVITY JUMP,LE 25$ LOAD.W D4,#+MAXVITY 25$: LOAD.W (A5)+OOBVIT+0,D4 POP.L D4 RET ;--------\\ ; MOVERAQ > ;========/ ; Dplace la raquette. ; in A4.L ^description de la raquette ; D4.W nouvelle position (x) ; D3.W nouvelle inclinaison (+/-) ; out - ; mod D7.W MOVERAQ: PUSHM.L D1..D5,A5 TEST.B (A6)+OMODE:#BFACILE ; mode facile ? JUMP,BC 02$ ; non => 02$ LOAD.W D4,(A5)+OOBPOS+2 LOAD.W D2,(A5)+OOBDIM+2 SR.W D2,#1 ADD.W D4,D2 SUB.W D4,#IDXRAQ/2 ; D4 <-- juste dessous la balle ! 02$: TEST.B (A6)+OFIXE ; raquette fixe ? JUMP,F 05$ ; non => 05$ LOAD.W D4,#POSXRAQ ; D4 <-- impose la position horizontale 05$: TEST.W (A4)+ORAQEL ; raquette leve ? JUMP,EQ 07$ ; non => 07$ DEC.W (A4)+ORAQEL ; oui => rabaisse-la 07$: SWAP.W D4 LOAD.W D4,#POSYRAQ ; D4 <-- impose la position verticale SUB.W D4,(A4)+ORAQEL ; D4 <-- tient compte d'une ventuelle lvation SWAP.W D4 ; Regarde si la position ou l'inclinaison ont chang. ; Si l'un ou l'autre a chang, il faut redessiner la raquette. COMP.L D4,(A4)+ORAQPO JUMP,NE 10$ COMP.W D3,(A4)+ORAQIN JUMP,EQ 90$ 10$: LOAD.L A5,#(A6)+OBALLE ; Vrifie si la position de la souris n'est ni trop  gauche ; ni trop  droite. LOAD.W D2,(A4)+ORAQDX COMP.W D4,D2 ; souris trop  gauche ? JUMP,GE 25$ LOAD.W D4,D2 25$: LOAD.W D2,(A4)+ORAQFX COMP.W D4,D2 ; souris trop  droite ? JUMP,LE 30$ LOAD.W D4,D2 ; Regarde si l'ancienne ou la nouvelle raquette recoupe, mme ; partiellement, la balle. 30$: LOAD.W D1,#1 ; D1 <-- la balle recoupe la raquette TEST.B (A4)+ORAQET:#BRAQS ; lancement de la balle ? JUMP,BS 35$ ; oui => 35$ PUSHM.L D3,D4 LOAD.L D3,(A4)+ORAQPO LOAD.L D4,#H'10000*IDYRAQ+IDXRAQ CALL DETOBJ ; balle recoupe l'ancienne raquette ? LOAD.W D1,D7 ; D1 <-- zro si pas de collision POPM.L D3,D4 TEST.W D1 JUMP,NE 35$ PUSHM.L D3,D4 LOAD.L D3,D4 LOAD.L D4,#H'10000*IDYRAQ+IDXRAQ CALL DETOBJ ; balle recoupe la nouvelle raquette ? LOAD.W D1,D7 ; D1 <-- zro si pas de collision POPM.L D3,D4 ; Dplace la raquette, en effaant puis en remettant la balle ; si elle recoupe l'ancienne ou la nouvelle raquette. 35$: TEST.W D1 JUMP,EQ 40$ TEST.B (A5)+OOBNEW JUMP,T 40$ CALL INVOBJ ; efface la balle ; Si on est en phase de lancement, met la balle sur la raquette, ; en tenant compte de son inclinaison. 40$: TEST.B (A4)+ORAQET:#BRAQS JUMP,BC 50$ LOAD.L D5,D4 ADD.W D5,#IDXRAQ/2 LOAD.W D2,(A5)+OOBDIM+2 SR.W D2,#1 SUB.W D5,D2 LOAD.W D2,(A4)+ORAQIN ASR.W D2,#1 ADD.W D5,D2 SWAP.W D5 ADD.W D5,#22 SUB.W D5,(A5)+OOBDIM+0 LOAD.W D2,(A4)+ORAQIN JUMP,NC 45$ NEG.W D2 45$: SR.W D2,#1 SUB.W D5,D2 SWAP.W D5 LOAD.L (A5)+OOBPOS,D5 ; met la balle sur la raquette ; Maintenant que la balle est ventuellement enleve, dplace ; l'icne de la raquette. 50$: LOAD.W (A4)+ORAQIN,D3 LOAD.W D2,D3 ; D2 <-- nouvelle inclinaison NEG.W D2 ADD.B D2,(A4)+ORAQIC ; D2 <-- code de l'icne LOAD.L D5,#H'10000*IDYRAQ+IDXRAQ ; D5 <-- dimensions LOAD.L D3,(A4)+ORAQPO ; D3 <-- ancienne position CALL MOVELICONE ; dplace l'icne LOAD.L (A4)+ORAQPO,D4 ; Remet la balle si elle avait t enleve. TEST.W D1 JUMP,EQ 90$ CALL INVOBJ ; remet la balle CLR.B (A5)+OOBNEW 90$: POPM.L D1..D5,A5 RET ;--------\\ ; DETOBJ > ;========/ ; Dtecte si un objet (rectangulaire) entre en collision ; avec une zone rectangulaire quelconque. ; in A5.L ^description de l'objet ; D3.L coin sup/gauche (y;x) ; D4.L dimensions (dy;dx) ; out D7.W EQ => pas de collision ; NE => collision ; mod D7.W DETOBJ: PUSHM.L D2..D4 CLR.W D7 ; D7 <-- pas de collision LOAD.W D2,(A5)+OOBPOS+2 ADD.W D2,(A5)+OOBDIM+2 COMP.W D3,D2 JUMP,HS 90$ SUB.W D2,(A5)+OOBDIM+2 ADD.W D3,D4 COMP.W D3,D2 JUMP,LO 90$ SWAP.W D3 SWAP.W D4 LOAD.W D2,(A5)+OOBPOS+0 ADD.W D2,(A5)+OOBDIM+0 COMP.W D3,D2 JUMP,HS 90$ SUB.W D2,(A5)+OOBDIM+0 ADD.W D3,D4 COMP.W D3,D2 JUMP,LO 90$ LOAD.W D7,#1 ; D7 <-- collision 90$: POPM.L D2..D4 TEST.W D7 ; retour EQ/NE RET ;--------\\ ; INVOBJ > ;========/ ; Inverse un objet. ; in A5.L ^descripteur de l'objet ; out - ; mod D7.W INVOBJ: PUSHM.L D2..D5 CALL GETICONE ; D2 <-- code de l'icne LOAD.B D3,D2 ; D3 <-- code de l'icne LOAD.W D2,#INVDOT ; D2 <-- mode LOAD.L D4,(A5)+OOBPOS ; D4 <-- position LOAD.L D5,(A5)+OOBDIM ; D5 <-- dimensions CALL DRICONE ; inverse l'icne POPM.L D2..D5 RET ;-----------\\ ; MOVEIICONE > ;===========/ ; Dplace une icne sur l'cran en l'inversant. ; in A5.L ^description de l'objet ; D3.L ancienne position (y;x) ; D4.L nouvelle position (y;x) ; D5.L dimensions (dy;dx) ; out - ; mod D7.W MOVEIICONE: PUSHM.L D1..D4 CALL GETICONE ; D2 <-- code de l'ancienne icne LOAD.B D1,D2 ; D1 <-- code de l'ancienne icne CALL AGEICONE ; vieilli l'icne ! CALL GETICONE ; D2 <-- code de la nouvelle icne COMP.L D3,D4 ; nouvelle position = ancienne ? JUMP,NE 20$ COMP.B D1,D2 ; nouvelle icne = ancienne ? JUMP,EQ 90$ ; oui => 90$ 20$: PUSH.L D3 LOAD.B D3,D2 ; D3 <-- code de la nouvelle icne LOAD.W D2,#INVDOT ; D2 <-- mode CALL DRICONE ; dessine la nouvelle icne POP.L D3 TEST.B (A5)+OOBNEW JUMP,T 80$ LOAD.L D4,D3 ; D4 <-- ancienne position LOAD.B D3,D1 ; D3 <-- code de l'ancienne icne LOAD.W D2,#INVDOT ; D2 <-- mode CALL DRICONE ; efface l'ancienne icne 80$: CLR.B (A5)+OOBNEW 90$: POPM.L D1..D4 RET ;---------\\ ; GETICONE > ;=========/ ; Donne le code de l'icne d'un objet. ; in A5.L ^description de l'objet ; out D2.B code de l'icne ; mod D2.L, D7.W GETICONE: PUSH.W D3 LOAD.B D2,(A5)+OOBICO ; D2 <-- code de l'icne TEST.W (A5)+OOBVIE JUMP,NE 90$ LOAD.W D3,(A5)+OOBFIN ADD.B D2,D3 COMP.W D3,#NBANIME JUMP,LS 90$ CLR.B D2 90$: POP.W D3 RET ;---------\\ ; AGEICONE > ;=========/ ; Fait vieillir une icne, jusqu' sa mort ! ; in A5.L ^description de l'objet ; out - ; mod D7.W AGEICONE: PUSH.L D3 COMP.W (A5)+OOBVIE,#-1 ; icne immortelle ? JUMP,EQ 90$ ; oui => 90$ TEST.W (A5)+OOBVIE ; icne morte ? JUMP,EQ 20$ ; oui => 20$ DEC.W (A5)+OOBVIE ; oeuvre inxorable du temps ... JUMP 90$ 20$: ; mort de l'icne => TEST.W (A5)+OOBFIN JUMP,NE 30$ TEST.W (A5)+OOBVIF JUMP,NE 30$ CALL MUS3OBJ ; bruit de la mort de l'objet 30$: LOAD.W D3,(A5)+OOBFIN COMP.W D3,#NBANIME JUMP,LO 40$ SET.B (A5)+OOBOLD JUMP 90$ 40$: INC.W (A5)+OOBVIF COMP.W (A5)+OOBVIF,#VTANIME JUMP,LO 90$ CLR.W (A5)+OOBVIF INC.W (A5)+OOBFIN 90$: POP.L D3 RET ;-----------\\ ; MOVELICONE > ;===========/ ; Dplace une icne sur l'cran en mode "load". ; in D2.B code de l'icne ; D3.L ancienne position (y;x) ; D4.L nouvelle position (y;x) ; D5.L dimensions (dy;dx) ; out - ; mod D7.W MOVELICONE: PUSHM.L D2,D3 CALL MOVECLR ; efface ce qui dpasse LOAD.B D3,D2 ; D3 <-- code de l'icne LOAD.W D2,#SETDOT ; D2 <-- mode "load" CALL DRICONE ; dessine la nouvelle icne POPM.L D2,D3 RET ;--------\\ ; MOVECLR > ;--------/ ; Efface la zone laisse vide aprs un dplacement. ; in D3.L ancienne position (y;x) ; D4.L nouvelle position (y;x) ; D5.L dimensions (dy;dx) ; out - ; mod D7.W MOVECLR: PUSHM.L D3..D5 TEST.L D3 ; ancienne position existe ? JUMP,EQ 90$ ; non => 90$ PUSHM.L D3..D5 SUB.W D4,D3 JUMP,NC 10$ NEG.W D4 10$: COMP.W D4,D5 ; trop loin horizontalement ? JUMP,HS 60$ ; oui => 60$ SWAP.W D3 SWAP.W D4 SWAP.W D5 SUB.W D4,D3 JUMP,NC 15$ NEG.W D4 15$: COMP.W D4,D5 ; trop loin verticalement ? JUMP,HS 60$ ; oui => 60$ POPM.L D3..D5 PUSHM.L D3,D4 SWAP.W D4 SWAP.W D5 LOAD.W D4,D5 SWAP.W D5 SWAP.W D4 COMP.W D3,D4 JUMP,EQ 30$ JUMP,HI 20$ SUB.W D4,D3 CALL DRCLEAR ; efface la zone  gauche JUMP 30$ 20$: SUB.W D4,D3 NEG.W D4 ADD.W D3,D5 SUB.W D3,D4 CALL DRCLEAR ; efface la zone  droite 30$: POPM.L D3,D4 LOAD.W D4,D5 SWAP.W D3 SWAP.W D4 SWAP.W D5 COMP.W D3,D4 JUMP,EQ 90$ JUMP,HI 40$ SUB.W D4,D3 SWAP.W D3 SWAP.W D4 CALL DRCLEAR ; efface la zone en haut JUMP 90$ 40$: SUB.W D4,D3 NEG.W D4 ADD.W D3,D5 SUB.W D3,D4 SWAP.W D3 SWAP.W D4 CALL DRCLEAR ; efface la zone en bas JUMP 90$ 60$: POPM.L D3..D5 LOAD.L D4,D5 CALL DRCLEAR ; efface toute l'ancienne zone 90$: POPM.L D3..D5 RET ; Gestion du tableau de bord ; -------------------------- ;-----------\\ ; NEWSERVICE > ;===========/ ; Cherche qui doit effectuer le service, et clignotte plus ; longtemps en cas de changement de service. ; in - ; out D4.W bit zro indique  qui le service ; mod D4.L, D7.W NEWSERVICE: PUSHM.L D3,A3 CLR.L D4 LOAD.W D4,(A6)+OCONJ ADD.W D4,(A6)+OCONS ; D4 <-- total des points COMP.W D4,#MAXPOINT*2 ; prolongation ? JUMP,HS 10$ ; oui => 10$ (change de service chaque fois) DIV.WU D4,#5 ; non => change toute les 5 balles 10$: LOAD.W D3,#1 ; D3 <-- juste une fois SWAP.W D4 TEST.W D4 JUMP,NE 15$ LOAD.W D3,#5 ; D3 <-- beaucoup car changement de service 15$: SWAP.W D4 20$: LOAD.L A3,#R16"TMUSSERV1 TEST.L D4:#0 JUMP,BC 22$ LOAD.L A3,#R16"TMUSSERV2 22$: CALL PATATRA TEST.L D4:#0 JUMP,BS 30$ CALL JSERVICE ; allume service au joueur JUMP 35$ 30$: CALL SSERVICE ; allume service au SMAKY 35$: PUSH.W D4 LOAD.W D4,#8 NTREL ?DELMS POP.W D4 LOAD.L A3,#R16"TMUSSERV1 TEST.L D4:#0 JUMP,BS 42$ LOAD.L A3,#R16"TMUSSERV2 42$: CALL PATATRA CALL ESERVICE ; teint services PUSH.W D4 LOAD.W D4,#8 NTREL ?DELMS POP.W D4 DEC.W D3 JUMP,NE 20$ 90$: POPM.L D3,A3 RET ;---------\\ ; JSERVICE > ;=========/ ; Allume la case de service du joueur. ; in - ; out - ; mod D7.W JSERVICE: TSET.B (A6)+OSERV:#0 JUMP,BS 20$ CALL IJSERVICE ; allume 20$: TCLR.B (A6)+OSERV:#1 JUMP,BC 30$ CALL ISSERVICE ; teint 30$: RET ;---------\\ ; SSERVICE > ;=========/ ; Allume la case de service du SMAKY. ; in - ; out - ; mod D7.W SSERVICE: TCLR.B (A6)+OSERV:#0 JUMP,BC 20$ CALL IJSERVICE ; teint 20$: TSET.B (A6)+OSERV:#1 JUMP,BS 30$ CALL ISSERVICE ; allume 30$: RET ;---------\\ ; ESERVICE > ;=========/ ; Efface les cases de service. ; in - ; out - ; mod D7.W ESERVICE: TCLR.B (A6)+OSERV:#0 JUMP,BC 20$ CALL IJSERVICE ; teint 20$: TCLR.B (A6)+OSERV:#1 JUMP,BC 30$ CALL ISSERVICE ; teint 30$: RET ;----------\\ ; IJSERVICE > ;----------/ ; Inverse la case de service du joueur. ; in - ; out - ; mod D7.W IJSERVICE: PUSHM.L D3,D4 LOAD.L D3,#H'10000*POSYSJ+POSXSJ LOAD.L D4,#H'10000*13+13 CALL DRINV POPM.L D3,D4 RET ;----------\\ ; ISSERVICE > ;----------/ ; Inverse la case de service du SMAKY. ; in - ; out - ; mod D7.W ISSERVICE: PUSHM.L D3,D4 LOAD.L D3,#H'10000*POSYSS+POSXSS LOAD.L D4,#H'10000*13+13 CALL DRINV POPM.L D3,D4 RET ;----------\\ ; VIECOMPTE > ;==========/ ; Fait clignotter le compteur du gagnant. ; in - ; out - ; mod D7.W VIECOMPTE: PUSH.L D4 INC.W (A6)+OCOMPF COMP.W (A6)+OCOMPF,#6 JUMP,LO 90$ CLR.W (A6)+OCOMPF LOAD.W D4,(A6)+OCONJ COMP.W D4,(A6)+OCONS JUMP,EQ 60$ JUMP,LO 40$ 20$: ; joueur gagne => CALL IJCOMPTE CALL CSCOMPTE JUMP 90$ 40$: ; SMAKY gagne => CALL CJCOMPTE CALL ISCOMPTE JUMP 90$ 60$: ; galit => TEST.W D4 ; zro  zro ? JUMP,EQ 90$ ; oui => 90$ CALL IJCOMPTE CALL ISCOMPTE ; JUMP 90$ 90$: POP.L D4 RET ;---------\\ ; SJCOMPTE > ;=========/ ; Allume le compteur du joueur. ; in - ; out - ; mod D7.W SJCOMPTE: TSET.B (A6)+OCOMP:#0 JUMP,BS 90$ CALL IIJCOMPTE 90$: RET ;---------\\ ; CJCOMPTE > ;=========/ ; Eteint le compteur du joueur. ; in - ; out - ; mod D7.W CJCOMPTE: TCLR.B (A6)+OCOMP:#0 JUMP,BC 90$ CALL IIJCOMPTE 90$: RET ;---------\\ ; IJCOMPTE > ;=========/ ; Inverse le compteur du joueur. ; in - ; out - ; mod D7.W IJCOMPTE: TNOT.B (A6)+OCOMP:#0 CALL IIJCOMPTE RET ;---------\\ ; SSCOMPTE > ;=========/ ; Allume le compteur du SMAKY. ; in - ; out - ; mod D7.W SSCOMPTE: TSET.B (A6)+OCOMP:#1 JUMP,BS 90$ CALL IISCOMPTE 90$: RET ;---------\\ ; CSCOMPTE > ;=========/ ; Eteint le compteur du SMAKY. ; in - ; out - ; mod D7.W CSCOMPTE: TCLR.B (A6)+OCOMP:#1 JUMP,BC 90$ CALL IISCOMPTE 90$: RET ;---------\\ ; ISCOMPTE > ;=========/ ; Inverse le compteur du SMAKY. ; in - ; out - ; mod D7.W ISCOMPTE: TNOT.B (A6)+OCOMP:#1 CALL IISCOMPTE RET ;----------\\ ; IIJCOMPTE > ;----------/ ; Inverse la case du compteur du joueur. ; in - ; out - ; mod D7.W IIJCOMPTE: PUSHM.L D3,D4 LOAD.L D3,#H'10000*(POSYCJ-12)+(POSXCJ-2) LOAD.L D4,#H'10000*15+23 CALL DRINV POPM.L D3,D4 RET ;----------\\ ; IISCOMPTE > ;----------/ ; Inverse la case du compteur du SMAKY. ; in - ; out - ; mod D7.W IISCOMPTE: PUSHM.L D3,D4 LOAD.L D3,#H'10000*(POSYCS-12)+(POSXCS-2) LOAD.L D4,#H'10000*15+23 CALL DRINV POPM.L D3,D4 RET ;---------\\ ; SCOMPTE > ;=========/ ; Affiche le compteur du SMAKY. ; in - ; out - ; mod D7.W SCOMPTE: PUSHM.L D4 CALL CSCOMPTE ; teint le compteur LOAD.W D4,(A6)+OCONS LOAD.L D3,#H'10000*POSYCS+POSXCS CALL MAJCOMPTE POPM.L D4 RET ;---------\\ ; JCOMPTE > ;=========/ ; Affiche le compteur du joueur. ; in - ; out - ; mod D7.W JCOMPTE: PUSHM.L D4 CALL CJCOMPTE ; teint le compteur LOAD.W D4,(A6)+OCONJ LOAD.L D3,#H'10000*POSYCJ+POSXCJ CALL MAJCOMPTE POPM.L D4 RET ;----------\\ ; MAJCOMPTE > ;----------/ ; Affiche un compteur sur l'cran. ; in D4.W compteur (..n) ; D3.L position dans l'cran ; out - ; mod D7.W MAJCOMPTE: PUSHM.L D2..D4 LOAD.L D2,D3 TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,F 20$ LOAD.B D3,#AFINV LIB ?AFCAR ; passe en vide inverse 20$: LOAD.L D3,D2 LIB ?SETCURS AND.L D4,#H'FFFF DIV.WU D4,#100 CLR.W D4 SWAP.W D4 ; D4 <-- 0..99 DIV.WU D4,#10 LOAD.B D3,D4 ADD.B D3,#'0 LIB ?AFCAR ; affiche les dizaines LOAD.L D3,D2 ADD.W D3,#13 LIB ?SETCURS SWAP.W D4 LOAD.B D3,D4 ADD.B D3,#'0 LIB ?AFCAR ; affiche les units LOAD.B D3,#AFDIR LIB ?AFCAR POPM.L D2..D4 RET ; Routines de GA (gomtrie analytique) ; ------------------------------------- ;----------\\ ; GAINTERHV > ;==========/ ; Trouve le point d'intersection d'une droite quelconque P1(y,x)-P2(y,x) ; avec une droite horizontale ou verticale P3(y,x)-P4(y,x). ; in D1.L P1(y,x) ; D2.L P2(y,x) ; D3.L P3(y,x) ; D4.L P4(y,x) ; out D0.L I(y,x) ; D7.W erreur ; mod D0.L, D7.W GAINTERHV: PUSHM.L D1..D4 LOAD.W D7,#1 ; D7 <-- erreur COMP.W D3,D4 ; droite verticale ? JUMP,EQ 50$ SWAP.W D3 SWAP.W D4 COMP.W D3,D4 ; droite horizontale ? JUMP,NE 90$ SWAP.W D4 SWAP.W D3 ; droite horizontale => LOAD.L D0,D3 CALL GAINTERH JUMP,NE 90$ EX.L D0,D3 ; D0 <-- I(y,x) LOAD.W D7,#1 COMP.W D0,D3 JUMP,LO 90$ COMP.W D0,D4 JUMP,HS 90$ CLR.W D7 ; D7 <-- ok JUMP 90$ 50$: ; droite verticale => LOAD.L D0,D3 CALL GAINTERV JUMP,NE 90$ EX.L D0,D3 ; D0 <-- I(y,x) LOAD.W D7,#1 SWAP.W D0 SWAP.W D3 SWAP.W D4 COMP.W D0,D3 JUMP,LO 90$ COMP.W D0,D4 JUMP,HS 90$ SWAP.W D0 CLR.W D7 ; D7 <-- ok 90$: POPM.L D1..D4 TEST.W D7 ; retour EQ/NE RET ;---------\\ ; GAINTERH > ;---------/ ; Trouve le point d'intersection d'une droite P1(y,x)-P2(y,x) ; quelconque avec une droite horizontale. ; (P2x-P1x) * (Iy-P1y) ; Ix = ---------------------- + P1x ; (P2y-P1y) ; in D1.L P1(y,x) ; D2.L P2(y,x) ; D3.L I(y,?) ; out D3.L I(y,x) ; D7.W erreur ; mod D3.L, D7.W GAINTERH: SWAP.W D1 SWAP.W D2 ; swap x <--> y SWAP.W D3 CALL GAINTERV ; comme si vertical ! SWAP.W D3 SWAP.W D2 ; swap y <--> x SWAP.W D1 TEST.W D7 ; retour EQ/NE RET ;---------\\ ; GAINTERV > ;---------/ ; Trouve le point d'intersection d'une droite P1(y,x)-P2(y,x) ; quelconque avec une droite verticale. ; (P2y-P1y) * (Ix-P1x) ; Iy = ---------------------- + P1y ; (P2x-P1x) ; in D1.L P1(y,x) ; D2.L P2(y,x) ; D3.L I(?,x) ; out D3.L I(y,x) ; D7.W erreur ; mod D3.L, D7.W GAINTERV: PUSHM.L D0..D2 LOAD.W D7,#1 ; D7 <-- erreur SUB.W D2,D1 ; D2 <-- P2x-P1x JUMP,EQ 90$ SWAP.W D1 SWAP.W D2 SUB.W D2,D1 ; D2 <-- P2y-P1y SWAP.W D1 LOAD.W D0,D3 SUB.W D0,D1 ; D0 <-- Ix-P1x MUL.WA D0,D2 ; D2 <-- (P2y-P1) * (Ix-P1x) SWAP.W D2 DIV.WA D0,D2 SWAP.W D1 ADD.W D0,D1 SWAP.W D3 LOAD.W D3,D0 ; D3 <-- Iy SWAP.W D3 CLR.W D7 ; D7 <-- ok 90$: POPM.L D0..D2 TEST.W D7 ; retour EQ/NE RET ; Gestion des bruits ; ------------------ ;--------\\ ; MUS1OBJ > ;========/ ; Fait entendre un bruit numro 1 li  un objet spcifique. ; in A5.L ^description de l'objet ; out - ; mod D7.W MUS1OBJ: PUSH.L A3 LOAD.L A3,#R16"TMUS ADD.W A3,(A5)+OOBMU1 CALL PATATRA POP.L A3 RET ;--------\\ ; MUS2OBJ > ;========/ ; Fait entendre un bruit numro 2 li  un objet spcifique. ; in A5.L ^description de l'objet ; out - ; mod D7.W MUS2OBJ: PUSH.L A3 LOAD.L A3,#R16"TMUS ADD.W A3,(A5)+OOBMU2 CALL PATATRA POP.L A3 RET ;--------\\ ; MUS3OBJ > ;========/ ; Fait entendre un bruit numro 3 li  un objet spcifique. ; in A5.L ^description de l'objet ; out - ; mod D7.W MUS3OBJ: PUSH.L A3 LOAD.L A3,#R16"TMUS ADD.W A3,(A5)+OOBMU3 CALL PATATRA POP.L A3 RET ;--------\\ ; PATATRA > ;========/ ; Fait un bruit rigolo ! ; in A3.L ^table de bruit ; out - ; mod D7.W PATATRA: PUSH.L A4 LOAD.L A4,A3 TEST.W (A4) JUMP,EQ 90$ LIB ?PLAY 90$: POP.L A4 RET TMUS: TMUSCOLB1: .W PERIODE+3000,PERIODE+3001,PERIODE+3002,H'100*20+0 .W 0 TMUSCOLR1: .W PERIODE+2000,PERIODE+2001,PERIODE+2002,H'100*20+0 .W 0 TMUSENDB1: .W PERIODE+3567,PERIODE+3254,BRUIT+31,H'100*50+0 .W 0 TMUSCOLBRI1: .W PERIODE+3000,PERIODE+3001,PERIODE+3002,H'100*10+0 .W 0 TMUSCOLBRI2: .W BRUIT+4,SILENCE,SILENCE,H'100*50+0 .W 0 TMUSSERV1: .W NOTE+OCTAVE*6,NOTE+OCTAVE*5,NOTE+OCTAVE*4,H'100*10+0 .W 0 TMUSSERV2: .W NOTE+OCTAVE*5,NOTE+OCTAVE*4,NOTE+OCTAVE*3,H'100*10+0 .W 0 TMUSSERVICE: .W PERIODE+1000,SILENCE,SILENCE,H'100*255+2 .W PERIODE+900,SILENCE,SILENCE,H'100*255+2 .W PERIODE+800,SILENCE,SILENCE,H'100*255+2 .W PERIODE+700,SILENCE,SILENCE,H'100*255+2 .W PERIODE+600,SILENCE,SILENCE,H'100*255+2 .W PERIODE+500,SILENCE,SILENCE,H'100*255+2 .W PERIODE+400,SILENCE,SILENCE,H'100*255+2 .W PERIODE+300,SILENCE,SILENCE,H'100*255+2 .W PERIODE+200,SILENCE,SILENCE,H'100*255+2 .W PERIODE+100,SILENCE,SILENCE,H'100*2+2 .W 0 TMUSYOUPIE: .W PERIODE+800,PERIODE+400,PERIODE+600,H'100*10+4 .W PERIODE+300,PERIODE+600,PERIODE+400,H'100*10+4 .W PERIODE+250,PERIODE+500,PERIODE+1000,H'100*10+4 .W PERIODE+600,PERIODE+300,PERIODE+400,H'100*10+4 .W PERIODE+1000,PERIODE+500,PERIODE+1500,H'100*10+4 .W PERIODE+500,PERIODE+1000,PERIODE+750,H'100*10+4 .W PERIODE+200,PERIODE+300,PERIODE+400,H'100*10+4 .W PERIODE+400,PERIODE+500,PERIODE+600,H'100*10+1 .W 0 TMUSPERDU: .W NOTE+14,NOTE+12+14,NOTE+14+34,H'100*50+30 .W NOTE+13,NOTE+12+13,NOTE+14+33,H'100*50+30 .W NOTE+12,NOTE+12+12,NOTE+14+32,H'100*50+30 .W NOTE+11,NOTE+12+11,NOTE+14+31,H'100*60+0 .W 0 ; Gestion de la souris ; -------------------- ;--------\\ ; IFMOUSE > ;========/ ; Donne la position de la souris dans la swdo. ; in - ; out D4.L position de la souris (y;x) ; D7.W erreur ; mod D4.L, D7.W IFMOUSE: PUSH.L D3 LIB ?IFMOUSE JUMP',NE 90$ SUB.W D4,(A0)+ODFFX JUMP',HS 20$ CLR.W D4 LOAD.W D7,#ERDIOUT 20$: SWAP.W D4 SUB.W D4,(A0)+ODFFY JUMP',HS 30$ CLR.W D4 LOAD.W D7,#ERDIOUT 30$: SWAP.W D4 90$: POP.L D3 TEST.W D7 ; retour EQ/NE RET ;--------\\ ; PMOUSE > ;========/ ; Positionne la souris en (y;x). ; in D4.L nouvelle position y;x ; out - ; mod D7.W PMOUSE: PUSHM.L D3,D4,D6,A4 LOAD.L (A6)+OMOUPO,D4 ; mm. la position de la souris ADD.W D4,(A0)+ODFFX SWAP.W D4 ADD.W D4,(A0)+ODFFY SWAP.W D4 ; Ramne la position dans la fentre si elle en sort. TEST.W D4 ; trop  gauche ? JUMP',NC 10$ CLR.W D4 10$: COMP.W D4,(A0)+ODFDX ; trop  droite ? JUMP',LT 15$ LOAD.W D4,(A0)+ODFDX DEC.W D4 15$: SWAP.W D4 TEST.W D4 ; trop en haut ? JUMP',NC 20$ CLR.W D4 20$: COMP.W D4,(A0)+ODFDY ; trop en bas ? JUMP',LT 25$ LOAD.W D4,(A0)+ODFDY DEC.W D4 25$: SWAP.W D4 ; Calcul la position absolue dans le grand bitmap $DIS_0. ADD.W D4,(A0)+ODFX SWAP.W D4 ADD.W D4,(A0)+ODFY SWAP.W D4 ; D4 <-- position dans $DIS_0 ! ; Envoie la commande secrte et mystrieuse de positionnement. LOAD.L A4,#(A6)+OBUDIS+1 LOAD.B (A4)+0,#'P ;

LOAD.L (A4)+1,D4 ; CLR.B (A4)+5 LOAD.W D3,#TYPIO ; D3 <-- type du driver souris LIB ?GCHMOU ; D6 <-- canal souris FOS ?COMMAND POPM.L D3,D4,D6,A4 RET ; Routines graphiques rapides ; --------------------------- ;--------\\ ; PREPBRI > ;========/ ; Prpare un caractre pour pouvoir l'animer rapidement ; en mode inverse (petite recette de cuisine secrte) ! ; ATTENTION: On gnre directement la matrice dans le ; gencar, d'o incompatibilit si plusieurs programmes ; utilisent ce mme gencar. ; in D3.B code de l'icne ; out - ; mod D7.W PREPBRI: PUSHM.L D1..D6,A2..A4 LOAD.L A2,(A6)+OPGICO ; A2 <-- ^gencar IMP64 AND.W D3,#H'FF MUL.WU D3,(A2)+OGCMSB LOAD.L A3,#(A2)+OGCMAT ADD.L A3,D3 ; A3 <-- ^matrice source LOAD.L A4,A3 ADD.W A4,(A2)+OGCMSB ; A4 <-- ^matrice destination CLR.W D5 LOAD.B D5,(A2)+OGCMWB ; D5 <-- largeur en bytes LOAD.W D6,D5 LOAD.L D3,#H'10000*IDYBRI CLR.L D4 LOAD.L D1,#H'10000*IDYBRI+IDXBRI LOAD.W D2,#SETDOT CALL DRRASTER LOAD.L A3,A4 LOAD.W D2,#INVDOT CALL DRRASTER POPM.L D1..D6,A2..A4 RET ;--------\\ ; DRICONE > ;========/ ; Dessine une icne de IPP64. ; in D3.B code de l'icne (0..127) ; D4.L position coin inf/gauche (y;x) ; D5.L dimensions (dy;dx) ; D2.W mode ; out - ; mod D7.W DRICONE: PUSHM.L D0..D5,A1,A2,A4 CLR.W D1 LOAD.B D1,D3 ; D1 <-- code de l'icne LOAD.L A4,(A6)+OPGICO ; A4 <-- ^gencar IPP64 LOAD.L D3,D5 ; D3 <-- dimensions CLR.W D5 LOAD.B D5,(A4)+OGCMWB ; D5 <-- largeur en bytes MUL.WU D1,(A4)+OGCMSB ADD.L A4,#OGCMAT ADD.L A4,D1 ; A4 <-- ^la bonne matrice LOAD.W D1,D2 ; D1 <-- mode CLR.B D2 ; D2 <-- pas d'inversion vido COMP.B D1,#INVDOT JUMP,EQ 50$ TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,F 50$ ; non => 50$ NOT.B D2 ; D2 <-- inversion vido 50$: LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADMATRIX CALL (A1) ; appel de GRA_MATRIX POPM.L D0..D5,A1,A2,A4 RET ;--------\\ ; DRRECT > ;========/ ; Dessine un rectangle. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; D2.W mode ; out - ; mod D7.W DRRECT: PUSHM.L D3..D5 LOAD.L D5,D4 ; D5 <-- dimensions (dy;dx) AND.L D4,#H'FFFF CALL DRLINE ; trace ligne suprieure LOAD.L D4,D5 CLR.W D4 CALL DRLINE ; trace ligne de droite LOAD.L D4,D5 AND.L D4,#H'FFFF NEG.W D4 CALL DRLINE ; trace ligne infrieure LOAD.L D4,D5 SWAP.W D4 NEG.W D4 SWAP.W D4 CLR.W D4 CALL DRLINE ; trace ligne de gauche POPM.L D3..D5 RET ;---------\\ ; DRRASTER > ;=========/ ; Dplace une surface rectangulaire mmoire/cran --> mmoire/cran. ; in D3.L coordonne source (y;x) ; A3.L ^mmoire source/^nil si cran ; D5.W Iy source (si mmoire) ; ---- ; D4.L coordonne destination (y;x) ; A4.L ^mmoire destination/^nil si cran ; D6.W Iy destination (si mmoire) ; ---- ; D1.L hauteur/largeur (y;x) ; D2.B opration (INVDOT, SETDOT, CLRDOT ou LOADDOT) ; out - ; mod D7.W DRRASTER: PUSHM.L D1,D2,A1,A2 TEST.W D1 ; dx <= 0 ? JUMP',LE 90$ SWAP.W D1 TEST.W D1 ; dy <= 0 ? JUMP',LE 90$ SWAP.W D1 EX.L D1,D2 ; D2/D1 <-- mode/dimensions LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADRASTER CALL (A1) ; appel de GRA_RASTER 90$: POPM.L D1,D2,A1,A2 RET ;-------\\ ; DRDOT > ;=======/ ; Dessine un point. ; in D3.L coordonne (y;x) ; D2.W mode ; out - ; mod D7.W DRDOT: PUSHM.L D1..D4,A1,A2 LOAD.W D1,D2 ; D1 <-- mode LOAD.L D4,D3 ; D4 <-- y;x LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADDOT CALL (A1) ; appel de GRA_DOT POPM.L D1..D4,A1,A2 RET ;--------\\ ; DRLINE > ;========/ ; Dessine un segment de droite. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; D2.W mode ; out D3.L coordonne d'arrive (y;x) ; mod D3.L, D7.W DRLINE: PUSHM.L D1,D2,D4,A1,A2 LOAD.W D1,D2 ; D1 <-- mode EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADLINE CALL (A1) ; appel de GRA_LINE EX.L D3,D4 ADD.W D3,D4 ; D3 <-- arrive en X SWAP.W D3 SWAP.W D4 ADD.W D3,D4 ; D3 <-- arrive en Y SWAP.W D3 ; SWAP.W D4 POPM.L D1,D2,D4,A1,A2 RET ;----------\\ ; DRELLIPSE > ;==========/ ; Dessine une ellipse, ou un arc d'ellipse. ; in D3.L coordonne centre (y;x) ; D4.L rayons (dy;dx) ; D2.W mode ; D1.B bitmap des octants  dessiner ; out - ; mod D7.W DRELLIPSE: PUSHM.L D1..D4,A1,A2 EX.L D1,D2 ; D2/D1 <-- mode/octants EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADELLIPSE CALL (A1) ; appel de GRA_ELLIPSE POPM.L D1..D4,A1,A2 RET ;---------\\ ; DRTRADEF > ;=========/ ; Dfinit une trame. ; in D3.L trame ; D4.L trame ; out - ; mod D7.W DRTRADEF: PUSHM.L D1..D4 COMP.B (A6)+OMACHINE,#SMAKY100 JUMP',NE 80$ ; si SMAKY100 => LOAD.W D1,#4-1 20$: CALL FLIP RR.L D3,#8 DECJ.W,NMO D1,20$ EX.L D3,D4 LOAD.W D1,#4-1 30$: CALL FLIP RR.L D3,#8 DECJ.W,NMO D1,30$ EX.L D4,D3 80$: LOAD.L (A0)+ODFTRA+0,D3 LOAD.L (A0)+ODFTRA+4,D4 POPM.L D1..D4 RET ;--------\\ ; FLIP > ;--------/ ; Permute tous les bits de D3.B. Pas de boucle pour tre ; rapide, et pas de table de 256 bytes pour conomiser la RAM ! ; in D3.B byte ; out D3.B byte "flipp" ; mod D2.B, D3.B FLIP: RLX.B D3 RRX.B D2 ; D2 <-- bit 0 RLX.B D3 RRX.B D2 ; D2 <-- bit 1 RLX.B D3 RRX.B D2 ; D2 <-- bit 2 RLX.B D3 RRX.B D2 ; D2 <-- bit 3 RLX.B D3 RRX.B D2 ; D2 <-- bit 4 RLX.B D3 RRX.B D2 ; D2 <-- bit 5 RLX.B D3 RRX.B D2 ; D2 <-- bit 6 RLX.B D3 RRX.B D2 ; D2 <-- bit 7 LOAD.B D3,D2 ; D3 <-- byte "flipp" RET ;---------\\ ; DRTRAME > ;=========/ ; Dessine une surface rectangulaire. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; D2.W mode ; out - ; mod D7.W DRTRAME: PUSHM.L D1..D4,A1,A2,A4 TEST.W D4 ; dx <= 0 ? JUMP',LE 90$ SWAP.W D4 TEST.W D4 ; dy <= 0 ? JUMP',LE 90$ SWAP.W D4 LOAD.W D1,D2 ; D1 <-- mode EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A4,#(A0)+ODFTRA ; A4 <-- ^trame utilisateur LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADTRAME CALL (A1) ; appel de GRA_TRAME 90$: POPM.L D1..D4,A1,A2,A4 RET ;--------\\ ; DRZONE > ;========/ ; Efface, allume ou inverse une surface rectangulaire. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; D2.W mode ; out - ; mod D7.W DRZONE: COMP.B D2,#INVDOT JUMP,EQ DRINV COMP.B D2,#SETDOT JUMP,EQ DRSET ;---------\\ ; DRCLEAR > ;=========/ ; Efface une surface rectangulaire. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; out - ; mod D7.W DRCLEAR: TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,T DRSET0 ; oui => DRSET0 DRCLEAR0: PUSHM.L D1..D4,A1,A2 TEST.W D4 ; dx <= 0 ? JUMP',LE 90$ SWAP.W D4 TEST.W D4 ; dy <= 0 ? JUMP',LE 90$ SWAP.W D4 LOAD.W D1,D2 ; D1 <-- mode EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADCLEAR CALL (A1) ; appel de GRA_SET 90$: POPM.L D1..D4,A1,A2 RET ;---------\\ ; DRSET > ;=========/ ; Allume une surface rectangulaire. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; out - ; mod D7.W DRSET: TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,T DRCLEAR0 ; oui => DRCLEAR0 DRSET0: PUSHM.L D1..D4,A1,A2 TEST.W D4 ; dx <= 0 ? JUMP',LE 90$ SWAP.W D4 TEST.W D4 ; dy <= 0 ? JUMP',LE 90$ SWAP.W D4 LOAD.W D1,D2 ; D1 <-- mode EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADSET CALL (A1) ; appel de GRA_SET 90$: POPM.L D1..D4,A1,A2 RET ;---------\\ ; DRINV > ;=========/ ; Inverse une surface rectangulaire. ; in D3.L coordonne origine (y;x) ; D4.L dimensions (dy;dx) ; out - ; mod D7.W DRINV: PUSHM.L D1..D4,A1,A2 TEST.W D4 ; dx <= 0 ? JUMP',LE 90$ SWAP.W D4 TEST.W D4 ; dy <= 0 ? JUMP',LE 90$ SWAP.W D4 LOAD.W D1,D2 ; D1 <-- mode EX.L D3,D4 ; D4/D3 <-- y;x/dy;dx LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADINV CALL (A1) ; appel de GRA_INV 90$: POPM.L D1..D4,A1,A2 RET ;--------\\ ; DRFILL > ;========/ ; Rempli une surface quelconque. ; in D3.L point de remplissage (y;x) ; out D7.W erreur ; mod D7.W DRFILL: PUSHM.L D1..D4,A1,A2 LOAD.L D4,D3 ; D4 <-- y;x LOAD.L A2,A0 ; A2 <-- ^descripteur de la fentre LOAD.L A1,(A6)+OADFILLO CALL (A1) ; appel de GRA_FILLO PUSH.W D7 LOAD.L A1,(A6)+OADFILLC CALL (A1) ; appel de GRA_FILLC POP.W D7 POPM.L D1..D4,A1,A2 TEST.W D7 ; retour EQ/NE RET ;--------\\ ; AFIMAGE > ;========/ ; Affiche une image, sans la conserver en mmoire. ; in A3.L ^nom de l'image ; out D7.W erreur ; mod D7.W AFIMAGE: PUSH.L A4 CALL LOADIMAGE ; charge l'image en mmoire JUMP,NE 90$ CALL SHOWIMAGE ; affiche l'image CALL KILLIMAGE ; libre la mmoire 90$: POP.L A4 TEST.W D7 ; retour EQ/NE RET ;----------\\ ; LOADIMAGE > ;==========/ ; Charge une image en mmoire. ; in A3.L ^nom de l'image ; out A4.L ^image ; D4.L dimensions (dy;dx) ; D7.W erreur ; mod A4.L, D7.W, A4.L LOADIMAGE: PUSHM.L D0,D1,D3,D6,A1..A3,A5 LOAD.L A5,A3 ; A5 <-- ^nom de l'image LOAD.L D4,#LGHIMA LOAD.W D1,#MTYPCP GESMEM ?GETMEM ; demande un buffer pour l'en-tte JUMP,NE 90$ LOAD.L A2,A4 ; A2 <-- ^en-tte LOAD.W D3,#2^BOPRD!2^BOPSYS ; D3 <-- mode d'ouverture FOS ?OPEN ; ouvre l'image JUMP,NE 84$ LOAD.L A4,A2 FOS ?RDBYTE ; lit l'en-tte JUMP,NE 82$ COMP.B (A2)+OIMTYP,#H'82 ; image du LAMI ? JUMP',NE 20$ ; non => 20$ ; oui => CLR.B D3 LOAD.L D4,#256 FOS ?SPOS ; saute la stupide en-tte de 256 bytes ! JUMP,NE 82$ LOAD.L D4,#LGHIMA FOS ?RDBYTE ; lit l'en-tte JUMP,NE 82$ 20$: LOAD.W D0,(A2)+OIMDLX ; D0 <-- largeur de l'image LOAD.W D1,(A2)+OIMDLY ; D1 <-- hauteur de l'image LOAD.W D4,D0 SR.W D4,#3 MUL.WU D4,D1 ; D4 <-- largeur*hauteur/8 ADD.L D4,#IMLBUF ; D4 <-- rserve pour codage PUSH.W D1 LOAD.W D1,#MTYPCP GESMEM ?GETMEM ; demande un buffer pour toute l'image POPM.W D1 JUMP,NE 82$ LOAD.L A1,#(A4)+IMLBUF ; A1 <-- ^image LOAD.L D4,(A2)+OIMNBB ; D4 <-- longueur  lire TEST.B (A2)+OIMCOD ; image code ? JUMP',NE 30$ ; oui => 30$ ; non => LOAD.L A4,A1 FOS ?RDBYTE ; lit toute l'image dcode JUMP,NE 80$ JUMP' 35$ 30$: FOS ?RDBYTE ; lit toute l'image code JUMP,NE 80$ LOAD.L A3,A1 GRA_ DECOIMA ; dcode l'image ... JUMP,NE 80$ 35$: TEST.B (A6)+OINV ; fond de l'cran blanc ? JUMP,T 40$ ; oui => 40$ CALL INVIMAGE ; inverse compltement l'image 40$: LOAD.L A4,A1 ; A4 <-- ^image LOAD.W D4,D1 SWAP.W D4 LOAD.W D4,D0 ; D4 <-- dimensions de l'image CLR.W D7 ; D7 <-- ok JUMP 82$ 80$: PUSH.W D7 LOAD.L A4,#(A1)-IMLBUF LOAD.W D1,#MTYPCP GESMEM ?GIVMEM ; rend la mmoire de l'image POP.W D7 82$: PUSH.W D7 FOS ?CLOSE ; ferme l'image POP.W D7 84$: PUSHM.L D7,A4 LOAD.L A4,A2 LOAD.W D1,#MTYPCP GESMEM ?GIVMEM ; rend le buffer pour l'en-tete POPM.L D7,A4 90$: POPM.L D0,D1,D3,D6,A1..A3,A5 TEST.W D7 ; retour EQ/NE RET ;----------\\ ; SHOWIMAGE > ;==========/ ; Affiche une image dans la (sous-)fentre. ; Si elle est trop petite, elle est centre au milieu de l'cran. ; Si elle est trop grande, on affiche sa partie centrale. ; in A4.L ^image ; D4.L dimensions (dy;dx) ; out - ; mod D7.W SHOWIMAGE: PUSHM.L D0,D1,D3,D4,A3 LIB ?AFTIM .B NOCURS ; plus de curseur .B EOP ; efface toute la fentre .B 0 .EVEN LOAD.W D0,D4 ; D0 <-- largeur de l'image SWAP.W D4 LOAD.W D1,D4 ; D1 <-- hauteur de l'image LOAD.L A3,#(A6)+OBUDIS ; A3 <-- ^buffer pour DRAWRASTER LOAD.W D3,D0 SR.W D3,#3 LOAD.W (A3)+10,D3 ; source: CLR.W (A3)+20 ; destination: LOAD.L D4,(A0)+ODFFDY ; D4 <-- dimensions de la fentre COMP.W D0,D4 ; image trop large ? JUMP',HI 50$ ; oui => 50$ CLR.W (A3)+2 ; source: LOAD.W (A3)+22,D0 ; image: SUB.W D4,D0 SR.W D4,#1 LOAD.W (A3)+12,D4 ; destination: JUMP' 55$ 50$: SUB.W D0,D4 SR.W D0,#1 LOAD.W (A3)+2,D0 ; source: CLR.W (A3)+12 ; destination: LOAD.W (A3)+22,D4 ; image: 55$: SWAP.W D4 COMP.W D1,D4 ; image trop haute ? JUMP',HI 60$ ; oui => 60$ CLR.W (A3)+4 ; source: LOAD.W (A3)+24,D1 ; image: SUB.W D4,D1 SR.W D4,#1 LOAD.W (A3)+14,D4 ; destination: JUMP' 65$ 60$: SUB.W D1,D4 SR.W D1,#1 LOAD.W (A3)+4,D1 ; source: ; ADD.W (A3)+14,#0 ; destination: LOAD.W (A3)+24,D4 ; image: 65$: LOAD.W (A3)+0,#DRAWRASTER LOAD.L (A3)+6,A4 ; source: CLR.L (A3)+16 ; destination: LOAD.B (A3)+26,#SETDOT ; image: LOAD.W D3,#1+26 ; D3 <-- longueur LIB ?STRING ; affiche l'image POPM.L D0,D1,D3,D4,A3 RET ;----------\\ ; KILLIMAGE > ;==========/ ; Libre la mmoire d'une image. ; in A4.L ^image ; out - ; mod - KILLIMAGE: PUSHM.L D1,D7,A4 LOAD.L A4,#(A4)-IMLBUF LOAD.W D1,#MTYPCP GESMEM ?GIVMEM ; rend la mmoire de l'image POPM.L D1,D7,A4 RET ;---------\ ; INVIMAGE > ;---------/ ; Inverse compltement une image. ; in A1.L ^image ; D0.W largeur ; D1.W hauteur ; out - ; mod D7.W INVIMAGE: PUSHM.L D0,A1 SR.W D0,#3 ; D0 <-- largeur en bytes MUL.WU D0,D1 ; D0 <-- nb total de bytes SR.W D0,#2 ; D0 <-- nb total de .L DEC.W D0 ; D0 <-- -1  cause NMO 20$: NOT.L (A1+) DECJ.W,NMO D0,20$ POPM.L D0,A1 RET ; Tirage de nombres alatoires ; ---------------------------- ;--------\\ ; COUPSAC > ;========/ ; Coup de sac pour le gnrateur alatoire. ; in - ; out - ; mod D7.W COUPSAC: PUSHM.L D3,D4 LIB ?RDCLOCK ; D3/D4 <-- date et heure RR.L D3,#3 RL.L D4,#7 ; savante cuisine NOT.L D3 XOR.L D4,D3 LOAD.L (A6)+OHAZA+0,D3 LOAD.L (A6)+OHAZA+4,D4 LOAD.W D3,#10-1 20$: CALL HAZARD ; tire qq nombres DECJ.W,NMO D3,20$ POPM.L D3,D4 RET ;---------\\ ; MMHAZARD > ;=========/ ; Tire un nombre alatoire (16 bits) compris entre deux bornes. ; in D3.W +/- borne infrieure (min) ; D4.W +/- borne suprieure (max+1) ; out D4.W +/- nombre alatoire: D3 <= n < D4 ; mod D4.L, D7.W MMHAZARD: PUSH.W D2 LOAD.W D2,D4 SUB.W D2,D3 ; D2 <-- sup - inf CALL HAZARD AND.L D4,#H'FFFF DIV.WU D4,D2 SWAP.W D4 ; D4 <-- reste de la division ADD.W D4,D3 POP.W D2 RET ;--------\\ ; HAZARD > ;========/ ; Tire un nombre alatoire de 32 bits. ; On utilise un registre  dcalage de 63 bits, avec un XNOR entre ; les bits 0 et 60 pour calculer le nouveau bit inject. ; in - ; out D4.L nombre ; mod D4.L, D7.W HAZARD: PUSHM.L D2,D3 LOAD.W D2,#32-1 LOAD.L D3,(A6)+OHAZA+0 LOAD.L D4,(A6)+OHAZA+4 10$: TEST.L D4:#1 JUMP,BC 20$ TEST.L D3:#30 JUMP,BC 35$ JUMP 30$ 20$: TEST.L D3:#30 JUMP,BS 35$ 30$: CLRX RRX.L D3,#1 RRX.L D4,#1 JUMP 40$ 35$: SETX RRX.L D3,#1 RRX.L D4,#1 40$: LOAD.L (A6)+OHAZA+0,D3 LOAD.L (A6)+OHAZA+4,D4 DECJ.W,NMO D2,10$ POPM.L D2,D3 RET ; Debug ; ----- DRD0: PUSHM.L D2..D4 LOAD.W D2,#INVDOT LOAD.L D3,D0 SUB.W D3,#10 CLR.L D4 LOAD.W D4,#20 LIB ?DRSEG LOAD.L D3,D0 SWAP.W D3 SUB.W D3,#10 SWAP.W D3 LOAD.W D4,#20 SWAP.W D4 CLR.W D4 LIB ?DRSEG POPM.L D2..D4 RET DRD0C: PUSHM.L D2..D4 LOAD.W D2,#CLRDOT LOAD.L D3,D0 SUB.W D3,#10 CLR.L D4 LOAD.W D4,#20 LIB ?DRSEG LOAD.L D3,D0 SWAP.W D3 SUB.W D3,#10 SWAP.W D3 LOAD.W D4,#20 SWAP.W D4 CLR.W D4 LIB ?DRSEG POPM.L D2..D4 RET AFCOOR: PUSH.L D4 LIB ?AFTIM .ASCIZ " x=" .EVEN CALL AFD4 SWAP.W D4 LIB ?AFTIM .ASCIZ " y=" .EVEN CALL AFD4 POP.L D4 RET AFD4: PUSHM.L D2..D4 AND.L D4,#H'FFFF TEST.W D4 JUMP,NC 20$ LOAD.B D3,#'- LIB ?AFCAR NEG.W D4 20$: LOAD.W D3,#8 LOAD.W D2,#2^BAFDCM LIB ?AFDEC POPM.L D2..D4 RET ; Textes ; ------ TXMENU0: .ASCIZ "" .ASCIZ "Fin" .ASCIZ "Suite des" .ASCIZ "explications ..." .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" TXMENU1: .ASCIZ "" .ASCIZ "Fin" .ASCIZ "" .ASCIZ "Dbut du jeu" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" TXMENU2: .ASCIZ "" .ASCIZ "Fin" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "Aide" TXMENU3: .ASCIZ "" .ASCIZ "Fin" .ASCIZ "" .ASCIZ "Lance la balle" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "" .ASCIZ "Aide" NAIMA: .ASCIZ "PING_AIDE.IMAGE" NRIMA: .ASCIZ "PING_RAQ.IMAGE" NMIMA: .ASCIZ "PING_JEU.IMAGE" NFIMA: .ASCIZ "PING_FIN.IMAGE" .EVEN .END START \ No newline at end of file diff --git a/pixmap.cpp b/pixmap.cpp index 9c518dd..765dd60 100644 --- a/pixmap.cpp +++ b/pixmap.cpp @@ -308,6 +308,7 @@ BOOL CPixmap::Restore() return TRUE; } + void CPixmap::QuickIcon(int channel, int rank, POINT pos) { int num; @@ -376,7 +377,7 @@ void CPixmap::QuickIcon(int channel, int rank, POINT pos) rect.bottom = rect.top + rect.bottom; goto LABEL_1; } - if (g_exploMax <= rank) + if ((int)g_exploMax <= rank) { return; } @@ -432,6 +433,7 @@ LABEL_1: } + // Initialise la palette syst�me. BOOL CPixmap::InitSysPalette() @@ -999,11 +1001,11 @@ BOOL CPixmap::CacheAll(BOOL cache, HWND hWnd, BOOL bFullScreen, BOOL bTrueColor, } else { - *(char*)image = (LXIMAGE) << 64; + + rect.right = LXIMAGE; rect.bottom = LYIMAGE; - rect.left = LOWORD(image); - rect.top = HIWORD(image); - rect.right = HIWORD(image); + rect.left = 0; + rect.top = 0; DrawImage(0, 0, rect, 1); Display(); } @@ -1250,6 +1252,8 @@ BOOL CPixmap::DrawIcon(int chDst, int channel, int rank, POINT pos, int mode, BOOL bMask) { int nbx, nby; + short rank1, rank2, rank3, rank4; + LONG lRank5; RECT rect; HRESULT ddrval; COLORREF oldColor1, oldColor2; @@ -1260,13 +1264,25 @@ BOOL CPixmap::DrawIcon(int chDst, int channel, int rank, POINT pos, { return FALSE; } - + rank1 = g_object[rank * 6]; + rank2 = g_object[rank * 6 + 1]; + rank3 = g_object[rank * 6 + 3]; + rank4 = g_object[rank * 6 + 4] + rank1; + lRank5 = g_object[rank * 6 + 5] + rank2; + pos.x = pos.x + g_object[rank * +2]; } else if (channel == CHELEMENT) { if (g_elementMax <= rank) { return FALSE; } + rank1 = g_element[rank * 6]; + rank2 = g_element[rank * 6 + 1]; + rank3 = g_element[rank * 6 + 3]; + rank4 = g_element[rank * 6 + 4] + rank1; + lRank5 = g_element[rank * 6 + 5] + rank2; + pos.x = pos.x + g_element[rank * 6 + 2]; + } else if (channel == CHBLUPI || channel == CHBLUPI1 || @@ -1277,38 +1293,46 @@ BOOL CPixmap::DrawIcon(int chDst, int channel, int rank, POINT pos, { return FALSE; } + rank1 = g_blupiCh[rank * 6]; + rank2 = g_blupiCh[rank * 6 + 1]; + rank3 = g_blupiCh[rank * 6 + 4] + rank1; + rank4 = g_blupiCh[rank * 6 + 5] + rank2; + lRank5 = g_blupiCh[rank * 6 + 2]; + pos.x = pos.x + g_blupiCh[rank * 6 + 2]; } else { if (channel != CHEXPLO) { - nbx = m_totalDim[channel].x / m_iconDim[channel].x; - nby = m_totalDim[channel].y / m_iconDim[channel].y; if (channel < 0 || channel >= MAXIMAGE) return FALSE; if (m_lpDDSurface[channel] == NULL) return FALSE; if (m_iconDim[channel].x == 0 || m_iconDim[channel].y == 0) return FALSE; + nbx = m_totalDim[channel].x / m_iconDim[channel].x; + nby = m_totalDim[channel].y / m_iconDim[channel].y; if (rank < 0 || rank >= nbx * nby) return FALSE; + } + + if ((int)g_exploMax <= rank) return FALSE; + + rank1 = g_explo[rank * 6]; + rank2 = g_explo[rank * 6 + 1]; + rank3 = g_explo[rank * 6 + 4] + rank1; + rank4 = g_explo[rank * 6 + 4] + rank2; + lRank5 = g_explo[rank * 6 + 2]; + pos.x = pos.x + g_explo[rank * 6 + 2]; } - if (g_exploMax <= rank) return FALSE; - - if ( channel < 0 || channel >= MAXIMAGE ) return FALSE; - if ( m_lpDDSurface[channel] == NULL ) return FALSE; - - if ( m_iconDim[channel].x == 0 || - m_iconDim[channel].y == 0 ) return FALSE; + pos.y = pos.y + rank3; nbx = m_totalDim[channel].x / m_iconDim[channel].x; nby = m_totalDim[channel].y / m_iconDim[channel].y; - if ( rank < 0 || rank >= nbx*nby ) return FALSE; - - rect.left = (rank%nbx)*m_iconDim[channel].x; - rect.top = (rank/nbx)*m_iconDim[channel].y; - rect.right = rect.left + m_iconDim[channel].x; - rect.bottom = rect.top + m_iconDim[channel].y; + rect.left = (rank % nbx) * m_iconDim[channel].x; + rect.top = (rank / nbx) * m_iconDim[channel].y; + rect.right = rect.left + m_iconDim[channel].x; + rect.bottom = rect.top + m_iconDim[channel].y; oldColor1 = m_colorSurface[2*channel+0]; oldColor2 = m_colorSurface[2*channel+1]; diff --git a/resource.h b/resource.h index 6bac520..5d05175 100644 --- a/resource.h +++ b/resource.h @@ -79,6 +79,7 @@ #define TX_BUTTON_SETUP7 156 #define TX_BUTTON_SETUP8 157 #define TX_READINFO 167 +#define TX_WRITENAME 172 #define TX_CONFIRM 174 #define TX_CANCEL 175 #define TX_YES 176