Git Product home page Git Product logo

pksm-core's People

Contributors

epicpkmn11 avatar fm1337 avatar mrhappyasthma avatar piepie62 avatar snbeast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pksm-core's Issues

Backwards transfer: Language and Character Impossibilities

On backwards transfers, it currently looks like names composed of characters that are impossible to represent in that generation will be completely blank. This should be verified, and if it is the case, should be changed. Low priority, as it shouldn't break anything

PK6->PK7 Marking value not adjusted

In the formats for generations 3-6, markings are stored as single-bitflags as a u8.
In generation 7 and above, markings are stored as bit-pairs as a u16, with 0/1/2 being valid values (off, blue, pink).

When converting from PK6->PK7, the marking value must be adjusted instead of copied. By copying the bits directly, you can end up with invalid marking values (such as 3), which can cause misbehavior in future games.

Logic in question -- scroll to bottom line:

std::unique_ptr<PK7> PK6::convertToG7(Sav& save) const
{
auto pk7 = PKX::getPKM<Generation::SEVEN>(const_cast<u8*>(data));
// markvalue field moved, clear old gen 6 data
pk7->rawData()[0x2A] = 0;
// Bank Data clearing
for (int i = 0x94; i < 0x9E; i++)
pk7->rawData()[i] = 0; // Geolocations
for (int i = 0xAA; i < 0xB0; i++)
pk7->rawData()[i] = 0; // Amie fullness/enjoyment
for (int i = 0xE4; i < 0xE8; i++)
pk7->rawData()[i] = 0; // unused
pk7->rawData()[0x72] &= 0xFC; // low 2 bits of super training
pk7->rawData()[0xDE] = 0; // gen 4 encounter type
pk7->markValue(markValue());

Potential fix would be exposing a bit field in the PKM structs, with gen3-6 being u8 MarkN:1 * 6, and gen7+ being u16 MarkN:2 * 6. Then you can just property copy as 1->1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.