Skip to content

Commit

Permalink
v0.99.8 release (#20)
Browse files Browse the repository at this point in the history
* update update mirror

* support for long presses

* add tcc in compiler toolset

* update updater

* v0.99.8 release
  • Loading branch information
Nigh authored May 15, 2024
1 parent 0341e94 commit 82b2f15
Show file tree
Hide file tree
Showing 101 changed files with 37,053 additions and 36 deletions.
56 changes: 39 additions & 17 deletions DoMiSo.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@ genshin_array_sort(ByRef array)
array_string:=""
For index, v in array
{
array_string .= v.delay "," v.note "`n"
array_string .= v.delay "," v.note "," v.time "`n"
}
Sort, array_string, N
array:={}
Loop, Parse, array_string, `n
{
if(RegExMatch(A_LoopField, "O)(\d+),(\w)", note))
if(RegExMatch(A_LoopField, "O)(\d+),(\w),(\d+)", note))
{
array.Push({"delay":note[1], "note":note[2]})
array.Push({"delay":note[1], "note":note[2], "time":note[3]})
}
}
}
Expand Down Expand Up @@ -164,7 +164,7 @@ genshin_main:
if(!global_mode) {
genshin_win_hwnd:=genshin_window_exist()
}
if(genshin_play_p > genshin_play_array.Length() or (!global_mode && !genshin_win_hwnd))
if(genshin_released_p > genshin_play_array.Length() or (!global_mode && !genshin_win_hwnd))
{
isBtn1Playing:=0
btn1update()
Expand All @@ -173,25 +173,46 @@ if(genshin_play_p > genshin_play_array.Length() or (!global_mode && !genshin_win
}
DllCall("QueryPerformanceCounter", "Int64P", nowTime)
; genshin_window_active(genshin_window_exist())
While(nowTime//(freq/1000)-startTime >= genshin_play_array[genshin_play_p].delay)
deltaMS:=nowTime//(freq/1000)-startTime
While(genshin_released_p <= genshin_play_array.Length() and deltaMS >= genshin_play_array[genshin_released_p].delay+genshin_play_array[genshin_released_p].time)
{
if not genshin_play_array[genshin_play_p].note
if not genshin_play_array[genshin_released_p].note
{
Return
genshin_released_p += 1
Break
}
if(global_mode) {
if WinActive("ahk_id " domiso_active_hwnd)
{
Send, % "{" genshin_play_array[genshin_released_p].note " up}"
}
} else {
if WinActive("ahk_id " genshin_win_hwnd)
{
Send, % "{" genshin_play_array[genshin_released_p].note " up}"
}
}
genshin_released_p += 1
}
While(genshin_pressed_p <= genshin_play_array.Length() and deltaMS >= genshin_play_array[genshin_pressed_p].delay)
{
if not genshin_play_array[genshin_pressed_p].note
{
genshin_pressed_p += 1
Break
}
if(global_mode) {
if WinActive("ahk_id " domiso_active_hwnd)
{
Send, % genshin_play_array[genshin_play_p].note
Send, % "{" genshin_play_array[genshin_pressed_p].note " down}"
}
} else {
if WinActive("ahk_id " genshin_win_hwnd)
{
Send, % genshin_play_array[genshin_play_p].note
Send, % "{" genshin_play_array[genshin_pressed_p].note " down}"
}
}
; ControlSend, ,% genshin_play_array[genshin_play_p].note, ahk_exe GenshinImpact.exe
genshin_play_p += 1
genshin_pressed_p += 1
}
Return

Expand Down Expand Up @@ -237,8 +258,9 @@ GuiDropFiles(GuiHwnd, FileArray, CtrlHwnd, X, Y) {

genshin_play()
{
global startTime, freq, genshin_play_p, isBtn1Playing, global_mode, domiso_active_hwnd, gui_id
genshin_play_p := 1
global startTime, freq, genshin_pressed_p, genshin_released_p, isBtn1Playing, global_mode, domiso_active_hwnd, gui_id
genshin_pressed_p := 1
genshin_released_p := 1
DllCall("QueryPerformanceCounter", "Int64P", nowTime)
domiso_active_hwnd:=0
if(global_mode) {
Expand Down Expand Up @@ -569,8 +591,8 @@ note_parser(tune)
if(noteTune>0) {
Notes.Note(noteTune,noteTime,50).Delay(noteTime)
output.="Notes.Note(" noteTune "," noteTime ",50).Delay(" noteTime ")`n"
genshin_output.="[" Round(genshin_delay) "]-(" genshin_note_map[noteTune] ")`n"
genshin_play_array.Push({"delay":Round(genshin_delay),"note":genshin_note_map[noteTune]})
genshin_output.="[" Round(genshin_delay) "]-(" genshin_note_map[noteTune] ")-{" Round(noteTime) "}`n"
genshin_play_array.Push({"delay":Round(genshin_delay),"time":Round(noteTime),"note":genshin_note_map[noteTune]})
} else {
Notes.Delay(noteTime)
output.="Notes.Delay(" noteTime ")`n"
Expand Down Expand Up @@ -646,7 +668,7 @@ bracket_end_parser(mark)
; chord_cache[A_Index].time
output.="Notes.Note(" chord_cache[A_Index].note "," chordTime ",50)`n"
genshin_output.="[" Round(genshin_delay) "]-(" genshin_note_map[chord_cache[A_Index].note] ")`n"
genshin_play_array.Push({"delay":Round(genshin_delay),"note":genshin_note_map[chord_cache[A_Index].note]})
genshin_play_array.Push({"delay":Round(genshin_delay),"time":Round(chordTime),"note":genshin_note_map[chord_cache[A_Index].note]})
}
Notes.Delay(chordTime)
chord:=0
Expand Down Expand Up @@ -677,7 +699,7 @@ bracket_end_parser(mark)
Notes.Delay(mk*multiplet_cache[A_Index].time)
output.="Notes.Note(" multiplet_cache[A_Index].note "," mk*multiplet_cache[A_Index].time ",50)`n"
genshin_output.="[" Round(genshin_delay) "]-(" genshin_note_map[multiplet_cache[A_Index].note] ")`n"
genshin_play_array.Push({"delay":Round(genshin_delay),"note":genshin_note_map[multiplet_cache[A_Index].note]})
genshin_play_array.Push({"delay":Round(genshin_delay),"time":Round(mk*multiplet_cache[A_Index].time),"note":genshin_note_map[multiplet_cache[A_Index].note]})
genshin_delay+=mk*multiplet_cache[A_Index].time
}
total_beats += mtime/beatTime
Expand Down
Binary file added ahk_compiler/tcc/i386-win32-tcc.exe
Binary file not shown.
170 changes: 170 additions & 0 deletions ahk_compiler/tcc/include/_mingw.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/*
* _mingw.h
*
* This file is for TinyCC and not part of the Mingw32 package.
*
* THIS SOFTWARE IS NOT COPYRIGHTED
*
* This source code is offered for use in the public domain. You may
* use, modify or distribute it freely.
*
* This code is distributed in the hope that it will be useful but
* WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
* DISCLAIMED. This includes but is not limited to warranties of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
*/

