Skip to content

Commit fd7c3f3

Browse files
committed
Update to v0.50.15.
1 parent fe36ab4 commit fd7c3f3

24 files changed

+186
-79
lines changed

Common/Cpp/LifetimeSanitizer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class LifetimeSanitizer{
131131
private:
132132
uint64_t m_token;
133133
void* m_self;
134-
std::string m_name;
134+
const char* m_name;
135135
};
136136

137137

SerialPrograms/Source/CommonFramework/Globals.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ namespace PokemonAutomation{
2222
// misleading version information.
2323
//
2424

25-
const bool IS_BETA_VERSION = true;
25+
const bool IS_BETA_VERSION = false;
2626
const int PROGRAM_VERSION_MAJOR = 0;
2727
const int PROGRAM_VERSION_MINOR = 50;
28-
const int PROGRAM_VERSION_PATCH = 14;
28+
const int PROGRAM_VERSION_PATCH = 15;
2929

3030
const std::string PROGRAM_VERSION_BASE =
3131
"v" + std::to_string(PROGRAM_VERSION_MAJOR) +

SerialPrograms/Source/Kernels/BinaryImageFilters/Kernels_BinaryImage_BasicFilters_Core_64x8_arm64_NEON.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "Kernels_BinaryImage_BasicFilters_Routines.h"
1111
#include "Kernels_BinaryImage_BasicFilters_arm64_NEON.h"
1212

13+
1314
namespace PokemonAutomation{
1415
namespace Kernels{
1516

@@ -24,6 +25,8 @@ void filter_by_mask_64x8_arm64_NEON(
2425
}
2526

2627

28+
29+
2730
void compress_rgb32_to_binary_range_64x8_arm64_NEON(
2831
const uint32_t* image, size_t bytes_per_row,
2932
PackedBinaryMatrix_IB& matrix0, uint32_t mins0, uint32_t maxs0

SerialPrograms/Source/Kernels/BinaryImageFilters/Kernels_BinaryImage_BasicFilters_arm64_NEON.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
#include "Kernels/PartialWordAccess/Kernels_PartialWordAccess_arm64_NEON.h"
1111

12-
#include <iostream>
13-
using std::cout;
14-
using std::endl;
12+
// #include <iostream>
13+
// using std::cout;
14+
// using std::endl;
1515

1616
namespace PokemonAutomation{
1717
namespace Kernels{
@@ -149,8 +149,6 @@ class FilterByMask_arm64_NEON{
149149
const uint32x4_t m_zeros;
150150
};
151151

152-
153-
154152
// Compress given pixels buffer (of up to 64-pixel long) into bit map and store in one uint64_t.
155153
class Compressor_RgbRange_arm64_NEON{
156154
public:
@@ -178,13 +176,14 @@ class Compressor_RgbRange_arm64_NEON{
178176
bits |= convert16(pixels + c) << c;
179177
c += 16;
180178
}
181-
for(; c < count; c += 4){
179+
180+
count %= 16;
181+
for(size_t i = 0; i < count / 4; i++, c+=4){
182182
const uint8x16_t pixel = vld1q_u8((const uint8_t*)(pixels + c));
183183
bits |= convert4(pixel) << c;
184184
}
185185
count %= 4;
186186
if (count){
187-
c -= 4;
188187
PartialWordAccess_arm64_NEON loader(count * sizeof(uint32_t));
189188
const uint8x16_t pixel = loader.load(pixels + c);
190189
const uint64_t mask = ((uint64_t)1 << count) - 1;
@@ -273,6 +272,7 @@ class Compressor_RgbEuclidean_arm64_NEON{
273272
for(size_t i = 0; i < count / 4; i++, c+=4){
274273
bits |= convert4(pixels + c) << c;
275274
}
275+
count %= 4;
276276
if (count){
277277
PartialWordAccess_arm64_NEON loader(count * sizeof(uint32_t));
278278
const uint8x16_t pixel = loader.load(pixels + c);

SerialPrograms/Source/Kernels/Waterfill/Kernels_Waterfill_Session.tpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#include "Kernels/BinaryMatrix/Kernels_SparseBinaryMatrixCore.h"
1717
#include "Kernels_Waterfill_Session.h"
1818

19-
//#include <iostream>
20-
//using std::cout;
21-
//using std::endl;
19+
// #include <iostream>
20+
// using std::cout;
21+
// using std::endl;
2222

2323
namespace PokemonAutomation{
2424
namespace Kernels{

SerialPrograms/Source/NintendoSwitch/DevPrograms/TestProgramSwitch.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@
125125
#include "PokemonLA/Inference/Map/PokemonLA_OutbreakReader.h"
126126
#include "PokemonSV/Programs/Farming/PokemonSV_AuctionFarmer.h"
127127
#include "PokemonLA/Inference/Objects/PokemonLA_MMOQuestionMarkDetector.h"
128-
128+
//#include "PokemonSwSh/Inference/Battles/PokemonSwSh_BattleMenuDetector.h"
129+
#include "PokemonSwSh/MaxLair/Inference/PokemonSwSh_MaxLair_Detect_BattleMenu.h"
130+
#include "PokemonSwSh/MaxLair/Inference/PokemonSwSh_MaxLair_Detect_PokemonSwapMenu.h"
129131

130132

131133
#include <QPixmap>
@@ -277,9 +279,17 @@ void TestProgram::program(MultiSwitchProgramEnvironment& env, CancellableScope&
277279
BotBaseContext context(scope, console.botbase());
278280
VideoOverlaySet overlays(overlay);
279281

282+
#if 0
283+
PokemonSwSh::MaxLairInternal::PokemonSwapMenuReader reader(console, overlay, Language::English);
284+
285+
ImageRGB32 image("20241221-123730238930.png");
286+
287+
double hp[4];
288+
reader.read_hp(image, hp);
289+
#endif
280290

291+
// reader.read_opponent_in_summary(logger, image);
281292

282-
// ImageRGB32 image("Screenshot.png");
283293
// PokemonSwSh::find_selection_arrows(image, 10);
284294

285295

SerialPrograms/Source/NintendoSwitch/Inference/NintendoSwitch_DateReader.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ bool DateReader::detect(const ImageViewRGB32& screen) const{
112112

113113
return true;
114114
}
115+
#if 0
115116
int8_t DateReader::read_hours(Logger& logger, const ImageViewRGB32& screen) const{
116117
if (!detect(screen)){
117118
return -1;
@@ -158,7 +159,9 @@ int8_t DateReader::read_hours(Logger& logger, const ImageViewRGB32& screen) cons
158159
}
159160
return (int8_t)hours;
160161
}
162+
161163
}
164+
#endif
162165

163166

164167
void DateReader::set_hours(
@@ -187,7 +190,9 @@ void DateReader::set_hours(
187190

188191
// Read the hour.
189192
VideoSnapshot snapshot = console.video().snapshot();
190-
int8_t current_hour = read_hours(console.logger(), snapshot);
193+
// int8_t current_hour = read_hours(console, snapshot);
194+
int8_t current_hour = read_date(console, snapshot).second.hour;
195+
191196
if (current_hour < 0){
192197
throw_and_log<FatalProgramException>(
193198
console, ErrorReport::SEND_ERROR_REPORT,

SerialPrograms/Source/NintendoSwitch/Inference/NintendoSwitch_DateReader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class DateReader : public StaticScreenDetector{
3939

4040
// Read the hours (0 - 23) while on the date change window.
4141
// Returns -1 if unable to read.
42-
int8_t read_hours(Logger& logger, const ImageViewRGB32& screen) const;
42+
// int8_t read_hours(Logger& logger, std::shared_ptr<const ImageRGB32> screen) const;
4343

4444
void set_hours(
4545
const ProgramInfo& info, ConsoleHandle& console, BotBaseContext& context,

SerialPrograms/Source/Pokemon/Inference/Pokemon_NameReader.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ OCR::StringMatchResult PokemonNameReader::read_substring(
2929
Language language,
3030
const ImageViewRGB32& image,
3131
const std::vector<OCR::TextColorRange>& text_color_ranges,
32-
double min_text_ratio, double max_text_ratio
32+
double min_text_ratio, double max_text_ratio,
33+
double max_log10p
3334
) const{
3435
return match_substring_from_image_multifiltered(
3536
&logger, language, image, text_color_ranges,
36-
MAX_LOG10P, MAX_LOG10P_SPREAD, min_text_ratio, max_text_ratio
37+
max_log10p, MAX_LOG10P_SPREAD, min_text_ratio, max_text_ratio
3738
);
3839
}
3940

SerialPrograms/Source/Pokemon/Inference/Pokemon_NameReader.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class PokemonNameReader : public OCR::LargeDictionaryMatcher{
3131
Language language,
3232
const ImageViewRGB32& image,
3333
const std::vector<OCR::TextColorRange>& text_color_ranges,
34-
double min_text_ratio = 0.01, double max_text_ratio = 0.50
34+
double min_text_ratio = 0.01, double max_text_ratio = 0.50,
35+
double max_log10p = MAX_LOG10P
3536
) const;
3637

3738
};

0 commit comments

Comments
 (0)