From 987ead98aca9e8b87343741980a30aeeb7f765f7 Mon Sep 17 00:00:00 2001 From: canni2007 Date: Sat, 3 Nov 2007 13:53:10 +0000 Subject: Added missing files :( sry git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/branches/1.0.1@569 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Modis/5000Points/Until5000.dpr | 91 ++++++++++++++ Modis/Blind/Blind.dpr | 102 +++++++++++++++ Modis/Don't_Get_Worse/Hold_The_Line.dpr | 212 ++++++++++++++++++++++++++++++++ Modis/Duell/Duell.dpr | 99 +++++++++++++++ Modis/SDK/ModiSDK.pas | 145 ++++++++++++++++++++++ Modis/SDK/StrUtils.pas | 70 +++++++++++ 6 files changed, 719 insertions(+) create mode 100644 Modis/5000Points/Until5000.dpr create mode 100644 Modis/Blind/Blind.dpr create mode 100644 Modis/Don't_Get_Worse/Hold_The_Line.dpr create mode 100644 Modis/Duell/Duell.dpr create mode 100644 Modis/SDK/ModiSDK.pas create mode 100644 Modis/SDK/StrUtils.pas (limited to 'Modis') diff --git a/Modis/5000Points/Until5000.dpr b/Modis/5000Points/Until5000.dpr new file mode 100644 index 00000000..b826d212 --- /dev/null +++ b/Modis/5000Points/Until5000.dpr @@ -0,0 +1,91 @@ +library Until5000; + +uses + ModiSDK in '..\SDK\ModiSDK.pas'; + +//Gave the Plugins Info +procedure PluginInfo (var Info: TPluginInfo); stdcall; +begin + Info.Name := 'PLUGIN_UNTIL5000_NAME'; + + Info.Creator := 'Whiteshark'; + Info.PluginDesc := 'PLUGIN_UNTIL5000_DESC'; + + //Set to Party Modi Plugin + Info.Typ := 8; + + Info.NumPlayers := 31; + //Options + Info.LoadSong := True; //Whether or not a Song should be Loaded + //Only When Song is Loaded: + Info.ShowScore := True; //Whether or not the Score should be shown + Info.ShowNotes := True; //Whether the Note Lines should be displayed + Info.LoadVideo := True; //Should the Video be loaded ? + Info.LoadBack := True; //Should the Background be loaded ? + + Info.BGShowFull := False; //Whether the Background or the Video should be shown Fullsize + Info.BGShowFull_O := True; //Whether the Background or the Video should be shown Fullsize + + Info.ShowRateBar:= True; //Whether the Bar that shows how good the player was sould be displayed + Info.ShowRateBar_O := True; //Load from Ini whether the Bar should be Displayed + + Info.EnLineBonus := False; //Whether LineBonus Should be enabled + Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled + + //Options even when song is Not loaded + Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn + Info.TeamModeOnly := False; //If True the Plugin can only be Played in Team Mode + Info.GetSoundData := False; //If True the RData Procedure is called when new SoundData is available + Info.Dummy := False; //Should be Set to False... for Updateing Plugin Interface +end; + +//Executed on Game Start //If True Game begins, else Failure +function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall; +begin +Result := True; +end; + +//Executed everytime the Screen is Drawed //If False The Game finishes +function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall; +var +I: Integer; +begin +Result := False; + for I := 0 to PlayerInfo.NumPlayers-1 do + begin + PlayerInfo.Playerinfo[I].Bar := PlayerInfo.Playerinfo[I].Score div 50; + PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Bar; + if (PlayerInfo.Playerinfo[I].Score >=5000) then + Exit; + end; +Result := True; +end; + +//Is Executed on Finish, Returns the Playernum of the Winner +function Finish (var Playerinfo: TPlayerinfo): byte; stdcall; +var + I:Integer; +begin +Result := 0; +for I := 0 to PlayerInfo.NumPlayers-1 do + begin + if (PlayerInfo.Playerinfo[I].Score >=5000) then + begin + Case I of + 0: Result := Result OR 1; + 1: Result := Result OR 2; + 2: Result := Result OR 4; + 3: Result := Result OR 8; + 4: Result := Result OR 16; + 5: Result := Result OR 32; + end; + end; + end; +end; + +exports +PluginInfo, Init, Draw, Finish; + +begin + +end. \ No newline at end of file diff --git a/Modis/Blind/Blind.dpr b/Modis/Blind/Blind.dpr new file mode 100644 index 00000000..c806171d --- /dev/null +++ b/Modis/Blind/Blind.dpr @@ -0,0 +1,102 @@ +library Blind; + +uses + ModiSDK in '..\SDK\ModiSDK.pas'; + +//Gave the Plugins Info +procedure PluginInfo (var Info: TPluginInfo); stdcall; +begin + Info.Name := 'PLUGIN_BLIND_NAME'; + + Info.Creator := 'Whiteshark'; + Info.PluginDesc := 'PLUGIN_BLIND_DESC'; + + //Set to Party Modi Plugin + Info.Typ := 8; + + Info.NumPlayers := 31; + + //Options + Info.LoadSong := True; //Whether or not a Song should be Loaded + //Only When Song is Loaded: + Info.ShowScore := True; //Whether or not the Score should be shown + Info.ShowNotes := False; //Whether the Note Lines should be displayed + Info.LoadVideo := True; //Should the Video be loaded ? + Info.LoadBack := True; //Should the Background be loaded ? + + Info.BGShowFull := False; //Whether the Background or the Video should be shown Fullsize + Info.BGShowFull_O := True; //Whether the Background or the Video should be shown Fullsize + + Info.ShowRateBar:= False; //Whether the Bar that shows how good the player was sould be displayed + Info.ShowRateBar_O := True; //Load from Ini whether the Bar should be Displayed + + Info.EnLineBonus := False; //Whether LineBonus Should be enabled + Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled + + //Options even when song is Not loaded + Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn + Info.TeamModeOnly := False; //If True the Plugin can only be Played in Team Mode + Info.GetSoundData := False; //If True the RData Procedure is called when new SoundData is available + Info.Dummy := False; //Should be Set to False... for Updateing Plugin Interface +end; + +//Executed on Game Start //If True Game begins, else Failure +function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall; +begin +Result := True; +end; + +//Executed everytime the Screen is Drawed //If False The Game finishes +function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall; +var +I: Integer; +begin +Result := True; +end; + +//Is Executed on Finish, Returns the Playernum of the Winner +function Finish (var Playerinfo: TPlayerinfo): byte; stdcall; +var + I:Integer; + MaxScore: Word; +begin + Result := 0; + MaxScore := 0; + for I := 0 to PlayerInfo.NumPlayers-1 do + begin + PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Score div 9999; + if (PlayerInfo.Playerinfo[I].Score > MaxScore) then + begin + MaxScore := PlayerInfo.Playerinfo[I].Score; + Case I of + 0: Result := 1; + 1: Result := 2; + 2: Result := 4; + 3: Result := 8; + 4: Result := 16; + 5: Result := 32; + end; + end + else if (PlayerInfo.Playerinfo[I].Score = MaxScore) AND (PlayerInfo.Playerinfo[I].Score <> 0) then + begin + Case I of + 0: Result := Result OR 1; + 1: Result := Result OR 2; + 2: Result := Result OR 4; + 3: Result := Result OR 8; + 4: Result := Result OR 16; + 5: Result := Result OR 32; + end; + end; + end; + //If everybody has 0 Points nobody Wins + If (MaxScore = 0) then + Result := 0; +end; + +exports +PluginInfo, Init, Draw, Finish; + +begin + +end. \ No newline at end of file diff --git a/Modis/Don't_Get_Worse/Hold_The_Line.dpr b/Modis/Don't_Get_Worse/Hold_The_Line.dpr new file mode 100644 index 00000000..de19858b --- /dev/null +++ b/Modis/Don't_Get_Worse/Hold_The_Line.dpr @@ -0,0 +1,212 @@ +library Hold_The_Line; + +uses + ModiSDK in '..\SDK\ModiSDK.pas', + StrUtils in '..\SDK\StrUtils.pas', + OpenGL12, + Windows; + +var + PointerTex: TSmallTexture; + CountSentences: Cardinal; + Limit: Byte; + MethodRec: TMethodRec; + Frame: Integer; + PlayerTimes: array[0..5] of Integer; + LastTick: Cardinal; + PointerVisible: Boolean; + + DismissedSound: Cardinal; + +//Gave the Plugins Info +procedure PluginInfo (var Info: TPluginInfo); stdcall; +begin + Info.Name := 'PLUGIN_HDL_NAME'; + + Info.Creator := 'Whiteshark'; + Info.PluginDesc := 'PLUGIN_HDL_DESC'; + + //Set to Party Modi Plugin + Info.Typ := 8; + + Info.NumPlayers := 31; + //Options + Info.LoadSong := True; //Whether or not a Song should be Loaded + //Only When Song is Loaded: + Info.ShowScore := True; //Whether or not the Score should be shown + Info.ShowNotes := True; //Whether the Note Lines should be displayed + Info.LoadVideo := True; //Should the Video be loaded ? + Info.LoadBack := True; //Should the Background be loaded ? + + Info.BGShowFull := False; //Whether the Background or the Video should be shown Fullsize + Info.BGShowFull_O := True; //Whether the Background or the Video should be shown Fullsize + + Info.ShowRateBar:= True; //Whether the Bar that shows how good the player was sould be displayed + Info.ShowRateBar_O := False; //Load from Ini whether the Bar should be Displayed + + Info.EnLineBonus := False; //Whether LineBonus Should be enabled + Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled + + //Options even when song is Not loaded + Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn + Info.TeamModeOnly := False; //If True the Plugin can only be Played in Team Mode + Info.GetSoundData := False; //If True the RData Procedure is called when new SoundData is available + Info.Dummy := False; //Should be Set to False... for Updateing Plugin Interface +end; + +//Executed on Game Start //If True Game begins, else Failure +function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall; +var + I: Integer; + Texname, TexType: PChar; +begin + TexName := CreateStr(PChar('HDL_Pointer')); + TexType := CreateStr(PChar('Font Black')); + PointerTex := Methods.LoadTex(TexName, TexType); + + FreeStr(TexName); + FreeStr(TexType); + + TexName := CreateStr(PChar('dismissed.mp3')); + DismissedSound := Methods.LoadSound (TexName); + FreeStr(TexName); + + CountSentences := Sentences.High; + Limit := 0; + Frame := 0; + + MethodRec := Methods; + + for I := 0 to PlayerInfo.NumPlayers-1 do + begin + PlayerInfo.Playerinfo[I].Enabled := True; + PlayerInfo.Playerinfo[I].Percentage := 100; + PlayerTimes[I] := 0; + end; + + LoadOpenGL; + + Result := True; +end; + +//Executed everytime the Screen is Drawed //If False The Game finishes +function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall; +var + I: Integer; + L: Byte; + C: Byte; + Text: PChar; + Blink: Boolean; + tick: Cardinal; +begin + //Aktivate Blink + If (CurSentence = CountSentences div 5 * 2 - 1) OR (CurSentence = CountSentences div 3 * 2 - 1) then + begin + Tick := Gettickcount div 400; + If (Tick <> LastTick) then + begin + LastTick := Tick; + PointerVisible := Not PointerVisible; + end; + end + else + PointerVisible := True; + + //Inc Limit + if (Limit = 0) And (CurSentence >= CountSentences div 5 * 2) then + Inc(Limit) + else if (Limit = 1) And (CurSentence >= CountSentences div 3 * 2) then + Inc(Limit); + + case Limit of + 0: L := 20; + 1: L := 50; + 2: L := 75; + end; + + C:= 0; + + Result := True; + + for I := 0 to PlayerInfo.NumPlayers-1 do + begin + if PlayerInfo.Playerinfo[I].Enabled then + begin + if PlayerInfo.Playerinfo[I].Bar < L then + begin + PlayerInfo.Playerinfo[I].Enabled := False; + Inc(C); + PlayerTimes[I] := CurSentence; //Save Time of Dismission + //PlaySound + MethodRec.PlaySound (DismissedSound); + end; + + //Draw Pointer + if (PointerVisible) then + begin + glColor4f (0.2, 0.8, 0.1, 1); + + glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glBindTexture(GL_TEXTURE_2D, PointerTex.TexNum); + + glBegin(GL_QUADS); + glTexCoord2f(1/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY - 4); + glTexCoord2f(1/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX + L - 3, PlayerInfo.Playerinfo[I].PosY + 12); + glTexCoord2f(31/32, 1); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY + 12); + glTexCoord2f(31/32, 0); glVertex2f(PlayerInfo.Playerinfo[I].PosX+ L + 3, PlayerInfo.Playerinfo[I].PosY - 4); + glEnd; + + glDisable(GL_TEXTURE_2D); + glDisable(GL_BLEND); + end; + + end + else + begin + Inc(C); + //Draw Dismissed + Text := CreateStr(PChar('PARTY_DISMISSED')); + + glColor4f (0.8, 0.8, 0.8, 1); + + MethodRec.Print (1, 6, PlayerInfo.Playerinfo[I].PosX, PlayerInfo.Playerinfo[I].PosY-8, Text); + FreeStr(Text); + end; + end; + if (C >= PlayerInfo.NumPlayers-1) then + Result := False; +end; + +//Is Executed on Finish, Returns the Playernum of the Winner +function Finish (var Playerinfo: TPlayerinfo): byte; stdcall; +var + I:Integer; +begin +Result := 0; +for I := 0 to PlayerInfo.NumPlayers-1 do + begin + PlayerInfo.Playerinfo[I].Percentage := (PlayerTimes[I] * 100) div CountSentences; + if (PlayerInfo.Playerinfo[I].Enabled) then + begin + PlayerInfo.Playerinfo[I].Percentage := 100; + Case I of + 0: Result := Result OR 1; + 1: Result := Result OR 2; + 2: Result := Result OR 4; + 3: Result := Result OR 8; + 4: Result := Result OR 16; + 5: Result := Result OR 32; + end; + end; + end; +end; + +exports +PluginInfo, Init, Draw, Finish; + +begin + +end. \ No newline at end of file diff --git a/Modis/Duell/Duell.dpr b/Modis/Duell/Duell.dpr new file mode 100644 index 00000000..cff9d4ef --- /dev/null +++ b/Modis/Duell/Duell.dpr @@ -0,0 +1,99 @@ +library Duell; + +uses + ModiSDK in '..\SDK\ModiSDK.pas'; + +//Gave the Plugins Info +procedure PluginInfo (var Info: TPluginInfo); stdcall; +begin + Info.Name := 'PLUGIN_DUELL_NAME'; + + Info.Creator := 'Whiteshark'; + Info.PluginDesc := 'PLUGIN_DUELL_DESC'; + + Info.Typ := 8; + + Info.NumPlayers := 31; + //Options + Info.LoadSong := True; //Whether or not a Song should be Loaded + //Only When Song is Loaded: + Info.ShowScore := True; //Whether or not the Score should be shown + Info.ShowNotes := True; //Whether the Note Lines should be displayed + Info.LoadVideo := True; //Should the Video be loaded ? + Info.LoadBack := True; //Should the Background be loaded ? + + Info.BGShowFull := False; //Whether the Background or the Video should be shown Fullsize + Info.BGShowFull_O := True; //Whether the Background or the Video should be shown Fullsize + + Info.ShowRateBar:= False; //Whether the Bar that shows how good the player was sould be displayed + Info.ShowRateBar_O := True; //Load from Ini whether the Bar should be Displayed + + Info.EnLineBonus := False; //Whether LineBonus Should be enabled + Info.EnLineBonus_O := True; //Load from Ini whether LineBonus Should be enabled + + //Options even when song is Not loaded + Info.ShowBars := False; //Whether the White Bars on Top and Bottom should be Drawn + Info.TeamModeOnly := False; //If True the Plugin can only be Played in Team Mode + Info.GetSoundData := False; //If True the RData Procedure is called when new SoundData is available + Info.Dummy := False; //Should be Set to False... for Updateing Plugin Interface +end; + +//Executed on Game Start //If True Game begins, else Failure +function Init (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall; +begin +Result := True; +end; + +//Executed everytime the Screen is Drawed //If False The Game finishes +function Draw (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall; +begin +Result := True; +end; + +//Is Executed on Finish, Returns the Playernum of the Winner +function Finish (var Playerinfo: TPlayerinfo): byte; stdcall; +var + I:Integer; + MaxScore: Word; +begin + Result := 0; + MaxScore := 0; + for I := 0 to PlayerInfo.NumPlayers-1 do + begin + PlayerInfo.Playerinfo[I].Percentage := PlayerInfo.Playerinfo[I].Score div 9999; + if (PlayerInfo.Playerinfo[I].Score > MaxScore) then + begin + MaxScore := PlayerInfo.Playerinfo[I].Score; + Case I of + 0: Result := 1; + 1: Result := 2; + 2: Result := 4; + 3: Result := 8; + 4: Result := 16; + 5: Result := 32; + end; + end + else if (PlayerInfo.Playerinfo[I].Score = MaxScore) AND (PlayerInfo.Playerinfo[I].Score <> 0) then + begin + Case I of + 0: Result := Result OR 1; + 1: Result := Result OR 2; + 2: Result := Result OR 4; + 3: Result := Result OR 8; + 4: Result := Result OR 16; + 5: Result := Result OR 32; + end; + end; + end; + + //When nobody has Points -> Everybody loose + if (MaxScore = 0) then + Result := 0; +end; + +exports +PluginInfo, Init, Draw, Finish; + +begin + +end. \ No newline at end of file diff --git a/Modis/SDK/ModiSDK.pas b/Modis/SDK/ModiSDK.pas new file mode 100644 index 00000000..d8bad0d2 --- /dev/null +++ b/Modis/SDK/ModiSDK.pas @@ -0,0 +1,145 @@ +unit ModiSDK; + +interface + +type //PluginInfo, for Init + TPluginInfo = record + //Info + Name: Array [0..32] of Char; //Modi to Register for the Plugin + Creator: Array [0..32] of Char; //Name of the Author + PluginDesc: Array [0..64] of Char; //Plugin Description + + //Plugin Typ, atm: 8 only for PartyMode Modi + Case Typ: byte of + 8: ( + //Options + LoadSong: boolean; //Whether or not a Song should be Loaded + //Only When Song is Loaded: + ShowNotes: boolean; //Whether the Note Lines should be displayed + LoadVideo: boolean; //Should the Video be loaded ? + LoadBack: boolean; //Should the Background be loaded ? + + ShowRateBar: boolean; //Whether the Bar that shows how good the player was sould be displayed + ShowRateBar_O: boolean; //Load from Ini whether the Bar should be Displayed + + EnLineBonus: boolean; //Whether LineBonus Should be enabled + EnLineBonus_O: boolean; //Load from Ini whether LineBonus Should be enabled + + BGShowFull: boolean; //Whether the Background or the Video should be shown Fullsize + BGShowFull_O: boolean; //Whether the Background or the Video should be shown Fullsize + + //Options -> everytime + ShowScore: boolean; //Whether or not the Score should be shown + ShowBars: boolean; //Whether the White Bars on Top and Bottom should be Drawn + TeamModeOnly: boolean; //If True the Plugin can only be Played in Team Mode + GetSoundData: boolean; //If True the RData Procedure is called when new SoundData is available + Dummy: boolean; //Should be Set to False... for Updateing Plugin Interface + + NumPlayers: Byte //Number of Available Players for Modi + //Set different Bits + //1 -> One Player + //2 -> Two Players + //4 -> Three Players + //8 -> Four Players + //16-> Six Players + //e.g. : 10 -> Playable with 2 and 4 Players + ); + + end; + + TPlayerInfo = record + NumPlayers: Byte; + Playerinfo: array[0..5] of record + Name: PChar; //Name of the Player + Score:Word; //Players Score + Bar: Byte; //Percentage of the SingBar filled + PosX: Real; //PosX of Players SingBar + PosY: Real; //PosY " + Enabled: Boolean; //Whether the Player could get Points + Percentage: Byte; //Percentage Shown on the Score Screen + end; + end; + + TTeamInfo = record + NumTeams: Byte; + Teaminfo: array[0..5] of record + Name: PChar; + Score: Word; + Joker: Byte; + CurPlayer: Byte; + NumPlayers: Byte; + Playerinfo: array[0..3] of record + Name: PChar; + TimesPlayed: Byte; + + end; + end; + end; + + TsmallTexture = record + TexNum: integer; + W: real; + H: real; + end; + + TSentences = record + Akt: integer; // aktualna czesc utworu do rysowania + High: integer; + Ilosc: integer; + Resolution: integer; + NotesGAP: integer; + TotalLength: integer; + Sentence: array of record + Start: integer; + StartNote: integer; + Lyric: string; + LyricWidth: real; + Koniec: integer; + BaseNote: integer; + HighNote: integer; + IlNut: integer; + TotalNotes: integer; + Note: array of record + Color: integer; + Start: integer; + Length: integer; + Ton: integer; + TonGamy: integer; + //Text: string; + FreeStyle: boolean; + Typ: integer; // zwykla nuta x1, zlota nuta x2 + end; + end; + end; + + DWORD = Longword; + HSTREAM = DWORD; + + //Routines to gave to the Plugin + fModi_LoadTex = function (const Name, Typ: PChar): TsmallTexture; stdcall; //Pointer to Texture Loader + //fModi_Translate = function (const Name, Translation: AChar): Integer; stdcall; //Pointer to Translator + fModi_Print = procedure (const Style, Size: Byte; const X, Y: Real; const Text: PChar); stdcall; //Procedure to Print Text //Now translated automatically + fModi_LoadSound = function (const Name: PChar): Cardinal; stdcall; //Procedure that loads a Custom Sound + pModi_PlaySound = procedure (const Index: Cardinal); stdcall; //Plays a Custom Sound + + TMethodRec = record + LoadTex: fModi_LoadTex; + Print: fModi_Print; + LoadSound: fModi_LoadSound; + PlaySound: pModi_PlaySound; + end; + //DLL Funktionen + //Gave the Plugins Info + pModi_PluginInfo = procedure (var Info: TPluginInfo); stdcall; + //Executed on Game Start //If True Game begins, else Failure + fModi_Init = function (const TeamInfo: TTeamInfo; var Playerinfo: TPlayerinfo; const Sentences: TSentences; const Methods: TMethodRec): boolean; stdcall; + //Executed everytime the Screen is Drawed //If False The Game finishes + fModi_Draw = function (var Playerinfo: TPlayerinfo; const CurSentence: Cardinal): boolean; stdcall; + //Is Executed on Finish, Returns the Playernum of the Winner + fModi_Finish = function (var Playerinfo: TPlayerinfo): byte; stdcall; + //Procedure called when new Sound Data is available + pModi_RData = procedure (handle: HSTREAM; buffer: Pointer; len: DWORD; user: DWORD); stdcall; + +implementation + +end. diff --git a/Modis/SDK/StrUtils.pas b/Modis/SDK/StrUtils.pas new file mode 100644 index 00000000..276d95a2 --- /dev/null +++ b/Modis/SDK/StrUtils.pas @@ -0,0 +1,70 @@ +unit StrUtils; + +interface +uses ModiSDK; + +//function StrToAChar(Str: String): AChar; +function CreateStr(Str: PChar): PChar; +procedure FreeStr(Str: PChar); + +implementation + +{function StrToAChar(Str: String): AChar; +var + L, I: Integer; +begin + L := Length(Str); + For I := 0 to L-1 do + AChar[I] := Str[I+1]; + + For I := L to 254 do + AChar[I] := #0; +end; } + +function StrCopy(Dest, Source: PChar): PChar; assembler; +asm + PUSH EDI + PUSH ESI + MOV ESI,EAX + MOV EDI,EDX + MOV ECX,0FFFFFFFFH + XOR AL,AL + REPNE SCASB + NOT ECX + MOV EDI,ESI + MOV ESI,EDX + MOV EDX,ECX + MOV EAX,EDI + SHR ECX,2 + REP MOVSD + MOV ECX,EDX + AND ECX,3 + REP MOVSB + POP ESI + POP EDI +end; + +function StrLen(Str: PChar): Cardinal; assembler; +asm + MOV EDX,EDI + MOV EDI,EAX + MOV ECX,0FFFFFFFFH + XOR AL,AL + REPNE SCASB + MOV EAX,0FFFFFFFEH + SUB EAX,ECX + MOV EDI,EDX +end; + +function CreateStr(Str: PChar): PChar; +begin + GetMem(Result, StrLen(Str) + 1); + StrCopy(Result, Str); +end; + +procedure FreeStr(Str: PChar); +begin + FreeMem(Str); +end; + +end. \ No newline at end of file -- cgit v1.2.3