#ifndef __MINGW_H
#define __MINGW_H

/* some winapi files define these before including _mingw.h --> */
#undef __cdecl
#undef _X86_
#undef WIN32
/* <-- */

#include <stddef.h>
#include <stdarg.h>

#define __int8 char
#define __int16 short
#define __int32 int
#define __int64 long long
#define _HAVE_INT64

#define __cdecl
#define __declspec(x) __attribute__((x))
#define __unaligned __attribute__((packed))
#define __fastcall __attribute__((fastcall))

#define __MSVCRT__ 1
#undef _MSVCRT_
#define __MINGW_IMPORT extern __declspec(dllimport)
#define __MINGW_ATTRIB_NORETURN
#define __MINGW_ATTRIB_CONST
#define __MINGW_ATTRIB_DEPRECATED
#define __MINGW_ATTRIB_MALLOC
#define __MINGW_ATTRIB_PURE
#define __MINGW_ATTRIB_NONNULL(arg)
#define __MINGW_NOTHROW
#define __GNUC_VA_LIST

#define _CRTIMP extern
#define __CRT_INLINE extern __inline__

#define _CRT_ALIGN(x) __attribute__((aligned(x)))
#define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
#define _CRT_PACKING 8
#define __CRT_UNALIGNED
#define _CONST_RETURN

#ifndef _TRUNCATE
#define _TRUNCATE ((size_t)-1)
#endif

#define __CRT_STRINGIZE(_Value) #_Value
#define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
#define __CRT_WIDE(_String) L ## _String
#define _CRT_WIDE(_String) __CRT_WIDE(_String)

#ifdef _WIN64
#define __stdcall
#define _AMD64_ 1
#define __x86_64 1
#define _M_X64 100 /* Visual Studio */
#define _M_AMD64 100 /* Visual Studio */
#define USE_MINGW_SETJMP_TWO_ARGS
#define mingw_getsp tinyc_getbp
#define __TRY__
#else
#define __stdcall __attribute__((__stdcall__))
#define _X86_ 1
#define _M_IX86 300 /* Visual Studio */
#define WIN32 1
#define _USE_32BIT_TIME_T
#ifdef __arm__
#define __TRY__
#else
#define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec);
#endif
#endif

/* in stddef.h */
#define _SIZE_T_DEFINED
#define _SSIZE_T_DEFINED
#define _PTRDIFF_T_DEFINED
#define _WCHAR_T_DEFINED
#define _UINTPTR_T_DEFINED
#define _INTPTR_T_DEFINED
#define _INTEGRAL_MAX_BITS 64

#ifndef _TIME32_T_DEFINED
#define _TIME32_T_DEFINED
typedef long __time32_t;
#endif

#ifndef _TIME64_T_DEFINED
#define _TIME64_T_DEFINED
typedef long long __time64_t;
#endif

#ifndef _TIME_T_DEFINED
#define _TIME_T_DEFINED
#ifdef _USE_32BIT_TIME_T
typedef __time32_t time_t;
#else
typedef __time64_t time_t;
#endif
#endif

#ifndef _WCTYPE_T_DEFINED
#define _WCTYPE_T_DEFINED
typedef wchar_t wctype_t;
#endif

#ifndef _WINT_T
#define _WINT_T
typedef __WINT_TYPE__ wint_t;
#endif

typedef int errno_t;
#define _ERRCODE_DEFINED

typedef struct threadlocaleinfostruct *pthreadlocinfo;
typedef struct threadmbcinfostruct *pthreadmbcinfo;
typedef struct localeinfo_struct _locale_tstruct,*_locale_t;

/* for winapi */
#define _ANONYMOUS_UNION
#define _ANONYMOUS_STRUCT
#define DECLSPEC_NORETURN
#define DECLARE_STDCALL_P(type) __stdcall type
#define NOSERVICE 1
#define NOMCX 1
#define NOIME 1
#define __INTRIN_H_
#ifndef DUMMYUNIONNAME
# define DUMMYUNIONNAME
# define DUMMYUNIONNAME1
# define DUMMYUNIONNAME2
# define DUMMYUNIONNAME3
# define DUMMYUNIONNAME4
# define DUMMYUNIONNAME5
#endif
#ifndef DUMMYSTRUCTNAME
# define DUMMYSTRUCTNAME
#endif
#ifndef WINVER
# define WINVER 0x0502
#endif
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x502
#endif

#define __C89_NAMELESS
#define __MINGW_EXTENSION
#define WINAPI_FAMILY_PARTITION(X) 1
#define MINGW_HAS_SECURE_API

#endif /* __MINGW_H */
57 changes: 57 additions & 0 deletions ahk_compiler/tcc/include/assert.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef __ASSERT_H_
#define __ASSERT_H_

#include <_mingw.h>
#ifdef __cplusplus
#include <stdlib.h>
#endif

#ifdef NDEBUG
#ifndef assert
#define assert(_Expression) ((void)0)
#endif
#else

#ifndef _CRT_TERMINATE_DEFINED
#define _CRT_TERMINATE_DEFINED
void __cdecl __MINGW_NOTHROW exit(int _Code) __MINGW_ATTRIB_NORETURN;
_CRTIMP void __cdecl __MINGW_NOTHROW _exit(int _Code) __MINGW_ATTRIB_NORETURN;
#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
/* C99 function name */
void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN;
__CRT_INLINE __MINGW_ATTRIB_NORETURN void __cdecl _Exit(int status)
{ _exit(status); }
#endif

#pragma push_macro("abort")
#undef abort
void __cdecl __declspec(noreturn) abort(void);
#pragma pop_macro("abort")

#endif

#ifdef __cplusplus
extern "C" {
#endif


extern void __cdecl _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line);
extern void __cdecl _assert(const char *, const char *, unsigned);

#ifdef __cplusplus
}
#endif

#ifndef assert
//#define assert(_Expression) (void)((!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0))
#define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__))
#endif

#endif

#endif
Loading

0 comments on commit 82b2f15

Please sign in to comment.