earlier:
- struggled to create fastest possible parser, which eventually turned out to be a generated state machine
18.03.2018.
- finished custom step of Meson build
- refactored script a little
- working on enabling test of TookenLookup.cpp
19.03.2018.
- fixed invalid token lookup test generator dependency
- trying to get generated token lookup to compile with the tester
20.03.2018.
- managed to compile null tester
- had to change TokenLookup into header instead of cpp file so Meson would stop compiling it
- trying to create actual tester implementation
21.03.2018.
/
22.03.2018.
/
23.03.2018.
/
24.03.2018.
/
25.03.2018.
/
26.03.2018.
/
27.03.2018.
/
28.03.2018.
/
29.03.2018.
/
30.03.2018.
- added T_EOF handling
- working on tester implementation
01.04.2018.
/
02.04.2018.
- improved tester a bit
03.04.2018.
- implemented test string output (print string split into lines)
04.04.2018.
/
05.04.2018.
/
06.04.2018.
- properly implemented output of test string and test tokens
- got to a point where actual tester function needs to be written
07.04.2018.
- fixed a bug in test tokens output
- tester dummy compiled correctly!
- continuing with tester implementation, switched to raw multi-line strings where applicable
- tester basic function compiled for the first time!
08.04.2018.
- fixed tester crashing :)
- passed tests?!?! IMPOSSIBRU!!
- finished std lib lookup function, setting up performance test
09.04.2018.
- implemented custom hash function
- lookup generator + performance tests FINITO!!! RAWR!
- Meson is retarded, doesn't allow access to output from the tests >< (there's a not a very good workaround)
- found out about gperf & the other tool
- successfully added gperf to build, and verified that it is slower (albeit only slightly)
- other tool is a bit slower than gperf so skipping it (only advantage is it's 100% in C++)
- now creating Meson build for ida2asm, in order to have fully functional Visual Studio project
10.04.2018.
- had to modify Python script to accommodate retarded Meson's hard-coded expectancy about output file locations
- got up to the rest of the parser now, trying to get it compiled
11.04.2018.
- Meson build done, even though it's buggy for VS (doesn't rebuild when Python script changes)
- ida2asm successfully compiled!
- and it's not crashing anymore! :)
12,13.04.2018.
- working on parser, solid progress, hope to finish struct parsing soon
- enabled tokenizer to recognize and report numbers
14.04.2018.
- switched build to x86 (was x64), it can only be done when running Meson from x86 set up VS command prompt
- did some testing, and IFs turn out to be slightly faster than SWITCH (tables probably mess up the cache)
- switched to custom isspace that's 10x faster than the one from std lib (wtf)
- added support for parsing numbers, and debugged it
- in the light of recent changes gperf seems to slightly outperform the state machine
15.04.2018.
- after some changes state machine is beating gperf again :)
- improved custom hash by using binary search, now it's outperforming std::unordered_map in release too
- implemented state machine using ifs instead of switches, but it's just slightly slower
- fixed some bugs in parsing
16.04.2018.
- debugging parser and struct assembling code, getting more quirks resolved
17.04.2018.
- re-consolidated struct handling code
- fixed test (broken with new changes and optimizations)
18.04.2018.
- tested tokens with alignment, almost no difference, it even feels negligibly slower
- made lookupToken return hash for id's as well, performance hit is small
- implemented HashMap to store defines
19.04.2018.
- moved hash function to util and turned it into constexpr; however it came with a big performance hit due to
  recursion, so I made constexpr a second version to use for static strings
- made a template so I can just call constHash("some str") and everything is handled perfectly :)
- fixed includes, Meson already includes directories of generated files automatically
- code to catch custom hash collisions was buggy :) but I don't wanna bother finding collision-free function
- moved parseInt() to Token, it was much more natural fit
- now parsing dot directives
- started work on labels
20.04.2018.
/ (lot to do on my real job :P)
21.04.2018.
/
22.04.2018.
/
23.04.2018.
/
24.04.2018.
/
25.04.2018.
/
26.04.2018.
/
27.04.2018.
/
28.04.2018.
/
29.04.2018.
/
30.04.2018.
/
01.05.2018.
/
02.05.2018.
- planned on adding instructions and 'output lines' in general
03.05.2018.
- worked on expanding parser with [,],comma,+,-,* (will need it for parsing instructions)
04.05.2018.
- finally passed tests with parser extensions
- trying to create some sort of instruction parsing/storing skeleton
05.05.2018.
- worked on instruction storage implementation
06.05.2018.
- working on instruction parsing & related stuff
- added register size field
07.05.2018.
- continuing work on instructions, came up with an idea to use placement new
08.05.2018.
- refactored instructions, used placement new (sooo much better now!), continuing work on parsing
09.05.2018.
/
10.05.2018.
/
11.05.2018.
- attempt to change Token into full fledged class failed miserably
12.05.2018.
- added single-quoted string to tokenizer
13.05.2018.
- a bit of work on data item parsing
14.05.2018.
/
15.05.2018.
- close to finishing data item parsing (for now)
16.05.2018.
- worked on adding dup() support to tokenizer (sheesh)
17.05.2018.
- changed the way number parsing works
- refactored lot of code, it's shorter and more clear now
- finally passed all test with parser dup() extension
- after all the changes it's 25% faster!!! (and I wasn't optimizing at all) :)
- initial collecting of data items seems to work fine
18.05.2018.
- added some cool templates to OutputItem ;)
- eliminated size inside output items themselves, only keeping it at outer output item container
- it occurred to me to run static analysis, it uncovered couple of interesting things
- parsed function local variables and arguments
19.05.2018.
- instructions can have THREE operands... gah, fixing that
- save the comments from ignored entities
- parsing passed for the first time!!
- changed struct parsing code to use placement new as well (ended up with more compact and clear code)
- turned size_t to explicit size type where mattered
- starting work on output machinesZ, for now verbatim (copy input as is) to verify parsing
20.05.2018.
- added measurement of the time whole program took to execute
- made output hierarchy, went into details, file opening, reading into buffer etc.
- added #pragma pack where needed, we were using sizeof() which was returning the size with padding
  (and I later assumed no padding when copying data)
21.05.2018.
- fixed a bug in calculating struct size, a bit of progress in verbatim output
22.05.2018.
- struct output is done & correct!! :)
23.05.2018.
- added support for precompiled headers
- defines outputted correctly!! :)
- filtered original swos.asm in the same way as ida2asm, I can diff like a boss now ;)
24.05.2018.
- set up skeleton for instructions output and outputted some basic elements
- replaced all that ugly duplicated code for size assertion with a cool template
- restructured instruction handling code but now it's crashing... ugh... too late to continue
25.05.2018.
- improved instruction processing a bit, but it's still not working properly
26.05.2018.
- improved instruction processing, it's almost there :) just a few more glitches, I hope :)
27.05.2018.
- turned + into strictly binary operator (numbers can't start with it), since IDA uses it ambiguously (& fixed tests)
- missed that variable after "offset" part can also have its offset ;)
- implemented stack variables output
- implemented data items output
- discovered junk chars in strings... sigh... handled those and added tests as well
- they have a char constant: '\'... >_<
- verbatim output is now close enough! :)
28.05.2018.
- tried assembling with TASM but _no chance_
- set up output class hierarchy to share output code efficiently
- haha MASM swallowed up structs :)
- as well as defines! took some friendly persuasion (ie. editing names in IDA), MASM is picky about keywords
29.05.2018.
- implemented mechanism for removing unneeded procs via a text file (this will be expanded later)
- fixed instruction parameter spacing in output
- fixed a bug when some new lines ended up being non-Windows (\r got eaten)
- gah... found out that stupid MASM needs a command line argument to be case-insensitive
- worked around MASM bug (or *extremely* undocumented area), whereas it seems impossible to initialize an array of
  structures containing array of other structures
30.05.2018.
- MASM regards any label inside proc as local, while IDA doesn't and calls them liberally, so worked around that by
  turning each non-anonymous label inside proc into an empty proc (nested proc's are OK)
- included "assume" into output (since MASM needs it)
- started working on parallelized parser (which should break input file to many separate files too)
31.05.2018.
- worked on breaking parsing into threads... unsuccessfully
01.06.2018.
- implemented parsing units
- implemented error reporting system for parsing units
02.06.2018.
- fixed comments being left out when determining chunk borders (as well as segments)
- set up output system for parsing units
03.06.2018.
- fixed invalid output file forming if only a path without filename is given
- now workers only output disassembly and structs & defines go separately
- wrote a Perl script for creating a cleaned up version of swos.asm for testing if everything's in order
- fixed errors in determining limits of input file chunks
- fixed error in parsing directives with comments
- fixed empty lines at starts of output files
- fixed invalid line numbers when reporting parsing errors
04.06.2018.
- set up string set class to hold references
- decided to go with generic map
- learned that externs require type for MASM, need to redesign solution
05.06.2018.
- implemented generic StringMap template, and wired it to defines (seems to work! :))
- redesigned a bit StringMap and StringSet, added range for loop support, it's cleaner now with less code repetitions
- they can also change size and reallocate now (although we don't want them to do that)
- did some refactoring on asm converter worker, it's much nicer now
- finished reference resolving, but it's untested :)
06.06.2018.
- resolved all externs and publics, sent it to output... but it's not working :)
07.06.2018.
- debugging externs resolving
08.06.2018.
- more debugging of externs resolving
- did a bit of refactoring, const Token is used in sooo many places, so aliased it with CToken
09.06.2018.
- did some research on SWOS palettes (unrelated to this project ;))
- finally output is done without triggering any assertions :P
- got the script for assembling all output files going, fixing all the errors
- everything assembled without an error???
- researched on raylib vs SDL, will go with SDL after all
10.06.2018.
- reverted StringMap<T>::Node to private, now iterator returns special struct type with all the necessary data
- removed duplicate references, seems like it slightly improved performance
- implemented move constructor for StringView
- it's not assembling anything... object files are 230 bytes long...
- I was happy too soon :) include had "end" in it so the assembly stopped before any real output
11.06.2018.
- move segments to labels before resolving references to help cache
- finally fixed bugs in extern matching, now line numbers in MASM errors work again! :)
- however, we're back to fixing assembling errors due to MASM idiosyncrasies
12.06.2018.
- fixed redefined Amiga registers
- fixed broken reference duplicate removal
- switched to MASM 8.0; some errors disappeared :D
- fixed invalid prefix error
13.06.2018.
- removed char * and void * operators from String class, it's safer and more efficient now
- added workaround for weird IDA behaviour of not marking initialized structs with data as struct variables
- added guaranteed EOF token to the end of each unit
- added support for deleting range of functions from the assembly
- so far pieces 2, 3, 4, 7 & 8 are assembling fully!
14.06.2018.
- fixed quoted string parsing, I assumed it would work same as in C, but I was completely wrong
- piece 6 and 1 assembling correctly!
- turns out "assume" directives were causing MASM to freak out and add cs: prefix to almost every instruction :P
  (this made some short jumps fall out of range and cause errors)
- it all REALLY assembled correctly this time!!!
- it's linking _without a single_ warning, whew!
15.06.2018.
- plotted out plan for building the whole thing
- went and manually built SDL2 and belonging libraries
16.06.2018.
- will compile libs manually and just use the resulting lib files (with debug versions as well)
- fixed couple of bugs in ida2asm
- fighting with Meson again
17.06.2018.
- build systems are shit, gonna write my own script
18.06.2018.
/
19.06.2018.
/
20.06.2018.
- gave up on writing script, making Visual Studio project and that's it
- great day, it's all linked together and actually correctly invoking SWOS code!!! :)))
21.06.2018.
- added capability to replace asm functions with imports from C++ to ida2asm
- making ida2asm generate swos.h, better to keep it all in one place
22.06.2018.
- finished symbol file parsing code
- added possibility to remove variables from assembly too (not just procs)
- removed a bunch of useless crap and rerouted SWOS() into C++ :)
23.06.2018.
- fixed export needed by C++ not turning up in publics list if it wasn't needed as public in asm
- implemented a nice templatized class to deal with nasty conversions involved with 68k registers ;)
- advancing toward initial image scrolling
24.06.2018.
- collapsed consecutive anonymous data items to 'x dup(y)' form (shaved of ~300kb and should speed up assembling)
- fixed some invalid code, refactored source a little, made it a bit nicer
  (learned that fread() has max read count that it accepts, 1mb = OK, 10mb = FAIL)
- worked on initial image scrolling, will need palette settings & flipping for this
- SDL is so under-documented, will need to figure out a reliable way to do 70FPS precise enough, as well as
  fast way to scale up to at least 640x480
25.06.2018.
- reading docs, trying to figure out how to get 320x200x8 buffer to the screen (efficiently)
26.06.2018.
- managed to draw intro scrolling images, but palette for two.256 comes out wrong :(
27.06.2018.
- ida2asm now reports if any symbol from symbols.txt wasn't found in the asm file
- allowed data items to spawn ranges too
- drew a menu :) but still can't move cursor
28.06.2018.
- added code for keyboard handling (but it's not working)
- enabled ShowMenu
- had crashes in menu drawing functions, turned out to be caused by some SWOS functions destroying registers
  VC++ expects not to change across function calls; modified ida2asm, added generation of push/pop instructions
  to save and restore those registers and that set it straight
- seems like MASM uses nops (0x90) for alignment instead of zeros in data segment, had a string lose ending zero
  terminator because of it, will need to be more careful since retarded MASM can't be instructed which value to use
- implemented natvis file (debugger instructions) for my custom classes, it works great now
29.06.2018.
- added support for hooking functions (inject call to our function on entry)
- placed replaced symbols into SWOS namespace
- some small refactoring
- discovered that the crash outside IDE was due to joypad controls which weren't patched
- implemented directory listing
- implemented log file
- added macro for invoking SWOS procs with relevant registers preserved (esi is especially problem, since it's used
  in so many places), release version used some registers that got clobbered and crashed
- integrated crash reporter
- finished Bash script for creating backups
30.06.2018.
- fixed palette problem, I'm the retard :D only copied 256 bytes instead of 768
- fixed bug in ida2asm where a data belonging to a menu that landed between the chunks got lost (will detect and
  report it if it ever happens again)
- fixed initial cross fade from images to menu
- added 68k register values to crash report
- implemented text input and made hooks bit more elegant and general
- figured out why it's crashing on Playa's machine: MASM is treating variables as pointers within procs in data
  segment... on my machine it works randomly but overwrites memory all over the place
  fixed it by temporarily switching to cseg if proc isn't inside it
01.07.2018.
- fixed highlights not loading in release mode (LoadFile needs to set zero flag even though it's the only outcome)
- removed int 3 at start from DIYLeagueTournamentMatch (bah)
- fixed a bug in ida2asm's collapsing of contiguous anonymous data items... was only comparing their value but
  not the size... yikes!
- fixed not being able to close program while fading (process events on each palette change)
- added synchronization, not perfect but seems OK for now
- fixed lost leading comments on data items
- fixed errors in stdlib fopen(), seems it didn't like unaligned stack, SWOS was pushing a word, made it push
  dword always
- fixed crash before the game, LoadFile() wasn't returning size in D1 per specification, so a low number was inside,
  causing sprite fixup to be done only partially
02.07.2018.
- fixed a bug in log functions (it was choosing va_list variant over ... for 1 argument, had to rename to logv)
- did some timing experiments (unsuccessfully, it's still too slow/fast, but I'll check swpe it had good sync)
03.07.2018.
- fixed fade out to black from stadium menu when starting the game
04.07.2018.
- debugged in-game crash, I thought pitch memory is maybe getting overwritten, tested it with OllyDbg memory range
  breakpoints, but it turned out to be dead-end; memory isn't overwritten, pointer from pitch dat buffer is read
  beyond end of array, and turns out null (so need to check if fixup routine should fix up that area too or somehow
  it's getting the wrong coordinate (D2 is 57 and I think it shouldn't be over 55))
05.07.2018.
- debugged scrolling routines... I understand them much better now, this is very sloppily written, and the code is
  accessing indices outside the array bounds
06.07.2018.
- fixed in-game crashes, game wasn't clipping pattern drawing, and was reading patterns from nullptr
  and writing them to virtual screen area that was never shown
07.07.2018.
- fixed big S sprite not spinning, and crowd not cheering (now calling equivalent of TimerProc each frame)
- fixed generating weird construct "dword ptr [word ptr ..."
- fixed messed up sprites during the game, thank you OllyDbg! :) animation tables were overwritten by
  ResetResultSprites, since the sizes of ScorerInfo arrays were wrong (wrote wrong MASM expression :/)
- program now utilizes ~0% CPU when paused :)
08.07.2018.
- tried to solve damn goalkeeper position problem, unsuccessfully
09.07.2018.
- solved goalkeeper positions :) IDA was misinterpreting some data in positions array as offsets
- fixed CPU player always shooting too high when near goal
- seems edit tactics menu got fixed along the way :)
10.07.2018.
- setup.dat wasn't loaded if game was ran out of directory
- replaced "QUIT TO DOS" with "QUIT TO WINDOWS" :) & added facility to replace contents of data variables
  with given text in @replace section of symbols.txt
- added assert at startup to check if strings offsets are OK, so it will break if they get messed up again
- fixed darkened colors for result overlay appearing greenish
11.07.2018.
/
12.07.2018.
/
13.07.2018.
- decided to use SDL Mixer library for sound, now need to set it up
14.07.2018.
- SDL Mixer set up, added menu music
15.07.2018.
/
16.07.2018.
/
17.07.2018.
/
18.07.2018.
- fixed nasty crackle at sound init
- fixed too fast sound reproduction (played at invalid frequency)
- fixed slowed down replay of menu music when returning from game
- sound's kinda decent now, but there are still some problems (chants go quiet sometimes, some samples seem not to
  play or get muted sometimes)
19.07.2018.
- sound seems quite all right now, except small weird sound in one of the chants, like a quiet whistle
- got XMI support through ADLMIDI, but it sounds awful, will try compiling it with mingw later
20.07.2018.
- trying to fix choppy XMI music... unsuccessfully...
21.07.2018.
- faded MIDI menu music before the game
- finally found a way to play XMI MIDI properly, it was just a shitty example code :) we'll need advanced buffering
22.07.2018.
- implemented advanced buffering and XMI MIDI is finally playing great :)
- implemented MIDI music loop & fade
23.07.2018.
- fixed MIDI menu music messing up the Windows volume when fading out
- fixed OGG pop when starting music again after the game
24.07.2018.
- removed "short" from branch instructions if they want to jump to external symbol
- preparing for intro, at least got it to stop crashing via stubs :P
25.07.2018.
- added one-time play of title.* song if present as in SWOS CD version
- got the intro to play... psychedelic shapes :P
26.07.2018.
- sound on/off option from command line overrides setup.dat
- added sound to intro (at least it seems so :))
- at least intro now shows a picture that it should before it crashes (albeit quite darkened)
27.07.2018.
/
28.07.
- fixed some stuff in intro, but it's still crashing
- fixed title music playing at game frequency if intro was played
29.07.2018.
- intro is showing proper graphics now, but it's still not working correctly
- added command line options to skip intro and image reels
30.07.2018.
/
31.07.2018.
/
01.07.2018.
- speeded up to 15ms per frame, and implemented dynamic slack calculation
02.07.2018.
/
03.07.2018.
/
04.07.2018.
/
05-06.08.2018.
- banging my head about implementing multi-song ADL player, and keep it super efficient
07.08.2018.
- finally had some success with implementing title XMI song, although it's far from over
08.08.2018.
- XMI seems fine playing multiple songs now :)
- added command line parameter for switching midi bank
09.08.2018.
- fixed fade bug introduced with adding intro (it was so simple... d'oh!)
- ReadFile() is literate now, will write "1 byte" and not "1 bytes" :D
10.08.2018.
- fixed Windows volume for the game going to the max after selecting replay after a friendly match
- fixed title song repeating after going back to menu after a match
- fixed players disappearing on fade-out when aborting match in highlights
- fixed pressing 'R' during replay freezing the game
11.08.2018.
- fixed ida2asm to allow combining on-enter and save-regs actions on a single proc
- fixed invalid leading comment getting assigned to generated instructions from on-enter and save-regs
- trying to fix players disappearing during replay fade (when 'R' is pressed)
12.08.2018.
- finally all fades seem to be fixed, hope nothing else was broken in the process :)
- fixed menu song not playing after game is finished normally (not aborted)
13.08.2018.
/
14.08.2018.
/
15.08.2018.
/
16.08.2018.
- implemented joysticks
17.08.2018.
- intro & image reel can be aborted with joypad buttons too
18.08.2018.
- implemented loading and saving options via ini file
- fixed freeze before the game if there is no menu music
- fixed trying to load menu music indefinitely if there music files are missing
19.08.2018.
- added auto-detection of joypad adding/removal
- JoyKeyOrCtrlPressed detects mouse clicks too
20.08.2018.
- added dead zone options for joypads
21.08.2018.
/
22.08.2018.
/
23.08.2018.
/
24.08.2018.
/
25.08.2018.
- fixed a small bug in ida2asm, when collapsing same db's first one would be skipped if it had leading comments
  (also now collapsing consecutive uninitialized values (? - question marks))
- fixed memory overwrite (was actually allocating a bit less DOS memory than is required)
  ha! seems to have fixed career crash ;) (at least one)
26.08.2018.
- studied why goalkeepers are shit... checked their skill values, and that's fine
27.08.2018.
/
28.08.2018.
/
29.08.2018.
/
30.08.2018.
/
31.08.2018.
/
01.09.2018.
/
02.09.2018.
/
03.09.2018.
- debugging goalkeepers... and they're... fixed?!?!
04.09.2018.
- painstaking analysis of diff files reveals the problem... bloody IDA syntax such as:
    mov ax, [esi+(TeamGeneralInfo+6Ch)]
  makes MASM generate some garbage code (no idea how that even worked without crashing)
  does it interpret it as a struct size? who knows...
- hopefully fixed all occurrences (there were like 5-6-7)
- anyway... fucking goalkeepers work!!! :)
- seems passing is also good now, but will be listening for news
- fixed crash when pausing in highlights
05.09.2018.
- [ida2asm] fixed unnecessary space in front of the label that has "short" removed
- [ida2asm] fixed a small glitch, it wasn't picking up \n at the end of the line in @replace section
06.09.2018.
/
07.09.2018.
- worked on fixing ida2asm invalid file limit determination
08.09.2018.
- worked on rewriting file chunk limit determination routine... until the morning but still failed to
  debug it properly
09.09.2018.
- finally, limit determination routine is much better now! I hope :)
- implemented no-break tags: anything between $no-break{ & $no-break} comments must not be split into different files
- optimized ida2asm a little bit ;) sorted if's in lookupToken() by frequency and tightened OutputWriter::outputTab()
- made sure that function leading comment remains in tact if file chunk limit falls in the middle of it
- trailing comment at the end of the file chunk gets outputted properly instead of disappearing
- moved simpleini.h to include root, all the single *.h files are now there
10.09.2018.
- [ida2asm] implemented check for closing no break tag without matching the opening one (across the files)
- started implementing interface to SWOS menu system
11.09.2018.
/
12.09.2018.
/
13.09.2018.
- worked a bit on menu parser
14.09.2018.
- almost finished initial syntax analysis of menu parser (then what's left are semantics, and output generation)
15.09.2018.
- first part of first part is done ;) will be focusing on finishing just enough of menu parser to get the current
  menu stuff to compile (right now that would be the options menu)
16.09.2018.
/
17.09.2018.
/
18.09.2018.
/
19.09.2018.
/
20.09.2018.
/
21.09.2018.
/
22.09.2018.
/
23.09.2018.
- working on implementing first menu (options), the C++ code output
24.09.2018.
/
25.09.2018.
/
26.09.2018.
/
27.09.2018.
- introduced simple variables and expressions (so we can calculate coordinates)
28.09.2018.
- debugging expressions
29.09.2018.
- began implementing output
- integrated options menu in the project for the first time... and it actually works! :)
30.09.2018.
- templates tested and working
- implemented default entry dimensions (not even template entries could do that)
- entries in options menu are now of proper dimensions
- added assert if entry width or height is zero (makes the game crash)
- implemented entry label forward reference system (the thing that even YASM was lacking)
- implemented entry colors
- expanded built-in variables
01.10.2018.
- implemented callback function syntax
- passed entry symbolic names to C++
- implemented a secret in options menu ;)
- started implementing gameplay options menu
02.10.2018.
- menu variables holding defaults entry coordinates and dimensions are now calculated dynamically -- so now each
  entry gets its own values, enabling easy stacking of entries in regards to their predecessors
- built-in variables contained in user variables are now expanded correctly
- values of properties can now be full expressions
- added support for string tables
- implemented complete gameplay options UI
03.10.2018.
- [ida2asm] separated replace variables into their own namespace (there was a variable both in replace and import)
- implemented range check for variable values loaded from ini file
- added support for STDMENUTEXT (text pointers with value -1, and alias @kAlloc)
- added do not edit warning to the top of the .ini file
- added support for entries that are numbers
- implemented complete audio options UI
04.10.2018.
/
05.10.2018.
- fixed the game crashing if ran from outside the SWOS dir
- contemplated about how to implement video options, that menu should go to render module, now have to
  expand menu parser with includes to implement that nicely
06.10.2018.
- refactored parser to be a class without global variables (in order to implement include easier)
- implemented include directive (but haven't tested it :))
07.10.2018.
- debugged include directive and made it work
- working on implementing video options men, got some kind of outline
- implemented default text flags
08.10.2018.
- implemented function and variable that return text width/height in pixels
- I'm finally satisfied with the look of the video options menu (without resolution list)
09.10.2018.
- implemented display resolution gathering and filtering
10.10.2018.
- implemented #repeat <num.repeats> [, <loop variable] preprocessor directive
- implemented nested repeats
- implemented join directive (for concatenating tokens)
- implemented entry dot property syntax (for amending entry properties later on)
- set up non-dynamic entry order
11.10.2018.
- fixed text width calculation bug
- implemented export keyword to export variables to C++
- implemented resolution list scrolling
- implemented video options variables and their save/load to/from ini file
12.10.2018.
- created variables for video options and implemented loading/saving
- implemented whole video options except custom width/height input
- alt-enter switches to/from fake full screen mode (or real back to window)
13.10.2018.
- implemented custom window width/height input, as well as clamping it to the desktop size
- video options menu fully finished (I think ;))
14.10.2018.
/
15.10.2018.
- connected audio options variables, but it's all untested
16.10.2018.
- debugged audio options variables, made it _mostly_ working
- added "please wait" line while enumerating video modes
- fixed a bug in video options when an entry that becomes hidden was still selected when moving window to other
  monitor (when resolution list was recreated)
17.10.2018.
- added volume control for ADL as well
- implemented mouse selection in menus
- fixed ADL fade out (regression)
- increased the size of pitch patterns buffer (and placed it in a separate array of its own)
18.10.2018.
/
19.10.2018.
- fixed issue with git & swos.asm; git was doing CR/LF conversion and it made ida2asm crash (it was violating some
  assumptions about the file) -- starwindz was downloading the source 7z and it got Linux new lines by defaults
20.10.2018.
- worked on describing SWOS sound reproduction into sound.txt, discovered some new stuff
- fixed not playing intro crowd chants
21.10.2018.
- added crowd chants on/off to audio options menu
- discovered memory overwrite when loading result crowd chant (and it's only loaded when auto-replays are on?!)
  (however it might not be observed in original SWOS due to another bug)
- I think I understand sounds now very well (if not completely), I'll let it sleep over before deciding what
  to do next
22.10.2018.
/
23.10.2018.
- contemplating on new audio implementation
24.10.2018.
- started implementing new audio routines a bit
25.10.2018.
- worked on audio, but didn't make as much progress as I would want, ran into a bug in ida2asm file separation,
  same function ended up in two different files
26.10.2018.
- fixed a bug in ida2asm where it would put same function in two files if limit between files ended up somewhere in
  the function leading comments
27.10.2018.
- finished writing new comment loading code
- added new kind of variable to symbols.txt, functionPointer
28.10.2018.
- removed AIL + C lib + most of CD-ROM routines
- connected sound routines with stubs
- implemented comments & most of sfx, only crowd noise is missing atm
29.10.2018.
- added @insert-hook section to symbols.txt, name of the function comma line number goes there, and it will insert
  a <proc name>_<line number> call to external procedure; it's crapily done, only supports one call per proc but it
  was fairly quick to implement :P
- fixed bug when crowd chant wouldn't get reloaded with auto-replays off
- added more log lines for sound reproduction
- fixed a bug with incorrectly calculating random sample index
30.10.2018.
- fixed sample volumes
- implemented enqueued samples reproduction
- finally, it works nicely with original samples ;) now on to enable custom ones
31.10.2018.
- fixed custom comment loading
- connected header comments :)
- fixed menu song played twice when coming back from the game
- trying to implement delayed loading of samples (first we load data from files into memory, and later convert to
  Mix chunks, if ever needed)
01.11.2018.
- fixed delayed loading of samples, it all works great now
- fixed header comment also being played when CPU does it :)
- fixed same comments being picked twice in a row
02.11.2018.
- commentary categories are now neatly sorted to match the document ;)
- fixed some chants wrongly loaded from hard\*
- rearranged audio options menu
- injury comments are played now
- fixed intro chant not being played
- fixed F8 not turning comments on/off
- increased chants volume a bit
- fixed errors when playing with sound off
03.11.2018.
- fixed penalty comments not being played
- fixed original SWOS bugs with penalty flag staying on (discovered by Michael Mihelakakis)
- removed even more CD-ROM routines (sadly, some small number still remains)
- rewriting MenuProc in C++
04.11.2018.
/
05.11.2018.
/
06.11.2018.
/
07.11.2018.
/
08.11.2018.
/
09.11.2018.
- rewrote MenuProc in C++ (hopefully correctly! :))
10.11.2018.
- moved swossym.h out of source dir into output dir, since it's a generated file
- removed crazy, probably invalid high bit clearing of pitch pattern pointers
- fixed ida2asm file splitting when it has align directive preceding a proc that's on the limit
11.11.2018.
- added prevention of mouse selecting whatever item it is on initially when the program starts
- solved starwindz's problem with pitch (I hope!) :)
12.11.2018.
- fade-out title song at start
- hide the cursor while in borderless window full-screen mode
- crowd background noise (that loops the whole game) is now turned on/off together with chants
- temporarily disabled chairman scenes
- starting converting some of the control functions in order to implement new control methods more easily
13.11.2018.
/
14.11.2018.
- allowed symbol that's removed + imported in ida2asm
- set sensible default values for missing variables in ini file (instead of zeros)
15.11.2018.
- wrote mouse input routine :)
16.11.2018.
/
17.11.2018.
/
18.11.2018.
- learned that sprintf_s _does not_ behave as I expected :/ what I really needed was snprintf
- [mnu2h] implemented #print directive for easier debugging
- [mnu2h] fixed bug when reading x/y menu coordinates (missing "self." :)), and implemented output
- [mnu2h] removed previousProperty mechanism, and I had a feeling I was implementing it for nothing :)
- [mnu2h] added dot directive in order to be able to declare entry properties in terms of other entry properties
- made menus always controllable with keyboard, even when no player has keyboard selected
- implemented joypad data saving to options, at least the bulk of it
19.11.2018.
- implemented joypad data loading, fixed some errors
- fixed mouse ruining other controls (I hope!)
20.11.2018.
- implemented redefine keys "dialog", although it's quite buggy
21.11.2018.
- debugged redefine keys, it works pretty good now
- started implementing on select routines for the actual changing of controls
22.11.2018.
- finished on select routines, fixed some bugs, started (made stub) select joypad menu
23.11.2018.
- [mnu2h] added warning about unused variables (only non-included though)
24.11.2018.
- fixed swapped comment playing functions (foul and dangerous play)
25.11.2018.
- [mnu2h] fixed some bugs and added line number to referencing unknown entry error
26.11.2018.
/
27.11.2018.
/
28.11.2018.
/
29.11.2018.
- struggling with controls
30.11.2018.
- ditto
01.12.2018.
/
02.12.2018.
/
03.12.2018.
/
04.12.2018.
/
05.12.2018.
/
06.12.2018.
/
07.12.2018.
/
08.12.2018.
/
09.12.2018.
/
10.12.2018.
/
11.12.2018.
/
12.12.2018.
/
13.12.2018.
/
14.12.2018.
/
15.12.2018.
- haven't done much, but at least got it to compile again and stop triggering asserts :P
16.12.2018.
/
17.12.2018.
- repositioned config entries and implemented highlighting and enabling/disabling on main controls menu
18.12.2018.
- [mnu2h] fixed handling of next entries if disabled and next direction are given
- [mnu2h] fixed #join directive (was returning one token before the proper one)
- fixed controls menu items order
19.12.2018.
- further fixed controls menu items order (hopefully it's all good now)
- implemented scroll arrow handlers (and corrected arrow positions)
20.12.2018.
- worked on implementing controls selection from the menu (although it needs debugging)
21.12.2018.
- fixed controls selection (seems quite all right now)
- fixed item transition order (control items to scroll arrows)
- fixed infinite loop in InputText (was happening since MenuProc rewrite in C++)
22.12.2018.
- found out that I've missed to analyze CheckControls, but luckily it can stay as is (it just translates
  both player controls into menu controls (ORs them))
- trying to fix controls getting stuck in menus even after key release when player 2 is set to mouse,
  and finally succeeded! forgot to reset the controls as the first step (d-oh!), how did it work at all??
23.12.2018.
- a little bit of analysing, but no results
24.12.2018.
- fixed invalid entry selection by mouse calculations (y coordinate wasn't taking into account black bars
  on top and bottom if height isn't a multiple of 200)
- set default height to be multiple of 200
- started implementing play match menu fire, but it will be more complicated then I anticipated;
  hopefully any joypad fire press should select that joypad for the team (as well as mouse click)
25.12.2018.
- thought out how to apply controls through fire in play match menu and maintain them throughout the game
- the need to track all joypad buttons will require that all joypads be open, which means big changes to
  joypad processing code...
26.12.2018.
/
27.12.2018.
- I've decided to go with always current list of all connected joypads, player's choice will be an index there, and
  we will be able to track all the buttons pressed anytime (I've read some SDL code and it doesn't seem that tracking
  all joypads will pose a significant resource drain)
28.12.2018.
- first phase of moving to permanent joypad list is finished, gotta fix menus to use it too
- GUIDs of selected joypads are now saved, and an attempt is made to restore it at the next startup
- list of joystick ID's in recently added order is maintained (single id won't cut it)
29.12.2018.
- fully switched to a new way of handling joypad input
- just noticed that each SWOS menu has something "useful" selected upon entry... NOT exit button which I was
  systematically setting as default in all of my menus... d-oh!
- fixed controls menu items order some more :)
- added log entries for control selection
- wow, it didn't even crash :P
30.12.2018.
- separated kKeyboard controls into explicit kKeyboard1 and kKeyboard2 in order to be able to use them independently
  during the game
- implemented key conflict resolution at startup if both players are using keyboard
- plenty of refactoring
- fixed some small bugs
- reorganized scan codes into a small class, stopped using SWOS variables
31.12.2018.
- fixed mouse clicks when only player 2 keyboard is selected (they would stop working)
- fixed player 1 having invalid index for selected joypad
- fixed invalid joypad assignment if GUIDs are not found
- fixed fire staying on shortly after clicking a menu item
- implemented mouse wheel scrolling where applicable ;)
01.01.2019.
- fixed wrong joypad GUIDs ending up in ini file
- fixed warning message overlapping mouse click aborts label in redefine keys dialog
- changed menu default items from exit to something useful (usually top element), except in controls menu (for safety)
- refactored video and audio options saving/loading into renderer/audio module (where they belong)
- no more "Window mode change requested, from 1 to 1" message in the log :)
- played a first mouse "controlled" game :)
02.01.2019.
- implemented selection of joypad by simply pressing fire, had to add special case handling of my stupid game port to
  USB adapter which sends button codes when axis are used for the first time
03.01.2019.
- [mnu2h] fixed parsing empty file :)
- [mnu2h] added a rudimentary check for variables that go into C++, making sure they aren't C++ keywords (not
  everything is checked, that might be a too big effort, but even checking at this level helps)
- in-game controls are finally working properly! as well as any controller fire on "PLAY MATCH" entry
- working on rewriting replay/exit menu after friendly game, but so far got only black screen
04.01.2019.
- fixed mouse not working on replay/exit menu, it's working perfectly now, just needed to redraw the menu
  before the fade-in ;-)
- added a new shortcut: alt-shift-enter -> going into true full screen mode
- fixed bench button not working on keyboard controls
- fixed joypad auto-connect (player 1 and 2 were swapped... d-oh!)
- mouse cursor doesn't get hidden anymore when going full screen if we have a mouse player
- playing with mouse is a bit easier now, but it's still awful :D
05.01.2019.
- got some cool ideas for joystick config menu ;) (decided to combine everything into one menu)
- things can't go on like this, I simply must refactor and divide monstrous controls.cpp file
- pooh... refactored the damn thing, I'm dying
06.01.2019.
- working on joypad config menu, it turns out there will be quite a lot to do there
- finished joypad info & readings display
07.01.2019.
- introduced error checking when saving and loading options
- just realized I haven't checked for invalid joypad buttons input (fixed!)
- working on joypad config menu, finished numeric input in menus, rewrote input routine from scratch, it works
  so beautifully :)
08.01.2019.
- [mnu2h] fixed invalid line number when warning about unused variables (was storing wrong token)
- [mnu2h] fixed invalid unmatched parenthesis error if there's more than one closing parenthesis clumped together
- [mnu2h] fixed last token in the file getting ignored
- [mnu2h] fixed incredible error of ending up with wrong results due to expressions not having outer parenthesis, so
  if we got a = b + c, d = 2 * a, it expands to d = 2 * b + c (ouch!)
- also learned the difference between parenthesis and parentheses :D
- incredibly dull work of setting up dead zone box menu entries
09.01.2019.
- [mnu2h] added some aliases to some entry properties cause I kept getting it wrong :)
- set up dead zone % +/- buttons order
- introducing button handlers to actually change dead zone values
10.01.2019.
- finished implementing handlers for changing all dead zone values (both absolute and percentage)
- dead box "animation" finished and works nice :)
11.01.2019.
- finished joypad button selection! finally the joypad config menu is finished! :)
- fixed few critical bugs preventing match from playing
- fixed mouse wheel stopping working after returning to a menu with wheel entries
- added right mouse click = exit menu (works on most menus but not every single one)
12.01.2019.
- finally fixed mouse coordinate calculation in odd sized window (for good I hope!) ;)
- refactored render into video dir with several components (menu is now in its own file)
- stopped hiding mouse pointer in fake fullscreen mode if we're not in the game, and fixed entry selection
- applied my beautiful number input routine to width/height fields in video options menu, and centered entries
  a bit better
13.01.2019.
- changed crash report to grab swos.ini instead of setup.dat (woops)
- fixed crash at startup if joypads aren't selected for both players
- forgot to save regs of GetTextSize, seems it caused crash at Playa's
- fixed Int2Ascii not returning A1 as the end of the string (totally missed that one)
- [mnu2h] fixed undefined fields in entry when there previous entry variables are used in first entry
- [mnu2h] added proper support for changing meny x/y coordinates
14.01.2019.
/
15.01.2019.
- started implementing main menu a little, laid out some basics
16.01.2019.
/
17.01.2019.
/
18.01.2019.
/
19.01.2019.
/
20.01.2019.
/
21.01.2019.
- [ida2asm] added special symbol "@end" which can be used in symbol removal range as an end of range marker, meaning
  remove everything until the end of the file
- worked a little on main menu reimplementation
22.01.2019.
- wrote a bit of Awk[ward] script to convert nationality codes to enum :)
- finished converting main menu, just noticed that colors looks slightly different compared to DOSBox
- [ida2asm] fixed not reporting duplicate symbols in symbols.txt
- [mnu2h] if function name is prefixed with tilde AND in quotes, it will be sent to C++ as is (and without checking)
- added handling of numeric keyboard digits
- fixed invalid mouse behaviour in full screen (I hope! too tired to check...)
23.01.2019.
- and of course it's not fixed, it's not THAT easy
- improved error handling in full screen switching logic
24.01.2019.
- but NOW I really fixed mouse in full screen, seems I had to clear full screen flag of the window and then set it
  back in order for changes to occur and mouse coordinates to be correctly translated
- request to switch to the same full screen resolution we're in will be refused
25.01.2019.
/
26.01.2019.
- rewrote delay routine and switched to high precision timer... wow, the game feels much better! downside is that
  more CPU is used, but we'll see if something can be done there
27.01.2019.
- PrepareMenu() was calling ConvertMenu() without saving the registers... yikes, no idea how it even worked so far
28.01.2019.
/
29.01.2019.
/
30.01.2019.
/
31.01.2019.
/
01.02.2019.
/
02.02.2019.
/
03.02.2019.
/
04.02.2019.
/
05.02.2019.
/
06.02.2019.
/
07.02.2019.
/
08.02.2019.
/
09.02.2019.
- made test exit icon
10.02.2019.
- [mnu2h] added support for custom draw entry functions
- test exit icon improved, and is now in place.. doesn't look half bad ;)
11.02.2019.
- implemented quit game menu
- learned that I have to call CommonExitMenu() after showing any menu from main menu
12.02.2019.
/
13.02.2019.
/
14.02.2019.
/
15.02.2019.
/
16.02.2019.
- did some planning on how to implement replays; will need to reimplement selectFilesMenu, that will be a bitch
- reversed select files menu, another tiny corner of SWOS is charted, woopteedoo
- [ida2asm] fixed reporting `@end' as a duplicate symbol
- [ida2asm] segments are now properly terminated if they are split in different files
17.02.2019.
- fixed invalid constants for gray frame... all options menu header items had invalid colored frame (dark gray
  instead of light gray), funny how nobody noticed :P
- [mnu2h] fixed outputting initial menu x/y coordinates (last ones listed in file were outputted as initial)
- [mnu2h] decided to implement compile-time mini-language inside menu converter ;)
  (in order to address the needs of new increasingly complex menus)
  so it was programmed but not tested at all, this will be fun to debug :P
18.02.2019.
- [mnu2h] been debugging preproc parser, will need to add some changes to the scanner in order for everything to work
19.02.2019.
- [mnu2h] changes in effect, parser debugged and working beautifully, C expressions are now available :)
- [mnu2h] implemented quoting in strings ("thi\"s\"" and 'this\'s\'')
- [mnu2h] extended preprocessor expressions to use all kinds of variables, and fixed bunch of small bugs
  (now just gotta implement repeat loops properly, with expression re-evaluation)
20.02.2019.
- worked on evaluation tree generation as a result of parsing so true loops can be implemented (and conditional
  statements later if/when required)
21.02.2019.
- separated evaluation from parsing, so now the field is ready for proper repeat loop implementation (still have to
  figure out constant expression folding, although it's not too difficult)
22.02.2019.
- almost debugged repeat loop implementation (nested loops still not working properly)
23.02.2019.
- debugging loops, seems the problem is more involved
24.02.2019.
- some invalid tokens are in the stream, seems tokens weren't copied by value (by reference) and got modified, but
  didn't manage to fix it
25.02.2019.
- finally fixed nested loops :)
- linted mnu2h Python code, that didn't go too bad
26.02.2019.
/
27.02.2019.
/
28.02.2019.
/
01.03.2019.
/
02.03.2019.
/
03.03.2019.
/
04.03.2019.
/
05.03.2019.
/
06.03.2019.
- looked around re-establishing select files menu
07.03.2019.
- some small advancement, wrote machine-independent findFiles()
08.03.2019.
- dabbling a bit with replacements for GetFilenameAndExtension() and SelectFileToSaveDialog(), will need a way to
  return int from imported function (since just setting eax doesn't work with void function, compiler is adding
  some destructor and what not)
09.03.2019.
- had to modify import function specification so that I could specify that function returns an int, writing a
  linear memory storage vector-like template to hold imports
10.03.2019.
- trying to fix a problem with custom iterator dereference operator
11.03.2019.
- silly me, it was simple, I was returning value instead of reference, now everything is all right
- implemented function that returns zero flag clear/set (had to use declspec naked), so the temporary problem is
  solved, we're back in the saddle ;)
12.03.2019.
/
13.03.2019.
- removed all of the old select files menu code and data, and started the re-implementation
14.03.2019.
/
15.03.2019.
/
16.03.2019.
- wrote sorting routine for filenames
17.03.2019.
- managed to work on it a little bit
18.03.2019.
/
19.03.2019.
/
20.03.2019.
/
21.03.2019.
/
22.03.2019.
- progressed a bit in initializing select files menu
23.03.2019.
- refactoring mnu2h into submodules, it was already at over 2k LOC single file
24.03.2019.
/
25.03.2019.
/
26.03.2019.
- finally got a little done
27.03.2019.
/
28.03.2019.
/
29.03.2019.
/
30.03.2019.
- did a little bit
31.03.2019.
/
01.04.2019.
/
02.04.2019.
- worked a bit
03.04.2019.
/
04.04.2019.
/
05.04.2019.
/
06.04.2019.
/
07.04.2019.
/
08.04.2019.
/
09.04.2019.
/
10.04.2019.
/
11.04.2019.
/
12.04.2019.
/
13.04.2019.
/
14.04.2019.
/
15.04.2019.
/
16.04.2019.
/
17.04.2019.
/
18.04.2019.
- finally managed to do some significant work, continued with mnu2h refactoring, extracted tokenizer from parser,
  and currently breaking up those awful long parser methods, making them much shorter and sweeter
19.04.2019.
- continued working on refactoring, had solid progress
20.04.2019.
- menu and entry parsing is refactored (Uncle Bob would be proud ;)), now working on code generator
- code generation has been extracted from parser
- it turned out that due to a bug the refactored code didn't run at all, and there were plenty more bugs :)
  nevertheless, a lot has been done and it seems I will be able to extract preprocessor after all, so that's some
  good news, but too tired to do it now :)
21.04.2019.
- set up Python tests with coverage reporting
- covered Tokenizer completely! (except for __repr__ and one line I think can never be reached :))
22.04.2019.
- upgraded mnu2h into its own project with separate dir (it earned it well ;))
- started covering parser (it's gonna be a rough ride ;)) and fixed some minor bugs in tokenizer
- got parser coverage up to 46%
23.04.2019.
- got parser coverage up to 72%
- extraction of preprocessor and test coverage in progress, it is currently at 27%
24.04.2019.
- doing a big redesign of the way tokens are handled through the parser (I think this implicit structure that kind
  of grew on its own is invalid, as each function returning the token that follows it doesn't allow for entities at
  the end of the file, + I have much better error handling as it is known in advance which tokens are searched for
  (since we do it now from the handling function, and not the previous one which has no clue about what's coming))
25.04.2019.
- big redesign done! finished with negative test and that's a huge milestone, coverage is up at 83% for parser and
  71% for preprocessor, which is about the max before positive tests
- fixed many smaller bugs
- started implementing positive tests, added tests for parser warnings and preprocessor expressions;
  raised coverage to 87% parser, 82% preprocessor (winning these high percentages is harder than it seems!)
- I better go to sleep soon or I feel I might faint :P
26.04.2019.
- fixing and refactoring repeat directive
- extracting preproc expressions into a class of its own
- extracting variable handling into a class of its own
27.04.2019.
- fixed all tests except #repeat
- all the tests are passing after the refactor!
- added text measurement test
- coverage: Parser 89%, PreprocExpression 97%, Preprocessor 99% (!), Tokenizer 95%, Util 86%, VariableStorage 92%
- this is getting near the end, gotta add some additional tests here and there and to write code generator tests
28.04.2019.
- added line number checks to error message tests
- fixed bug handling raw (~) functions
- fixed bug handling single quoted string in string tables
- added tests for all kinds of variables
- fixed a few bugs
- added two new directives: #warningsOn and #warningsOff, mainly for tests ;) but it could prove useful on its own
- learned I can access static method through self reference, oops :)
- added tests for entry properties
- did a pylint run, looking good
- added crazy hybrid evaluation of preprocessor and standard variables (whatever can be parsed by the preprocessor
  expression parser will be evaluated as integer)
29.04.2019.
- fixed a little bug with tokenizer warnings off directive
- implementing many of code generator tests
- #join() can now be used within expressions
- forgot to test string escapes, fixed
- woops, seems a preprocessor expression inside a loop containing a mix of constants and variables is broken
30.04.2019.
- doh, preprocessor is PURRfect, I put the wrong variable in the test (idiot!)
- allowed #join to join itself recursively, pretty cool huh :)
- added integer format specification as in Python (actually just forwarding it to Python :))
- improved tests a bit
01.05.2019.
- added verify C++ keyword test
- covered dynamic menu variables (prev. x/y etc.)
- fixed some problems with internal variables expansion
- added some awesomeness in the form of string indexing operator as well as ability to invoke basic string editing
  functions on constant string (and the parameters can be preproc expressions!)
02.05.2019.
- added tests for included files (and fixed a bug there)
- added tests for string tables
03.05.2019.
- improved parsing of delayed expansion properties
- fixed negative number parsing
- fixed error in rotation routines
- added Util tests
- coverage: Parser 99%, Preprocessor 100% (!), Util 100%, only CodeGenerator left (81%)
04.05.2019.
- fixed error in function parameters
- added test for preprocessor in all contexts
05.05.2019.
- added tests for menu index assignment and exported variables to code generator tests
06.05.2019.
- adding final code generator tests
- fixed a bug in the parser (when assigning default entry values)
- fixed a bug in the code generator, it was needlessly outputting entry for default color
- fixed a bug where ResetTemplateEntry wasn't outputted
- fixed a minor bug with settings entry directions
- overall coverage is at 99%! my job here is done :)
07.05.2019.
- fixed a small bug when assigning entry property values from other entry properties
08.05.2019.
- and the build is running again! (although I'm not satisfied with it -- VS build system just sucks big time)
- started extraction of comments.cpp from audio.cpp
09.05.2019.
/
10.05.2019.
- refactoring comments but it seems to be much more complicated than I thought...
11.05.2019.
- refactoring audio stuff is nasty, but at least it's coming along
12.05.2019.
- finished audio refactoring, took longer than expected, but it looks good, and seems I didn't break anything :)
  (but who knows :)); also found and removed an unused variable (it seemed to have been there for quite a while)
13.05.2019.
- [mnu2h] report an error when an entry has zero width/height (so we can catch it before compiling C++ code)
14.05.2019.
/
15.05.2019.
/
16.05.2019.
/
17.05.2019.
- fixed a small bug in findFiles()
18.05.2019.
/
19.05.2019.
/
20.05.2019.
- I've been contemplating the idea of creating tests for SWOS menus for a while now; it's gonna be really difficult
  getting it all to work, but the benefits will be immense
21.05.2019.
/
22.05.2019.
/
23.05.2019.
/
24.05.2019.
/
25.05.2019.
/
26.05.2019.
/
27.05.2019.
/
28.05.2019.
/
29.05.2019.
/
30.05.2019.
/
31.05.2019.
/
01.06.2019.
/
02.06.2019.
/
03.06.2019.
/
04.06.2019.
/
05.06.2019.
/
06.06.2019.
/
07.06.2019.
- created DLL that will be fetching SDL function address table (so we can mock them)
08.06.2019.
- SDL hooking test passed with flying colors!! :)
09.06.2019.
/
10.06.2019.
/
11.06.2019.
- integrated tests into main project (will need to use asm files)
12.06.2019.
- trying to compile tests which use basically all stuff as the main project, but currently failing
13.06.2019.
- fixing all the link errors since some files are missing from the main project
14.06.2019.
- tests finally compile and link!
15.06.2019.
- realized I didn't need render.cpp (it's all SDL interface to "VGA" buffer)
16.06.2019.
- setting up base test structure... still struggling :)
- need to include generated menu header in order to access menu constants... but there are also static functions in
  there that get declared, so added them as stubs in header, under conditional SWOS_TEST but now it fails since I got
  menus in tests that are supposed to be compiled normally... ugh
17.06.2019.
/
18.06.2019.
- [mnu2h] updated tests with #ifdef for testing stubs
19.06.2019.
- worked a bit on it, fixed creating a library when compiling tests
20.06.2019.
- dabbled a bit
21.06.2019.
/
22.06.2019.
- executed first hello world unit test, very primitive, but it ran :)
23.06.2019.
- finally set up SWOS environment in tests :)
- [mnu2h] declared string tables as static (that was discovered when including the file twice for the tests)
24.06.2019.
- fixed commentary loading that I completely broke :/ I really have to get these things covered with unit tests...
- tried to compile with C++17 since I upgraded to Visual Studio 2019, but if I do that I lose capability to compile
  for Windows XP.. @#$&$!^ (plus SimpleIni breaks... sheesh)
- [mnu2h] fixed nasty bug with string tables: I forgot to #pragma pack them! added test for this as well
- finally managed to render a single menu frame for tests... I think :D
25.06.2019.
- had nice progress with unit tests, now actually writing one for video options menu, will see how it goes ;)
- [mnu2h] fixed minor formatting issues, extraneous new lines
26.06.2019.
- finally got the error reporting the way I like it, and failed assertion exception hierarchy took shape
- civilized SDL faker a bit, now need to fill in more stuff and create a good test for video options
27.06.2019.
- fixed a bug in loadFile when using offset parameter
- refactored duplicated code in video options menu
- implemented screenshot grabbing in tests (damn useful it is!)
- writing tests, but it's not going the way I planned
28.06.2019.
- writing video options resolutions test
- removed resolution limiting from video options (any resolution will be now displayed in the menu, not sure if
  that's smart, remains to be seen)
29.06.2019.
- fixed few bugs in tests and finally incomplete tests are passing
- lookie, lookie, VS static analysis actually caught a bug in menus, whaddya know...
- updated SimpleIni, and I can compile with C++17 now MUAHAHAHA (at least the tests, they don't need Windows XP ;))
- implemented tester command line parameters
- started implementing window mode tests
30.06.2019.
- implemented video options menu mode switching test
- fixed slight mis-positions of the items (by a pixel or two)
01.07.2019.
- added timeout detection to tests, if any case gets into infinite loop tester will detect it, report it and exit
02.07.2019.
- fixed nasty bug with tester error reporting, took a reference to a non-const object returned from a function
- implemented custom width/height input test
03.07.2019.
- sorted video resolution list by highest first, makes more sense to prefer the best resolutions system can handle
- handled the case when we can't go full-screen (resolution list empty) (UT's already showing their value)
- recolored items in video options menu (didn't like the gray on inactive items, it looked like they can't be
  selected anymore)
04.07.2019.
/
05.07.2019.
- implemented list scrolling test
- added exit button test
- implemented test for resolution change failure
06.07.2019.
- fixed a small bug with resolution list where the current resolution would stay marked even in windowed mode
- video options menu tests are DONE!!! hellz yeah!!!
- [mnu2h] added tests for string manipulation routines
- finally pushed code to the repository today, haven't done that in a looong time
- fixed clumsy report output in tester with multiple tests
07.07.2019.
- fixed crash when opening edit tactics menu
- added Great Scott! We've crashed! to the log when crashing ;)
08.07.2019.
/
09.07.2019.
/
10.07.2019.
/
11.07.2019.
/
12.07.2019.
- wrote fake file system for testing ;)
13.07.2019.
- debugged fake file system and sound samples loading
14.07.2019.
- some more stuff done on commentary tests
15.07.2019.
- and here the value of tests show: I actually swapped foul & dirty tackle comments; stuff like this is really hard
  to catch by testing alone
16.07.2019.
- again the power of testzs: bar hit comment was wrong, reusing last comment from post hit and not using its last
  comment at all
- found that keeper claimed has one mute comment (length of sample is 0, I assume AIL will ignore but it still goes
  through normal comment procedure, so it's a valid silent comment), chance of playing is 12.5%
- fixed some errors in sound.txt
- fixed invalid penalty saved comment table
- so much invalid stuff in the comments, will check it thoroughly tomorrow
17.07.2019.
- fixed yet ANOTHER bug with double chance sample assignment.... ><
- worked on wrapping up original comments tests but didn't managed to finish
18.07.2019.
- finished all the testing for original comments except for a few complicated routines, leaving those for later
19.07.2019.
/
20.07.2019.
/
21.07.2019.
- finished tests for original comments, skipped chants during the game as their logic is very complicated
22.07.2019.
- added test for automatic loading of custom sound extensions (mp3, wav, etc.)
23.07.2019.
/
24.07.2019.
/
25.07.2019.
/
26.07.2019.
/
27.07.2019.
/
28.07.2019.
- finally started testing custom comments, and found a bug: if a category consist of 2 or more files which have
  identical content (actually one file with different filenames), game will hang when trying to play comment from
  this category
29.07.2019.
/
30.07.2019.
/
31.07.2019.
/
01.08.2019.
/
02.08.2019.
- finally finished commentary tests... making tests is taking longer than I expected (and is boooring), I'll have to
  restrict them to absolutely essential stuff and TDD
03.08.2019.
/
04.08.2019.
- [ida2asm] line number bug that is tormenting me for a long time was at least partially amended, but still not
  fixed completely :(
05.08.2019.
- [ida2asm] fixed a bug when remove block goes to the file end, EOF token is returned from the parseProc(), but new
  line is expected, resulting in parse error; solved by injecting new line token to the end of each division end if
  it wasn't already there
- [ida2asm] fixed a bug when proc hook was placed on a label; it was checked only in instruction, now it's checked
  when label is encountered as well, notice that it could still be skipped if it's placed on a comment line but I'd
  rather not check it for every comment in the file
- fixed a crash in a CPU vs CPU game with at least 1 top goalkeeper (discovered by starwindz)
06.08.2019.
- haven't done much, but finally settling on select files menu recreation (with test ready to debug it once it's
  (nearly) done)
07.08.2019.
/
08.08.2019.
- didn't do any coding, but debugged a bit and found out why bottom fans aren't getting animated
09.08.2019.
/
10.08.2019.
/
11.08.2019.
/
12.08.2019.
- [ida2asm] added parsing error for unknown directive, it was unhandled before but starwindz was modifying swos.asm
  directly and entered something unsupported
- [mnu2h] added special variable to reference previous entry ordinal
- bit of progress in select files menu (actually wanted to fix career crash but can't load career without this
  menu :D)
13.08.2019.
/
14.08.2019.
/
15.08.2019.
/
16.08.2019.
/
17.08.2019.
- fixed a problem with findFiles() using real root path and fake test files were added to root
18.08.2019.
- fighting with select files menu, it's as nothing is working properly
19.08.2019.
- so a hilarious thing happened, suddenly debug tests got really really slow... up to a point they couldn't be run
  in entirety; timeout check wasn't triggering so it wasn't an endless loop, it was just slow; upgraded Visual
  Studio, rebooted the computer... slow again!! OK, I fire up the profiler, it finishes in <50ms (debug version)!!!
  run debug version => dog slow... I am pissed now, WTF is going on and how will I even debug this nightmare...
  luckily, in a flash of inspiration data breakpoint comes to mind, and I check, yes! here it is! little mother
  @#$%@# :D deleted it and it's all good again :)
- didn't progress much but at least cleared up the mess a bit
20.08.2019.
/
21.08.2019.
/
22.08.2019.
/
23.08.2019.
/
24.08.2019.
/
25.08.2019.
/
26.08.2019.
/
27.08.2019.
/
28.08.2019.
/
29.08.2019.
/
30.08.2019.
/
31.08.2019
- cleaned up Visual Studio directory structure as per good advice by Mike McShaffry; now everything gets generated
  in tmp dir without polluting vc-proj dir
01.09.2019.
/
02.09.2019.
/
03.09.2019.
/
04.09.2019.
/
05.09.2019.
/
06.09.2019.
/
07.09.2019.
/
08.09.2019.
/
09.09.2019.
- finally got some progress, x positions seem to be fine now
10.09.2019.
- file type descriptions are shown, and starting y position is fixed
11.09.2019.
/
12.09.2019.
/
13.09.2019.
- [ida2asm] pointer to an array can now be used in symbols.txt
- implemented getPixelStringLength in C++
14.09.2019.
/
15.09.2019.
- misread spriteGraphicsPtr type :facepalm, it's actually a pointer to array of pointers to Sprite graphics, updated
  SymbolFileParser accordingly
- made a good quality string elision routine, since I have a feeling this isn't the last we'll see of it, but some
  tests are still failing
16.09.2019.
/
17.09.2019.
- fixed tests, elision seems to work great now
18.09.2019.
/
19.09.2019.
/
20.09.2019.
- [mnu2h] fixed template entry values being ignored under certain conditions
- found that the colors are broken in controls menu, but no time now to fix them...
21.09.2019.
- fixed missing background colors in controls menu, entry background type wasn't set (it was set to default
  0 = none), no idea how that worked before
- thought there was a bug in handling expressions inside mnu2h #repeat's but it's just me failing basic matrix math
- [mnu2h] fixed duplication of fields from template entry
- [mnu2h] fixed a small bug with evaluation of entry ordinals involving expressions
- set up navigation in select files menu, however something might be buggy around moving through disabled item
  field, too tired to handle now
22.09.2019.
- ha, it wasn't a bug with moving through items, it's that I used next disabled entry to the left field as custom
  user fields for storing file indices to associate entries with filenames... sucks that entries lack user field,
  but fixed it now and it works like a charm :)
- loading files finally works again :) (with same old limitations but we'll get to that ;))
23.09.2019.
- got kinda close to making save work, but something's wrong with competitions (I get wrong name after loading them)
24.09.2019.
- fixed default menu entry in quit menu to be return to the game
- fixed crash when aborting save (returned string could be nullptr, d-oh!)
- fixed a small bug with string elision
- aaand the save is finally working! :) as for the competitions nothing was wrong, their funny names confused me :)
- added scrolling but arrows aren't reachable yet so gotta solve that first
25.09.2019.
- scrolling arrows are now reachable and the scrolling works just perfect :)
- added a feature to menu system which enables menus to register a "global mouse wheel entires", a pair of entries
  which get triggered whenever the wheel is scrolled up/down; it works globally, simplifies things a lot and is
  pretty cool, for now using it in select files and video options menus
- fixed single column with long filenames sticking to the right (since there's only 2 columns it can only pick
  leftmost or rightmost)
- wrote initial version of build description document
26.09.2019.
- did something but fell asleep and now can't remember what it was
27.09.2019.
- did some nice refactoring
- writing tests for select files menu, and caught one bug! even being boring to exhaustion and slow to write, tests
  are a really great asset
28.09.2019.
- adapted C++ style guide to use with the SWOS port
- wrote bulk of initial version of ida2asm documentation
29.09.2019.
- finished entry transition test for select files menu and fixed bugs found during the writing
- added abort button press test for select files menu
30.09.2019.
- worked on selecting file test in select files menu
01.10.2019.
- finish() hook in tests wasn't called at all, whoops!
- fixed yellow "please wait" test in video options menu
- finished selecting file test in select files menu and fixed some bugs that were discovered
02.10.2019.
- implementing scrolling files test
03.10.2019.
- finished scrolling files test, now debugging it, but it's still not working properly
04.10.2019.
- scrolling files test is passing! :)
- load competition test is passing as well!
- spotted a bug, loaded highlight name gets forgotten upon reentering the menu
05.10.2019.
- fixed yesterday's bug and added a test case, easy peasy
- fixed top scroll arrow overlapping with files if it's a full list with in a save dialog
- some tests are failing in release mode :O and they are flaky no less -_-
    edit: EditTactis() needed a safe call macro, but it somehow worked in debug version,
    and the flakiness came from returning address of local TeamGeneralInfo variable, IDIOT :S
    can't believe there was no warning about this, maybe because I was assigning it to a Register class and
    its voodoo template magic mesmerized the compiler
- [tests] added assert when warning or error are logged (can be turned off), it's too dangerous when those
    things go unnoticed
- [tests] fixed not reporting case name of the test that failed
- [tests] fixed some hideous examples of illiteracy
- [tests] fixed names of bitmap screenshots (much nicer now)
- fixed wrongly matching file extension if first 3 characters match (but not the rest) & wrote a test for it
06.10.2019.
- refactored mouse handler in menus into its own module
- sped up scrolling when arrow is clicked and mouse button held; while doing it found out that menu entry
  functions were getting called without safe call, preservation of 68k registers and setting A5 to entry
  pointer... yikes, how did that even work so far
07.10.2019.
- [mnu2h] fixed unary +/- applied to a variable
- finished initial version of ida2asm document
- strange, I'm getting some test failures after a reboot, there could be some timing problems
08.10.2019.
- fixed tests, luckily there were no timing problems, just a side effect of new speed scrolling on click
09.10.2019.
- fixed menu glitch (it was a small error in refactoring)
- disabled in-game animations (all of them, I hope)
10.10.2019.
- tried to improve ida2asm to support remove ranges split in different files, but didn't manage to finish it
  even after a furious struggle
11.10.2019.
/
12.10.2019.
- finally made it work, now I can specify unbroken remove segments and it will be processed automagically,
  no more need to waste time on that (and in doing that switched to thread pool and removed a case of false
  sharing, I may have shaved a few ms off the running time :P)
13.10.2019.
- [ida2asm] started adding support for unlimited proc hooks, more than half is implemented I'd say
14.10.2019.
- [ida2asm] pretty good progress on unlimited proc hooks, was hoping to wrap it up today, but unfortunately
  got some other things to attend to, hopefully tomorrow is the day
15.10.2019.
- [ida2asm] unlimited proc hooks done! tested it, and it works very well + custom names for hooks are really
  great, finally renamed those awful mnemonic names into something more meaningful; will write the
  documentation and publish it tomorrow
- [ida2asm] unfortunately realized that false sharing isn't properly fixed, well, another thing for tomorrow
16.10.2019.
/
17.10.2019.
- [ida2asm] finally fixed the damn false sharing... it was pretty hard, as it involved fixing class design
  and a lot of pointer arithmetics... but it was fun :)
18.10.2019.
- converted sprite drawing routine to C++ after a long struggle... SWPE was a huge help at this
19.10.2019.
- bench routines seem to use sprite drawing routines of their own, at first I tried to convert them but that
  proved to be a too massive step, so I will keep some temporary code to route their sprite draw into the new
  routine that I wrote until it's all nicely converted and cleaned up
- need to research this a bit more, and find precise connections between 320 -> 336 -> 384
20.10.2019.
/
21.10.2019.
/
22.10.2019.
- started reconstructing highlights menu
23.10.2019.
- fixed menu mouse selection being able to select disabled items
- fixed highlights not exiting on fire
- fixed saving highlights file with double extension if selecting a filename from the list
- reimplemented highlights saving
24.10.2019.
- fixed tests broken yesterday
- covered saving file by selecting file from file list with tests; I want to emphasize once again how gross
  patching the global load file routine is to save selected files pointer
25.10.2019.
- reimplemented SaveCoordinatesForHighlights and hooked it up with replay vector, but haven't tested it yet
26.10.2019.
- fixed rerouted replay, but getting reminded now of how replays work, it's not as simple as I initially
  thought, will need to reorganize it a bit
27.10.2019.
- implemented replay scheme, it's not really working yet, but felt like in good old SWOS++ days there for a
  moment ;)
28.10.2019.
- added auto save replays option
29.10.2019.
- implemented actual auto-saving the current replay file
- and the replays are finally working!! :) still need to test a few more edge cases, but it's looking good
30.10.2019.
- fixed invalid filename for auto saved replay file, and not saving it in binary mode (oops!)
- fixed invalid logic when aborting load/save
- saved replays seem to be corrupted :/
31.10.2019.
- refactored replays file, fixed some mistakes and finally fixed the corruption bug; but auto saved replay
  isn't saved properly when game is exited with alt-F1, that's left for tomorrow, too tired now
01.11.2019.
- auto saved replay wasn't corrupted on alt-F1 :) I broke playing replays when fixing the bench replay
  corruption bug; it's too difficult determining dynamically the point of call of InitCurrentGoal(), so I
  just added a way to remove lines to ida2asm, and removed it directly from BenchCheckControls()
- [ida2asm] fixed parsing error when hook proc was empty (but leading comma was present)
- [ida2asm] added support for removing lines, by inserting special hook name "@remove"
- added capturing in-game screenshots on F2 (file format PNG)
- in case user-assigned key conflicts with some game function key, game function key will not be doing this
  function anymore
- added fast replays/highlights mode, can be toggled via 'F'
- debug variables can be toggled via 'D'
- fixed trying to auto-save a replay if alt-F1 is pressed while watching highlights
- improved replay menu navigation when there are disabled items
- prevented menu item initially under mouse arrow getting selected (I don't like that)
02.11.2019.
- [ida2asm] handled properly cases where start/end removal range symbols are missing (e.g. they got renamed)
- bah, just realized pressing 'R' during the game messes up replay (cuts it off at the first press)
- blocked recording while in substitutes (like SWOS++)
03.11.2019.
- [ida2asm] fixed reporting same unused symbol multiple times
- transfered useful part of docs from SWOS++, now on they will be kept in this repository
- debugged 'R' killing replay problem but no success
04.11.2019.
- moved replays to its own "replays" dir, should probably do that for other types as well later
- still no solution to the replay bug, what could be so different in playback?
05.11.2019.
- [ida2asm] fixed nasty and subtle memory overwrite bug in StringMap, didn't allocate 1 more byte for the end
  sentinel node string content
- changed "REPLAY" text after friendly game to "PLAY AGAIN" (I think it was confusing considering the usage
  of term "replay" for watching saved games)
- oof, fixed at least a part of the replay bug, so a short replay with 1 'R' works now, but the longer one
  with more doesn't
- omg, FINALLY fixed the damn thing; if 'R' is pressed during the game, game switches into instant-replay
  mode, it will replay whatever is in the current hil buffer and will inevitably overflow the buffer (if not
  interrupted), and our poor class will think the buffer was filled with new data and will save entire
  contents to replay, which is a double problem: not only will it save unnecessary repeated recording, it
  will also pick up -1 marker from the buffer (left by the last saved coordinate), and that will make the
  recording later stop at that point when replayed; so I think it's fixed now, only thing that concerns me
  a bit is that I managed to get a crash once when pressing 'R' near the beginning of the game: currentHilPtr
  was null which could only mean that RestoreHighlightPointers() was called without calling
  SaveHighlightPointers() first, which could happen in case numReplaysInHilFile was 0, which I have no idea
  why would be 0...) but I never managed to reproduce it so it might have been something temporary; will
  maybe try some more later... pheww.....
06.11.2019.
- fixed glitch that was preventing startup in release mode (failing to read one.256)
- "please wait" text when enumerating video modes will now only appear if it takes longer than 333ms
- hid mouse cursor when playing the game full screen
- fixed crash at the start of the game, not sure if it's the same thing as yesterday, this was when the
  sound was off but StopAudio() was called which called Mix_HaltChannel and apparently SDL_mixer doesn't
  like that when it's not initialized
- fixed text alignment in video options menu
- added pause at stadium loading screen (can be disabled via command line)
07.11.2019.
- working on converting UpdateTime
08.11.2019.
- -//-
09.11.2019.
- -//-
10.11.2019.
- finally finished converting UpdateTime! it took longer than expected, in the future conversions like this
  should best be avoided (even though it is the ultimate goal, but it's just so error prone that it
  shouldn't go into any build that has to be bug free)
- making two screenshots in succession (same second) would result in 2nd overwriting 1st; added milliseconds
  to the filename to fix that (if you do make two in the same millisecond you're out of luck)
11.11.2019.
- not much, but explored the idea of C output writer, and wrote some skeleton files
12.11.2019.
/
13.11.2019.
- generated struct & define file in C ;) some stuff is hard-coded assuming ASM file will be generated, so
  fixing that is gonna be the next goal
14.11.2019.
- fixed ASM assumption stuff, started crunching the instructions, finished push/pop instructions
15.11.2019.
- suddenly started getting some garbage in tokens in ida2asm, thought it's some new gruesome bug, but it
  turned out that IDA 7.0 (to which I upgraded ;)) adds BOM to exported ASM
- new IDA adds Unicode symbols for up/down arrows, copied those into output, it's looking nicer now ;)
- implemented cbw/cwde/conditional jumps
- need to figure out a good way to fetch operands generically for all instructions, it would make things lot
  easier afterwards
16.11.2019.
- still fighting with mov instruction, it's quite nasty
- added original instruction as a comment, it's pretty useful for debugging
17.11.2019.
- testing initial decomposition of instruction parameters (addressing modes & stuff),
- extended tokenizer to recognize parentheses as delimiters, to avoid "(offset" ending up as one token
  (thank goodness for tests, otherwise I don't think it would be possible); comparing generated assembly,
  seems the same, hope it didn't break anything :)
- phew, 1st phase of parameter parsing is OK, source and destination are extracted, now to generate C code
  properly out of those data
18.11.2019.
- some very nice progress! mov instruction seems to be outputting just fine, and added an OR instruction
  output together with setting flags
19.11.2019.
- found out that instruction operand sizes haven't been set correctly in some cases, they weren't used much
  before (or at all) so it slipped through the cracks; fixing it as we go
- working on making CMP instruction reality, detecting flag conditions was annoying but I think I got it
20.11.2019.
- handled global level instructions - have put them into automatically generated function (with name
  containing auto incrementing integer)
- handled lookup of variable size (needed for cases like: cmp g_gameType, 4), also added lookup when structs
  are used without size prefix (e.g. cmp [esi+MenuEntry.entryType2], NO_FOREGROUND)
- CMP is almost there! (+ refactored and fixed bunch of stuff that lead to it)
- CMP done! + did a bunch of small things
21.11.2019.
- implemented INC, AND, XCHG, SUB, ADD
- now new line is properly inserted after a label, but not if it's already there (say from goto)
22.11.2019.
- implemented MUL, DEC, MOVZX
23.11.2019.
- implemented DIV, TEST, JNB
24.11.2019.
/
25.11.2019.
- implemented JA, SHL
26.11.2019.
- implemented SHR, XOR
27.11.2019.
/
28.11.2019.
/
29.11.2019.
/
30.11.2019.
/
01.12.2019.
/
02.12.2019.
/
03.12.2019.
/
04.12.2019.
- implemented rotate instructions, INT, NEG, LOOP, MOVSX, JL, JLE, IMUL
- oops, it seems that loop wasn't flagged as a branch instruction in the tokens list
05.12.2019.
- implemented IDIV, PUSHA, SAR, MOVSD, CDQ, NOT, POPA, MOVSB, OUT, STOSB/D, STC, CLC, IN, CLI, STI, POPF,
  CLD, SETZ, STOSW, MOVSW, probably missed some...
- but finally all the instructions are handled!!
07.12.2019.
- got some initial version of data output, but it's probably lacking badly
- trying to compile, but there are a lot of errors, fixing
- currently ran into a problem with accessing labels before the definition point
08.12.2019.
- did an extra first pass and forward declared all the data and functions and also fixed a bunch of
  compiling errors
09.12.2019.
- classified labels properly, no more errors there, fixed bunch of other compiling errors, error count is now
  at 20-30ish with only 2 known cases to fix (albeit a bit tricky)
- I slipped with failing to mark some static buffers used by multiple threads as thread local, and was
  getting weird random null bytes in output, but always at numeric offsets converted from struct fields,
  it looked pretty funny ;)
10.12.2019.
- implemented horrible hack for switch in ConvertMenu, I simply didn't see any other way that wouldn't
  include extremely time consuming implementation of flow analysis (let's not go there)
- fixed bad generated code for add/sub/cmp
- fixed bunch of small issues
- getting close to clean compile, but still there are some errors to fix
11.12.2019.
- fixed a bunch of stuff... can't remember which... battery low... but the thing is not far from finish,
  I see the same errors related to struct access that plagued assembly output writer as well
12.12.2019.
- out() wasn't outputting a number if it's a zero... what a shameful mistake all this time >_<
- fixed struct variables problem, another gross hack
- implemented local variables and fixed some more stuff I can't remember now
- errors shrank even more, really hoping to finish it tomorrow or the day after
13.12.2019.
- only one file left to clean... ONE... unless I die first
- and the damned C converter is finally done, 2.3k lines and about 4x the size of the ASM counterpart
- only one crash with changes this big... not bad ;)
14.12.2019.
- VS build system is too retarded to support different projects building the same files, so I'll just create
  a separate *.sln to build with generated C files
- and after numerous ordeals it's finally compiling and building! :)
- now all that's left is the integration, connecting flags to VM flags, already figured out a nice way, will
  abstract it with macros and replace all naked ASM (if it's possible ;)), and of course debugging the thing
15.12.2019.
- integrated fully with the code (parts that mess with zero flags), now debugging
- something weird is happening, seems like compiler is moving parts of string pool to non-contiguous memory
  locations :/
16.12.2019.
- trying to force string pool into contiguous block of memory by turning it into a struct; all variables
  access will be turned into struct fields access; easier said than done ;) plenty of problems, couldn't
  finish it today, but hopefully it will fall tomorrow
17.12.2019.
- after many setbacks finally got the string pool as struct set up, very close to compiling the thing again,
  now getting 13 (bad luck!) linker errors, type of extern seems to be different than the defined variable
  for some reason
- finally fixed string pool, now getting infinite loop :P seems one level of indirection is missing when
  using brackets, that will have remain for tomorrow
18.12.2019.
- was inverting zero flag, oops :)
- also fixed some indirect access
- movs/stos/loop instruction were incorrectly implemented: bumping pointer before the write, always
  incrementing by 1 instead of 1/2/4, and not reflecting pointer increments back to esi/edi
- something's broken in DoUnchainSpriteInMenus()
19.12.2019.
/
20.12.2019.
- seems the culprit is invalid offset calculation in structs (mistake in Token::toInt() implementation
  :facepalm), fixed it and now there's an infinite loop inside bubble sort in InitializeTacticsPositions()
21.12.2019.
- carry flag calculation in CMP was wrong, additionally it was in the wrong spot for SUB/ADD (after
  destination gets updated instead of before)
- argh more pointer table problems... if they're not contiguous it's gonna crash, I'll have to solve this
  thing in some kind of generic way
- some asserts started firing, seems instruction size wasn't being determined correctly when one of the
  operands was a struct field (e.g. mov eax, [esi + Struct.field] or move [structVar + Struct.field], 42)
22.12.2019.
- fixed instruction size
- realized there will need to be some changes to the architecture to accommodate generic contiguous tables,
  current hacks simply won't do
- transforming sources in preparation of contiguous tables gathering, we'll need to mark no-break tokens
  [done], then create lists of ranges & string sets of removed variables for each chunk, and merge those
  individual tables into read-only global one (done at resolve reference time) which will be finally used
  when outputting (so each chunk will have complete information and those ugly tables header per file can
  be eliminated)
23.12.2019.
- very close to finishing the damn contiguous variables support:
    - created a list of user defined types for externs in input symbol parser
    - added support to mark data items as contiguous (only start & end), and wired it to parser
    - ignored externs belonging to other file tables during externs resolution phase
    - just one global header is created for the structures, right after the output is done (it's a perfect
      spot as all the information is available and it doesn't parallelize well)
    - when outputting the file user defined type overrides auto-detected type from the assembly
        here we have a problem, as types might not match (int variable vs array) and there are also
        empty array dimensions (can't have those inside structs) + need to debug some
24.12.2019.
- it's finally compiling with contiguous variables support!! hallelujah!!! but... it's still crashing :(
  (we're back to InitializeTacticsPositions())
- after a long fight got it to run without crashing, but with messed up strings and keyboard not functioning;
  the problem lies in data alignment, C compiler does whatever it likes with it, lays it out in unpredictable
  way, while the code assumes it will be contiguous without alignment; the game uses huge number of tables,
  and marking them manually will be a lot of work, my hope is that some compiler specific switch could be
  discovered and make this problem go away
- so either a compiler switch, or shoving _everything_ into structs (ugh)
25.12.2019.
- put 68k registers near x86 ones to improve cache coherency
- implemented multi-line array collapsing into one line, but the menu is still messed up :(
26.12.2019.
- found out why the menu text is messed up, char tables have a struct in C++, but not in ASM, since IDA
  doesn't declare structure instances properly, it just lists the fields as if they were consecutive
  variables, this'll be tough to cure
- current solution is to just leave struct variables with their ASM type, but cast them inside C++-facing
  define, tried as I might, but had to leave it for tomorrow :/
27.12.2019.
- found out that prefix feature in symbols.txt wasn't used (woops) and removed it (this simplified things a
  bit); it was used in SWOS++ but the things worked differently there: based on map file assembly file was
  generated with symbols corresponding to offsets, so we could practically generate any symbol as long as it
  had a correct offset to match the original SWOS variable in memory
- going crazy with all the typecasts (from ASM to C++ types in defines for structs vars)
- fixed text output in menus!! hallelujah! still, keyboard isn't working and menu items aren't rendered
  properly :D
28.12.2019.
- found out why controls weren't working: I was actually using keyboard variables from SWOS as if they were
  contiguous (as a struct) in my code, hihi, just added no-break for now but it'll have to be changed for a
  new architecture
- also found out that contiguous variables problem extends to menus (their packed form), for now will detect
  them and add contiguous flag automatically (have only just started though)
- a proper solution would require some sort of code layer for accessing the memory (a virtualization of
  sorts); still have to figure out all the details, and it will take foreva to implement... but this is what
  will make iOS and Android ports tick
29.12.2019.
/
30.12.2019.
/
31.12.2019.
/
01.01.2020.
/
02.01.2020.
/
03.01.2020.
/
04.01.2020.
/
05.01.2020.
/
06.01.2020.
/
07.01.2020.
/
08.01.2020.
/
09.01.2020.
/
10.01.2020.
- did some theorizing on the new memory layer™ technology, it's not all that frightening
11.01.2020.
/
12.01.2020.
/

....

13.01.2020. - 19.05.2020.
- big break period, lots of changes at work, been trying to get into Android development, will continue
  trying, maybe making a career switch (Kotlin+NDK might give a good edge and allow me to find good remote
  jobs easier) and all that will most definitely help Android game porting efforts ;)

....

20.05.2020.
- sorted out game docs a bit, needed to look up some things and realized it's a bit messy
  it's not easy translating soccer terms, even had to look them up on soccer for dummies :D
- feels really good to be back in VS2019, it's just so much better than VS2015
- reversed DoAI() a little bit, on to something here perhaps, but there's more work to be done
21.05.2020.
- went through Meson release logs, seems it has improved a lot, will give it another shot
22.05.2020.
- today I learned that ARM _does_ support misaligned memory access :O however, it only pertains to modern
  ones (so it might still crash on older one), there is a performance hit, and some other potential problems,
  so it should still be avoided
- Meson is a bit skimpy on the tutorial-style documentation, and I suspect VS support is poor, which would
  force me to improve it myself and that might take prohibitively long time; instead, I might just create
  build scripts with ninja in mind, and simply maintain VS project files separately; this might just be
  satisfactory solution in the short term (and give me time to potentially improve VS support gradually,
  well, maybe ;))
23.05.2020.
- went through Meson manual and source code
24.05.2020.
- accomplished massive progress in Meson scripts; will take it in steps:
    step 1 - win32 version/asm
    step 2 - win32 version/C
    step 3 - Android
    step 4 - iOS
  so far working on step 1 :) gotta fix up the menu compiler
25.05.2020.
- moving forward with Meson scripts, very rough outline is done, now ironing out the quirks, will need to
  reorganize script locations a bit
26.05.2020.
- advanced further, there are some problems with include directory paths, on it atm
- finally got the Meson Manual book after some shenanigans, thanks Playa! :)
27.05.2020.
- oh dear, I seem to have broken career loading... 5 months ago x_x
  luckily it was a small oversight, just used a wrong register in what was supposed to be a fix for another
  thing :)
- added prompt asking the user if they really want to play with the mouse... hopefully this will make
  getting into the game clearer for the players, so they can let poor Playa breathe a little :)
- finally compiling without errors using Meson, and it even works without crashing!! :D
  it's only annoying me by recompiling needlessly, will need to find out why's that happening
- phew, solved it! it seems the problem was in passing absolute paths to Meson; Meson turns path into some
  weird identifiers for ninja, and when they're absolute they start with C: which ninja eliminates in file
  name, but not in its internal id, and the result is that it never can find the files after the build (on
  disk they look something like _blah_blah but ninja is looking for C_blah_blah)
  had to resort to invoking Python instead of cmd to get the source file paths recursively and in relative
  form (Python has to be available since it's needed anyway for the build and Meson itself)
- I'm amazed how elegant ninja build is, quite a slick little software
- so step 1 of the plan finished, more to come! ;)
28.05.2020.
- ops, still need to add tests to the build; on it
- moved all the Meson scripts to main branch (the test succeeded ;))
- extended backup script to backup meson build files too, and went back to regular backup scheme
- replaced cmd calls with Python so the globbing is now portable
29.05.2020.
- refactored build scripts a bit, working on tests, it's more difficult than anticipated but it's
  coming around
- tests are built!!!
- but when I ran them, one test was crashing, but only in release version, debug was just fine... after hour+
  of debugging, eventual inspection of generated code showed that the optimizer was eliminating the code to
  save selTeamsPtr after it gets overwritten when loading teams from file... for f@#$&! sake (seems even the
  compiler thinks it's a garbage code)
- fixed some mistakes in the test code when running without --swos-dir parameter (directly from the game dir)
- had a hard time fixing up tester in regard to SDL address fetcher DLL, but made it, now the tester fails
  some tests, but those will have to be dealt with later
- found a small bug in Meson along the way
30.05.2020.
- it's so devilishly difficult to debug non-VS-built executable from VS, but copied Meson-built debug exe
  and pdb over its, bumped timestamp, pressed F5 and it worked perfectly :D
- finally made it, tests are passing!! it was some weirdness in the order of the object files sent to the
  linker: if test files are linked first, SWOS_STUB_MENU_DATA seems to be defined when it shouldn't and
  stubbed menu routines will be linked in the wrong file (the file that uses the real ones); not really sure
  why is this happening but rearranging linker order solves it
- update: I've stopped defining the menu in stubs mode, so now it doesn't depend on the linking order, but
  it's still a mystery, I don't think it should have happened in the first place
- generated *.map file and checking it out, quite interesting, we get
    0005:00005780       ?selectFilesMenu@@3USWOS_Menu_selectFilesMenu@@B 0080f780     selectFilesMenu.obj
    0005:001475b0       ?selectFilesMenu@@3USWOS_Menu_selectFilesMenu@@B 009515b0     SelectFilesMenuTest.obj
  the decorated name is the same! could this be a bug in the linker?
- talked to a friend to see if I'm crazy, turns out I'm not (yet :))
  tried a minimal example with gcc, it works so it's definitely a MSVC++ bug!
  updated to latest Visual Studio, they solved it... so much for that :P
- learned about Meson Filesystem module, and improved the scripts accordingly
31.05.2020.
- had an interesting idea, how about making a translation into ARM assembler? it would still have
  misalignment problem and might not work on older CPUs, but it would be so much faster and simpler than C
  conversion; will try to make a proof of concept and see if it will work properly without proper alignment
01.06.2020.
- there's quite a bit of stuff to read on the ARM architecture and its assembler
02.06.2020.
- learning about ARM and its architecture, although haven't managed to read much today
- damn it, if I use 64-bit architecture then I'll need to fix every pointer access, and if I use 32-bit
  architecture then I have to fix every misaligned memory access... ARGH
03.06.2020.
- the way forward is to focus on memory indirection system (and flow analysis for simple optimizations),
  from which both C and ARM optimized version can be developed
04.06.2020.
/
05.06.2020.
/
06.06.2020.
/
07.06.2020.
- finally read a good introduction to ARM architecture, a chapter from a reverse engineering book
08.06.2020.
/
09.06.2020.
/
10.06.2020.
- working on getting the C output converter done; removed the old code and started from scratch, it's been
  tough so far, trying to assemble a kind of a register containing all the variables in the program, which
  will later serve as a main data structure for generating all the stuffzorgs
11.06.2020.
- just realized that ida2asm can be compiled with C++17, since it doesn't need to run on XP (only the main
  SWOS port executable needs to, so it can be the only one compiled with VS2015 toolset)
- made all the plumbing up to marking of the redundant instructions, will leave that for tomorrow, it will
  require devising a way to track all the register contents as well as knowing when each instruction destroys
  them
12.06.2020.
- was definitely doing something, but forgot to type it in and now can't remember what it was
13.06.2020.
- laid ground for instruction operand type parsing
14.06.2020.
- wrote operand type extraction code, now trying to come up with values to assign to registers to track
  their usage; it's more difficult than anticipated, but it's moving slowly
15.06.2020.
/
16.06.2020.
/
17.06.2020.
- wrote register assignment and value propagation logic
18.06.2020.
- worked on setting up variables tracking
19.06.2020.
- returned old COutput :) will remove struct tables from it, and add a new variable handler
20.06.2020.
- seems there's more stuff to remove from COutput, but it will be more clear once the data bank conversion
  is close to completion
- wrote initial implementation of data bank variables parsing
- found that structs were not being handled properly (bit inefficient), and they're being written by multiple
  threads, so rewrote them a bit; now they're a prime example of purity
- created variable to offset mapping, ready to be used by the code generator
- planning to extract the instruction emulating functions into a class of its own, and do some modifications
  required for memory layer to work; also have to integrate intermediate code into COutput and finish
  optimizer
21.06.2020.
- broke everything :)
- finished rough initial version of memory array output, untested though! (until I sort all the mess)
22.06.2020.
- already evening, and finally it's compiling again (compiling but not more!)
- fixed barrage of asserts, broke the build again, fixed it
- assertions are pure gold, they should thrive and multiply
- fawk! I didn't consider pointers to code, only data... must rethink this
23.06.2020.
- it's not that big of a problem actually, figured out a decent solution I think: will keep a separate table
  of function pointers and replace any address with index into this table, since there are no arithmetics on
  values of function pointer it should work (we incur additional memory access each time a function pointer
  is used, but it shouldn't be a big problem, they are used relatively rarely and are expensive anyway)
- this seemingly never ending rain seems to do wonders for my productivity ;)
- phewww, finally made it through the crashes and asserts, got the output file, of course it's wrong :P
- I'm very glad to be able to remove the switch table hack, with the new proc invoke system this case will be
  handled automatically
- parsing of integer values in tokens was broken all this time, incredible...
- found a weird bug in IDA, it outputs extraneous semicolon if the comment contains one when exporting ASM
- memory array looks great :) procs array not so much, but no time left, gotta get some work done, will fix
  it up tomorrow
24.06.2020.
- first time to see the sun in days
- I might be able to remove gross struct hack as well, but it might still be too early
- and finally, data and proc arrays look good! :) at least I can't find any mistakes, we'll probably see more
  once the compilation starts, but this is it for now, therefore I officially pronounce phase 1 finished ;)
  now on to actually using this lovely juicy data to make the game moving >:)
25.06.2020.
- figured out how to rework instruction generation, but haven't got around to actually do anything
26.06.2020.
- begun converting instruction generation code
27.06.2020.
- continuing with instruction generation, it's pretty rough, discovered that offset integer parsing didn't
  account for hex offsets and was therefore producing completely wrong offsets; no wonder it was crashing
- finally had a good idea how to generate more complicated instructions with memory access
- so much to do... want to write more... but must... sleep...
28.06.2020.
- d-oh... function pointers can be referenced from the code directly, not just from data... must capture them
  as well
- replacing MOV instruction, but there are still some failing cases
- fixed generating wrong addresses for variables & added a check so it doesn't go unnoticed again
29.06.2020.
- MOV is looking pretty good aside from some small things, can't wait to fix it all and move on to
  implementing other instructions... heat was exhausting these days, will have to service air conditioner
  if this hellish weather continues
30.06.2020.
- MOVSX working
- turned single byte dynamic access via function into a direct byte array access, since 1 byte access can't
  be misaligned, so it's a bit simpler now
- reworked memory array into union of three arrays that can be accessed with three variables, as byte, word
  or dword array as needed (simplifies access code)
- implemented initial read/writeMemory functions
- MOVSB/MOVSW/MOVSD implemented
- removed direction flag
- STOSB/STOSW/STOSD implemented
- bumped into and removed some unused functions
- added debugBreak() function instead of INT 3, it should trigger a breakpoint and is compiler-dependant
- fixed some small issues
01.07.2020.
- LODSB/LODSW/LODSD converted
- implemented function calls
- refactored a bit
- PUSH/POP converted ("small" handled as well)
- OR/XOR converted
02.07.2020.
- CMP/SUB/ADD converted
- INC/DEC converted
- XCHG converted (phew, that was a tough cookie)
03.07.2020.
- NEG/NOT converted
- DIV/IDIV converted
- SHL/SHR/SAR converted
- only rotate instructions to go! they're by far the toughest though :P
04.07.2020.
- phew, RCL/RCR/ROL/ROR finished, that's about it, now let's see if the code can be optimized
05.07.2020.
- eliminated redundant flag assignments (when an instruction sets the flags, they never get used, and a
  subsequent instruction resets them); quite content how well this works and how quick it was to implement
- working on redundant assignment elimination, set it up in theory, sounds solid, trying to turn it into
  implementation
06.07.2020.
- moved forward with redundant assignment elimination, refined the plan some more
07.07.2020.
/
08.07.2020.
/
09.07.2020.
- resumed working on optimizer code, moved it a bit forward
10.07.2020.
- sort of finished, but lots of debugging ahead
11.07.2020.
- woops, forgot other instructions than MOV ;) but it's a good progress nevertheless
12.07.2020.
- working on handling instructions that change state, quite a lot to handle there
- there's still stuff to be done on the "simulator", I'm hoping to wrap this all up over the incoming week
13.07.2020.
- implemented stack operations (untested though)
14.07.2020.
/
15.07.2020.
/
16.07.2020.
- implementing block instructions, interestingly, LODSD was missing all this time
17.07.2020.
- finished with block instructions, they're looking good now :)
- introduced new Value abstraction and made things a LOT easier, seems good ideas only come after a
  significant effort
- omigawd, finitto! (minus the debugging :P)
- found a problem with extractValue()
18.07.2020.
- fixed extractValue() problem (was surprisingly easy), and a bunch of other small bugs
- found out about and fixed flow change instructions that weren't being marked properly
- stack is giving me headache, there are push/pop instructions executed conditionally :/
19.07.2020.
- fixed stack (simple idea again, to duplicate it for each branch) and a bunch of small issues
- realized IMUL slipped through the cracks (the notorious three-operand instruction)
- refactored a bit so the code is a less of a monstrosity
- ran into interesting thing: my lovely jovely stack tracer pointed to a stack imbalance inside
  FillManagementRecordInfo(), so I checked it manually, and am pretty sure it's a faulty code; it should
  crash when there is no best scorer in the season; there is a test if best scorer string is empty, but
  when I looked, the string has value "SEVERAL", so it might be a different bug preventing the first
  one from manifesting ;)
  will patch it up later just in case
- finally everything is passing without triggering any asserts, but we're not out of the woods yet, I see
  some invalid looking things in the output file
- gah, my implementation of expressions was too simplistic, I'll have to rework it tomorrow (or whenever
  the next time will be)
20.07.2020.
- refactored code and simplified it a lot, it's more manageable now (removed extraneous data structures and
  functions), shaved off ~200 lines
21.07.2020.
- ...aand finished (yet again) but it's still generating invalid code, let's put our improved debugging to
  some good use
- fixed local variable output (the only one ;))
- fixed nasty bug where I didn't check if operand string in OperandInfo wasn't empty first, before doing
  anything; and quite annoyingly, it was only manifesting in release build
- there's still (another) crash happening in release build only :/
- after a little bit of desperation did the most stupid (but effective) thing: commented out functions one
  by one, and soon pinpointed it to assignRegisters() then to widenRegister(); it was an invalid index
  arithmetics, and it was starring into my face all the time... sigh, moving on
- applied bunch of little fixes, and hallelujah! finally can't find anything wrong in the output (or maybe
  I'm just tired and couldn't see a white cat on a sunny day)
- tomorrow will add orphan assignment remover and then the next step is compiling it :)
22.07.2020.
- orphan assignment remover turned out to be more complicated than anticipated
- fixed invalid constant detection
- fixed expressions involving unknown memory addresses that were acting up
- removed ADD/SUB xxx, 0 instructions
- made flags optimizer respect deleted node flag
23.07.2020.
- refactoring operand info extraction to be ready for assignment remover code to fit in
24.07.2020.
- discovered 's' suffix for std::string creation, what an awesome thingie
- refactoring done, but dreaded error is back, now it won't even crash in release, just throwing exception
  when invoking a worker thread
- seems my debugger wasn't set up correctly to capture some of C++ exceptions, it should be fine now (and
  fixed the error)
- finally the refactoring is done, and the output file matches the old one, except it's better since there
  were some bugs I fixed along the way; road to orphan assignment removal cleared!
25.07.2020.
- been developing orphan assignment removal, got close to finish and the start of debugging
26.07.2020.
- added CBW/CWDE/CDQ
27.07.2020.
- didn't have too much time today, worked on MUL
28.07.2020.
- finished MUL/IMUL/DIV/IDIV
- "done", but need to actually connect it with the rest of the program
29.07.2020.
- realized mul & div's weren't handled properly, fixing
30.07.2020.
- passed all asserts
- wrote test cases
- found out the hard way I haven't checked if the proc was already open when encountering endp inside the
  parser (made a mistake in test input); though it should never happen in automatically generated IDA code
- fixed CBW/CWDE/CWD/CDQ
31.07.2020.
- realized I haven't maintained lists of connected instructions properly, so separated links and reference
  counts and created new links when appending
- after the smoke has settled from all the debugging, ALL THE TESTS ARE PASSING! WOOHOO!!!
- discovering more problems in output files, there's still some work to be done before trying to compile
- finally, can't find any more problems, it's time for the next phase, gotta get this thing to compile
  and start game-testing :)
01.08.2020.
- started compiling the generated code, and fixed TONS of small mistakes
- compiled it, but darn, there are linker errors due to the fact that all SWOS variables are now contained
  in an array, and we need to access them from the outside code; must figure out something to handle this
02.08.2020.
- just learned that a void function can return another void function... as well as any void type... seems
  it's like that so the templates with generic return types would work, wicked
- started working on solving the outside access to SWOS variables array, don't have all the details figured
  out yet, but hope to carve them out as I go
03.08.2020.
- been converting direct memory access to SWOS variables from outside to indirect; ugh, this will be really
  rough
04.08.2020.
- solved problem of words (maybe but probably not), haven't ran it yet, I see that interoperability between
  SWOS and non-SWOS code is jeopardized, pointers are especially sore subject, I'll have to come up with
  something, maybe some bridge routines
05.08.2020.
- converting SWOS variable access with templates, down to 117 unresolved externs!
- char arrays converted, 107 externs to go
- void pointers: 98
- yipes, forgot about pointer difference: pointers are 4 bytes in SWOS and 8 bytes in a 64-bit system, and
  they and/or stuff they point to could be misaligned, so there are two levels to take care of... will have
  to devise some convenient interface to handle all of this
- another tough problem: how to handle buffer extensions for pitch patterns and so on?
06.08.2020.
- all right, after some rumination I think I have a reasonable plan to deal with the memory probljem: first,
  the additional memory allocated when the game starts will be joined to the g_mem array (at the end), there
  will be an interface to get its size and pointer to the beginning, and the size should be configurable via
  a command line switch; second, pointers will be coded into 4 bytes: highest bit clear: typical SWOS offset
  into g_mem, highest bit set: following bits will be an index into a pointer pool (set say at the g_mem end,
  right before extra memory area), remaining bits will be the offset and together with the stored pointer
  would form the real pointer to the data... sounds nice in theory, let's see if it actually works ;)
- added support for specifying extra memory size and disabling optimizations from command line, and basic
  variables for SWOS extended memory
07.08.2020.
- finished converting access to extended memory, and with pointer arithmetics (luckily, they weren't too
  heavily used), now the new problem is how to handle struct member access, since they too can be misaligned,
  by starting address as well as by internal variable ordering (which I can not touch since the SWOS expects
  it that way); most likely the approach here would be to replace variables with functions, or to have
  essentially a collection of variables instead of a struct (teamData.playerNumber() or
  teamData_playerNumber.get() or teamData.get(kPlayerNumber)... #1 looks best IMHO)
- trying to handle structs, it's getting complicated
08.08.2020.
- struggling with structs, tried & rejected new approach
09.08.2020.
- dwelled deep into dark art of templates, but haven't managed to finish struct access yet
10.08.2020.
- fixed a small bug only appearing in release mode, accessing all opInfo members, even if there are none
- feeling somewhat better today, yesterday evening was a disaster, a food poisoning or an allergy attack or
  both :/ nevertheless made some progress, but things are taking a turn for the uglier, I can't properly
  assign types to automatically generated structures, so I might have to manually create them, which is
  quite unsatisfactory as well... will need to think a bit on this
11.08.2020.
- was mostly resting today, but did finally decide on the issue of structs, they will remain as they were,
  and the client will have to take care of the alignment (sucks to throw it on the client, but they are
  heavily customized and there is a similar situation already with SAFE_INVOKE macros), will add some
  templates later for safe generic pointer manipulation; it also means most of the code I was writing past
  days had to go, painful but it's for the better in long-term
- also read about packed structure access, seems that the compiler will take care of unaligned access, which
  makes my life a lot easier (and has influenced the decision, since only the pointer itself will need
  adjustment and the compiler will take care of the rest)
- with this intervention it's compiling again and down to 71 unresolved externals
12.08.2020.
- fixed a fix for accessing all opInfo members
- moved forward within new direction; planning to add "align" directive to ida2asm so important variables
  can have proper alignment guaranteed
13.08.2020.
- implemented alignment of all exported variables (though this might come back to haunt me if I disturb some
  of the save/load buffers, but will fix it if it becomes an issue)
- deleted a lot of code again, and reverted back to the direct variable access, only thing it's now one big
  struct with filler arrays in between non-consecutive variables, accessed via "swos." macro (e.g.
  swos.someVar)
- seems it could work, got a tons of references to fix, and to sort variable access from menu files, as they
  need to add "swos." prefix sometimes
14.08.2020.
- the cunning plan worked flawlessly, added "swos." prefix to all SWOS variables and fixed up menu scripts
  to add it as well (via $.var syntax), it even looks nice
- in the process realized it would be so much easier if generated files were C++ as well, so switching from
  C to C++ now, it shouldn't make much of a difference in portability, all the major platforms have at least
  one good C++ compiler
- argh, so close to getting a clean compile (replaced functions are treated as ordinary exports without SWOS
  namespace and thus create linker errors)
15.08.2020.
- solved SWOS:: problem, now only at 24 unresolved externs!
- gah, my hope menu switch table would be handled gracefully was shattered, even if all jumps are
  straightforward except one, it makes partitioning into separate functions impossible (too intertwined with
  ConvertMenu), will just convert the whole proc, should be fun too, haven't been converting anything in a
  while ;)
16.08.2020.
- converted ConvertMenu, but realized there is a grave problem: the MenuEntry struct contains pointers, which
  will become 8 bytes in 64-bit systems and break the layout; they will have to remain 4 bytes and yet
  somehow do their duty both in SWOS and non-SWOS code; most likely I will need to extend invokeProc array
  dynamically and use negative offsets for reference; menu scripts will have to take care of registering menu
  functions
17.08.2020.
/
18.08.2020.
/
19.08.2020.
/
20.08.2020.
/
21.08.2020.
/
22.08.2020.
/
23.08.2020.
/
24.08.2020.
/
25.08.2020.
/
26.08.2020.
/
27.08.2020.
/
28.08.2020.
/
29.08.2020.
- finally back, haven't realized it was so long, but have to do some work for the paying job from time to
  time as well ;)
- started implementing classes for interfacing with SWOS variables and procedures, got an include dependency
  hell on my hands, will need to start defusing it slowly
30.08.2020.
- tried untangling circular dependency, but failed miserably
31.08.2020.
- solved the dependency, but it was tough, introduced functions for pointer/offset conversion, and put them
  to cpp file so swos.h wouldn't need to include vm.h; the only way I see to solve this
- unfortunately now the templates are going rampant, trying to fix the mess
01.09.2020.
- managed to solve the templates, as well as pile of compile errors, back to linker errors, 8 unresolved
  externs
02.09.2020.
- removed shift by 32 to the right from rcr instruction (extraneous as well as undefined behaviour)
- unreferenced label warnings helped me remove one unnecessary label in IDA
- converted swos.h to use wrapped pointer classes, surprisingly few errors
- missed ConvertMenu reference from RestorePreviousMenu, fixed now
03.09.2020.
- fixed invalid generated string table name, and learned that C++ compiler actually accepts $ as variable
  name quite happily
- fixed mnu2h tests and covered latest syntax additions
- fixed one unresolved external, one element of the proc array was C++ function and was missing SWOS::
  namespace prefix
- facing horrible problem with insanely long compile times, I've narrowed it to the memory union, if I make
  it static it goes away, but that will require some annoying code changes, lucky I was accessing it via a
  macro so it's doable
- ARGH now it's back even with static qualifier :`-(
04.09.2020.
- finally pinned it down the slowdown to templated class SWOSDataPointer, still analyzing why the hell is
  this happening, and how could it be avoided
- it seems a template (the usual performance suspect) doesn't really matter in this case, only if I remove
  the constructor it goes back to full speed; it's quite crazy, but anyways I've created minimal project and
  reported it to Microsoft, hope they'll fix it properly soon enough, or I'll need to modify a lot of code,
  without being sure it would ultimately work...
05.09.2020.
- argh, nobody looked at my report yet, it's weekend -_- will just have to patch it up somehow until it's
  properly fixed
- phewwww, found a satisfying workaround! I've thrown out union temporarily (since I only need it to
  guarantee the alignment of the data, and that I can forego temporarily during the development -- x86
  swallows anything :D); now I'm using raw array with few pointers pointing into it (not gonna worry about
  aliasing either), and it's compiling fast again! this will be good enough to unblock me until the proper
  bug fix (also turned off assembly listing generation for a small additional speed up)
- finally back on track, debugging invalid generated types of SwosVariables struct
06.09.2020.
- fixed natvis definitions for Token, seems something might have changed between Visual Studio versions
- joined terminating zero to its parent string (so the sizeof operator would return correct size now)
- fixed array dimensions in SwosVariables
07.09.2020.
- expanded natvis script with descriptions of StringView and it's Node, need to debug it since its behaviour
  seems suspicious (especially duplicate elimination)
- worked on eliminating duplicate functions in proc array, as well as comparison with outside functions; got
  sidetracked but luckily those function pointer variables got eliminated, so there wasn't any work left for
  this matter
08.09.2020.
- discovered that chant function pointers weren't needed in the SWOS code (removed/replaced all the functions
  that used them), so removed them and replaced with a C++ array
- converted raw pointers in SwosVariables to SwosDataPointer's, now fixing up the rest of the code, wherever
  there's some compile error
09.09.2020.
- omg, FINALLY a clean compile!! (even though there's plenty to do it's still a nice landmark ;))
- fixed duplicate proc's in the proc array and other smaller mistakes
- now have to figure out how to reconcile using menu variables from both SWOS and C++, since the pointer size
  is potentially different... tough problem, will need to think hard on this
10.09.2020.
- the bug I reported is under consideration, got a reply to try making constructor constexpr, which works in
  simple example, but unfortunately it wouldn't work in the real project (maybe I've missed something, or
  something else triggers it, such as copy constructor)
- started working on a system to add external pointers into SWOS VM, they will have the highest bit set and
  be treated specially, that should reconcile SWOS and non-SWOS menus
11.09.2020.
- implemented simple memory allocation system to support mixed menus + system for SWOS VM pointers that can
  access outside memory, we'll see how it will fare in practice ;)
- implemented safe fetch()/store() for 8-byte pointers
12.09.2020.
- implemented registering user procs with SWOS VM
- updated verifySafeMemoryAreas() to check all newly added safe areas
- fixed a bug in convertMenu(), didn't bump data pointer when handling custom foreground function
- implemented native menu codes (to support out-of-SWOS menus)
- starting with mnu2h and menu system modifications but it's revealing to be more complex than I thought;
  lucky I took over convertMenu() or it would be impossible; and it's even greater luck I wrote a little
  language for describing menus, which allows this big change without myself going insane (just barely)
13.09.2020.
- created Offset and Procs enums in vm.h and expanded procs with exported ones
- begun converting mnu2h to support new stuff
14.09.2020.
- my two week vacation begins! let's push this far! ;)
- moved mnu2h conversion further, now using new enums but still need to fix up StringTable (and maybe few
  other smaller codes) so it's possible to handle mix of contained SWOS and non-SWOS pointers
15.09.2020.
- implemented C++ classes for new native menu codes
- updated output from mnu2h to detect and generate them (except for string tables)
- added check for menu headers to report error if functions are mixed SWOS/non-SWOS (luckily there is no
  need for such menus yet)
- pushed plenty of changes to mnu2h, and woah... it compiles, but too scared to run it ;)
- fixed asserts so debug version now compiles too
- fixed variable offsets off by 256 bytes
16.09.2020.
- added natvis visualization for SwosDataPointer and SwosProcPointer
- trying to fix another variable offsets mess up, it only happens with the later ones, the first ones are OK;
  seems the problem is tied with @replace section, which was introduced to help expand some buffers in SWOS;
  actually the size of the array was picked up from export section (which was inflated since the buffer was
  extended with @replace, but the variables were generated according to the old size)
- argh, @replace section was implemented on output level, by simply copying replacement to the output
  verbatim, since the syntax is ASM that worked but with advent of C++ output it couldn't be done like that
  anymore; added proper parsing of the replacement text and everything is fine again
- introduced a new check: size of exported array variables must match with the source, and already caught
  a couple of mistakes with it
- improved error reporting a bit
- even after all these fixes there's still another variable offset discrepancy :/
- pinpointed it to smallCharsTable, it's a struct variable, but one not properly declared in IDA, so it looks
  like an ordinary word, while it's imported as a CharTable (but much too late now to even try fixing it)
17.09.2020.
- fixed struct variables size in a satisfactory way, but there's still some more discrepancy :/
- it was due to convertKeysTable being interpreted as a single byte variable instead of 110 bytes array
- then there's more, currentHilBuffer is making problems -- size calculation didn't take in account base
  size of array element (dword in this case), fixed, but can you guess? something else still ain't right
- spritesIndex was the culprit, this time exported declaration had smaller size so it shifted everything up
- moving on, stadiumMenu is of PackedMenu type, and ida2asm doesn't know about it and defaults to 4 bytes...
- implemented system to report an error if an unknown struct type is encountered in exports
- adding @type-sizes section to symbols.txt so type sizes can be introduced to ida2asm (hard coding them is
  really wrong)
- argh, dword -> byte[4] conversion sabotaged the works
- stopped counting issues, but finally, offsets are matched! :)
- and FINALLY, after some months, going to run the game :) of course it crashes, so now fixing stuff on the
  fly and debugging; it's a great pleasure watching SWOS VM work, even in its current crippled state :)
- there's some gnarly bug that forces 16-bit conversion on each memory read, but it's too late now to fix,
  besides, gotta leave some for tomorrow too ;)
18.09.2020.
- my, my, what was I on to write such vulgar and unrefined code, this must be addressed at once; so it seems
  I added it to address compiler warnings, which is only fine for 16-bit access, I must have been misled by
  the sheer number of them and disregarded the other option (a lesson to take); a simple check for operand
  size did the trick and we're back to the races
- optimized generated code when assigning zero constant to memory, things like "= 0 & 0xff" and "= (0 << 8)"
  were annoying me
- added leading comments for functions to output (making them easier to debug)
- fixed removal of unnecessary "return" from the end of the proc and double empty line, those somehow got
  broken with the introduction of intermediate form converter
- fixed double empty lines before labels
- fixed jmp short missing space between local label
- converted jumps to last labels to returns (and removed the labels)
- now on to solving some mysterious crash in DoUnchainSpriteInMenus(), looks like some mess up with memory
  write indirection, but gotta quit for now; back, no big mystery, high and low words of a Register struct
  were mixed up
- good we're moving forward, now there's an infinite loop in InitializeTacticsPositions() ;)
  so it seems integer conversion rules have bitten me:
  a, b, c -> signed 16-bit ints
  (word)a - (word)b < (word)a
  left side ends up as signed, expression gets promoted to int (since it's smaller), and then the right one
  as well (but not relevant since it was positive); in the end it's negative int compared to positive and
  doing the opposite of what was intended :S
- seems some of the menu infrastructure will have to be rewritten
19.09.2020.
- managed to fix menus cheaply ;) a bit hacky but it was fast
- seems there are misaligned fields in the SWOS structs, thinking about the best way to address this, but
  first will try to enable exceptions for misaligned access on x86 somehow
- seems it's very difficult to enable AC (alignment check) exceptions on Windows, and even if successful it
  will cause a large amount of noise from Windows code itself and libraries... have to give it up for now
  and rely on my own asserts
- trying to get convertMenu() to working condition (plenty of small mistakes fixed so far)
- just my luck, found a compiler bug again (this time connected with template non-type parameter); reported
  it, let's see what happens; the previous bug is still "under consideration", it will probably die like that
- implemented a workaround, code is a bit uglier now, but no choice really, it's most important that it works
- crap, when I introduced external pointers I broke reading of a single g_memByte element, will have to call
  readMemory() on bytes as well
20.09.2020.
- added readMemory() and also writeMemory() for byte access
- got pissed of occasional crash that happens in ida2asm only in release version, found a place where opInfo
  was accessed before being initialized (for no operand instructions) and fixed it, but it's still happening,
  about once in 10-20-30 runs
- after gruesome debugging session narrowed it down to orphaned assignments remover (causes crashes) and
  redundant instruction remover (causes error in output file, could be some overwrite or something weirder);
  and now it's as if it stopped happening, giving it up for now, but it's just sooo annoying $%&#*@$!^
- ops, I overlooked the fact that pointers from the pointer pool can be incremented and manipulated; so the
  strings will have to be copied in the SWOS VM address area with the linear allocator, but the index
  variables in string tables can still use the pointer pool just fine (those pointers are constant and will
  allow updates from the UI to propagate to C++ code)
- ha, finally got to a menu screen, though it's completely broken and crashes on mouse move :D actually it's
  just the text that seems garbled & plenty of alignment asserts are triggering
21.09.2020.
- comparing sprite data after unpacking with x86 version, and it is a bit off; signed right shift where
  unsigned should have been slipped into rotation with carry routine, fixed it and now the unpacked sprite
  data is identical
- the menu is still garbled but the text looks a little bit more like a proper text :D off to get bicycle
  from the bike repair shop and then will see wth is going on :D
- dumped memory after sprite uncrunching and compared it, it's the same (save for pointers); so uncrunching
  routine has cleared suspicion and restored its good name
- changed 8 and 16 bit registers to unsigned to avoid problems with signed right shift
- seems flags optimization was too aggressive since I changed node.flowChange flag to only include
  instructions jumped to and not jumped from (alleviated with instruction->isBranch() check)
- ops, forgot to put return in writeMemory() after writing single byte, and wooow the menu is finally showing
  up properly :D it doesn't _work_ properly, but one step at a time :D
- fixed miscalculation in registerProc()
22.09.2020.
- overrode assignment of 68k registers to automatically convert pointers into SWOS VM offsets
- fixed calling convertMenu() instead of prepareMenu() (so selected entry index wasn't converted to pointer)
- fixed invalid code generation for onSelect function with mask in mnu2h and menuCodes.h (and some more)
- added new type of menu header (v2), it differentiates from the old by starting with -2 (in onInit field);
  it should never show up in old menus; this header type supports mix of SWOS and non-SWOS functions
- fixed some more miscalculations about proc indices, and separated 0 and -1 values for pointers
- fixed not assigning memory for string that are to be allocated
- fixed bugs in natvis script
- ha, menus "kind of" work now, victory is near! ;)
23.09.2020.
- they closed my bug, it seems VC++ does some retarded things by default, but luckily it can be disabled with
  "/permissive-" command line switch; what's worse I've read the article but couldn't believe a simple thing
  like this wouldn't work by design
- realized that -2 isn't good value for menu header mark (considering VM starts procs from -2 downwards),
  changed to -100,000
- invalid codes started popping out again, but I can't reproduce it in a small project, reverting to the
  workaround and not looking back
- reworked menus a bit, eliminated g_currentMenuPtr since it could potentially point to both VM and non-VM
  address
- fixed some pointer methods I missed in Register
- woohoo! basic menu navigation works!
- now trying to get into the game but friendly menu isn't reacting; it's because pass through functions
  weren't implemented correctly (and friendly menu depended on them) - fixed
- fixed null strings wrongly set to kSentinel, causing allocation of menu space for string data, and
  starving the menu buffer
- trying desperately to reach the game ;) but getting some null pointer access in SetCountryNames()
24.09.2020.
- fixed missed initialization of MenuEntry drawn field
- really fixed pass through functions, this time for real
- removed extraneous "return" when jumping out of the proc
- this is funny, I've never been debugging two programs at once -- x86 SWOS vs VM SWOS comparing what's
  going on, and a good old x86 version has been an immense help, speeding everything up
- now the friendly menu shows "CHOOSE TEAMS" button after pressing "OK" (this part was missing), but it still
  fails with null pointer access in SetCountryNames() because countryNames array isn't getting populated for
  some reason
- yikes! I've accessed g_memDword in one place without dividing address by 4; that's why country names
  weren't populated
- managed to pass to the next menu, but this one is broken, the title entry is selected and I can't move
  anywhere :D
- dayum, didn't write to 2nd address when writing word to odd memory address :/ took a nice investigation to
  uncover this; with this fix the next menu is unlocked! I can now select teams, but when going to the next
  menu it crashes again :P
- the struct offset was wrong, when a struct contained a nested struct with dup modifier, the dup modifier
  wasn't multiplied in; after taking care of that got into play match menu and started the game... almost! :)
  it's crashing on the loading screen
- mistake was in struct variables... ugh, hate syncing variables, but had to go back there and fix extraneous
  bytes added to stadiumMenu
- also discovered a mistake in types sizes for ida2asm, added static_assert's so at least it won't compile if
  it ever happens again
- now going further, and crashing in ConvertSpriteColors(); seems that movzx is generating signed extension
  instead of unsigned; fixed and now reaching deep ocean, ending with a heap corruption X_X
25.09.2020.
- testing things by adding heap checks after each call, and then verify VM memory checks (after making them
  work properly), but it's all checking out fine, except for load file call, something fishy is going on
  there
- fixed ++/--/+=/-= SwosDataPointer operators
- d-oh! the memory array had the old (lower) size the whole time, that's why there were memory overwrites...
  :facepalm; after the fix there's some rogue pointer in GetTeamPointer()
- urgh, mask for writing 16-bit values was wrong, 0xff instead of 0xffff :/
- fixed copying pitch patterns, g_pitchDatBuffer was reinterpret casted into array of ordinary char pointers
  instead of SWOSDataPointer<char>'s
- fixed movzx from a variable (constant address) that was broken
- somehow in FadeOut() palette pointer gets obliterated; reason is a bit crazy, because in the calling tree
  from setPalette() a SWOS function(s) gets called (char drawing, by dumping routine) and trashes the
  important registers, so not even virtual registers are safe!
- and finally in the game :D player names are messed up, and flicker in an epilepsy-inducing manner, ball
  bounces strangely, as if it has more energy than it should, goalkeepers are letting easy goals in...
  just kidding about the goalkeepers ;D they seem OK-ish, as much as I could see until the game crashes
  (it hardly every survives longer than minute 70 or so); still, I'm pretty satisfied, will investigate more
  tomorrow, better get some sleep now :D
26.09.2020.
- implemented removing unused flags calculation from a function; unfortunately I didn't remember that there
  are functions that use flags as return values (zero, sign & carry), so the only flag available for removal
  was overflow; still, it removed thousands of lines, and overflow is the most complicated to calculate
- I've discovered something very interesting, there are only two jump-if-overflow instructions used in the
  whole program, and both are actually wrong! they are used after div instruction, which leaves overflow
  flag in undefined state; 68k does set overflow flag after division, so it must have been an oversight;
  they are used after some calculations in unknown part of the game (it seems to be something related to
  price calculations in career mode) and are practically used as an assertion -- game goes into infinite loop
  asking for debugger if they trigger -- so I will disable them for now
- fixed invalid code in the case when overflow flags is supressed
- added static assertions for couple variables struct members, so if it gets broken again it will be reported
  immediately
- fixed LODSW & LODSD; now the team names display properly at the start of the game; sprite flicker and weird
  ball bouncing are still present; played the game till minute 78 before crashing, that's a record so far
- fixed flags optimizer not removing flags on the instruction immediately following a label
- fixed flags optimizer not removing flags of the instruction before a label (caused by me erroneously adding
  isBranch() check along with flowChange, instead of replacing it)
- sprite flickering: after putting an assert at sprite index assignment and going backward I found that
  invalid sprite index was occasionally set by the animation routine, but it wasn't its fault, it was getting
  an already corrupted animation table; then I've set a data breakpoint on those trashed bytes and that lead
  me to ResetResultSprites(); it was trying to initialize team scorers data, but the structure wasn't
  generated properly, it was too short causing ResetResultSprites() to write well beyond it, into the
  animation tables; struct size was invalid (didn't count nested struct size properly), same thing I fixed
  in a different spot before -_- but not gonna bother now with refactoring
- fixed a little crash when going back to menus after the game
- and the game is working pretty well :) played a few games, no crashes, works pretty smooth, only this
  weird ball bouncing that's bugging me; will try compiling a 64-bit version, maybe it will be easier to
  catch it there (if I don't solve it by then)
- started with project conversion to 64-bit, ida2asm is already triggering some new assertion
27.09.2020.
- with the help of x64 version finally fixed that damn ida2asm occasional crash, ran it 30+ times and not
  a single failure, woohoo! it all came from branch instructions not getting their op info initialized and
  later causing nasty things, what was I thinking writing it...
- reorganized project to better accommodate multiple platforms, as well to be organized a bit better overall
- compiled all the necessary libraries in 64-bit mode, fixed errors, and the x64 version is finally built!
- adjusted VM memory pointers to be on the pointer size boundary and set up static asserts to trigger if
  they aren't
- 64-bit compiler is generating some stupid code, creating temporary SwosDataPointer on stack at rsp+21h,
  triggering misalignment assert; that forced me to add assignment operator that takes dword, and now it's
  assigning it directly and everyone is happy
- and played the first SWOS 64-bit game :D it was in debug mode and slow-motion, at least 2 times slower than
  the x86; noticed some other glitches too, some player icons weren't drawn during the loading menu, and
  sometimes wrong comment was played (maybe I'm wrong about this one); the ball bounce still felt weird,
  although it's hard to gauge when the game is so slow
- tried the release version, and that calmed me down: the game works brilliantly :D super fast and smooth,
  just the SWOS we know and love; the bounce still feels weird, and is especially noticeable on muddy pitch;
  it seems to happen on several occasions but it can be triggered by simply holding up/down and pressing
  fire, kick like this reaches opponents goal from almost half of the field
- pressing 'S' in debug version was causing stack overflow: the jump-to-function-start instruction was
  implemented via a function call and that was sucking the poor stack dry; replaced the call with a goto and
  it's fine now (still no idea why x64-debug version is so slow)
- lol, my x64 debug configuration was copied from release, that's why I was able to capture the ida2asm error
  so easily with an assert, why didn't I think of this before :)
- there was an error in parsing negative hex numbers, they weren't detected as hex properly; fixed, but the
  ball still acts weird :/
- fixed invalid memory dword read when address % 4 == 1, both constant and dynamic
- did more detailed comparison with x86, and "the super-bounce" is definitely a thing
28.09.2020.
- improved ida2asm error reporting a bit, though it's still quite rough
- fixed not clearing string flags for color converted sprite entry in unpackMenu()
- fixed a mistake in fetch user proc routine that was failing for the first one
- implemented releasing of memory when the menu closes (hope this will not unearth some bugs in SWOS menu
  handlers!)
29.09.2020.
- did static analysis and fixed a bunch of things, e.g. I was returning references to tmp objects in postfix
  increment overridden operators... big whoops, bunch of integer promotion traps etc.
- discovered & fixed an invalid type cast in IMUL
- preparing to commit took insanely long time, wasn't aware there were this many changes
30.09.2020.
- reversed parts of career initialization, namely parts that initialize foreign market players while chasing
  that infinite loop bug when starting new career
- that led me to a bug in optimizer, pinpointed it to shift instructions which weren't properly marking their
  target causing wrongful removal of some instructions; haven't got around to properly fix it just yet though
01.09.2020.
- ha, fix almost worked from first try, almost got me worried ;) still, it was done in a satisfying manner
- tested, and the infinite loop is gone as well as the super-bounce! so that's two birds with one stone :D
- fixed load files menu, now highlights/replays work, tactics importing etc.
- fixed video options menu
02.09.2020.
- had some fun & learning while profiling ida2asm, shaved of another ~50ms :D
- optimized optimizer a bit ;) it now deletes a bit more instructions
- trying to compile SDL2 for Android, this will be death on the dance floor
03.09.2020.
- managed to compile SDL2 for ARM with Visual Studio, but not its Java wrapper project
- had an idea today, to actually kick out lot of x86 registers from the code and leave 68k (since it was what
  the conversion was from), but it could get complicated, might leave for later, will see
04.09.2020.
- managed to build Java project as well, but can't setup latest SDL (which has a lot of Android updates)
  since I don't know how to assemble optimized NEON blitting routines
05.09.2020.
- managed to build complete project with the latest SDL; managed to set up compilation of NEON assembly
  routines, it seems they were made for GNU `as', not internal clang assembler (-fno-integrated-as flag),
  had to tell it specifically to assemble (-x assembler-with-cpp flag) and set target specifically
  (-target aarch64-none-linux-android and -Wa,-march=armv8-a for the assembler) + the assembler has to be
  copied from the ARM NDK dir; however it turned out that the generated object files are 32-bit (for arm v6/7)
  and can't be linked with the rest), but the worst thing is I saw on the Github that they disabled them since
  "they are buggy", so excluded them for now - atm I got everything compiled for API level 26, but I'm
  targeting level 16, and as soon as the level is switched everything breaks apart, so trying to figure that
  out now
- there are indications if this is successful I could build the whole game from Visual Studio using the
  existing project and solution which would be awesome :)
- trying APK on 3 phones but it won't install, even the emulator is refusing it :(
06.09.2020.
- APK doesn't work since it wasn't signed; so I need to figure out how to sign it :P
- despite not being signed it should still work on the emulator, but it doesn't; when trying to deploy to
  emulator Visual Studio just sits there and nothing happens, updated to the latest version but it still
  happens
07.09.2020.
- updated Windows but it's still not working... and now the Internet loses connection every 20 seconds or
  so... reverted back, what a debacle
- giving up on Visual Studio for now, trying to make Android Studio work, it can at least deploy to emulator
- failed to build in Android Studio via CMake, it keeps failing to configure without a clear reason
- maybe it could work via ndk-build even if it's deprecated (I'll take anything right now)
- Android Studio using ndk-build just wouldn't budge, only managed to get some limited info via command line
  (possibly jni dir is in wrong place, or they just changed expectations between different versions), maybe I
  could just use pre-made binaries from Visual Studio and combine them with project in Android Studio, will
  try that tomorrow
- haha, managed to build it with CMake with last ditch effort :)
08.09.2020.
- built native libs of all flavours in Android Studio (debug/release, 32-bit and 64-bit Intel/Arm), had to
  hack cpu-features include/C file for 32-bit Arm but it succeeded in the end; I thought the build was for
  the Android level 16, but I missed a warning that CMake never actually used that variable, so it's a big
  question if this would really work
- failing to build hello world (it fails to find lib SDL2)
09.09.2020.
- after many shenanigans managed to compile SDL program and execute it on the emulator, bundled with all the
  necessary native libraries; it's not really doing anything, will have to compile SDL_image library and see
  if it would load an image correctly
10.10.2020.
/
11.10.2020.
- compiled SDL2_Image
- trying to make a sample program that loads a PNG and displays it, but I realized I have no idea how to
  prepare files so IMG_Load() can find them :P I think they must go to assets directory, but now realized I
  haven't properly compiled SDL_image: PNG support is missing, and must be added via external libpng library
  and now have to figure out how to compile and integrate that...
- managed to build static libpng, after the usual long fighting with this build system
- woohoo! hello world is finally running! it works on the emulator, good phone and mediocre phone, only fails
  on the crappy phone (it can't find libc++_shared.so even though it's inside the APK); will see more about
  this later, it might be possible to fix it and cover a truly insane range of devices :) and if it turns out
  impossible, it will still be all right; will be split on 1) fix support for Android 16 and 2) start to
  compile/boil the water for the Android SWOS build ;)
12.10.2020.
- fixed library load error, all it took was some load order rearranging, seems later Androids are smarter
  about this, however SDLActivity is triggering an exception, something about Bluetooth
- it was using BluetoothManager class not present on Android 16; just checked for null and skipped Bluetooth
  initialization and voila, the little sample is working on the crappola phone too :)
- reorganized project files hierarchy to accommodate other platforms, had to replace ..\ with ..\..\ for
  every single file in VC++ project files, ugh...
- making VS project file to create Android shared library with the game's main code; so far it seems I must
  use VS supplied NDK and Android version at least 21 for everything to compile properly; I'll move forward
  with this combination for development, and resolve any issues in the end, possibly doing final build in
  Android Studio
- trying to compile for clang, but the errors keep piling up :P
13.10.2020.
- got the thing to compile, but not link; need to build SDL_mixer and ADLMIDI for Android
14.10.2020.
- compiled SDL2_mixer (and it's accompanying libraries), it's been an unsurmountable suffering
15.10.2020.
- compiled ADLMIDI
- removed useless ORs with the same operands (e.g. ax |= ax) in the generated code
- fixed linker errors and finally got SWOS in the lib form, unfortunately it's crashing at start; not sure
  it's Visual Studio build's fault somehow, will investigate
- seems Android Studio is very insistent in stripping native libraries during the build, gotta stop it from
  doing that or link symbols somehow to see why is it crashing
- found out, I just had to add each arch dir under jniLibs to debugger search path and now debugging works
  beautifully; ops, I didn't pack all the necessary files :) and the log file couldn't be open for writing,
  I just rerouted it to Android's logcat
- trying to make it load files from assets
16.10.2020.
- switched to using SDL's RWops file handling system, it's simple, covers desktop & Android transparently
  and does exactly what I wanted to do
- got into menus on the emulator :)
- fixed control options menu
- added a system for caching constant strings from SwosVM
- changed "QUIT TO WINDOWS" to "QUIT TO ANDROID" on Android ;)
- found out that I actually have a 32-bit ARM CPU - a Cortex-A9, that will come in handy later
17.10.2020.
- managed to run it on the real phone (it does take a while!), but it crashes when opening league to pick
  teams; and that is because annoying Linux case-sensitive file system is creating problems, converted all
  paths and filenames in assets to lowercase to compensate
- fixed a few bugs in the conversion
- turned off selected entry shining frame in menus on Android, looks too weird when there's no mouse pointer
  to follow; but then changed my mind (what if someone uses attached keyboard?) and added an option to turn
  flashing on/off so the code doesn't go to waste ;)
- fixed a highlighting current entry bug in menus which only now became visible after some unrelated changes
- "played" a game on the emulator :) it's nearly impossible to control with "mouse" controls, and arrows get
  rotated (up/down becomes left/right and vice versa) since the phone is in landscape mode :P
- played it on two phones too :) performance was OK on the good phone, but the game runs a bit slow on the
  worse phone, fluid but just slower than it's supposed to (I was testing debug version will see how release
  is doing)
18.10.2020.
/
19.10.2020.
/
20.10.2020.
/
21.10.2020.
/
22.10.2020.
/
23.10.2020.
- started modifying controls code in order to have menus controlled by any controller simultaneously; that
  will require removal of pl1 & 2 controls, and changing game controls into just controls; also controls
  module should be responsible for maintaining and returning a list of potential controllers; will need to find
  a way to detect keyboard on Android/iOS too
24.10.2020.
- converted MenuCheckControls(), for now as original, without additional code for handling all the
  controllers (but partially, since I'll delete a lot of code, no need to bother to be super precise)
- removed too many variables, will have to fix it tomorrow (or remove/convert some more functions if
  possible)
25.10.2020.
- rewriting the controls code, making any controller control the menus; there's a lot of code here that is
  assuming the wrong thing(s), and I kind of forgot how it all worked, so this might take a while
26.10.2020.
- continuing with controls, it's going slow
27.10.2020.
- removed internal handling of keys via PC scan codes, now SDL scan codes are used and the game should be
  able to use all the keys SDL supports
- removed control flags, as it was nothing but an unnecessary layer; code is simpler now and some
  nanoseconds faster ;)
- removed more controls stuff, hope this will work :P
28.10.2020.
/
29.10.2020.
/
30.10.2020.
/
31.10.2020.
- writing/updating old SWOS++ document about the inner workings of SWOS controls (so I don't forget it for
  the umpteenth time)
01.11.2020.
- finally finished the document, it was exhausting for some reason; but I have a good base now if anything
  needs to be looked in more details
02.11.2020.
- noticed that there's been one unpleasant copyright notice in the source all this time; probably not a big
  deal, but removed it to be on the safe side + created a git pre-commit hook to stop the commit if it's
  detected
- trying to get things to compile again, and then get the combined menu controls running
03.11.2020.
- started writing a little documentation on the mnu2h, and realized there are some bugs, fixed them + fixed
  most of the failures in tests (will fix the rest on some other occasion)
- finally compiled and ran, and nothing is working... great...
04.11.2020.
- somewhat fixed it, but too tired to continue; seems keyboard navigation is slower now, will have to look
  what's with that; also fire is very unresponsive but when it finally responds it shoots like crazy and
  opens a bunch of menus
05.11.2020.
/
06.11.2020.
/
07.11.2020.
- I though I solved fire key spam problem, but I didn't, argh
- almost there ;) works, but it's slow to register the first press, something must be improperly initialized
08.11.2020.
- was fixing some left-over stuff after switch to SDL key codes and somehow got entangled into making strings
  work for any input (like names of the keys from SDL, names of joypads...)
- converted menu-time functions: GetTextSize() and DrawMenuText(), they can now handle lower-case text
  without spitting out a slew of x's (which should simplify things a bit and relieve menu functions from
  drudgery of converting text to upper case)
- things are a bit better but still not working correctly; also had to delete saved key codes from ini file
  since they were mapped to wrong integers (old PC scan codes, while the game now expects SDL ones)
09.11.2020.
- menus are now controlled by both keyboard keys-sets but the fire still feels a bit weird
10.11.2020.
- didn't really do much today, just one small intervention and the controls seem to be working just fine :)
  now got to hook up & test joypad menu code and universal menu controls should be done
11.11.2020.
/
12.11.2020.
- all right, fixed joypads (there was a silly mistake), now controlling the menu works except it ignores
  first couple of movement commands; will try updating SDL to see if it will help
13.11.2020.
- updated the SDL but the same thing is still happening, damn :)
14.11.2020.
- seems like a movement on left/right and up/down axis only starts after the d-pad was moved and released
  once, afterwards it works fine, and the SDL doesn't send an event for it; trying out SDL joystick test
  sample and it seems to detect the first movement but only via loop, not with events
- disabled accelerometer showing up as joypad on Android (needs to be tested though)
15.11.2020.
- bought a cheap knock-off Xbox/PS3 controller; woops, now I see what I've been doing wrong, will need to
  rewrite some code here
- trying to address problem of saving configuration for multiple joypads of the same model by adding a player
  number to go with it, so there can be at least 2 configurations; also transitioning joypad reading to state
  functions instead of events (to avoid the weird behaviour with the first movement which fortunately doesn't
  seem to happen on the new controller)
16.11.2020.
/
17.11.2020.
/
18.11.2020.
/
19.11.2020.
/
20.11.2020.
/
21.11.2020.
/
22.11.2020.
/
23.11.2020.
/
24.11.2020.
/
25.11.2020.
/
26.11.2020.
- decided to use last selected timestamps for joypad list, so most recently used joypads will be preferred
  when reconnecting; then I realized I haven't been saving timestamps to files in C/C++ before (only to
  SQLite), it turned out to be an interesting problem, had some interesting reads, especially about the year
  2038 problem
- trying to put everything back in order, but it's pretty smashed atm; need to find a way to access joystick
  axis mapping (hope SDL has it), so I can tell which one is x and which one is y
27.11.2020.
- exploring joystick test sample; seems it considers even axis as x and odd as y, even though that may not
  necessarily be true
- analyzed SDL Game Controller API, mappings are pretty cool thing and they could be used for our purposes,
  I just need to figure out how to actually map joypad controls through SWOS UI in some acceptable way
28.11.2020.
- figured out some more how this works, it's gonna be tough
29.11.2020.
/
30.11.2020.
/
01.12.2020.
/
02.12.2020.
/
03.12.2020.
/
04.12.2020.
/
05.12.2020.
/
06.12.2020.
/
07.12.2020.
/
08.12.2020.
/
09.12.2020.
/
10.12.2020.
/
11.12.2020.
/
12.12.2020.
/
13.12.2020.
- drew some rough sketches of new screens for configuring joypad elements
14.12.2020.
/
15.12.2020.
/
16.12.2020.
/
17.12.2020.
/
18.12.2020.
/
19.12.2020.
/
20.12.2020.
/
21.12.2020.
/
22.12.2020.
/
23.12.2020.
/
24.12.2020.
/
25.12.2020.
/
26.12.2020.
- randomly took to reversing AI routine, and had quite some success, learned a lot
27.12.2020.
- had some results but couldn't completely analyze it as I hoped, so putting it back on ice for now, it's
  not so important at this moment
28.12.2020.
- been trying to determine where the routine for calculating "VIEW RESULT" is, it's been pretty difficult
  I've finally located it (at least I'm pretty sure of it), however it's quite a mess, can't tell a thing,
  there are lots and lots of tables, indexed by some random values + some player related values; I think
  I've seen some average price calculations; note:
  cseg_2C47D <-- this should be explored, it loops for each player, and increases unknown field in TeamFile
  struct
29.12.2020.
/
30.12.2020.
- my vacation begins! finished with joypad configure screen design (I hope!)
- found out that I don't need to create a VS add-in in order to have custom syntax highlighting, only a
  TextMate language file, which is great
31.12.2020.
- after a long fight managed to get some coloring to the mnu files :) it's still crappy and needs a lot of
  fixing but it's a good start, I was already doubting if the whole thing works at all
01.01.2021.
- read a guide for writing TextMate grammars, and some (semi)official documentation
- starting to get the hang of it, made some nice progress; still need to finish preprocessor expressions and
  tie up some loose ends, but it's looking good
02.01.2021.
- finished with tmLanguage file! it's not perfect, since I couldn't access the colors directly, but it's way
  better than nothing ;) also quite content that I avoided the bullet with not having to mess with language
  services, now that'd take forever...
- wrote some more mnu2h documentation, now that I've refreshed my knowledge of it
03.01.2021.
- having a lot of unknown elements in entries of control menus is complicated, I've decided to embed
  automatic string elision into menus, and that requires getting control of menu rendering; this will also
  allow for creation of lists with automatic scroll arrows, and the interaction with SWOS VM address space
  can be improved
- [ida2asm] fixed incorrectly reporting an error about unused symbol when the symbol has been eliminated by
  a range and at the same time marked for import from C++
- converted DrawMenu
04.01.2021.
- decided to delete old controls code for now, it's just too messed up, we'll go from scratch
- converting DrawMenuItem, at approximately more than a half
05.01.2021.
- DrawMenuItem converted!
- somehow managed to compile it, debugged it, and it seems the conversion went without too many crashes ;)
  now ~80% menu code is converted, it's almost VGA graphics free ;)
06.01.2021.
- planning out new controls code flow & data structures
07.01.2021.
- started the initial coding
08.01.2021.
- did a bit, but it's harder than I thought, got an unpleasant case of multiple joypads of the same model, in
  which case the GUIDs are all the same, and then what to do?
09.01.2021.
- finished addJoypad() and some minor things
10.01.2021.
- been analyzing SDL's controller code in order to use their mapping database for defaults; it seemed like I
  wouldn't have to parse the mapping text format and could just fetch the already computed bindings from the
  controller API, but it turns out the API doesn't give enough information... ARGH, we'll just have to do
  this the hard way; will also have to figure out some way to test it, since there are ~200 controllers in
  the database
11.01.2021.
- finished mappings parser, mapping from SDL -> SWOS defaults in progress, going well
- did much needed refactoring of joypad code, put each class into a separate file
12.01.2021.
- finished default mapping, whew, that was tiresome, will have to find some way to test it well
- debugged it a bit, multi-joypad menu control works great ;) d-pad also works on Xbox-type of joypad; added
  default mapping for my retarded MediaTech USB controller so it also works out of the box (with the phantom
  axis disabled)
- fixed joypad input clearing (repeat button prevention when navigating new menus)
13.01.2021.
- extracted keyboard handling and belonging classes from controls; slowly unifying all controller types to
  return events mapping, and then further processing it on a higher layer to get the input for the menus
14.01.2021.
- didn't get much done today, but extracted mouse code, converted it to return events and added some special
  handling for right-click long kick (not sure if it works at all)
15.01.2021.
- fixed too fast fire on joypads
- fixed clicking with mouse
- fixed player keys getting precedence over function keys (stats, etc.)
- fixed options never applying default values if not present in ini file (oops, this was here for a long long
  time)
16.01.2021.
- made mouse clicks trigger on button up, as is true and righteous
- fixed blocking the cursor from flashing while mouse button is down
- fixed mouse click issue when going to friendly and click holding OK, it would select choose teams menu
  after a while
- fixed +/- entries not changing faster when holding mouse button
- unfortunately, there's still some stuff broken in mouse handling, but have to end here
17.01.2021.
- fixed arrows not working when an entry is selected with mouse
- fixed +/- entries not responding to a single click
- fixed still selecting old, now invisible entry when returning to previous menu
- fixed mouse wheel scrolling
18.01.2021.
- while looking how to fix name appearing in career menu exit entry after entering text, I found a bug (or
  maybe some way too clever programming): SetName() takes entry point in A5, but over the course of action
  invokes DrawMenu() [which trashes A5], and afterwards DrawSelected() to draw a frame around the selected
  entry -- now this only happens to set A5 to the selected entry, which was the original entry sent in via
  A5 (you gotta select it and press fire for SWOS to start the input sequence)... SetName() is only called
  from this one place, and therefore the entire thing worked by accident, and failed as soon as I converted
  DrawMenu(); simply saving and restoring A5 in DrawMenu() did the trick
- made backup script set archives to read-only, after I accidentally destroyed one :(
- ran static analysis and fixed a few nasty potential memory overwrites (e.g. when saving and restoring
  virtual 68k registers x_x)
- found a nasty bug manifesting in friendly menu, when choosing teams and then exiting all the way to the
  last menu before main, it seems to have been there for quite a while, most likely introduced with SwosVM
19.01.2021.
- fixed the damn thing!! it was actually a bug in the constant memory write generation routine in ida2asm,
  the case when address % 4 == 3 :/ took me whole day and good part of the night to trace the bloody thing,
  at least I've reversed some more around select teams routine
20.01.2021.
- fixed right button click in all the menus reachable from the main menu; it seems very menu-specific so
  it's quite possible it won't work with some or many of the untested menus, so for now let's call it an
  experimental feature
- fixed an assertion in load competition menu
- made mouse select only the entry that was clicked upon releasing the button (so it's possible for a user
  to change their mind and give up the click by dragging away)
- added caching to determineReachableEntires(), based on the last converted menu
- fixed an annoying warning in the token tester about "register" keyword usage
- added an option to disable joypads controlling the menus
21.01.2021.
- started with joypad info screen
- improved mnu2h tests a bit
- reviving tests project and converting it to 64-bit and SwosVM, fixed tons of errors but still not there
22.01.2021.
- made tests compile again (but haven't yet got around to see if they really work)
23.01.2021.
- they added an annoying message box in SDL that pops up whenever load of redirected DLL from environment
  fails (which it must to so I can grab the juicy function pointers), so I had to write a window hook to kill
  the first window that's created that contains some keywords
- fixed silly logic error when null testing SWOS proc
- fixed plenty of tests + some bug, but tests still not fully operational
24.01.2021.
- [ida2asm] added new directive for exports: (align: <n>)
- tests are back with vengeance!
- thanks to tests, fixed a couple of bugs:
    - typed keys weren't properly stacked (LIFO instead FIFO) and were registered twice (releases instead
      presses only)
    - invalid use of menu buffer when inputting a number
    - crash when showing error menu in video options menu
    - saving DIY file 1 byte longer due to 1 byte alignment added to the variable that follows the buffer
- fixed mnu syntax highlighting file, even though I believed it was perfect ;)
- fixed description for replay files, "REPLAYS" -> "REPLAY", that "S" made it overflow the box, no idea how
  that came to be
25.01.2021.
- started converting menu text routines, with the goal of adding automatic elision (seems lower-case handling
  and skipping of unknown characters was already done, sweet!)
26.01.2021.
- finished with menu text routines conversion, non-elided strings seem to work fine, haven't had a chance to
  test elision in action since SWOS strings fit well; it'll have to wait for controls menu and crazy big
  joypad names
27.01.2021.
- implemented enough stuff to make control options menu show properly again and started adding virtual
  joypad support
- [mnu2h] fixed a bug in expression evaluator where a parenthesized sub-result would overwrite current
  expression value
28.01.2021.
- [mnu2h] fixed a bug in expression evaluator where an expanded variable comprising of several operands would
  not be parenthesized and might be calculated incorrectly if a higher precedence operator precedes it
- [mnu2h] fixed a few smaller issues
- [mnu2h] tests are fixed! also expanded them and increased code coverage to 99% :)
29.01.2021.
- [mnu2h] fixed a few minor issues and covered a few more smaller cases with the tests; I'm quite satisfied
  now and think that it can be left like this, hopefully for a while
- came up with and drew a sketch of the setup keyboard menu
30.01.2021.
- started implementing setup keyboard menu & belonging code
31.01.2021.
- [mnu2h] disabled lower case strings warning, makes no sense anymore with improved menu text rendering;
  still, I let it live via a warning switch #lowerCaseStringsWarning[On|Off] which is off by default, in
  case it's needed for something in the future
- [mnu2h] fixed a bug when a result of join wasn't re-parsed as an expression member, causing dot expressions
  to go unevaluated (e.g. y: #join(some, Previous, Entry).endY + 2)
- [mnu2h] added "endX" entry dot property
- [mnu2h] added "entryAlias" command to define aliases for entries, so I don't have to write things like
  #join(key, #{kMaxKeysShown - 1}:02) every couple of lines
- implemented a rough initial look of the setup keyboard menu
01.02.2021.
- discovered a memory leak in the menus; unpackMenu() uses VM memory for unpacking, and when returning to the
  previous menu we have to unpack the last menu again, and all that memory goes to waste; to address it some
  ground rules had to be established:
    - unpackMenu() will tap memory from menu buffer (no VM)
    - onInit() function must only use VM memory, never menu
    - onReturn() function must only use menu memory, never VM
  hopefully this will sort it; also realized that clearing string cache after menu goes down is not correct
  with regard how it's currently used, but too tired to fix it now
02.02.2021.
- fixed string cache management (the thing from yesterday)
- fixed a mistake with index pointer in native string tables
- fixed a bug where an invisible entry would get selected by mouse when returning from setup keyboard menu
  to control options menu (player1, when there are no joypads); the issue was that we were updating mouse
  before onDraw() was executed, and in that first frame before onDraw() runs the entry is actually selectable
  (onDraw() hides it); moved updateMouse() after DrawMenu() and it doesn't happen anymore
- [mnu2h] disallowed top-level export (why? because I'm too lazy ;) and not to have it pollute the global
  namespace)
- [mnu2h] added menu entry aliases to C++ Entries enum as well
- got the keyboard setup menu to print keys and associated actions, finally got to implement a little bit of
  actual game code
03.02.2021.
- simplified setting up of mouse scrolling entries, and implemented it for setup keyboard menu
- disabled scrolling if the associated entry is hidden/disabled
- started refactoring mnu2h, trying to add string types in preprocessor expressions in order to create
  tokens conditionally (need this capability to assign top scroll arrow as a left entry to the first half
  of the scrolling entries, and right one to the second)
04.02.2021.
- [mnu2h] a grand refactoring is in progress
05.02.2021.
- [mnu2h] lowered number of failures and errors from gazillion to 36
06.02.2021.
- [mnu2h] woah, added the string type to the preprocessor expressions and the tests are passing!
- [mnu2h] added string indexing and Ruby-like symbols, :abc -> "abc", but some of the newly added tests are
  failing, no strength left to fix those
07.02.2021.
- [mnu2h] added int and str conversion operators to preprocessor expressions
- [mnu2h] apostrophe ' is now ignored among digits, just like in C++, so it can be used as decimal separator
- [mnu2h] finished writing and fixing tests for all the new stuff, it's working like a charm now!
08.02.2021.
- [mnu2h] added a warning if preprocessor expression uses empty global/menu variables (which is quite
  suspicious, possibly an error)
- [mnu2h] added missing unary + operator
- [mnu2h] went through all the source code, fixed some small issues and updated documentation a bit
- updated C++ project with changes in mnu2h dependencies
- added support for preprocessor symbols to syntax highlighting (regex doesn't actually capture only inside
  of preprocessor expressions, but what can ya do)
- finally set up the arrow movement in setup keyboard menu, the expression is working flawlessly ;)
09.02.2021.
- fixed scrolling of key/action entries
- fixed wrong size ellipsis in elision routine
- fixed slow scrolling when clicking on arrows (due to error in heuristics for recognizing scroller entries)
10.02.2021.
- fixed improper text elision for centered and right-aligned strings (needed to get the width the 2nd time,
  after elision and reposition the string)
- fixed a bug where a mouse click that brings focus to the window wasn't registered
- fixed not displaying "PLEASE WAIT..." message properly when enumerating video modes take too long
- implemented key deletion, added instruction labels, started writing a menu for getting game control events
  for a key (and other forms of controls later)
11.02.2021.
- fixed Python polluting the source tree with __pycache__ directories by setting env. var PYTHONPYCACHEPREFIX
- moved mnu2h into its own project
- moved VC++ projects into their own directories to clean up the mess in project dir a bit, I only left two
  old projects (swos-port and swos-asm), until I decide what to do with them (merge them to main one or not)
- [mnu2h] added support for having default next entries
12.02.2021.
- [mnu2h] added alias "onRestore" for "onReturn" function
- fleshed out select events menu, but realized it's confusing (and also ugly :P), so redesigned it
- fleshed out second version, and it's looking good, but realized it has a flaw from UX standpoint (big area
  that is not clickable), so going to improve there and hopefully that'll be the final version
- also fixed menu header in options that wasn't exactly in the middle, whoops!
13.02.2021.
- OK, the third menu version is done, and will leave it for now; I'm using gray for clickable entries which
  is inconsistent with options, and also having two columns doing the same thing, but it's the visually most
  pleasing version so far
- fixed click from canceling keyboard input clicking item in the previous menu
- fixed printing of key names with characters SWOS can't handle; actually I didn't do anything, just
  improved a little a function I already wrote no idea when, it's so cool when you can just cross an item
  of the TODO list ;)
- "fixed" assertion in draw text routine when given 255 (cursor block), turned out the assertion was wrong
  (treated char as signed), another item crossed :)
- fixed a bug where an entry would remain selected after it got hidden/disabled by its on-click handler
- finally finished with adding keyboard mapping, I think I've covered all the edge cases
- both adding and updating keys operational
- realized I've been using MS sprintf_s function which doesn't truncate too long strings but kills them
  completely; added a macro that will cause an error if it's ever detected in the source again, and switched
  to snprintf, it does the right thing
- implemented quick config, the old style of keyboard configuration
14.02.2021.
- fixed assigning keys from other player when adding key mapping and refactored common code so it's used by
  setup keyboard menu and redefine keys menu
- just realized I don't need to go through VM when using drawText routines (they're converted), woot,
  things just got simpler
- finished the keyboard tester, now the keyboard setup is functionally complete!
- [mnu2h] added apostrophe digit separator for hexadecimal numbers too
15.02.2021.
- realized it's too easy to delete a key accidentally, so added a confirmation dialog
- managed to sneak in some refactoring
- started joypad infrastructure restoration
16.02.2021.
- it's possible to select joypads again, though separate configs for player 1 & 2 aren't implemented yet
- designed configure joypad menu and started implementing it
17.02.2021.
- added whitespace removal to elision to cope with retarded joypad names like 'USB JOYPAD '
- configure joypad menu looking mostly good, still need to add dynamic behaviour
18.02.2021.
- moved update of power level to on draw since it can potentially change
- fixed a silly mistake when creating replays dir, it would report an error even if it succeeded
- hid non-existing joypad elements and centered the remaining ones vertically
19.02.2021.
- configure joypad menu:
    - movement between entries implemented
    - max and current elements field filled
    - elements are interactive now, current index can be incremented, decremented and typed in directly
    - fields resized based on content and whole row horizontally centered
    - selected entry is correct now
    - disconnection check added
- now need to extend select game control events menu for these new joypad elements (and create some specific)
20.02.2021.
- [mnu2h] fixed errors in expressions containing < and > (had to hack expression parser a bit to keep
  supporting these operators as previous/next entry shortcuts)
- did modifications for select game control events menu, now it can move to previous/next button or whatever
  it's given (only implemented and tested on keyboard caller so far, joypads are next)
21.02.2021.
- added config type to joypad info
- added inverted option to select game events menu (was more complicated than anticipated + is untested),
  but only for setup keyboard menu
22.02.2021.
- added inverted option for configure joypad buttons menu
- changed joypad menu controls a bit: a button will only trigger as fire if it wasn't assigned (it may have
  been assigned as say down, and then it will be triggering both down and fire, making the joypad unfit for
  use)
- realized humans find indexing from 0 awkward, changed joypad elements to start from 1
- button config for joypads _almost_ works :/ somehow the current button UI gets desynced from the variable,
  no strength left to fix it
23.02.2021.
- refactored joypad config menu code a bit, separated one-time init from refreshing the menu entries from
  data
- fixed all the bugs in the menu, I hope :)
- replaced "PREVIOUS" and "NEXT" text with arrows, I think it looks nicer
- added quitting/accepting state by pressing escape/enter to select game control events menu
- kicked out that awful red color from audio options menu
- added entries with left/right arrow sprites to the quick clicking list
24.02.2021.
- fixed selecting invalid menu item when returning to joypad config menu
- used better resizing on boxes for numbers of joypad elements, they have to have width of maximum possible
  number up to and including max, not just max (it could be something slim, like '11')
- fixed invalid entry order in joypad config menu
- fixed mouse wheel scrolling behaving awfully in controls menu (the reason was invoking
  processControlEvents() inside onDraw function, it resets the mouse wheel amount, wonder if this should be
  handled in some other way...)
- [mnu2h] fixed color entry for no color not being emitted when template entry is active and has non-zero
  color
- designed configure hat menu and fleshed it out
25.02.2021.
- fixed string centering, it was off by a pixel or two in some places, now it should be pixel-perfect
- fixed prompt menu, it wasn't vertically centering the strings properly (mistake in conversion, forgot to
  add text height to y for each line), and also improved it, distributed remainder pixels among the lines
  when free space wasn't equally divisible
- did positioning and navigation in configure hat menu, interactions remain to be done
26.02.2021.
- added a small delay before scrolling starts for entries with sped up click-scrolling (to make it easier to
  just do a single click transition)
- finished configure hat menu! had a different idea for creating new binding that saved me a ton of time
  compared to the original one
27.02.2021.
- finished entire configure axis menu! it was a bit simpler, and had everything laid out by the configure hat
  menu so it went faster
28.02.2021.
- fixed an improper layout in joypad config menu when all 4 joypad elements were present
- implemented configure balls menu + infrastructure (it's crucial that our joypads have balls!), but no way
  to test it, none of my sorry-ass chicken-shit joypads got any balls
01.03.2021.
- working on quick config menu for joypads; refactoring so it can be used by both keyboard and joypad, tried
  hard but couldn't finish it today
02.03.2021.
- gah, finished the menu, trying to debug it, and I realize there are axes triggering non-stop on the Xbox
  type joypad... that means I can't wait for the user to trigger an event from the controller; thinking how
  to get around this, maybe checking if there are any events coming in immediately, and if so, ask the user
  to leave the joypad idle and press a button -- this way I can eliminate those that trigger all the time,
  but I will also need to account for dead zones on a non-configured joypad...
- phew, overcame the problems; went with the initial idea, now the menu's finished but still debugging it,
  there are still some minor glitches but it's not that bad
03.03.2021.
- fixed stuff in quick joypad configure menu: warnings, closing app clicking x, prevented assigning opposite
  axis direction if it's marked to be ignored during the calibration, hat assignment; seems to work pretty
  nice now
- fixed invalid entry order in select game events menu when selecting events for a new key
- removed key buffering when selecting them, because the behaviour was really strange: pressing many already
  selected keys rapidly would make warning shuffle for a while even when nothing was pressed on the keyboard
- turned out quick config can skip some keys if pressing too fast without buffering, so I compromised: buffer
  was flushed only if there are more than 3 keys waiting, and this seems to work fine in both cases
- refactored quick key config to use generic quick config menu; few hundred lines of code shaved!
- only test menu remaining to finish config joypad menu!
04.03.2021.
- implemented joypad test! it's a quite awesome feature
- did some refactoring here and there, improved code quality a bit
- fixed invalid player number display in joypad quick config menu
- disabled global keyboard shortcuts while testing keyboard (a bit annoying that alt-F1 doesn't work, but
  it's probably better that way)
05.03.2021.
- added ability to change current axis to axis configure menu
- fixed not changing interval box width when changing current interval (max. number of digits might change)
- fixed joypad selection by button press in control options menu
- started restoration of joypad load/save system from/to ini file
06.03.2021.
- it looked like nothing would be done today, but in a final furious effort saving of joypad config to ini
  was finished (untested though!)
07.03.2021.
- after a little bit of fixing, joypad config ini saving seems to work fine
- fixed some code in joypads (or broke it, time will tell)
- implemented mechanism for handling two joypads having same GUIDs being selected at the same time, using
  alternative configuration for one (still untested)
- refined config loading scheme, but haven't completed it yet
08.03.2021.
- finished with joypad config loading, tested basic case and it seems to work fine, but needs more thorough
  testing
09.03.2021.
- had to remove cleanUp() routine for joypad configuration that removes anything that physical joypad doesn't
  have since there might be different joypads with the same GUID (e.g. connected via USB adapter)
- fixed handling of empty/missing joypad config elements in ini file
- discovered that atexit() order was wrong: finishRendering() would run first, and kill all SDL subsystems
  (including joysticks); only then saveOptions() would run, causing it to pick up wrong joypad GUIDs (since
  they are all closed and deallocated at this point SDL returns null-GUID for any of them)
- enlarged mouse pointer area for wheel scrolling to 4x4 pixels so annoying situations when the mouse pointer
  parks on a pixel just between entries causing mouse wheel scrolling not to work won't happen anymore
- fixed selection of joypad by button press in control options menu
- fixed assigned joypad buttons not triggering joypad selection; separated into two routines since we need
  unassigned buttons to run the menus (unassigned because assigned ones will trigger their own event anyway
  -- and it might be say a movement in which case we trigger fire wrongly)... it was a previous change, daily
  archives ftw ;)
10.03.2021.
- sketched out select match controls menu
- removed player1[2]ClearFlag -- it was only used to block player 1 controls while player 2 is setting up
  team, we'll just go all in
- I think I've figured out how to glue in the select match control menu inside play match menu without
  breaking (too much) stuff
11.03.2021.
- play match menu infiltration seems to have been successful
- seems I left global shortcuts turned off by default, oops
- [mnu2h] added #assert preprocessor directive
- [mnu2h] added @nextOrdinal/@nextOrd pseudo-constant to refer to the next entry's ordinal
- finished basic select match controls menu looks + navigation; it doesn't look particularly attractive,
  maybe that will be improved later
- [mnu2h] added constants for on select mask control values
12.03.2021.
- fixed showing select controls menu when match is only viewed
- [mnu2h] predeclared entry reference variables mirroring Entries enum, like headerEntry etc. so I don't need
  to call getMenuEntry() all the time
- [mnu2h] fixed code generator test regexes, they weren't actually working x_x
- [mnu2h] fixed '#x' format specifier for preprocessor expressions
- fixed invalid logic for blinking drawing entries without the background
- testing with two entries blinking showed that SWOS blinking code wasn't satisfactory: second blinking entry
  would make blink counter increment twice in a single frame, making it blink too fast, and also those two
  entries were slightly out of sync which made everything even more annoying; rewrote the blinking condition
  to use actual milliseconds, and now it's all fine and dandy
- implementing select match controls dynamics, these menus are going slower than anticipated (and are a bit
  boring, good thing this is the last one for now)
13.03.2021.
- fixed a bunch of small bugs in select match controls menu, now it works surprisingly well; still need to
  implement control dragging via mouse, that will be difficult (but will hopefully fix edit tactics too)
- ha, after a long battle the mouse dragging seems to work pretty good, even the trigonometry is spot on ;)
- while select controls is in great shape, edit tactics is utterly broken :( I might have to rewrite it
  completely
14.03.2021.
- fixed a bug where a new joypad configuration would be assigned only after trying to auto-select it (whoops)
- implemented single player version of select match controls menu
- implemented scrolling when there are many joypads
- implemented current game events, and the game seems to work just fine ;)
15.03.2021.
- fixed mouse click selecting wrong entry immediately after moving to a new menu and while the pointer is
  inside an entry which isn't selected
- implemented keyboard config saving and loading to/from ini file
- [ida2asm] fixed a bug in optimizer, when shifting constant memory address values nodes weren't copied
  correctly, also optimized rotate routines a bit; fortune in misfortune: the code wasn't even been executed
- [ida2asm] fixed a possible overflow when generating 32-bit multiplication instruction
- added opposite direction events cancelling, with new event having precedence
- finally pushed an update to repository!
- somehow I feel it's harder to do long kicks now (on keyboard), and that the controls are a bit worse, but
  it might be just a coincidence, will continue comparing
16.03.2021.
- I think I've fixed the problem with long kicks (but can never be sure!), I forgot to processControlEvents()
  before processing the controls, so they might have been a bit stale
- really fixed player keys overriding game shortcuts
- fixed two player controls not working, it was a really stupid bug where I forgot to send one optional
  parameter and lost way too much time because of it @_@ but looking at it from the good side: I analyzed
  TeamsControlCheck() and will be converting it at the first opportunity
- fixed mouse long kicks ;) good side here too: analyzing long kicks will help finding out why they fail
  more often than on DOSBox
- just realized that the release version (both x64 and x86) can't find any joypads o_O (debug works normally)
- SDL 2.0.14 fails trying to open some kind of sensor manager, maybe it requires admin privileges now, anyway
  giving up for now
17.03.2021.
- joypads issue solved, the problem was in calling SDL_PumpEvents() in certain places (namely at image
  scrolling at start), and it would let my precious events go to waste (such as add joystick), replaced all
  calls to it with processControlEvents() and it's all good now
- added some more checks when loading control config:
    - elements with duplicate index removed
    - check for duplicate keys when loading options, even though ini already filters multiple entries, so
      we're double safe here
    - check for duplicate and out of range hat mask values
    - check for null events
- changed "PLAY" button background to red and now it will say "COACH" if all players are coaches
- fixed exiting play match menu with right button and then entering edit tactics
- converted TeamsControlCheck(), having a bit better understanding of fire counters now
- added number suffixes for joypads with same names, instead of listing "SILLY JOYPAD", "SILLY JOYPAD", it
  will be "SILLY JOYPAD (1)", "SILLY JOYPAD (2)", so they can be distinguished more easily
18.03.2021.
- fixed joypads not getting selected in control options menu
- fixed team names in versus menu (right before the match) being "stuck" to the edge (no space between); this
  was caused by adding whitespace removal to menu string elision; it turned out there was plenty of places
  where SWOS inserts some spaces for positioning; solved by moving whitespace removal to the function that
  sets menu entry string (lucky I used it in a disciplined way), this way only new-style menus get whitespace
  removal while the old-style menus are unaltered
- added an option to disable/enable select match controls menu; I see how annoying it could be when just
  playing lots of games solo; it's still on by default for the noobies ;)
- seems menu controllers were disabled by default when loading from ini, whoops
- added overlapped interval check and elimination when joypad axis are loaded from the ini file
- fixed long kick keyboard problem for good! the culprit was invalid code that updates control state when
  opposite directions are pressed (left+right & up+down), it was also causing players to behave hilariously
  while up+down were held
19.03.2021.
- fixed show play match controls menu and enable menu controllers options
- changed "auto-detect" to "auto-select" controllers, since with that option they automatically get selected
  when connected
- fixed crashes in configure joypad sub-menus when the joypad being configured would disconnect
- fixed not being able to select 4th joypad for player 2 in control options menu
- fixed auto-selecting the most recently selected joypad when one player takes over the other player's joypad
- fixed same-name joypad renaming in case some in the middle get disconnected and re-added (say out of
  joy (1), joy (2), joy (3), #2 gets reconnected; old code would count the number of same-name joypads and
  would assign #3 to the new joypad, ending up with #1, #3, #3; fixed code assigns the max so it becomes
  #1, #3, #4
- added joypad tests for axis intervals reduction and adding suffixes for same name joypads
- paved some way for virtual joypad, added #ifdef, removed array and sticked to a single virtual joypad
  instance
- [mnu2h] added explicit entry limit so the template entries can freely use it as a start index
20.03.2021.
- finished a primitive version of virtual joypad, and it even gets highlighted when clicked ;) now I need to
  find out how to handle multiple touches on Android (it's unusable on PC since obviously I can only click
  one thing at a time); hope the changes won't be so drastic as to break the existing code
21.03.2021.
- [mnu2h] added a warning if an entry string contains leading/trailing whitespace
- fixed fire+left/right on control in select match controls menu so that pressing opposite direction while
  holding fire can assign other control too (mouse dragging is still limited to one assignment only)
- fixed out of range joypads vector access when virtual joypad is selected for player 2
- fixed virtual joypad SDL controller mapping
- fixed not properly switching config around when two joypads with same GUIDs are selected (that was causing
  incomplete controls warning to not appear sometimes when it should)
- fixed all the control switch spamming when changing controls in select match controls menu
- fixed select match controls menu showing up after "VIEW RESULT" is pressed
22.03.2021.
- changed instruction text in select match controls, and made it different for single vs 2 players
- fixed header text for setup keyboard menu (I think it was a leftover from testing from how it looks)
- removed limitation that only player 1 can select keyboard 1 and only player 2 keyboard 2; it was dragged
  over from original SWOS and I think it doesn't make much sense anymore, so now on there are two key sets
  and each can be assigned to any player + also made it possible to select no controls for any player (for
  any reason it might be)
- refactored windowManager out of renderer, it was long overdue
- added -fwrapv flag to Android build, better safe than sorry, especially with all the signed overflow checks
  in vm.cpp
- added ability to print exclamation point in strings, now we can YELL!!!!
- added "RESET TO DEFAULT" button to joypad config menu
- fixed virtual joypad wrongly detected as a free joypad even if it's used
- tried virtual joypad on a real device, but it's not working nicely :/ only one button can be pressed at a
  time, I'll probably have to use touch event APIs to handle it properly; also, touch areas are too small,
  it's too difficult to press them, I'll have to create some sort of config for that, since there are so many
  devices and screen sizes out there; on top of that, there are some rendering artefacts on the sides of the
  screen, only appearing when using virtual joypad
23.03.2021.
- [mnu2h] synchronized text measuring routines with the latest text printing changes in SWOS
- found a hint in SDL Android readme that "dirty rectangles" technique might cause visual glitches; disabled
  blending when drawing virtual joypad buttons and the artefacts disappeared, so that's a small progress
- seems coordinate mapping is off too, I was rendering small yellow cursor and it got out of sync
  horizontally: the game has black margins on my phone, cursor is always drawn only inside the field but
  touch coordinates come from the entire surface
- fixed ini file loading and saving on Android (the ini lib was using standard files, had to reroute it to
  use the SDL RWops)
- connected Xbox joypad to the phone via a USB adapter, and it worked perfectly :)
24.03.2021.
- [ida2asm] @insert-hook symbols are now in global namespace since having a symbol there and removing it at
  the same time is a hard error
- found a stack overflow that happens in TextInput() in debug version after some time; converted it to C++
  and added virtual keyboard pop-ups whenever the text needs to be inputted
- made Android back button quit the game (it now behaves the same as escape)
- fixed joypad setup menu for virtual joypad not opening
25.03.2021.
- fixed invalid mouse coordinate mapping on mobile (due to incorrect assumption that there is no slack area
  in full-screen)
- switched to touch API and added sort of pointer trails at finger touches, which disappear after a while;
  virtual joypad is improved, it now responds to multiple things at once (e.g. side + kick), but it's still
  unplayable; have to solve the diagonals and movement of the finger to a different "key" without releasing
26.03.2021.
- fixed buttons, axis etc. to start from 1 and not 0 in test menu
- [mnu2h] fixed making entry invisible even if the entry's invisible property is 0
- removed everything except full-screen from video options menu and ignored everything else when loading from
  ini file on Android
27.03.2021.
- fixed display truncation of joypad ids to 16-bit
- separated video options into two menus: true video options, which later optionally leads to window mode
  menu, where window mode and screen resolution can be adjusted (this is old video options menu)
- moved flash menu cursor to video options menu
- fixed up video options to display properly, hid show touch trail for non-virtual joypad builds; it looks
  pretty empty right now, but I'm foreseeing we'll add more stuff there
28.03.2021.
- [android] made back button work like a right mouse button (goes back to previous menu)
- made right click open quit menu if on main screen
- disabled virtual joypad rendering if it wasn't needed (e.g. single player game, player 1 using other
  controls and player 2 set to virtual joypad)
- determined that artefacts when rendering blended rectangles only happen on Samsung phone, but not on Huawei
  or even ancient Alcatel... weird
- fixed a bug in select match controls menu where a wrong joypad would be selected if some of the players
  were using keyboard (in 2 player game)
- added option to turn off transparent virtual joypad buttons (since it messes up the rendering on Samsung),
  and fixed saving of show touch trails option
- fixed up and tried out new virtual joypad direction pad layout, it's an improvement but still not as
  playable as it could be... going  for v3 now
29.03.2021.
- switched to a safer procedure for saving ini file options, they are first saved to tmp file, then tmp file
  is renamed to swos.ini (lost my options already when stopping the game at an inappropriate moment)
- [android] fixed directory scanning so now load competition menu works
- [android] fixed crash when selecting edit custom teams (file customs.edt was missing from assets)
- ugh, solved a nasty problem: suddenly team names in all loaded competitions started missing two first
  letters (" MILAN", "VENTUS"...); tracked the change to the exact date but couldn't figure out why it would
  happen from the diff; eventually, after a lot of investigation, uncovered that the removal of controlChars
  triggered cascading alignment disturbance and changed data alignment of selTeamsPtr which was located in
  the load competition buffer; it's an exported variable and therefore marked for alignment, but by simple
  chance didn't have it until now, when it got 2 bytes (exact 2 bytes from team names); added static_assert
  so if this ever happens I'll know immediately
- [ida2asm] expanded align directive to accept 1-byte alignment (meaning don't align this)
30.03.2021.
- connected PC keyboard to Android, and it works phenomenally with 0 configuration! all the keys work for
  text editing; tried SWOS and it worked perfectly! all the shortcuts work too, besides a small screen it's
  identical to PC experience (I only noticed comments lagging a little, but don't think it can be helped)
- figured out how to interface with Android to check the keyboard presence, and it works really well
- implemented keyboard adding/removal from control menus depending if it's connected on Android (for PC we'll
  just always assume connected)
- fixed some bugs in controls menu scrolling
31.03.2021.
- unset controls for keyboard players when keyboard was removed
- fixed control menus in case when there were no joypads connected
- [android] renamed mouse/mouse click mentions to touch/tap
- [android] fixed not closing RW context when saving ini file
- [android] the game used to hang when connecting/disconnecting joypads live, but that seems to be fixed
  along with previous fixes :P
- fixed selection remaining on an empty item in controls options menu when the item gets hidden (e.g.
  selected joypad gets disconnected, scroll arrows disappear)
- fixed wrong defaults for video options (flash menu cursor, show touch trails, transparent virtual joypad
  buttons and default window mode: full-screen (Android))
- [android] made touches open menu items immediately when pressed (instead of released) to make the UI seem
  more responsive
- discovered that it was possible to click on opponent's players with mouse when viewing opponent's team,
  yikes! luckily, it didn't take too long to fix, hope there are no more stuff like this lurking around
- [android] made annoying spinning "S" removable by tapping on it (my guess is that % of mobile users having
  a keyboard with F9 attached is ridiculously low)
- [android] fixed log file handling, now it will be saved into app data area in parallel with line being sent
  to Android system log
- fixed improper positioning of elements in select match controls menu for single player when keyboard is
  present (only first time it's shown)
- fixed virtual joypad sometimes not appearing even if it was selected
- [android] turned off touch trails during the match, it seemed out of place
- [android] switched mouse pointer positioning from mouse polling to touch events and it's much better, for
  example it was extremely difficult to hit left scrolling arrows in control options menu on Samsung, now
  they work great); it's also possible to select items by dragging a finger, which makes it easier to hit the
  active area; also this setup survives rotation just fine, rotation used to break menu controls
- learned that edit tactics "remembers" teams from friendly game, not sure if that's a bug or a desired
  behavior
01.04.2021.
- implemented test and quick config for virtual joypad; this made me realize I was making the same mistake as
  with Amiga joysticks: quick config expects second button to be given for the bench, but virtual joypad
  (currently) has only one
- implemented bench button skip in controller quick config menu: hold selected fire button for at least 2
  seconds and release
- [mnu2h] changed -1 to 255 in direction skip entries so clang would stop crying
- removed select joypad with fire item from control options menu; considering putting it into select match
  controls menu, but will see about that
02.04.2021.
- added clickable regions to quick config confirmation (save/discard/restart), so it can now be used on
  mobiles without the keyboard too
- fixed a small error in control options menu navigation
- [mnu2h] removed #define for *Entry reference creation so the values could show up properly in debugger
- fixed menu header turning into "STDMENUTEXT" in setup keyboard menu, when returning from event selection
- added control events for replay and save highlight, they're working pretty good ;) now it's becoming
  crowded in select events menu -- when the next event is added I'll probably have to lay them out in two
  columns; the reason for adding these is mostly to help the mobiles since they got no keys to access them,
  but on the other hand virtual joypad only has one button, oh well, can't have everything :)
- picked a nice GUID for virtual joypad
- added scrolling of a selected joypad into view when control options menu shows up; it's really annoying to
  have to keep scrolling to see what you got selected when you got plenty of controllers ;)
03.04.2021.
- tested out new preliminary virtual joypad rendering: drew a 1/8th of circle, a pie, 8 times with 45 degrees
  hardware rotation, then used texture color and alpha modding to achieve active/inactive color and
  transparency; rendering it in much larger dimensions than scaling it down with hardware, not sure if it's
  an overkill for small screens (it's probably fine, might test it later)
04.04.2021.
- did the math for the virtual pad touch detection
05.04.2021.
- implementing the joypad area detection, fixed some mistakes (like using y increasing up as in math instead
  of down for standard graphics programming), but still not quite there yet, need to fix the line separating
  right and top-right
06.04.2021.
- fixed bugs and tested out virtual joypad v3; not bad, I even scored a goal! ;) just gotta fix the Samsung
  rendering issues, if possible :/
- shrunk virtual joypad a bit, it was covering a bit too much of the field
- added little endian check to precompiled headers
- switched to making a surface first and then converting it to texture with color key (more proper way)
- fixed transparent joypad buttons option not getting saved properly to ini
- fixed invalid assert after the game (causing Android build to exit in debug mode)
- increased contrast between active and inactive virtual joypad colors so it could be more prominent on the
  devices with lower quality displays (having lesser number of colors)
- added virtual joypad version without the transparency (though it's now having rendering issues as well,
  since the texture has to be alpha blended)
- solved Samsung rendering issues! it disappeared when I started clearing rendering buffer as a first
  operation, guess I wasn't doing it as an optimization since the game texture covers entire field anyway;
  leaving it for now in case there are some other devices that act strangely, no idea about the performance
  hit, it's probably negligible, will measure when the time comes
07.04.2021.
- released a new version
- [android] added phone vibration when a goal is scored
- explored pitch rendering ideas
08.04.2021.
- added an option to turn linear filtering on or off, it looks blurry and kind of crappy on PC but it could
  be useful for other devices, who knows
- planning and researching about rendering architecture that would be able to handle 4k pitches and sprites
09.04.2021.
/
10.04.2021.
- how things stand currently:
    - projected required sizes of textures scaled to 4k resolution are simply too big (200-400mb per pitch),
      tiles will have to be used (again ;))
    - detail maps will be used to reduce repetitiveness (need to figure them out first, but luckily this can
      be done at a later point)
    - sprites and tile pitches will be held within as small as possible number of textures
    - some sort of texture manager will be tracking the individual sprites and tiles inside big texture
      atlases, and will keep atlases within the maximum texture size the graphics card is capable of handling
    - decided to do the sprites 1st, specifically menu sprites
    - managed to batch resize them with IrfanView, they look awful but it will have to do for 1st iteration
    - magnification is 12x (3840 / 320 = 12)
    - messing with TexturePacker to create nice & efficient sprite sheets (it would be great to find a free
      tool with the same capabilities)
11.04.2021.
- added printing of some renderer info to the log, namely max texture dimensions supported, on PC it's 8k,
  on two older phones 2k, and on Samsung 16k, so 2k should be a pretty safe bet
12.04.2021.
/
13.04.2021.
/
14.04.2021.
/
15.04.2021.
- started converting VGA-drawing routines to high-res drawing routines and implemented initial version of
  menu background (got some crash but too tired to chase it down now)
16.04.2021.
- fixed the crash: tracked it down to releasing a surface gotten from SDL_image; turned out it was caused by
  SDL_image being linked to older SDL version -- it got forgotten when switching to new SDL; good thing to
  remember in the future
- divided assets into 3 categories: 1) low-res (960x540) 2) HD (1920x1080) 3) 4k (3840x2060)
- and finally, menu background is showing
- started implementing a cache of menu item background textures
17.04.2021.
- finished initial version of menu item background rendering and caching (not debugged!)
    - initially pondered whether to include the menu item background effect at all (gradient between two
      colors), but decided it should be there since the menu should at least look similar to the original
    - guessed algorithm used to create fill.256 (distance from the lower left corner -> square root of x^2 +
      y^2 divided by the number of colors in gradient (originally 32, increased to 256))
    - removed dither since it's complicated and it's not really needed with 24-bit color: generated two
      gradient patterns in Gimp, one with and one without gradient and it takes zoom of 10x or so to notice
      the difference, and even then it's barely visible
    - to speed up things used technique similar to Goraud shading: calculated exact values for vertices of
      the rectangle, and then used those values to interpolate everything in the middle; hope it will look
      good! :)
18.04.2021.
- been debugging and fixing menu item backgrounds, got them to a level where they're kind of similar to the
  original, but perhaps differing a bit too much; will try matching them closer tomorrow, as well as adding
  menu frames and cursor, sprites too if I get that far
- also progressed a bit in transition from VGA-like to modern rendering
19.04.2021.
- seems the distance formula isn't precise, need to rethink it or include 32 element color table from
  the original into calculations
- yup, color changes too irregularly, have to include the table
20.04.2021.
- included the original color tables into the calculation, now it looks quite similar to the original, and
  the gradient is actually quite nice; now that the things are in high res maybe some even nicer effects
  could be added, but more important things await
21.04.2021.
- added menu items inner and outer frames rendering; compared to 320x200 version it's looking almost
  identical (only nicer) ;)
- started planning for including sprite packing into build process
22.04.2021.
- tried to reverse engineer TexturePacker, but gave up, at least for now, it could take way too long
- eventually found an open source Python library (PyTexturePacker) that's trying to mimic what TexturePacker
  is doing, will try improving it a bit and it might just cut it
23.04.2021.
- [PyTexturePacker] added detect duplicates option
- [PyTexturePacker] added ignore blank option
- seems there's an inexplicable hole in second texture, that could be filled with third texture contents,
  must debug that somehow
24.04.2021.
- [PyTexturePacker] added draw border option (red frame around sprites for debugging)
- the inexplicable "hole" is actually correct! third texture was a left-over from previous runs, with new
  options it actually packed everything into just two textures and the hole is a space to spare :)
- [PyTexturePacker] added option to not save atlas data, and return it for further processing
- [PyTexturePacker] added scale and scale_filter options, to rescale the sprites before processing
- created script that creates sprite maps via multiprocessing
25.04.2021.
- set inner_padding and shape_padding options to 2 pixels each, to be safer when rendering sprites, it
  introduced 3rd texture, but it was inevitable since I needed to add some more sprites anyway; but now I
  noticed the textures are always created at max size (2048x2048) regardless of their real size
- [PyTexturePacker] added crop_atlas option to size the texture atlas to the content
- option above solved the problem, but now I noticed that one texture has all the content next to the left
  edge, disrespecting both border_padding (2 pixels) and inner_padding (1 pixel)
- fixed the missing padding pixels problem with some hacking without fully understanding the code, so that's
  a bit concerning, but at least it was done in record time; will be doing a lot of packing and hopefully
  will notice if anything goes wrong
26.04.2021.
/
27.04.2021.
- finished initial version of packed sprite data array generator script
- fixed menu item frame rendering that somehow got broken
- writing sprite rendering routines (for menus)
28.04.2021.
- implemented loading of the texture atlases (menus)
- got the sprites rendering, although some are missing 1 pixel line on the top
- fixed shining frame drawing; had to add some timing code, it seemed to cycle colors too fast
29.04.2021.
- added exit icon to sprite sheet
- fixed rotated sprites rendering
- fixed a crash in audio options menu: A5 wasn't set before calling beforeDraw() function, strange how it
  didn't manifest sooner
- fixed last two entries in video resolution list being unselectable
30.04.2021.
- fixed menu movement going wild (consequence of switching to different screen update procedure & missing
  timing code)
01.05.2021.
/
02.05.2021.
- worked out player sprites customization scheme
03.05.2021.
/
04.05.2021.
/
05.05.2021.
/
06.05.2021.
- did some reverse engineering on the details of the team and skin color coloring of player/goalkeeper
  sprites (done in ConvertColorsAndTextSprites())
07.05.2021.
/
08.05.2021.
/
09.05.2021.
- went through SWOS code for sprite coloring, I think I got the gist of it; wrote the findings to sprites.txt
  as well
- removed duplicate sprite bitmaps, though there are still some empty and weird sprites
10.05.2021.
- cleaned up some unused routines, mainly sprites, will need to do it again later more thoroughly
- figured out what the useIndividualPlayerSkinColor variable is used for (former doSpriteColorConversion)
- started writing game sprite conversion script
11.05.2021.
- trying to break player sprites into layers, but it's still quite buggy
12.05.2021.
- noticed there are some stray hair pixels in the goalkeeper sprites, marked as hair but located near the
  legs, decided not to bother fixing since it's a graphics problem
- recompiled swpe and fixed saving big R/S sprites with invalid palette (needed ORing with 0x70); so they
  won't look like complete garbage even in POC version
- finished with the game sprites conversion script
13.05.2021.
- added a check for number of images processed to conversion script
- reorganized game sprites into directories, it's much more manageable now and easier to convert into sheets
- began with sheet compilation script modifications, made it handle more than just charsets and integrated
  fixed game sprites into game array (those that don't require color conversion)
- started replacing game initialization routine, so the new team sprites could be colored properly
- removing left-over SWOS code (did up to CopyAdvertisementsData)
14.05.2021.
- cleaned up ConvertColorsAndTextSprites() and belonging references, will have to create some tool to analyze
  cross-references and do this automatically sometime
- generated sheets for all the sprites in the game, looks good except for a couple of sheets with low number
  of sprites that got packed a bit inefficiently, must check if that can be avoided
15.05.2021.
- generated metadata for C++ for sprites that are going to be colorized
- began implementing coloring code for players
16.05.2021.
- removed SWOS_VM ifdef's, will be going with VM for 32-bit version too (in order to use the optimizations)
- moved coloring code some
17.05.2021.
- did a little on the sprite coloring code, but it still hasn't advanced much + is quite buggy atm
18.05.2021.
- fixed wrongly assigned texture indices in sprite array
- got all the layers except the shirt rendering nicely
19.05.2021.
- got the shirt layer rendering, the whole thing's looking good! however, I missed sprites of players with
  colored sleeves
- disabled duplicate removal for background level sprite sheets so certain sprites wouldn't merge; I'm
  starting to think that duplicate removal might be connected to the poorly packed sheets problem
- fixed a silly crash in swpe on ctrl+T (needed it to pull out colored sleeves variant of player sprites)
- added colored sleeves support
20.05.2021.
- got player sprites tied into sprites array, trying to get into the game but experiencing unknown crashes
  (consequence of removing a lot of pitch related code)
21.05.2021.
- been fixing crashes using the scientific method: running the game and adding more stuff back if it crashes;
  fixed a bunch, but still not quite there
- [ida2asm] fixed invalid variable size when exported array size differs from ASM source, and the base size
  is same and equal to 4 bytes
- added frame indices calculation for players, but need to fix up goalkeepers too
22.05.2021.
- [ida2asm] turns out invalid variable size from yesterday wasn't fixed, it just bypassed static assert with
  invalid size on both ends; undid the previous change and fixed the fill size in memory array, now it seems
  to work fine; also increased static asserts to every 16th exported variable while I was at it -- should
  help debug these kinds of problems in the future
- fixed sprite compile script to expand textures array for goalkeeper slots
- implemented goalkeeper coloring, but still couldn't run the game; there's too many stuff missing from
  InitGameRestoreTeams(), will need to focus on it and restore missing function calls
23.05.2021.
- removed lot of old code (mostly dealing with palettes and VGA drawing (+ old 320x200 texture))
- swos-port 32-bit x86 ASM project officially killed
- added all the initialization code (at least I think), but still couldn't run the game: discovered I'm
  lacking metadata about SWOS sprites (such as center x, y) to be able to render them, so gotta figure out a
  way to include that in the sprite script; until tomorrow!
24.05.2021.
- modified swpe to save a txt file along with each bmp with center x and y coordinates (if they're not zero)
- distributed txt files to proper places and scaled their dimensions
- extended sprite compile script and sprite struct to include center x and y information
- ha, ran the game for a little bit before it crashed; unfortunately, dreaded UpdatePlayersAndBall() is
  accessing spriteGraphicsPtr and reading sprite width out of it (with few other places doing it too), will
  need to fill it in or patch all the access points
25.05.2021.
- refactored sprites, broke off colorizeSprites() out of it, it's much neater now
- created fake old sprites array and placed it within the pitch patterns buffer: only copied dimensions and
  the rest of the sprite data except the pixels (pixel pointer was set to null), and it worked! :) I'm in the
  game and playing, even though it looks awful, has no pitches and player sprites are smearing all over the
  field (background should really be cleared, but will look into that later), it's working and is not
  crashing! :)
26.05.2021.
- implemented bench player sprites colorization and made them displayable
- fixed smeared sprites, seems clear call got lost in conversion; anyway, I see now that there are some
  rendering problems, some sprites don't display properly, while some are drawn with incorrect offsets
- adapted directory structure slightly to accommodate pitches
27.05.2021.
- added sub-pixel precision to sprite drawing (by using fractional component)
- debugged rendering problems, but couldn't solve them
28.05.2021.
- sprites were killing me, but finally fixed the bastards! fixed flickering, fixed invalid sprites that
  sometimes showed up, but the ball and player numbers kept getting drawn too close to the top; checked and
  rechecked drawing and rotation algorithms but the culprit was bad data generation: compile script kept
  invalid paths when I reorganized the directory tree and didn't pick up text files with center x/y
  coordinates, argh... anyway it's pretty good now, played a game and didn't see anything wrong with the
  coordinates (at least of those sprites that do get rendered)
29.05.2021.
- optimized packed sprite structure, added float fields to avoid conversions, actually all the fields in SWOS
  engine should be converted from fixed to floating point, but it's too early for that now
- reintroduced sub-pixel precision (had to remove it for debugging), it looks fine now, except for the corner
  flag and goal net which kind of wobble a bit, will investigate that further later on
- started adding darkened rectangles, those in stats look fine, but when the result is shown there are some
  artefacts, it seems the game is drawing it with multiple 252 sprites and there is some overlap between them
  which looks ugly with blending
30.05.2021.
- expanded swpe with the ability to save all the patterns from a pitch, together with a txt file containing
  placement of all the patterns on the pitch (pitch pattern matrix)
- extracted all pitch patterns, converted them to PNG and placed in a directory structure for compiling
  future pitches
31.05.2021.
- integrated pitch patterns packing into asset compilation script, it takes quite a bit longer now :/
- compared output with TexturePacker: if a sheet is about half filled, results are much worse; it's very
  annoying, will have to dig deep to learn details of that algorithm, and fix it properly sometime
- been modifying asset compilation script to include pitch patterns, but haven't managed to finish it
01.06.2021.
- finished with pitch part of C++ code generation in asset compilation script
- removed plenty of pitch initialization related SWOS code
- started implementing pitch loading
02.06.2021.
- implemented pitch loading
- [ida2asm] error is reported if ranges are used in @null and @type-sizes sections
- [ida2asm] stopped registering references out of procs (since those instructions are getting removed anyway)
- surgically removed SWOS code that does pitch scrolling and drawing, and all the EGA crap + AIL & C lib;
  operation: success! patient... dead?
03.06.2021.
- total weirdness, the game wouldn't start at the kick off after latest changes, and only after lot of
  debugging it suddenly began working normally, I'm blaming Microsoft's flaky incremental linker :D
  (it still happens occasionally though :/)
- did pitch rendering, the algorithm is off and displays wrong coordinates and sometimes lines between
  patterns, but at least something is on the screen ;)
04.06.2021.
- debugged pitches a bit, it's still messy but at least it's not completely off anymore
- eliminated inner padding when packing pitch patterns, to avoid pixel gaps between them
- had to switch from float to int coordinates, now the nasty stitches are gone, but the scrolling feels jumpy
  and awful
05.06.2021.
- finally got the formula right ;) the pitch is looking very good now, I notice some irregularities around
  certain pattern edges, but I believe it's a consequence of a resize algorithm, if created manually that
  shouldn't appear (really hope so! :P)
- optimized pitch pattern drawing by drawing each texture patterns sequentially, in order to minimize texture
  switching calls to the graphics card driver
- trying to figure out the camera fractional part calculation, but it's not clear; currently considering if
  there could be an error there, as the camera fraction part coordinate keeps getting some nonsensical
  values, causing the camera to wobble at certain points on the pitch; update: there's some weird
  multiplication with 0x4000, when I change it to left shift 16 the wobbling goes away, but the camera feels
  too fast and abrupt; must be a way to preserve identical behavior but without the numerical instability
06.06.2021.
- trying to fully understand MoveCamera() and convert it to C++
07.06.2021.
- camera implementation in C++ on the way
08.06.2021.
- MoveCamera() conversion finally complete! and amazingly, with just a bit of debugging it works too;
  wobbling is solved completely, and my subjective feel is that movement is quite smooth (not sure of any
  way to reliably compare with the original)
- had to return topTeamSaved and bottomTeamSaved buffers since they overlap DIY competition buffer (and a
  crash was happening without them)
- added the code to decrement showFansCounter, this should fix camera sometimes being locked to goal and
  refusing to travel to the pitch center at the start of the game
- just realized the fixed point number representation I was using was not quite right, the fraction must be
  always positive (instead of having the sign of the whole part), otherwise -0.something can't be
  represented; if it's positive all numbers can be represented: -0.something would be -1.(1 - something)
09.06.2021.
- used newly renovated fractional camera coordinates to improve precision of pitch rendering, but gave up on
  floating point SDL calls: when using them visible stitches where patterns connect would occasionally show
  up, so I went with integer call and did the rounding myself, will have to test how it looks like with
  random window sizes -- sprites are using floating point calls, and therefore a different rounding
  algorithm (than pitches), gotta bring them to integer coordinates as well
10.06.2021.
- changed precalculated float fields in sprites database from float to fixed point
- fixed wiggling corner post (it's still a bit weird, but it might be from the pixel conversion); width and
  height needed swapping for rotated sprites when filling legacy sprites array info
- something is wrong with colors, they're too bright, white background might be bleeding through to the
  pitches, I need to investigate it in more details
- result overlay rectangle would sometimes miss 1 pixel to the right side, it's because ShowResult truncates
  camera coordinates instead of rounding, so it has to be converted; it's quite a big function, so it might
  not go so fast
11.06.2021.
- implemented game time display; discovered that time digit sprites were missing, fixed sprite conversion
  script to include them too; added special handling for digit '1' which is shorter; added "mins." sprite but
  had to chop off leading digits to avoid a lot of complications
- started converting ShowResult, need to figure out what to do with scorer name widths array, it's populated
  by GoalScored which is itself a big routine, converting all that might take a while, so I'll probably
  ignore scorer names for now
12.06.2021.
/
13.06.2021.
/
14.06.2021.
/
15.06.2021.
- started converting ShowResult()
16.06.2021.
- rough version of ShowResult() is running, it's got no team and scorer names and 1st leg result; there are
  still problems with the game, pitch seams are visible on resolutions non-divisible by VGA dimensions + SDL
  returns the wrong window size (1280x720 when it should be 3840x2060)
17.06.2021.
- turned on option "reduce border artifacts" in PyTexturePacker and that solved dark seams; now I notice that
  patterns aren't aligning properly, particularly grass ones, not sure if it's an artifact of scaling up or
  something more serious, will need to figure out a way to check; another problem is that the sprite packing
  has become awfully slow with this option, will need to look if it's possible to optimize the code
18.06.2021.
/
19.06.2021.
- fixed invalid assumption that pitch patterns would be assigned in file order (causing some pitches to show
  up messed up)
- tried with and without linear filtering, but it doesn't make a difference as far as dark halos at pattern
  edges go; it's weird, I can't see the difference with/without alpha bleeding reduction, and yet it
  successfully removes dark halos
20.06.2021.
- [PyTexturePacker] did a compromise solution: added post processing routine to the lib, installed my routine
  to go over each pitch atlas sprite and add 1 pixel border around the frame (since I know they are all
  rectangular); works perfectly, no dark halo and only slows the compilation down by about a second
- float API is back in black, after clearing its good name; now I notice some weird transparency in player
  shirts, well there's always gotta be something
- seems rotated sprites are a bit off position, so the letters don't line up properly in 1280x720; so far
  can't get to the bottom of it
21.06.2021.
- fixed sprite rendering! (particularly text issue); width and height were swapped for rotated sprites, and
  then x and y scale factors got mixed up (multiplying wrong dimension)
- removed sprite 1208, seems it's never used
- added UINT16_MAX as a special pitch patter value, meaning don't draw anything (not used currently, but can
  be pretty useful if pitch sprites are implemented and in full use)
- fixed missing result dash sprite
- made the app DPI aware
- fixed number input (it was calling the wrong function when I tested it initially, d-oh!)
22.06.2021.
- implemented string coloring in menus, it's a pretty simplistic solution (changing texture color mod), I
  wasn't sure it will look good, but it seems it does, at least with these current shitty sprites
- converted remnants of FixedPoint to float
- fixed keyboard shortcuts getting blocked by custom player keys even if that player isn't currently playing
  (e.g. keyboard2 uses 'S' and stats get blocked even if the only player is playing with keyboard1)
- implemented statistics screen
- fixed invalid team colors conversion palette
23.06.2021.
- created blocky assets variant
- fixed compile assets script, it was skipping zero pattern which has only single color due to ignore_blank
  option; turned the option off for pitches
- removed empty sprites 1287 and 1302
- wanted to implement current player indicator, but it kind of ballooned out of proportions, so couldn't
  finish it, but it's on a good path
24.06.2021.
- recompiled SWOS++ to observe how some variables change in their original habitat without fear of accidental
  tampering ;)
- restored debug variable dump functionality
- finished with current player name indicator, but it's not working properly :/
25.06.2021.
- player name indicator fixed, that was easy, just wasn't resetting lastPlayerBeforeGoalkeeper when the name
  got hidden, and even remembered it while lying in bed; now it works perfectly in sync with the only true
  SWOS version
- conversion of code to display scorer list and rest of the result data is in progress
26.06.2021.
- decided to remove sprites 225 and 226 (big football pitches), they take up a lot of space, and 226 even
  can't fit in one 2k texture; I'll probably recreate them by drawing instructions, or even using SVG
- refactored sprites code, separated into few more files and removed some obsolete code
- working on GoalScored and ShowResult, one place updates internal data structures, second renders it (or
  sets it up to be called by the sprite renderer); still in progress
27.06.2021.
- removed all uses of SWOS charsTable from text.cpp except where strictly necessary; out with the old in with
  the new
- finished implementing result sprites, now on to debugging (since of course it's not working)
28.06.2021.
- result and scorer list fixed, now working! (though result needs a bit more testing)
29.06.2021.
- fixed invalid update of team1 total goals (not counting 2nd leg in total)
- digit 1 seems to look fine in the game time, no idea how that got spontaneously fixed :P
- started converting bench code, first removed a ton of it, it's gonna take a while
30.06.2021.
- been analyzing bench rendering code, pretty much figured it all out, now looking at BenchCheckControls();
  SWOS++ proved invaluable with its variable dumping and easy routine (or just about any code) nop-ing
01.07.2021.
- went through "dynamic" part of bench code, got it more-less
- removed tons of old bench variables (only some shared ones left for now)
- removed remains of CD-ROM routines
- finally started converting GameLoop()
- [ida2asm] added display error when an end of range symbol is encountered in a fragment, but without the
  starting symbol (which most likely means that the starting range symbol fell as a victim of another range)
02.07.2021.
- removing animation code completely
- removing unneeded music code and refactoring existing one a bit
03.07.2021.
- conversion of GameLoop() in progress, so annoyed by the highlights code, it's preventing me from removing
  so many variables, I'll have to convert it too sometime
04.07.2021.
- converted GameLoop(), albeit poorly, with goto's, but at least it's compiling... will be working to fix it
  up to some higher standards
- and after minor interventions the game even works, except for the comments and game clock
05.07.2021.
- structured gameLoop() successfully, only broke stats display, but quickly got it back ;)
- game time and comments fixed
06.07.2021.
- been bashing the bench code, managed to implement control check to catch when the bench is called, and move
  the camera there... nothing rendered yet; I think I managed to fix a little bug in the original code: bench
  tap timeout timer increments non-stop when no direction is pressed and once a direction is pressed for the
  second time the timer might end up too close to 15 (max value) and expire too fast, in the middle of three
  taps... at least that's how I see it according to the code, I've included the fix and will see if it makes
  any difference
07.07.2021.
- added handling of throw-in when bench is called (player should drop the ball and run away), and when keeper
  is holding the ball (not sure what problem would appear here if this piece of code went missing)
- had to modify definition of players sprite array field in TeamGeneralInfo, that's actually a SWOS data
  pointer to SWOS data pointer ;) (must also dereference it before indexing as it will be interpreted as an
  array of arrays)
- started with bench rendering implementation, haven't done much, sorting out all the variables is slowing
  me down
08.07.2021.
- implemented coach and reserve players rendering, but used fixed menu instead of game coordinates and
  nothing is showing... will have to leave that for tomorrow
09.07.2021.
- after a short fix (including subtraction of int and FixedPoint), players and coach are showing up on the
  bench
- been trying to implement arrow movement, but was unable to finish; damned crazy logic is making it real
  slow, so now I'm trying out new hybrid approach, copying in detail some parts of the code, and rewriting
  other parts from scratch from the way I know it works
10.07.2021.
- finished arrow movement, and debugged it, works nice
- added logic for selecting the bench player, but currently it isn't working properly
11.07.2021.
- fixed the glitches, now bench player selection works properly
- been working on substitutes menu rendering, but it isn't ready yet
- switched menu frame rendering to floating point, but menu backgrounds are more problematic, since they need
  to be rendered into textures with specified dimensions, which have to be truncated or rounded; I will
  probably have to round up, and then match the alpha to the fractional part (and will need to revise assert
  that catches off screen drawing)
12.07.2021.
- fixing menu textures in progress, nearly done
13.07.2021.
- added missing call to menu entry caching when menu is returned to
- found an easy solution for drawing frames with thickness other than 1 pixel... simple temporary setting of
  render scale, hope it won't backfire ;)
- ensured the fall-back branch when texture allocation fails works, it simply draws the entry background
  single colored
- handled the case when entry background is larger than maximum safe texture size (2k)
- haven't fixed asserts in play match menu, but they seem to come from two entries that have negative y
  coordinate (perhaps the game does it to shove them away, don't know for certain yet)
- removed scrolling images at the start
14.07.2021.
- seems there was a team colors mismatch, team colors weren't correctly picked, now it's fixed
- after menu background rendering digression and other annoyances, finally returned to bench menus; got some
  more of it rendered before the juice ran out, next is filling player menu entries with data; with things
  going smoothly like a wounded slug up the oak tree, everything's gonna be ready in no time
15.07.2021.
- player list rendering done!
- started implementing behaviour (cursor movement in the list); seems there are a few invalid memory accesses
  in the code >_> (e.g. indexing players array with -1)
16.07.2021.
- most of the bench logic is in place now, but couldn't debug it, so that awaits in the future
17.07.2021.
- fixed sprite rendering problems
- implemented formation menu rendering and controls handling, debugged it and it seems to work fine
- fixed most of the bench control handling, but there are still glitches
18.07.2021.
- substitutes are now actually happening
- fixed page up/down keys not triggering/returning from bench
- fixed those damn annoying assertions in play match menu
- rearranged code a bit better to protect from invalid player indices in bench
- fixed team reversal in bench (not properly initialized team players pointer), but a player swapping glitch
  still persists
19.07.2021.
- it seems player short and full name mismatch goes way back into DOS version (confirmed by memory dump),
  luckily long name is never used during the game (as well as that face2 field, at least I've never seen it)
- added asserts for allowed picture indices since the latest memory overwrite was causing some messed up
  sprites to show up
- no luck with fixing the glitch today, also the order of players in bench menu is incorrect
20.07.2021.
- fixed not properly showing selected player for swapping in bench menu when coach is selected
- fixed invalid order of players in bench menu, as well as swapped players ending up at wrong positions
- fixed bench player selected to go in not showing up properly on top of the menu
- fixed 5th reserve player not being selectable
- I think I got the memory overwrite after a substitute, it was due to old 1d array changed to 2d, but one
  place was still accessing it linearly, this is a good lesson to prefer std::array wherever possible
- fixed assert in menus that only string-type entries can blink (oops); I think this should also fix reported
  Android crash when swapping players before the game
- fixed yellow/red card bench menu icon sprites missing from the assets
- played a couple of games, seems to be working fine, hope I'm not forgetting something
- checked why asset packer chokes with big pitches, it seems it's working, just very slow; it starts getting
  really slow after 600-700 patterns; not sure if it's possible to speed it up, the algorithm seems like
  O(n^2), but will try to understand it better and then reevaluate
21.07.2021.
- debugged the rects packer algorithm, it seems to keep track of available space inside each atlas in form
  of a rectangle list; I've seen this list grow to 5-6k elements, and it's scanned in a double loop --
  O(n^2); changed packing algorithm to guillotine and it's now finishing within reasonable time, but what I
  really should do here is create a custom packer for the pitches, that would be the fastest running solution
  and guaranteed to be optimal (since each pattern is equal, no need to solve the general purpose packing
  problem), will see
22.07.2021.
- went for it, and implemented the above idea ;) works like a charm, and is as fast as can be
23.07.2021.
- committed to Github
- fixed menu item background showing up 1 pixel outside outer frame; rounded x & y up and lowered dimensions
  by that much, it's indistinguishable
- fixed player names in play match menu being too close to edge, their 2 pixel margin is restored
- fixed tactics entries in play match menu lacking outer frames
24.07.2021.
- fixed career loading, seems there was one exported variable inside the career file buffer (isCareer) that
  was getting alignment (old story already); turned out the variable was unused, so removed it, but added
  static assert check for career file buffer size if this ever happens again (lucky coincidence, exporting
  start of the buffer made the buffer at least word aligned, so isCareer got automatically aligned as well,
  and any other word needed won't get alignment bytes)
- removed support for original CD comments
- turned off comments and crowd chants in training games
- fixed career loading restarting menu music
- [mnu2h] added support for multiline text entries
25.07.2021.
- fixed a crash in continue/abort prompt, had to convert DoContinueAbortMenu and continueAbortMenu; and that
  was the last reference to GetTextWidth()
26.07.2021.
- studying highlights in order to fix them and replay bug and refactor and convert rest of the code
27.07.2021.
- compiled xenia, found license switch ;) and studied XBLA SWOS for a bit
- started with highlights conversion, but decided to do MainKeysCheck() first (even though I was initially
  gonna let it be for now)
28.07.2021.
- [ida2asm] stopped registering references from non-procs (we're removing them anyway)
- [ida2asm] fixed overstepping the fragment boundaries when skipping until a given symbol (this was causing
  an end symbol to be falsely found and then the range wouldn't connect with the next fragment)
29.07.2021.
- removed plenty of unneeded code, mostly highlights but some other variables too, trying to get it to
  compile
30.07.2021.
- fully translated and revised highlight files documentation
31.07.2021.
- did some work on highlights code conversion, at least finalized the specification of the new
  highlights/replay file format
01.08.2021.
- continuing with highlights/replays
02.08.2021.
- as yesterday; did loading routines, got both old and new highlight files supported
03.08.2021.
- been analyzing UpdateCameraBreakMode(), this might be a good candidate for converting next
04.08.2021.
- [ida2asm] added name of the procedure that references the missing reference to the output (it helps
  immensely in fixing that missing reference)
- [ida2asm] fixed only marking first import reference as found and leaving the rest unsatisfied (resulting
  in spurious error)
- converted most of MainKeysCheck()
05.08.2021.
- finished converting MainKeysCheck()
- removed bunch of intro variables and some others
06.08.2021.
- finalized rough play instant replay routine, everything is still quite broken
07.08.2021.
- finally got it to compile, but lot of things are broken, will need to analyze the diffs
08.08.2021.
- fixed camera getting stuck, mistakenly commented out the code that decrements showFansCounter in a rush
- finally the replays are working, except the buffer size needs to be tweaked; I've accounted for increased
  coordinate sizes, but not the amount of data: all sprites are getting recorded, since there's no way to
  know the screen size on which it will be replayed; and who knows, maybe some future replayers might even
  implement a custom moving camera
- fade out implemented, after figuring out how SDL_RenderReadPixels() works
- need to connect fade-in, but it's annoying since it has to be called at exactly the proper time, and
  replays are running until the buffer dries out
09.08.2021.
- trying to connect fade ins and outs, but only got menus and initial two before the game correctly, fading
  out can't be performed in the code that does fade-in, since the rendering buffer gets emptied by then, and
  that's causing plenty of trouble
10.08.2021.
- [mnu2h] fixed negative coordinate literals (how did this get broken again?)
- converted versusMenu; since PlayGame() was referencing it I had to convert it as well, renamed it to
  InitializeIngameTeamsAndStartGame() along the way; that helped remove some more code and data and
  amazingly, nothing seems to have been broken in the process
- haven't managed to fix the fades, since PlayGame() conversion ate all the time, but at least I'm in much
  better position to tackle it now
11.08.2021.
- same problems as with versusMenu, stadiumMenu is calling DrawMenu() from init function which ruins fades,
  decided to convert that menu as well
- [mnu2h] fixed single quoted strings getting incorrectly converted to numbers if they contain digits only
- [mnu2h] fixed a bug where new menus and entries retained some of the data from the previously parsed ones
- [mnu2h] fixed handler functions declared in template entries not getting C++ declaration in the header
12.08.2021.
- [mnu2h] added support for onDestroy function (will need this for per-menu texture caching)
- removed color converted sprite copying functionality from the menu system (used in stadium and edit
  tactics menu, which have to be converted anyway)
- introduced a concept of menu local sprites, sprites that are valid only during the lifetime of the current
  menu, and when it goes away they are destroyed automatically (this kind of makes onDestroy superfluous, but
  I'm keeping it in for now)
13.08.2021.
- contemplating how to properly colorize player sprites in stadium menu, refactored background image loading
  into a function of its own
- removed sprites [210..214]
- found some more code to remove
14.08.2021.
- removed assert for zero width/height entries, they're used in pre-match menus, and hopefully mnu2h will
  catch these issues compile time
- called parseCommandLine() again after loading options so they can override (can't parse them after loading
  options since they can affect options location ;))
- removed ADL lib and all the associated code
- added an option to skip showing pre-match menus (versus and stadium)
15.08.2021.
- all the gymnastics about sprite colorizing were futile :) simply moved game sprite loading into versus
  menu, and then just used normal sprites (works nicely, since the longest pause is while showing versus menu,
  so used that opportunity to actually load all that's needed for the game -- on a side note, sound file
  loading is slow because there are so many, they should really be stored in a non-compressed zip file)
- [mnu2h] fixed needlessly issuing native entry codes for null text and null multi-line text
- [mnu2h] fixed evaluation of certain built-in variables inside a preprocessor expression if they couldn't
  be trivially converted to integer
- [mnu2h] now issuing a warning if an entry-dependent variable is used inside a loop (e.g. @prevY), since
  the preprocessor expressions will evaluate immediately and each iteration will end up with the same value
  (very likely not what's intended)
- added a routine to swap menu background
- argh, game sprites have shadow! will need to figure out something
16.08.2021.
- [mnu2h] made ':' operator work with internal variables (starting with '@') in preprocessor expressions
- [mnu2h] added 't' format specifier for preprocessor expressions, it will cause the result of the expression
  to be tokenized and inserted back into the input
- fixed reserve player name entry positions in stadium menu
17.08.2021.
- [mnu2h] fixed tokenized preprocessor expression result missing first token when used in a void context
- finally set up players in the stadium menu properly (at least the positions), players are looking good but
  goalkeepers have a little bit of shadow left, leaving it as is for now, if it turns out a big problem one
  additional sprite could be added to the sheet, for this purpose only
- fixed fade-in when entering the game
18.08.2021.
- fixed pretty much all the menu <-> game fades, but I sometimes notice sort of a small flicker during the
  fades, doesn't happen every time, will have to check that out more thoroughly
- implemented in-game highlights (on 'H')
19.08.2021.
- expanded hil format with a pointer to the previous frame, that is required to add rewind support
- added a field to the hil file header that holds offset to the data buffer, it will ensure that the format
  is extensible in the future
- trying to get highlights and replays menu operational again
20.08.2021.
- trying to separate init match and showing pre-match menus in playing normal game and showing replay
21.08.2021.
- implemented reading of legacy highlight files and internal conversion into the new format
22.08.2021.
- got the highlights running with old highlight files, but it's still buggy
- fixed choppy sprites during the new-style replays (replays weren't getting full coordinates, just the whole
  parts)
- converted continue menu (need to show errors from replays failing to save/load)
- [ida2asm] stopped adding out-of-proc instructions into the output items stream, as a removed function was
  referenced from unreachable code, causing linker errors
23.08.2021.
- got the old format replay files to load and play, fixed some of the bugs, but the main problems still
  remain: the sprite movement is jerky and sprites are off center
24.08.2021.
- removed plenty more of SWOS variables, including control-related ones
- cleaned up game control code and now bench button works again
- refactored sound/music code a bit
25.08.2021.
- fixed off-center sprites in old-style replays; added assert that the sprite is actually loaded into
  getSprite() (was getting a null sprite with zero data since they're not yet loaded at the time of replay
  load, that's why the drawing was off)
- fixed music not stopping during the replay, and restarting after
- added basic key controls: F - fast replay, R - slow motion, P - pause, it's working nicely, next is to add
  rewind controls (did a small change compared to the original: allowed R to slow down replays/highlights as
  well)
26.08.2021.
/
27.08.2021.
- removed static vars for alt, shift etc., introduced usage of SDL_GetModState() (more proper)
- implemented keys for rewinding/skipping replay reproduction, and it's working great :) it's left/right
  arrow in combination with ctrl/alt/shift (kind of like in VLC)
- also added a small display with the current scene number, total number of scenes and percentage of the
  current scene replayed
28.08.2021.
- stopped crowd sound when returning to menu after a replay
- added abort by fire to replay, but only during the game
- fixed small imprecision in frame offset calculation, now toggling forward/backward returns to exactly the
  same frame
- fixed pause blocking scene fade-in after fade-out, leaving the screen black, appearing as if stuck
- fixed escape only going to the next scene instead of terminating the whole highlights session
- fixed not fading out when a replay is aborted
- added keys to go to the previous/next scene (if applicable), comma and dot (< and > on top)
- fixed stadium menu player sprites getting messed up when loading 2nd match or more
29.08.2021.
- [ida2asm] an error is issued when an unconnected range end is encountered while there was already an
  unconnected range end earlier; it's possible in case regions overlap, or some symbol was renamed (d-oh)
- converted corner flags update routine, but they're still annoyingly wiggling; ah, what a twist, after
  closely analyzing the original, found out that their corner flags are also mangled -- considering this a
  graphical problem and leaving it as is
- removed most of the camera variables, but the main ones are still hanging by the ActivateReferee(); and
  Flip() is finally gone
- implemented end game fade-out & in, it's still missing the stats overlay, but otherwise is looking good
30.08.2021.
- UpdateStatistics() is really two functions, update and show, separated them & working on converting the
  stats code and get it to display at the end of the game (and halftime)
31.08.2021.
- implemented pause and stats, but stats at half-time and end game don't appear automatically, will need to
  debug that
01.09.2021.
- fixed automatic stats not showing up
- implemented auto-save highlights and auto-replays
- fixed auto-replay being able to be interrupted by the non-scorer
- fixed invalid fade-out in play match menu when two players are playing (after 1st player is done)
02.09.2021.
- fixed a check if the scene table loaded properly when loading replays
- fixed replaying files as if they were instant replays (instant replay flag wasn't being reset)
- fixed not being able to save both highlights and replays after a match
- cut out the frames spent at the bench (only wondering if the cut is too harsh?)
- removed the game clock from highlights, and moved the result a bit down if we are displaying clock
- fixed saved highlights and replays ending up at game root, and not in their appropriate directories
03.09.2021.
- fixed highlight file getting the whole match data saved (had to do the extraction and fixup of
  highlights-only data and scene table reconstruction)
- fixed slow motion flag getting stuck for the next instant replay
- cleared game name and round buffer so random post-string garbage doesn't end up in the file
- fixed bad replay header alignment and static asserted it
- decided to save scene table along with replays, so highlights can be watched too from the same file (and
  updated GUI to allow it if present)
- removed current scene number from replay info if it's not a highlight
04.09.2021.
- changed debug memory flags, now the debug version is quite a bit faster
- fixed 64-bit version (but the debug version there is still slow as hell)
- fixed minutes display in replays
- fixed missing half-time and full-time sprites
- fixed right column in long-names save highlights menu getting yellow frame (it's that SWOS play match menu
  kludge, haven't been reseting the flag)
- trying to set up stats in replays, but it's still a bit buggy
05.09.2021.
- fixed wrong stats showing up in replays
- fixed crowd chants sometimes playing at double speed in replays
- refactored legacy highlights file parsing into separate class
- gave up on the system of having stats on and stats off packet, since frames containing them may get skipped
  over in rewinding and it would get very complicated keeping track of the state; now just saving stats each
  frame they're shown and that problem is gone; the file is a wee bit bigger, but the stats aren't really
  shown for a long time, even if left to expire on their own
- fixed bad fade out at the end of the game (displaying sprites on black background)
- fixed result/stats disappearing if game is exited with escape
- fixed final stats blinking (disappear then quickly reappear) when fire is pressed
- [mnu2h] fixed handling of string tables that have negative starting index
- fixed gameplay options menu crash when setting pitch type to seasonal/random (starting index is -2 not 0)
06.09.2021.
- reimplemented big S spinning sprite
- refactored timer code out of the renderer
- reimplementing timing code to fix some mistakes (the case when running on slower machine incapable of
  delivering 70FPS), but currently it's messed up (game's in slow motion, lol)
07.09.2021.
/
08.09.2021.
- can't find the timing of SDL_RenderPresent() anywhere, my measurements show 0-5ms, probably ~1.7 on
  average, so included average render time into timing calculations
- changed the timing algorithm slightly in order to accommodate slower machines, so far it's looking good but
  more thorough testing is required
09.09.2021.
- published a new version and pushed to Github
- fixed delta time getting ridiculous values after pause and instant replay (must update frame render time,
  there are probably more places like this in the code)
- fixed mouse not working in replay/exit menu after the match
- added FPS display indicator, and a way to toggle it in video options
- FPS was quite unstable, until I hit the jackpot: SDL_RenderFlush(); calling it after the game engine update
  has made the FPS much more stable; it's still just slightly below 70, maybe there's something that's
  outside the frame time measurement, or the FPS calculation itself isn't perfect... that's the next thing
  to investigate but it's pretty good even as it is now
10.09.2021.
- found a small error in timer code and fixed it, and with a small tweak FPS is now very, very close to 70,
  almost there
- simulation of slow machines fails miserably
- added zoom to video options menu and fixed the menu code for hiding virtual joypad options
11.09.2021.
/
12.09.2021.
/
13.09.2021.
/
14.09.2021.
/
15.09.2021.
/
16.09.2021.
/
17.09.2021.
- implemented wide-mode pitch rendering, there's no more stretching, 16:10 proportion for sprites is upheld,
  and extraneous space is filled with more of the pitch
- implemented zoom, like in XBLA SWOS, it's a bit buggy, but otherwise works really well :)
18.09.2021.
/
19.09.2021.
- prevented zoom from showing area beyond pitch limits (added clipping)
- prevented zoom from becoming too small (so that the screen is never less than pitch width/height)
- fixed nasty jump in zoom at the top of the pitch
- removed plenty of SWOS code from the comments
- converted referee code (though broke it a bit in the process)
- last remnant of the code that directly uses camera vars is gone... changed them to float
- removed game time sprite, just calling the draw routine directly now
- same with player name sprites
- and result sprites
20.09.2021.
- added zooming by 0.25 increments when holding control key while pressing +/-
- fixed menu item renderer constantly emptying the cache after the screen resolution changes
- fixed entry mouse selection being off if the screen resolution isn't the exact multiple of 320x200
- zoom is now properly shown in video options, and can be modified with +/- menu buttons
- fixed bench sprites size and position not respecting the zoom
- trying to fix the problem with visible bench on low zoom, but it's more complicated than I thought
21.09.2021.
- tweaked rectangle rendering routine and fixed issues with bottom menu item frames being cut off, and bench
  menu rectangles horizontal lines being too "thick"
- fixed invalid scorer names x positions
- added zoom in/out as default action for XBOX-like joypads second stick up/down, just like on XBLA ;)
- set a sensible default zoom value ;)
- fixed replays which got broken when switching coordinates from fixed to floating point
- transfered game data loading to stadium menu (but it brings its own set of problems)
- fixing fades in progress, almost there, just slightly buggy
22.09.2021.
- split pre-game loading a bit, versus menu loads sprites, and stadium menu everything else, I think the show
  times are a bit more balanced now
- fixed the fades finally! no more flicker, they're sooo good now ;)
- fixed sprite rendering in replays at pitch top/bottom when the zoom is less than one
- fixed not resetting pause when instant replay starts, making it look like it froze
- extended convert sprites script to create blocky assets
- extended convert sprites script to create stadium layered sprites
23.09.2021.
- modified convert and compile assets script to create stadium layered sprites
24.09.2021.
/
25.09.2021.
/
26.09.2021.
- implemented menu local sprites registration and cleanup, and fixed their rendering
- finished the code for loading and showing stadium sprites in C++
- fixed unwanted player transparency
- loading of match stuff is now transfered onto stadium menu (while it's shown), only thing versus menu loads
  are stadium menu sprites
27.09.2021.
- shifted player's x destination when leaving the pitch a bit more to the right (to be off-screen), since it
  looks very ugly on unzoomed pitch, they just all converge into one point
- added sound effects to replays (e.g. ball kicks), sounds good ;)
- fixed sprites failing to load when trying to view replays
- made zoom work during replays too
- finally solved the damn problem of horribly bright #$^%*! pitches... there was some transparency in images
  processed by IrfanView, somehow it added it there during the conversion to 32-bit; I instructed the sprite
  packer to ignore the transparency, which it did, but as it seems by blending it with white... argh!! and
  all this time I thought it was some graphical programming problem :) guess not, the programming is
  flawless ;) *shakes hands with self*; trying it out, looks great, and I immediately scored a goal, now that
  can't be a coincidence! ;)
28.09.2021.
- fixed referee animation (missed frame index reset when assigning a new table)
- fixed referee not showing up in replays
- had to revert the code to force integer scale factor for multiples of HD resolution, since it makes game
  screen bigger than the window vertically (200 doesn't divide 1080); this sucks as all the assets were
  created with this resolution in mind
29.09.2021.
- returned the code that blocks mouse selection if the pointer didn't move at all (only this time better ;))
  it's quite annoying that mouse pointer catches initial menu entry when I'm just using keyboard and not even
  thinking of the mouse
- lowered wild initial FPS values (it still starts high but it's tolerable :P)
- fixed menu background not reloading properly when asset resolution changes
- enabled zoom during paused game & replays
- zoom can now be finely tuned by holding shift (single step increment until depressed)
- implemented a bit of dynamic zoom, it will use larger steps when zoomed in more (otherwise it was too slow)
- added missing playCrowdNoise() call to the start of replays
- fixed video options of Android showing up on PC when returning from window mode menu
- published a new version and pushed to Github
30.09.2021.
/
01.10.2021.
/
02.10.2021.
/
03.10.2021.
- fixed sprite reloading when asset resolution changes (still needs some testing in the wild)
- added clear screen option (by default is on, and the screen is cleared to black before each frame is drawn;
  it's a small optimization since we redraw the whole screen anyway, but when off some glitches were showing
  up on Samsung phone, so it's better to allow the user to control it)
- removed old SWOS char tables
- fixed blocked bench bug (stats flag wasn't reset when the stats timer expire, and the game was thinking the
  stats are displayed, that was blocking the bench)
04.10.2021.
/
05.10.2021.
/
06.10.2021.
/
07.10.2021.
/
08.10.2021.
/
09.10.2021.
- implemented bench drawing all the time (since it can be visible with minimum zoom), works fine in regular
  game but is bugged a bit in training
10.10.2021.
- fixed training game bench problem
- extended sprite compile script with training pitch marking and printed a table listing memory requirements
  for each pitch/resolution
- implemented pitch type and number selection
- prevented resetting coach to lower bench in training game (at first was gonna leave it, but turned it off
  after all)
- fixed coach changing color from black to white in training game on half-time
- added default zoom button (keypad star)
- added zoom level display, it's only shown when the zoom is changed, and disappears after a bit
11.10.2021.
- fixed rendering for weird resolutions, there will be letter-boxing if aspect ratio is such that the screen
  width or height surpasses pitch width/height
- fixed pitch changing when resolution changes :)
- zoom is recalculated each frame (in case screen size changes and the minimum value is now too small)
- menu background image doesn't stretch anymore (though now we get black bars on the side)
- added yes/no confirmation dialog when trying to overwrite highlight/replay files
- fixed test controls menu
- fixed some invalid item movement order in control options menu
- fixed arrows and other sprites being off position in menus (those with center x/y values)
12.10.2021.
- fixed menu mouse selection being off when using letter-boxed resolution
- changed the way menu background is rendered, it will now stretch, but without distortion, and will try to
  fill largest space possible; I think it works much better now
- fixed a timing bug, much closer to target FPS now
- fixed resizing the window while the game is paused resulting in black/garbled areas
- fixed joypad quick config using red card sprite instead of white cursor block :)
13.10.2021.
- fixed wrong shorts colors, and accidentally along with it all-players-black problem :) it turns out that
  SDL's color mod algorithm can only subtract color from the original texture, effectively darkening it;
  proper sprite image therefore has to be prepared as a white version with shades of gray in the darker
  parts, and on top of it the actual color comes in; so I've compensated in the convert script by adding
  brightness operation with factor 2.2 (determined experimentally), seems to work fine ;)
- set default music and game audio volume to 50 (100 is probably too loud)
- fixed vertical and horizontal stripes on player shirts in the game being swapped
- fixed out of proportion stadium sprites
14.10.2021.
- app now remembers if it was maximized and restores on startup; added option switch to video options too;
  while I was there added dynamic vertical centering for resolution list if there are fewer than 8, and
  fixed wrong gray color for full screen label when the full screen mode is unavailable
- added zoom in/out on mouse wheel scrolling
- added new control events to control menus, so they can be mapped
- fixed yes/no dialog when trying to delete key control, and made abort default option
- fixed quick control config prompt rendering
- added initial check for minimum window size, so it can't start up say 3x3
- removed some menu code remnants, and lin384k, vsPtr & screenWidth (just one DOS buffer remaining)
15.10.2021.
- fixed missing menu entries caused by yesterday's removal of DrawMultipleItems(); forwarded items to
  drawMenuItem() and all is good again
- fixed wrong item navigation order in select game events menu (all variants)
- fixed not detecting already assigned key when adding new key control
- fixed controls quick config menu
- fixed second team result digits swapped when scoring 10+ goals
- published a new version and pushed to Github
16.10.2021.
- fixed a crash when some of the comments couldn't be played back
- fixed a crash caused by colorized sprites cache not being properly cleared when the resolution changes
  outside of the game
- fixed invalid menu background texture packing when a new texture is needed
- fixed passing a null texture for menu local sprites when a team doesn't have at least one player of each
  hair/skin variant
- fixed a crash when exiting with alt-F1 and the game is in borderless window mode (renderer gets destroyed
  first, but the window has event handler installed which receives size changed message and then queries the
  renderer in order to update the logical size... oops!)
- fixed a caching error, whereas game thinks it has all the player sprites ready but it doesn't (e.g. loading a
  team with no blacks first, and then a team that has)
17.10.2021.
- added boolOption entry type to replace all those ON/OFF string tables with additional functions all over
  the place (updated mnu2h to parse and generate them + support C++ code)
18.10.2021.
- added string description (more like an option name) to boolOption, to go in the log when the option
  changes
19.10.2021.
- re-hauling options, trying to centralize them a bit more in options.cpp, and to offload window manager
- removed chairman scenes option
20.10.2021.
- finished options refactoring, it wasn't possible to do it exactly as I planned, but I think it's still a bit
  better than it was before
- discovered that creation and caching of fancy backgrounds still takes place, even if they're not displayed;
  disabled that and the menus FLY again ;) excellent debug option, and might be useful for low-end machines as well
- enabled entering audio volume directly by keyboard
- fixed comment with control event values in ini file
21.10.2021.
/
22.10.2021.
/
23.10.2021.
/
24.10.2021.
/
25.10.2021.
/
26.10.2021.
/
27.10.2021.
/
28.10.2021.
/
29.10.2021.
/
30.10.2021.
/
31.10.2021.
/
01.11.2021.
- created a script for merging separate sprite layer images into a single multi-layered TIFF (to ease the
  artist's job)
02.11.2021.
/
03.11.2021.
/
04.11.2021.
/
05.11.2021.
/
06.11.2021.
/
07.11.2021.
/
08.11.2021.
/
09.11.2021.
/
10.11.2021.
/
11.11.2021.
/
12.11.2021.
/
13.11.2021.
/
14.11.2021.
/
15.11.2021.
/
...
01.01.2022.
- installed Photoshop to VM and realized it can't handle multi-layered TIFFs...
02.01.2022.
/
03.01.2022.
- managed to create proper PSD files with correct layers that are opening nicely in Photoshop
04.01.2022.
- integrated PSD creation into script and generated PSD's for all the layered sprites
05.01.2022.
- worked on image asset creation manual; to do: go over bench sprites, include pitch image examples, and an
  image of pattern separation grid, go over sprite descriptions, remove/add necessary
06.01.2022.
- added pitch bitmaps to asset spec archive
- added bench sprites to sprite layer generation script
07.01.2022.
- now copying missing *.txt files too (sprite center coordinates)
- optimized script to issue commands in parallel (much faster now)
- updated backup script to pick up doc file from assets dir
- added original scrolling board sprites
08.01.2022.
- finished asset manual, sent to Playa for review
09.01.2022.
/
10.01.2022.
/
11.01.2022.
/
12.01.2022.
/
13.01.2022.
- extending SWOS++ with game data recorder... going pretty slow so far, by now I've pretty much remembered
  why developing SWOS++ was so annoying and limited
14.01.2022.
- finished prototype version on SWOS++ side, all the data is properly saved to files; still need to test out
  the details, potentially add more data and handle pointers, but file checker on port side should reveal
  that -- on to fixing the tests
15.01.2022.
- working on getting the tests back up, the radical change of rendering method has brought a completely new
  set of challenges
16.01.2022.
/
17.01.2022.
- working on fixing commentary tests
18.01.2022.
- trying hard to finish commentary tests, almost there, but couldn't quite; need to fix up end game chant
  and comment
19.01.2022.
- commentary tests fixed!
20.01.2022.
- trying to fix select files tests
21.01.2022.
/
22.01.2022.
- select files tests fixed!
- added keypad enter as a key to end text input
- all tests are passing!
- was solving the newly manifested problem of creating test snapshots; seems SDL doesn't want to render
  while the main windows is hidden/minimized, will try to see if I can covertly do it via WinAPI; the system
  is still buggy and doesn't render correctly, but it's showing promise
23.01.2022.
- moved test window to the back, since there's no chance to render anything while it's hidden/minimized
- new challenge: tests are ran in background thread in order to be able to stop them if they run for too
  long, but now we need to access UI and SDL APIs which are not thread safe, what to do, what to do...
24.01.2022.
/
25.01.2022.
/
26.01.2022.
/
27.01.2022.
- posted ad for artist to convert graphics on Upwork, let's see how that goes
28.01.2022.
- got two offers already
- redid multi-threading setup of tests, now tests run in main thread so UI APIs can work properly, and the
  timeout check is in a thread of its own
- all the tests are passing!
29.01.2022.
/
30.01.2022.
- now deleting all the surfaces from snapshot thread properly
- fixed some snapshots not appearing (target rendering texture wasn't updated when window size changed)
31.01.2022.
/
01.02.2022.
- fixed invalid size of some snapshots
- fixed invalid yellow please wait message on snapshot when enumerating display modes goes too long, it's
  actually a real bug, if it shows up once, and then the window gets moved to another monitor, the string
  will point to garbage data
- with this, I proclaim the tests fixed!
02.02.2022.
/
03.02.2022.
- made a skeleton of the recorded data test
04.02.2022.
- moved a bit with recorded data, loading it and starting the game (whatever that does); now in the phase of
  disabling the SDL rendering calls
05.02.2022.
/
06.02.2022.
/
07.02.2022.
- fixed recorded data test, but it still needs more work, on both sides (currently need to save input near
  the start of the frame, not at the end; but everything else needs to come from when the frame is about to
  be shown)
08.02.2022.
/
09.02.2022.
/
10.02.2022.
/
11.02.2022.
/
12.02.2022.
/
13.02.2022.
/
14.02.2022.
/
15.02.2022.
/
16.02.2022.
/
17.02.2022.
/
18.02.2022.
/
19.02.2022.
/
20.02.2022.
/
21.02.2022.
/
22.02.2022.
/
23.02.2022.
/
24.02.2022.
/
25.02.2022.
/
26.02.2022.
/
27.02.2022.
/
28.02.2022.
/
01.03.2022.
/
02.03.2022.
/
03.03.2022.
/
04.03.2022.
/
05.03.2022.
/
06.03.2022.
/
07.03.2022.
/
08.03.2022.
/
09.03.2022.
/
10.03.2022.
/
11.03.2022.
- updated data format on the SWOS++ side, there was other data that had to be gathered, switching to parsing
  the data, will see if it's the final version
12.03.2022.
- fixed sprite storing and a couple more smaller issues with recording, finally ready to move to the
  verification
13.03.2022.
/
14.03.2022.
- realized I didn't store random generator state, which is a must; also reading tick variables from
  interrupt handlers might be problematic; and another problem is divergence of code between the two
  versions, just one missed Rand call can spell doom
- got some differences in TeamGame, might be explained by this, but needs further research
15.03.2022.-21.05.2022.
/
22.05.2022.
- implemented fixed random value on SWOS++ end
23.05.2022.
/
24.05.2022.-08.08.2022.
/
09.08.2022.
- began writing script to unpack sprites from artist-convenient form to game-ready form
10.08.2022.
- script finally finished! had to fix some invalid sprite dimensions, and there are still some wrong stuff:
  - all pitches are messed up except one :(
  - something in the bench sprites
  - something wrong in the stadium sprites (height one pixel too much)
  - couple of sprites missing
  it's hardly impressive looking but it's a bit better than before, especially compared to blocky sprites
- fixed some mistakes in documentation
11.08.2022.
- tried manually fixing just one pitch, but failed and wasted a lot of time... really need some kind of a
  tool for this; the problem with pitches is that he removed crowd and corner flags, but didn't update
  indices, and everything is out of place
12.08.2022.
/
13.08.2022.
/
14.08.2022.
/
15.08.2022.
- had an idea to convert pitch PNGs to 8-bit BMPs and use SWPE to edit the pitch (and later just convert SWOS
  binary DAT file index to new style text file index); no command line tool was able to apply fixed palette to
  bitmaps... sigh, had to resort to writing a script with Python+PIL, but it did the job beautifully; next step was
  to improve SWPE so it can scan the game directory and insert all present consecutive pitch patterns; but in the
  end realized this action only made things worse... instead of messing with ~200 pattern images and index file,
  now I have around 42x55 tiles to fix... ARGH! there's gotta be a
  decent way to do this...
16.08.2022.
- if I improve SWPE a bit more, maybe it would be possible to edit the pitches in a realistic amount of time; that
  experience could also translate nicely when a real pitch editor will be created
- added mouse selection of patterns in pitch edit mode, along with custom cursor
- right click & drag copies clicked pattern to all the dragged spots; when holding shift only straight lines are
  drawn
- mouse wheel scrolls pitch
- left click drag pans the pitch
- patterns can be deleted from pitch view too
- fixed window positioning and screen edge snapping
- small fixes (e.g. window centering and moving fixed, custom cursor behaves properly now)
- got more ideas but these have already turned it into a nice little editor :)
- even with these nice improvements it's still taking forever to edit the pitch...
17.08.2022.
- added control+s command to save pitch changes
- added control+r command to discard changes and revert to last saved pitch
- fixed a bug with pattern insertion when searching for wrong filename
- changed pattern mode to be consistent with pitch mode: up increases pattern number, down decreases
- improved pitch 2 (the one I'm converting) a bit, but it's still a long way to go
18.08.2022.
- added ability to enter pattern number directly in edit mode (to pattern under the cursor), press g to activate,
  or double-click the pattern
- holding middle mouse button shows pattern number in edit mode even if show pattern numbers is off
- in addition to right-click drag pattern copying, now the master pattern can be selected by control-left clicking
  as well (allows to draw with non-adjacent patterns)
- added red rectangle to mark the pattern that's being copied (for right-click "drawing")
- when pattern is unused it's displayed in pattern mode info (though needs to be updated when changing stuff)
- fixed a case when inputting a pattern number, cursor moves and wrong pattern ends up changed
- moved pattern number by a pixel right & down on the pitch, so it's easier to read now
- finally finished pitch, it's not that bad, if I may say so :) all these changes to the editor helped a lot,
  pinpointing unused patterns was especially useful for final touches; planning to add optimize feature, to remove
  unused patterns and nicely sort used ones (by the on-pitch position) + generating txt index file for swos-port
  and we're good to go ;)
19.08.2022.
- pattern usage count updated when editing
- fixed crash when inserting pitch while drawing with right button
20.08.2022.
- implemented undo when modifying/deleting patterns on the pitch
21.08.2022.
- added pitch optimization (control+o): unused patterns are removed, and the existing ones are re-indexed so that
  their order corresponds to order of appearance on the pitch (e.g. first unique pattern on the pitch from top-left
  gets index 0, second 1 and so on) -- very useful when editing and going through the patterns
- added text displaying what's going on when undoing/redoing
- added undocumented command control+t to save pitch index file to text format that port can directly use to
  compile resources
22.08.2022.
/
23.08.2022.
- fixed shift-insert in pattern mode (insert all patterns in directory) in case there are more files than patterns
  already in the pitch
- app doesn't ask to save changes when everything has been undone
- quit prompt can be dismissed by pressing escape again
- patterns can be highlighted now (very useful to find where in the pitch a particular pattern is placed); it can
  be done by ctrl-shift clicking the pattern, or pressing h while it's displayed in pattern mode
- middle click in pitch mode shows pattern number outside edit mode as well
- fixed index file saving to skip invisible rows
- added ctrl+insert command to pattern mode which adds new empty pattern to the end
- first attempt of pitch transfer failed, but there will be more :)
24.08.2022.
- it turned out that compile assets script already understands swpe index file and skips invisible rows, oops :) so
  removed that code
- pitch2 works great! I copied the wrong files initially :)
- made all new "ctrl+" shortcuts available out of edit mode too
- finished pitch1 in swpe + port conversion, mostly OK, there are just a few mistakes
- removed first and last two rows from pitch optimizations, they aren't visible and only mess up tile numbering
  (they are all set to 0 tile in the output and the top-left tile gets assigned number 0)
- argh... I haven't included other two types of shirts in the archive for the artist, so there's only one shirt
  type converted; messed with sprite resizer software a bit more to see if I can convert them and got better
  results than the first time, this looks even better than the converted sprites :P I'll play with this some more,
  might reconvert all the sprites
25.08.2022.
- pitch1 mistakes fixed, officially done
- added "change all instances of tile to" command, on C, useful when some tiles are shifted and can be quickly
  changed to proper number; edit -- it's not useful, it's super useful! :)
- finished pitch3 in swpe
- finished pitch4 (swpe) too, it's going a bit faster now
26.08.2022.
- alt-click on tile in pitch mode switches to tile mode and displays the clicked tile
- added ctrl-shift-s that forces save even if nothing changed
- when switching to pitch edit mode cursor is now aligned with mouse pointer, instead of always starting top-left
  (unless pitch didn't move -- in that case no change, assumption is that keyboard editing is in progress)
- also pitch x and y are not rounded to tile grid anymore, it was an annoying abrupt jump
- current tile number under the cursor can be shown while holding tab key regardless if the number display is on
- tiles can be copied via keyboard too: hold shift and press arrow (selected tile will overwrite neighbor tile in
  the arrow direction)
- finished pitch5 & 6 (swpe)
27.08.2022.
- fixed excessive CPU usage in pitch mode
- bulk change pattern operation (change all pattern instances to...) now undoes and redoes in a single step (what's
  the use of undo/redo if you have to step by step manually undo/redo say 700+ steps)
- included pitch optimization into undo/redo operations
- included insert new pattern into undo/redo chain + allowed ctrl+z/y on pattern screen (had to, it's modifying the
  same data as pitch)
- fixed asking to save after undoing all operations
- pitches 3, 4, 5 & 6 converted, that's all!
28.08.2022.
- patterns can be changed by holding ctrl and mouse wheel scrolling (current pattern changes +/-1)
- brush pattern can be set via keyboard too, ctrl+enter
- when using keyboard tile painting (shift+arrows), first the brush pattern will be used, if defined, and only if
  not adjacent tile will be used for copying
29.08.2022.
- messed a bit with pixel-art scaling algorithms, did some testing, picked a few variants that work best for SWOS
30.08.2022.
- applied pixel-art scalers to game sprites (and some menu sprites too), in the end went with EPX3+XBR 4x combo;
  while far from perfect it looks way better than what any ordinary scaling algorithm can achieve -- even though it
  sometimes end up looking weird, I appreciate abstract art :) number sprites turned out a bit crappy so touched
  them up a little by hand; tried a few other algo combinations for numbers-only, but eventually went with the
  original one; this game really has a potential to look beautiful :)
- deleted blocky assets (finally!) :)
- fixed half-time and full-time sprites position
31.08.2022.
- implemented new char sprites into fonts (!,@,#,$,%,^,&,[,], YU letters, German letters...)
- fixed text elision showing up in edit box when it shouldn't (input was allowing one character too many)
- added message display when screenshot is made
- fixed screenshot not working after 1st one was made (spam prevention working too well)
- fixed some slight sprite errors
01.09.2022.
- added curly braces
- added YU and German chars to allowed char list when entering names and filenames
- published a new version and pushed to Github
02.09.2022.
/
03.09.2022.
/
04.09.2022.
/
05.09.2022.
/
06.09.2022.
/
07.09.2022.
- doing some research on how to use shaders in conjunction with SDL, reading SDL sources of DirectX renderers a bit
08.09.2022.
- updated SWPE manual, and finally looked into those LaTeX warnings and fixed them ;)
09.09.2022.
- explored shaders some more, got a rough idea how that could be organized within the code, but also realized it's
  possibly better not to use them in this case, exploring other ideas such as texture generation/loading
10.09.2022.
- fixed menu gradient background option not getting saved
- seems like it is the actual software drawing that's the bottleneck, not texture creation and upload; added some
  timing code, and yes, it's abysmal
11.09.2022.
- optimized background drawing, changed from floating to fixed point and used multiple threads; it works much
  faster now, it's slightly less precise but it's practically impossible to notice the difference; still need to
  fix some bugs, but I think this is good for now, will need to test on some slow machine to see if it's really OK
  (possible things to do are moving to GPU shader rendering or caching patterns in files)
12.09.2022.
- fixed menu background texture invalidation when resolution changes
- made cache more granular, allowed it to cache menu entries independently of menus (since they can be reused by
  different menus, if position, dimensions and resolution are the same), also optimized it even further (increased
  parallelism)
- changed texture atlas dimensions to be more flexible (between 2k and screen size, but not over max texture width
  renderer reports)
13.09.2022.
- been getting some crashes in debug mode, although I think the code is fine and the bug is in VC++ (letting
  futures go out of scope should make the main thread wait on async to finish and clean up properly), I've added
  wait() calls just to be on the safe side and it hasn't happened since
- tried some optimizations in hope they would decrease false sharing in the surface memory:
  1. processing rows in a local array and then copying it to surface
  2. making every other thread process surface lines in reverse order
  3. increasing padding between images inside the surface
  but didn't get any meaningful improvement, so I ditched them to keep the code simpler (#3 surprisingly made
  things noticeably slower, the bigger the padding the slower it got)
- started converting CalculateDeltaXAndY()
14.09.2022.
- finished CalculateDeltaXAndY(), got it returning exactly the same results, interesting thing is when I do
  straight multiplication (x * 41 / 64) instead of the expression with sequence of shifts/subtracts, the result is
  off by 1-4 (less when I do integer rounding, but never was able to match it with mul/div) -- typical example is
  -142,000; decided to go with mul/div, it's much shorter and the error is only about 0.00006
- started implementing Amiga mode, will need some additions in ida2asm
15.09.2022.
- expanded ida2asm documentation, added new section I'm planning to implement, for converting constants to
  variables
- implemented it partially as well
16.09.2022.
- [ida2asm] @constant-to-variable section fully implemented
- [ida2asm] fixed not being able to create more than one hook in a single procedure
- implemented Amiga mode (can be changed in options)
17.09.2022.
- published a new version and pushed to Github
- removed menuCycleTimer, it's become completely unnecessary, it wasn't even doing anything
- fixed menu FPS dropping when switching to Amiga mode
- fixed Amiga mode not applied from the options at startup
- amped up crash reporter to suck in all the accessible data from the memory (dumps are now ~200mb on my machine)
18.09.2022.
- added goalkeeper changes for Amiga mode, to make them less super-powered
- added enter as fire to menus, and backspace/alt+left as back command
- fixed previous menu showing up in log as current, and improving logging (better now before the reports start
  pouring in ;))
- fixed default options getting bogus values (when ini file hasn't been created yet), also changed default window
  dimensions to 1920x1080
19.09.2022.
- fixed annoying occasional crash right before the game... very silly error:
    setupTeamPlayerSprites(..., m_team1);
    setupTeamPlayerSprites(..., m_team1);
  lol o_O
- found that per-team texture cache system was all wrong (never included team colors in consideration, always
  stupidly saving whatever was there before), and had to rewrite it... still fixing last bugs
20.09.2022.
- implemented reference counted shared texture class to properly manage texture sharing and lifetime
- finished debugging new texture cache system, seems to work fine now, time will tell if things are more stable
21.09.2022.
- messing with menu FPS influenced menu controls delay and repeat rate, made it really sluggish and annoying;
  fixed that by changing delays into millisecond values instead of frame counts, tweaked them a bit until it felt
  fine; was thinking of adding delays to options, but on second thought it seems like an overkill, so keeping them
  as constants in code for now and in case someone complains it's super easy to change
- fixed window size input in options only accepting input up to and including 3 digits
- published a new version and pushed to Github
22.09.2022.
- went back to recorded data tester, some discrepancies are creeping in with player skills, I haven't hooked other
  random function (Rand2) but it's possible there's another source of indeterminism
23.09.2022.
- fixed a bug in saving players pointer in TeamData, and also skipped saving the first frame, since it's called
  from Flip() which runs once before the game loop to handle the fades; fixed chance table comparison, now need to
  add the rest of the comparisons
- [ida2asm] added support for exporting multidimensional arrays (thought this was there all along)
24.09.2022.
- added rest of team verification checks except sprites, AI timer is triggering, pending investigation; also will
  need to figure out how to map sprites to SWOS sprites now that there is no all sprites array anymore
25.09.2022.
- added sprite index verification in team
26.09.2022.
- analyzed why AITimer is 11 when it should be 1, seems like playerNumber wasn't set so team appeared as CPU team,
  but I've fixed player numbers and AITimer is still wrong
27.09.2022.
- just debugged DOS version, AI routine is only called once for CPU team, while in port it's called 11 times (for
  each player it seems), and the caller is UpdatePlayersAndBall(), so this will be rough; eliminated some possible
  causes for this discrepancy, but still not sure what's going on, will rig random value on SWOS++, debug in
  parallel and watch where UpdatePlayersAndBall() executions diverge
28.09.2022.
- traced the execution and found where it differed: when the "local" variable was accessed: it turned out it's not
  really a local variable, but a D4 value pushed earlier, holding number of players left to process (one less
  actually); I'm not entirely sure how this works, but there is a variable in the team structure that is bumped
  each frame and holds values 0..10 (wraps at 11), which corresponds to players on the pitch; then this index gets
  compared with the number of players left to process, and only if it matches the AI routine is called (at least at
  this spot in the function); ida2asm generated access of a local variable, which held 0 and never changed, and
  that resulted in AI routine getting called 10 times per frame instead of once; this is a huge discrepancy, and
  it's interesting it wasn't discovered, as the gameplay is seemingly unaffected
- [ida2asm] now generates proper output when esp is directly referenced
- and with this fix team verification at frame 0 passes!
- did a little test on ida2asm parser processing UpdatePlayersAndBall() and then the rest of the file in regards to
  the mistake in line numbering, thought I'll catch it right there, but it turned out to work flawlessly; I'm
  beginning to think the error could be happening in between the segments
29.09.2022.
- solved a verification failure on team quickFire field: pl1FireCounter and pl2FireCounter were never reset and
  were causing team's quickFire field to become active with pre-game input (with no real fire issued); solved by
  resetting them, and as a precaution reset all timer fields of both teams
- fixed sprite validation issue: interesting, there is an unused sprite right after the referee sprite, no idea if
  it could be some kind of leftover from Amiga, but it was messing up the sprite indices (players were getting
  indices higher by one); counted unused sprite properly, renumbered the sprites and now it's passing
- changed team firePressed field to use 255 when pressed to match SWOS value
30.09.2022.
- only got around for a small peek, moved next frame reading to game loop beginning for input to be fresh; team
  fireThisFrame field is desynced -- it updates at two spots, AI routine and team controls update, it will be
  interesting to see which one it is
01.10.2022.
- fixed it in a very round about way, but it was damn last fired flag that wasn't reset on the SWOS++ side, as
  SWOS++ tracks fire before the match and port doesn't; once those were reset (in addition to counters), it all
  clicked; of course, now on to the next challenge
02.10.2022.
- added camera coordinates checking, but had to disable it for now, there's some discrepancy and I need to find out
  why (the camera code was converted to floats, but I forgot how it works :))
- added sprite checks (except pointers), getting desync on onScreen field, that will also require some research
03.10.2022.
- onScreen is not set because drawing has been stubbed out in tests, enabled it and that seems to be fine
- fixed referee and corner flag sprites to be more similar to SWOS ones and pass verification
- now some player coordinates are slightly different, will implement the same algorithm in CalculateDeltaXAndY()
  and try again
04.10.2022.
- prevented stoppageTimer from getting incremented in an interrupt handler, switched to incrementing it every frame
  (like SWOS++ multiplayer)
- replicated variable initialization from SWOS++ multiplayer game, and thoroughly cleaned sprite fields
- implemented "near" comparisons for fixed point/float/ball distance fields, it's starting to look like something
- now getting a discrepancy in frame 133 sprite 14 (team 1 player 11), even a sprite graphics is different, seems
  like their sprite started moving while ours lazy slowpoke only lies down and rests all day long
05.10.2022.
- chased the discrepancy down to the difference in onScreen field, sprite only gets animated if it was drawn, so
  the code diverges there (the check is in SetNextPlayerFrame()); not sure how to handle it: ignore it, or set the
  tester resolution to 320x200, or something else...
06.10.2022.
- came up with a cunning plan, if both sprites are visible, I will just simulate animation update of the SWOS
  sprite until frameSwitchCounter fields match, and then do the comparison of remaining fields; only catch is I
  have to implement proper indices frame table comparison and assignment
07.10.2022.
- [ida2asm] added support for label aliases (was needed to mark animation and frame indices tables start & end)
- implementation of animation and frame indices table verification in progress (turned out not to be quite
  straightforward as it initially seemed, but we're getting there slowly)
08.10.2022.
- [ida2asm] removed class from Offsets enum, since it's really more like an int, and needs to be available for
  calculations
- [ida2asm] fixed invalid variable offsets generated when exported declaration overrides parsed size of a variable
- animation and frame indices table verification implemented, but failing a basic test, after a long investigation
  discovered an unauthorized alignment for one exported table
- [ida2asm] removed 4-byte alignment on large exported structures
- [ida2asm] fixed some text output misalignments in comments
- the error was actually on the SWOS++ side, frame indices table index wasn't calculated properly; fixed and now
  dealing with some precision errors again (most likely), in the player-ball distance field
09.10.2022.
- added test cases for calculateDeltaXAndY(), since it's a prime suspect for the source of discrepancy; fixed it by
  replacing divisions with shifts, seems with divisions compiler does some adjusting for the sign; much better now,
  no more drifting away
- had to scratch simulation update :( since the switch counter only updates in one branch and not the others, the
  fields can still be out of sync, but at least the picture index must be the same... but its wooden stake was the
  problem of player changing animation tables (e.g. running left, then up while being off-screen in DOS); how do we
  know which one to apply? so it got axed
- now getting a mismatch in ball speed, interesting
10.10.2022.
- found that the ball speed is assigned during the pass, figured out that part nicely, learned about CPU botched
  pass chance ;)
- there is a second place where the ball speed is tampered, and that is UpdateBall(); discrepancy happens there,
  traced it to different values of pitchBallSpeedFactor (-3 port, 4 DOS), which is due to not synced game options
  (in this case game length), argh
11.10.2022.
- added game options to the format, now there's a desync in team firing flag, it's not set at SWOS++ side even if
  the input is fire
- creating a way to replay these files in SWOS++ so I can debug the exact frame, still not working properly though
12.10.2022.
- it was a mess with file access, and finally sorted it: buffering of input file interfered with seeking operation,
  these two should really not be mixed so switched to non-buffered file and that's fine now
- still it's desyncing quickly, it looks hilarious though
- fixed invalid sign conversion when reading game settings from header in tests
- argh, SWOS++ is so difficult to debug, why is it desyncing with itself?!
- turned all function static variables to file static in game controls, and reset them before each game to remove
  non-determinism
13.10.2022.
- added gameState and gameStatePl to frame
- added frame reading and verification to SWOS++ in order to be able debug game replays, and to be able to trace
  exact troublesome frames.. however it's still desyncing, sometimes even at the same frame as the port tests,
  maybe something is off with saving/recreating the environment (especially the controls)
- forgot to increment stoppageTimer, that made it go further, but still desyncs
14.10.2022.
- looked a bit more into desync, it happens when a player takes the ball, controlled player field is updated in the
  recording, but when replayed it doesn't happen (pointer remains null)
- started incremented currentTick in tests, was alway 0
- it dawned on me what the problem is while brushing teeth: keyboard control flags which I'm reading at the end of
  the frame are set asynchronously by a keyboard interrupt handler; therefore they might be overwritten by the next
  frame keys... will need to recreate it back from the variables set by Player1StatusProc() -- which are exactly
  what the current frame uses
15.10.2022.
- yup, the best ideas come in bathroom, after that fix and additional variables reset, SWOS++ can successfully
  replay its own replay files, focusing on repairing the port now
- already getting results! fixed mistake in pitch type generating routine, condition to pick seasonal or random
  pitch type was inverted, d-oh! also deleted more SWOS variables
- advanced 2 frames, and now there's a mismatch on passed to player by CPU team: should be 9 but it's 10
16.10.2022.
- this is the first proof of altered game logic: CPU chooses a player to control that is closest to the ball AND
  visible, and since the port screen shows more, it picks a closer, different player than in DOS original...
  nothing really to do here, except executing tests in 320x200 resolution so the logic must match
- now the center-the-ball-camera isn't matching original and logic diverges due to different visible sprites...
17.10.2022.
- changed camera coordinates from floating to fixed point (better for multiplayer)
- reminded myself how SWOS camera works; I seem to have already converted it, and the code seems very solid
  (*shakes hand with self*); then I went and finished camera documentation, which I forgot it even needed finishing
  :) but that's how it is, anything ever unfinished always jumps out of nowhere sooner or later and bites you in
  the ass
- fixed menu background disappearing when asset resolution changes
- fixed invalid minimum height expression when setting window size
- not sure if it was broken, but I changed the code that determines if sprite was drawn in the case the sprite is
  rotated; just did the test before the rotation, much simpler and am pretty sure it's correct now
- getting a mismatch in the camera coordinates even at 320x200 and zoom=1, will need to investigate this
18.10.2022.
- new camera code calculates deltas with more precision, that's why there's a discrepancy, made it less precise for
  the tests
- another discrepancy in onScreen sprite field: seems SWOS clips width at 336 pixels not 320 (VGA width), had to
  make 336 a minimum width in clipping test, ugly but it worked
- forced int-only code for onScreen detection to be exactly aligned with the original game, now halfPlayed field in
  PlayerGame desyncs
19.10.2022.
- halfPlayed investigation led to UpdateTime(), it should be updated from there but it didn't seem to happen, after
  more digging discovered this in SWOS++ pdata.asm:
    PatchByte UpdateTime + 0xfa, 1;54/70
  argh, who knows since when was that sitting there
- fixed the game length problem, it's now really 3 minutes
- game time synced, now triggering some camera x discrepancy again -- the reason is that I've used integers for
  camera movement deltas, but in case the game isn't stopped the ball deltas are used which are full 32-bit fixed
  point variables (so must use FixedPoint here)
- current player sprite is triggering some asserts, but seems it's not implemented as a sprite at all, so will need
  to figure out some better way to test it
20.10.2022.
- removed unused player name display sprite
- implemented proper player name display sprite verification
- oh noes, discrepancy again :) this time in team stats, wrong team got the ball possession bumped, since
  lastTeamPlayed somehow had a wrong value; traced it to inside AI_DecideWhetherToTriggerFire(), it's an error in
  VM, dword access is generated instead of word, as in: cmp word ptr ballSprite.z, <val>
- [ida2asm] fixed setting invalid operand size for instructions that access struct fields, wrongly overriding size
  specifier (byte/word/dword) with field size
- on to frame 4287! camera x coordinate mismatch, seems x velocity is out of sync from previous frame(s), will
  extend data collection with those variables; also had them reset before the game, better safe than sorry; this
  was caused by wrong additional SWOS compatibility code that was supposed to fix what I thought were left-over
  fractions (luckily I was able to remove all that crap)
- in a new recorded game corner flag isn't drawn even though it is in the original; the cause was wrong field used
  for width/height when mimicking SWOS clipping test
- went for 7688 frames! now a discrepancy in animation frame indices table, first time seeing this; port sprite has
  the table set, SWOS++ doesn't
- added /rf option to SWOS++, to replay the file fast, without waiting on retrace
21.10.2022.
- frame indices table problem was on SWOS++ side, needed to set highest bit for header-related tables, and I used
  AND instead of OR... sheesh...
- after the fix it still wasn't working, but found the root cause of the problem on port side: tables inside frame
  tables were declared as words and picked up automatic 2-byte alignment, 1 inserted byte of alignment ruined
  entire frame tables area; their alignment had to be turned off (hope it won't trigger unaligned access)
22.10.2022.
- [ida2asm] removed extraneous space after type name for exported variables with alignment specifier
- [ida2asm] fixed offset generation when real variable after alias variables has an alignment
- [ida2asm] fixed invalid data bytes generated when exported variable is declared as a struct type over an ordinary
  variable in assembly source
- added static assert for animation and frame tables, so that's immediately detected if they are not contiguous
- [ida2asm] fixed alignment directive not working on exported structs
- all this fixed table comparisons and we're off to frame 9511 where camera y velocity has diverged
23.10.2022.
- the reason for camera divergence was that the camera direction field was declared as word, and then read into int
  variable; so -1 became 65535 and wrongly passed < 0 test; converted it to int16_t and it's good, now reaching
  frame 9609
- re-enabled verification of sprite picture frame fields, already fixed small discrepancy in corner flag sprite
- player number sprite visibility mismatch, investigation reveals wrong width for sprite 1198 (player number 11)
- current replay desyncs in SWOS++ when CPU is about to take penalty (direction = -1 (saved) = 4 (in game)); funny
  thing happened during the game, it wouldn't take it for a while, I was changing formations and suddenly camera
  went to the center without penalty taking place (or at least I didn't see it)
- ahh, desync in frame 9609 is due to modified player exit coordinates to look better when unzoomed, completely
  forgot about this :) swoosh to frame 18470, camera x disparity
24.10.2022.
- camera is different because g_inSubstitutesMenu is true in port and false in SWOS++; created a short replay with
  lots of bench fiddling, but even SWOS++ desyncs on it, so have to resolve this first and make sure it's not an
  error on the recording side
- solved it, Player1StatusProc() was called from bench code (why really? this code is so junky); similar to
  previous desync, keyboard handler is async, and the keyboard input flags changed between two readings (got no
  input on first read -> that went into teams, then had down key on second read, and that was saved in the file, so
  when playing back the program expects teams to correspond to input down key and they don't); there are few more
  places that call the routine, so patched it up so it only does its work once per frame
- fixed desync where port calls the bench while SWOS++ doesn't (lowered number of taps needed, this was possibly
  intentional, but reverting it for now)
- fixed potential source of indeterminism in bench controls (reset pick bench team counter)
25.10.2022.
- fixed tap timeout counter being reset slightly prematurely when invoking the bench
- fixed camera x mismatch at frame 1920 due to new camera implementation being more precise
- mismatch at frame 2694, invalid sprite direction: turned out that x coordinate constant of a player that's coming
  to the game from the bench was wrong
- didn't get far, 2706, seems like a mistake in substitute player routine
26.10.2022.
- the bug in substitute player routine was that ApplyTactics() were called without setting A4 to TeamGame pointer,
  it was randomly set to some location in the team, causing overwrite of speed skill 0 with 2 for the player that
  was coming in to play
- getting to frame 23773! desync is because camera is out of leaving subs menu mode 1 frame too early; slightly
  invalid logic fixed
- did a small refactoring of bench and camera code, removed some unnecessary stuff
- frame 25615 now, seems GameOver is calling Flip and saves a superfluous frame to the file, but even with deleting
  this frame the next one still desyncs
27.10.2020.
- fixed ball set to invalid x coordinate when game ends
- ball is fine but now the desync is on camera y coordinate -- because SWOS only sets whole part and not the
  fraction
- that was the last issue, and finally, one whole match passes! :)
- however, 2nd one triggers on referee ;) but it's just a silly difference, SWOS has a referee-specific update
  animation routine (for no reason, really), and it doesn't update fullDirection field while the generic one (we
  use) does + mismatch due to more precision using rounded coordinates (really need to switch CalculateDeltaXAndY()
  to fixed points sometime)
- there was also referee coordinates desync at 7159, I missed some weird code that turned out to be necessary for
  detecting if the destination was reached
- frame 11934: direct assignment to x/y referee coordinates when sending it off-screen, clears fraction
- frame 23494: forgot to update SWOS extraTimeState and penaltyState variables with values from replay file
- frame 31149: mismatch in stats; caused again by more precise coordinate comparison, this time in the code that
  prolongs the last minute of the game; spent a while looking at this code and trying unsuccessfully to find a
  mistake, couldn't believe I've nailed it... which is a good thing cause I can barely understand it now lol
- and that was the last assert, the complicated match with extra time and penalties, yellow cards, own goals and
  what not has passed
- marked player in play match menu desyncs SWOS++ itself, gotta fix that, and also record one where marked player
  gets substituted
28.10.2022.
- added marked player fields to the rgd header, now player marking works properly
- testing another match, breaks at frame 6076; it was just a subtly different logic when decrementing bench delay
  timer
- 12474: fire time in subs has to have exact value of tick to substitute, must be a != and not < comparison
- 21415: pretty much the same thing, in a different spot (had to reset bench timers at an exact tick, not with >=),
  but also resetting the variable that blocks further bench input when it shouldn't be reset (shouldn't be reset
  together with everything else in reset() method)
- 22171: when leaving bench, player needs to press *only* left or right, without up/down (which was the logic up
  until now)
29.10.2022.
- 22402: similar to above, when moving up/down to select a player to go in, only up/down counts (no left/right)
- 25490: original game resets game ticks when fading in in the main loop, really an unimportant implementation
  detail, but it was very easy to add
- 2nd, very complex match passes!
- cleaned up .gitignore a bit and added sprites to the repo that somehow ended up not there
- getting desyncs when running 2nd game, found that frameIndicesTable and pictureIndex must be reset between the
  games (in case of ball sprite, but will do it for everyone), tacklingTimer also
- a desync in team at frame 640, static variable AI_turnDirection used in AI state machine must be restored to 1
  between the games
- new desync at 796, TeamGame
- found that m_endGameCounter wasn't reset between the games
- yikes, found a nasty bug in verifyTeamGame, memcmp was comparing size of m_frame.top/bottomTeam, but it should
  have compared m_frame.top/bottomTeamGame bytes (shortened the comparison and let one other bug slip unnoticed)
- fixed halfPlayed being set for all 16 players in team (should be only 11 that are playing)
- and with that both matches pass!!!
30.10.2022.
- disabled game keys (replay, save replay, pause etc.) in SWOS++ since they mess up the replays
- disabled replay coordinates saving while replaying in tests, should be a bit faster
- reset player mark sprite between games, included onScreen field too
- added a third match, got a desync at frame 4825, only when ran after another game
- made replay tests verify first file again after the last one, to check the first file too for some between-match
  state corruptions
- fixed forgotten m_lastGameTick initialization between matches, everything passes now
- added another match where I'm coaching only, and it desynced; there was a bug with reading bench controls, player
  coach combination wasn't considered
- yikes, same bug with reordering players as with substitutes: ApplyTactics() called without setting A4
- 3765: when swapping players in subs menu only pointers were swapped instead of actual sprite memory (couple of *
  did the trick ;))
- 21927: this discrepancy made me discover an interesting bug: when booking a player, there are three tables that
  control the behavior of player number (which is blinking); all three tables seem identical, but in case of double
  yellow card the table is missing last three bytes (only 27 bytes long instead of 30); so it reaches into some
  stuff that just happens to be after it in memory, and that follow-up table was removed in port with something
  that has initial 3 zeros, which triggers a different behaviour... there also seems to be code that never gets
  executed (expected values in the table seems to be <0,0,1,2,3 and it only contains -1,0,9)
- refactored a bit, separated sprites to its own header and added a few convenience methods
- fixed Menu struct not being under #pragma pack(push, 1)
31.10.2022.
- switched to VS2022, latest toolset and 64-bit build for tests
- fixed 32-bit libjpeg-9.dll and libpng16-16.dll being in 64-bit DLL directory
- wrote win32 resource loader for custom files, but had to scrape it since LockResource() consistently returns
  a pointer to wrong data; switched to ordinary files with data location embedded via a predefined preprocessor
  define
- fixed a texture loading bug which happens when a team's bench texture is already present in the cache and doesn't
  need to be recreated
- haven't been reseting m_frameNo to 0 before the match in SWOS++ (never really recorded two in a row)
- fixed iterating directories in virtual file system for tests
- fixed invalid sprite width in several characters (especially in big font)
- optimized recorded replay tests, they finish a bit faster now
01.11.2022.
/
02.11.2022.
/
03.11.2022.
/
04.11.2022.
/
05.11.2022.
/
06.11.2022.
- found a mistake in SWOS++ replays (by extension port's too): haven't set g_numSelectedTeams to 2, and then I
  guess team loading routine went to reload them from the disk instead of using my planted ones from the header
- replaying Playa's games, desync at 11630
07.11.2022.
- the desync happens when he changes formation to custom tactics, I haven't copied them to proper place after the
  replay header was loaded in port tests...
- got some problems when I declared USER_A as TeamTactics, generated data for it is too wrong, too short, and on
  top of that there's an assert triggering in ida2asm (something about instruction tokens)
08.11.2022.
- [ida2asm] fixed accessing invalid replacement tokens, deallocated on stack (made them static)
- the previous fix solved both the assert and USER_A getting very short length instead of 370 bytes in memory array
- the first game now passes verification but the second one triggers an assert with quick fire being active
  locally, and that's because fire counters weren't initialized between matches
- getting an assert, relatively recently added, at the long 120 min game at the end: game ends with plenty of
  frames left in the file (~3mb); the problem was that when currentGameTick was reset after fade-in at the end of
  the game, lastGameTick had to be reset as well; with this change all tests pass! :)
- applied SWOS variable initialization learned while fixing tests to the game itself
09.11.2022.
- checked update bench code and in two places fixed return to game action to react only when clear left/right was
  pressed, without up/down
- added support for ending games with escape to SWOS++ recorder and port, and recorded one aborted game (with lots
  of bench menu twiddling)
- fixed the code to prevent keyboard shortcuts doing what they normally do if they're selected as any player key
- desync in latest game on marked player in frame 1815; bench stuff, surprisingly more of the similar movement
  control issues (only move on up/down without left/right), however THIS time I fixed it all!
- fixed wrong control variable assignment in SWOS++, patched Player1StatusProc() and Player1StatusProc()
- [ida2asm] made registerPointer() return -1 if the point pool is filled
10.11.2022.
- added support for aborting recording games
- added support for recording training games (no support for changing starting lineup before the match though),
  supported by recorded game data file v1.2
- whoops, USER_A getting very short length problem wasn't really fixed, it was coming back if I set its type to
  TeamTactics (size to 370 in @type-size), opposed to declaring it as an ordinary array
- [ida2asm] fixed exporting char arrays as structures getting their size clamped to 4 bytes
- recorded a training game, successfully checked it on SWOS++, but getting a desync in port at frame 4070
- fixed not properly setting training top team flag when going to bench after substitute
- getting wrong coach/substituted player at frame 3803
11.11.2022.
- fixed the last issue, the code in question looks very fishy, I think it's a bug that just somehow works because
  the condition has superfluous parts: in IsThisPlayerOkToSelect() D0 is returned as a result, but in case
  substituted field is false and player's position is -1 (meaning he was substituted) D0 isn't initialized properly
  (holds positive value from previous calculation as a player offset) and makes the function return true; emulated
  this behavior in port for now, but it's possible that the whole condition would be rewritten in the future
- finally all tests passing again!
- converted MovePlayers() and MovePlayer(), game tests are already showing value
12.11.2022.
- did a little play through, and found bench doesn't work correctly anymore; after substitute it goes to wrong
  bench + it shows menu while going to bench, and responds to commands -- this actually happens in SWOS too, which
  I think is a bug, just doesn't draw it until the camera is there; fixed it, it was a consequence of changing was
  player substituted routine to be inline with original buggy behavior, it was called in several other places which
  assume it works correctly
- extended gathered data with pretty much complete set of bench variables, recorded game data file is now v1.3
- added SWOS++ and SWPE to the repository
- fixed selected player menu index not getting reset in bench between matches, and a few more variables
- ran static analysis but didn't find anything significant
- changing resolution during the game (e.g. maximizing the window) crashes the game, there's a possible memory
  overwrite, postponing the release
13.11.2022.
- fixed resolution change during the game crash, it was caused by additional sprite reset before the match, it was
  called on resolution change when it really shouldn't (it's a strictly pre-match operation)
- fixed invalid assertion when menu background is reloaded, it required that the background was empty while the
  match was running, but we also have replay/exit menu after the match where isMatchRunning() still returns true;
  in the end I ditched menu background unloading during the game because if there's enough GPU RAM it only slows
  things down, moved the unload to when we fail to create GPU textures -- there the game unloads menu background
  and any unnecessary cached textures and tries again
- fixed replays that got broken on float -> FixedPoint coordinates conversion
- fixed FPS going wild occasionally after alt-tab
- tried adding a bit more precision to the FPS calculation, but blew it completely; at least made the code nicer
  and menu FPS calculations more precise (without incurring anymore CPU)
- investigated a little why was crash reporter reporting an error at initialization (couldn't find language file),
  seems it was looking for ini at the path where it was finding its 64-bit DLL, in swos-port\dll... placed ini file
  there and it seems to be happy now
- fixed colored frame showing up on columns 2 & 3 of select files menu tests (g_allowShorterMenuItemsWithFrames
  wasn't reset back to 0 by recorded games tester)
- pushed to Github
14.11.2022.
- whoops, seems I broke my Github account data limit, will need to compress *.rgd files and add decompression
  functionality to the tests; will probably link dynamically to zlib1.dll (already used by some of the project
  libraries), and provide a local directory pointed to by an environment variable where the uncompressed files
  could reside and override the compressed equivalents when looked up; will need some of the functionality to go
  in the game as the sound files will be loaded from an archive
15.11.2022.
- I was interested why the executable takes up 3.3mb, was expecting some big junk taking up a lot of space, but
  it's actually pretty lean, saw some interesting stuff in there; seems that VM fixing of unaligned memory access
  has been bloating code a bit, will take care of that in the future; also would be great if flags could be more
  aggressively optimized; changed kSentinel to macro, it was getting instantiated as a variable for pretty much
  every cpp file; kRandomTable wasn't const, whoops!
- refactored directory file search routine, much shorter and simpler now
- added support for test resource files as compressed *.gz files, they are transparently decompressed as if they
  are ordinary files (via SDL SDLRwops mechanism); this even made tests faster by 5 seconds!! the only slightly
  annoying thing is I've added another dll to the deployment, zlib-ng along with ordinary zlib (opted for ng since
  it's faster -- optimized for modern machines and easier to build); also went with dll over static lib to avoid
  CRT linking conundrum; the way I added zlib-ng will be applied as a model for the rest of external libraries
16.11.2022.
- was trying to create an image of IDA graph; found a Python script, and it even worked, but not on
  UpdatePlayersAndBall() :( it works by setting graph widget size, making it gradually bigger, screen-shotting,
  and trying to trim the image (if it can trim it, the job's done, if not keep resizing); the problem is when
  widget reaches sizes close to 32k the grabbing function fails (possibly a limitation of QPixmap); some other way
  will have to be found, like writing a parser for that weird IDA-specific graph format
17.11.2022.
- created initial version of the graph image: wrote a parser that converts IDA gdl graph to dot format, and with
  that generating various output formats with graphviz; still needs some tweaking, but not too bad :)
- found some way to get decent looking images, converted graph to SVG then unzoomed and did screen capture with a
  plugin in Chrome (PDF format, and it automatically splits it in pages)
- looked how the gdl file is generated, I might just generate dot directly from the code
18.11.2022.
- wrote IDA assembly to dot converter, it was harder than expected, but a rough version is up, still needs to be
  debugged
19.11.2022.
- finally, the script is working great, and the output is looking good!
20.11.2022.
- managed to create code coverage report on tests, results are pretty intriguing, I was looking at
  UpdatePlayersAndBall() and unfortunately there are some missed spots (e.g. a player that's about to take
  throw-in gets substituted), although it's mostly covered; it'll be interesting moving forward
21.11.2022.
- went to printer's to try printing the UpdatePlayersAndBall() graph, but all shrunken versions failed :/ text is
  unreadable, and the full version is too big to be useful... left them a phone number in case they figure
  something out while I tried with the other printer, these guys are printing big posters, dude over there printed
  small short test sheet in full width; it was really close, only the text was a bit too small :/ created few
  other versions with increased font and somewhat compressed graph, and printed the one with 26pt size, it's almost
  1x3 meters, the text is barely readable (need a magnifying glass), but it's here :)
22.11.2022.
/
23.11.2022.
- the plan is to raise coverage of UpdatePlayers() to 100% (bar those unreachable places), and then begin with the
  conversion; for that it will be good to understand the code better, and one pass over the function should help
- been deciphering the code, went through tackling and tackled/injured branches
24.11.2022.
- went through heading (all three types), started with throw-ins, peeling it slowly like an onion ;)
25.11.2022.
- went through throw-ins
- clarified confusion about header type animation tables: there are 4 tables, 2 per header type (flying/lob &
  static) and 2 for attempt and hit -- player has to jump first, and then just maybe hits the ball, in which case a
  different animation table start rolling
26.11.2022.
- went through goalkeepers diving and a code for players in normal state, it's a bit complicated, didn't catch
  everything
- put breakpoints on uncovered code and managed to trigger plenty of them, will be making another game recording
  to cover as much of those as possible, but it will require RGD format upgrade (it will need to be able to handle
  'S' key during the game)
27.11.2022.
- during implementation of 'S' key in SWOS++ discovered that Watcom library functions were set up with wrong
  registers (firstly memset() which started crashing the program after GCC update); fixed it, but no idea how it
  worked in the first place
- unfortunately, couldn't finish, since I get desync at benchPickTeamTimer in SWOS++
28.11.2022.
/
29.11.2022.
/
30.11.2022.
- fixed desync in SWOS++, format is v1.4 now, and recorded a game with:
    - substitution of player that's taking throw-in
    - double digit score on each team
    - scoring own goals
    - weak tackle
    - stats aborted with fire during throw-in
    - use invalid turn directions on throw-in and penalty
    - tackling out of pitch
    - passing to player that's out of pitch
    - heading out of pitch/inside goal
    - goalkeeper playing as normal player
    - end a game in a draw
    - end a game with ball in motion
01.12.2022.
- implemented RGD v1.4 in tester, immediately found a bug: kResultAtGameBreakLength was initialized with a wrong
  value, 256 instead of 165
- now triggering another assertion at frame 3039: mismatch in team allowed directions, the new file is already
  turning out to be a success
02.12.2022.
- it was just that the player 2 was using 'S' for down, so he got issued down command instead of opening the
  stats, changed it to 'X'; also fixed comparison of statsTimer, since SWOS uses 32'000 as a true value
- now desync happens at the next frame in team player update index, turns out the logic wasn't correct,
  UpdatePlayers() was called when it shouldn't be (when fireBlocked is true)
- desync at 13858 but it turned out to be just inconsistent comparison of statsTimer (just had to compare them as
  bools)
- something related to bench previous direction at 16153
03.12.2022.
- accidentally found tab infected file, wrote a script to detect it, removed it and now we're clean
- argh, somehow I missed to include tapTimeoutCounter (or wrongly deemed it unnecessary) in v1.3 format, and it
  has come back to bite me: the last desync was caused by wrong tapTimeoutCounter value, which was caused by a
  small error in logic (I wasn't immediately clearing it when a new direction press was detected)
- desync at 17592: there was an error in calculating which team scored (in goalScored()) but it's fixed easily; no
  more asserts! this file proved to be a gold mine for bug catching and extending coverage
- noticed line when penalty is scored isn't covered, recorded quick penalty goal with stats (removed with fire),
  but it seems a queued 'S' key somehow gets lost
04.12.2022.
- it wasn't a case of lost 'S', it was a small logic discrepancy: if fireBlocked is true the controls team isn't
  chosen, and pick team counter isn't incremented (a small thing, but let's be consistent); and with this, the
  penalty goal is covered
- fixed invalid player name top-left when the player got substituted (it was much simpler than I thought, the
  index is just an ordinal in the team, no need to track anything when substituted)
05.12.2022.
- [ida2asm] implemented a switch to disable alignment checks; results are pretty nice, exe went down in size by
  700-800kb, x64: ~3.3mb -> ~2.6mb, x86: ~3.3mb -> ~2.5mb, and even the speed improved, tests are down from ~29 to
  ~22sec (x86) and from ~24 to ~20sec (x64)
06.12.2022.
- started with 3rd party libraries reorganization, created separate 3rd-party directory with separate directory
  per library, I think the layout is better now and more standardized; also made C++ additional include
  directories more consistent by moving everything to VC++ directories tab (vs C++/General tab), now it's possible
  to override if need be; super-boring job...
07.12.2022.
- finished with libraries reorganization... ewww
- noticed I wrongfully removed external pointer access when I implemented alignment checks off option...
  readMemory/writeMemory will have to go back in, a painful code deletion ensues... phew, it seems to not have
  added much to the exe, but it's a very rarely used feature, I wonder if there's some better (more efficient) way
  to implement it...
- something is messed up in 64-bit version, ZeroOutStars() zeros out too much
08.12.2022.
- just a silly mistake, writeMemory() was missing breaks in switch
- returned code for constant memory access with disabled alignment checks (only dynamic access had to go)
- introduced DISABLE_ALIGNMENT_CHECKS symbol for platforms that support unaligned access and modified fetch/store
  routines to do trivial data access if it's defined
09.12.2022.
/
10.12.2022.
- picked and compiled zip access library, minizip; replaced zlib dlls with zlib-ng in compatible mode, let's see
  if it works well and performs better
11.12.2022.
- recompiled minizip and removed some unnecessary stuff (mostly compression ability)
- added commentary loading from zip file, but haven't debugged it
12.12.2022.
- debugged comments zip loading and added tests (even Chinese characters in filename); actually works quite well,
  I've switched to using them, it's much cleaner now ;) could use some more testing in the wild, but so far
  looking good
13.12.2022.
- finished SWPE manual
- recorded raw videos for SWPE demo (and crashed during the take lol)
14.12.2022.
- SWPE demo video is edited and published on YouTube! And the program itself published on Discord
15.12.2022.
- compiled zlib-ng and minizip for Android, seems it wasn't all that complicated, just needed to set path to
  toolchain bin dir, and a few cmake toolchain-related variables and it went smooth; now, no idea if it will all
  work at runtime :) that will have to wait; also, it's questionable if these libs are at all required on Android,
  since are currently only used for zipped comments, which might be unnecessary for Android, as the files are
  packed into bundles anyway, but that might require a bit of research and Android build is so far ahead that
  things might change again until then
16.12.2022.
- pushed changes to Github
17.12.2022.
- started converting UpdatePlayers(), pasted generated code and just compiling it
18.12.2022.
/
19.12.2022.
/
20.12.2022.
/
21.12.2022.
/
22.12.2022.
/

----

30.10.2023.
- been messing with the source past few days, fixed the build on latest VS2022, and been trying to pass the tests
  (unsuccessfully)

----

08.11.2024.
- going for UpdatePlayers() conversion :) 1st task is making it compile, and that requires copying generated
  C++ code for entire call tree (some 50-ish functions); it's kind of like opening Pandora's box
09.11.2024.
- transfered some more C++ generated functions to source but it's pretty tough
10.11.2024.
/
11.11.2024.
/
12.11.2024.
/
13.11.2024.
/
14.11.2024.
- did some more transferring
15.11.2024.
- finally transfered all the connected functions to C++ files, now to fix cross-references
16.11.2024.
- only undefined references from UpdatePlayers() left!
17.11.2024.
- finally it compiles! tests fail though... it seems sprites pointer table inside a team contains bogus
  values; trying to think what could've caused it.. there are 3 functions from which I took off save-regs
  attribute, but they are only called at extra time, and this happens when the first game starts, so it
  can't be it (but it's good to keep it in mind for later); initTeamsData() initializes those fields, but
  it's a pretty old function, no way the problem is there; but what could it be? maybe a few functions that
  I've copied from old generated files?
- arggh!! found out the reason after a bit of debugging, seems I removed a couple of variables, but that
  caused offsets to change and invalidate all the procs pasted before that (+ a couple I carelessly copied
  from old files) cause they use raw numeric offsets... this will be a major PITA...
18.11.2024.
- since it was a huge job to do manually I went and wrote the script for it... except the script itself
  turned out to be arduous task as well.. but got it mostly working, except for dot variables where struct
  members are accessed directly from data segment variables; will need to figure something to patch those up
19.11.2024.
- phew, finally finished the damn thing; saving it under tools, so the rest of my hair doesn't turn white
  if I have to write something like this again
- it's finally compiling, but failing tests
20.11.2024.
- desync is in a sprite coordinate that wasn't getting fractional part trimmed
21.11.2024.
- chased down the desync to invalid top/bottomTeamData variable offsets, there was an error in script, it
  would miss blocks that don't have g_memByte reference (e.g. mov D1, offset topTeamData); fixed that +
  another error where 2nd variable reference would get skipped (an offset), but it's still desyncing, even
  at the same sprite again
22.11.2024.
- guess I was that desperate, enough to bring old SWOS++ DOSBox debugging machinery out of mothballs; not
  only was it blast from the past, it was quite efficient, solved the desync; somehow two old offsets got
  forgotten in game.cpp, changed those but now it's desyncing again, at frame 66
23.11.2024.
- checking side by side with SWOS++ works nicely, desync was caused because the script didn't properly
  handle expressions like: mov ax, lastPlayerTurnFlags+1, as well as `.' struct member addressing
- new desync at frame 113; because I missed to process a whole file, ball.cpp, whoops
- now a crash at frame 117; missed entering some struct fields into mapping, so they weren't recognized and
  replaced, added a warning for that
- desync at 621; after tracing UpdatePlayers(), ran into yet another unrecognized expression type:
  // mov A1, (offset ballYQuadrantLimits+2)
  inside UpdateBall()
- and with this one it finally passes!! :) "only" needed to copy functions and run tests, famous last
  words.. hehehe... now "only" to convert the functions
24.11.2024.
- been working on updatePlayerSpeed(), didn't manage to finish though
25.11.2024.
- finished the proc, but it's failing tests
26.11.2024.
- passed! these tests are gold :) now just need to catch some time and slowly convert everything around
  updatePlayers()
27.11.2024.
/
28.11.2024.
/
28.11.2024.
/
29.11.2024.
/
30.11.2024.
/
01.12.2024.
/
02.12.2024.
/
03.12.2024.
/
04.12.2024.
/
05.12.2024.
/
06.12.2024.
/
07.12.2024.
- been thinking some, maybe I could do the new sprites myself, backed by some AI image generation ;)
08.12.2024.
/

...

28.12.2025.
- took this out of mothballs ;) got some weird errors, updated IDE and compiler, and it seems to be working
but some new errors appear
29.12.2025.
- "fixed" pointer verification verifyShotChanceTable(), no idea how that worked before (probably didn't?);
but now the whole thing crashes :D
- some weirdness happening inside updatePlayerShotChanceTable(), team pointer seems corrupted, will
investigate later
30.12.2025.
- seems some templates somehow generated wrong code with a new compiler... now there's no crash but a
desync happens at frame 771, and of the worst kind: player pointers (controlledPlayer, passToPlayerPtr,
lastHeadingPlayer, passingKickingPlayer) aren't being cleared when they're supposed to; this will probably
require SWOS++ to resolve
31.12.2025.
- finally learned how to disable damned spell checker plugin for individual files
- the problem from yesterday was that I removed some data lines with symbols.txt, but haven't recalculated
hard-coded VM offsets in code copied over for conversion... luckily there was already a script to do that
(thank you past me); of course, only remembered about that after setting up DOSBox debugger, and debugging
it for a while; well, at least I managed to remember how to do it :P
- template error returned, since I wrote them in auto-generated files that got overwritten (d-oh);
pinpointed it to reference casting
- now a new desync occurs, some kind of sprite speed error (it's set to 0xdddd)
01.01.2026.
- huh, trying this game in SWOS++ and it desyncs there too?? the difference in frames is that actual frame
has controls set to 0x80 (escape pressed), and it's the last frame of a game that was aborted; let's just
ignore it since it's the last frame (+ old v1.1 file) and hope for the best :|
- argh, bit of a mess here but solved it; due to VM interactions (VM needs a pointer to shot chance table),
the tables must be allocated in VM memory space, but they were static and got destroyed between the
games... however, with fixing this all tests pass!!
- but only in debug... something nasty is going on in release, maybe even a memory overwrite... give me a
break
02.01.2026.
- seems like overflow flag calculation in static emulator had a subtle potential edge case bug that got
exposed on a different compiler with optimizations on... fixed it in the ida2asm generator
03.01.2026.
- had to fix already copied VM C++ code separately using the Python script, but finally the tests pass both
debug and release!
- converted a few short functions
04.01.2026.
- converted updateControlledPlayerNumbers(), now there's no generated code in game sprites anymore
05.01.2026.
- converted initTeamsData()
06.01.2026.
- uploaded changes to PyTexturePacker to GitHub and made a PR
- moved shot chance table into one memory block
07.01.2026.
- was converting some referee function, which led me to messing with the animation tables, realized they're
in a contiguous memory block, so maybe they can be referenced with an offset, and completely moved to new
executable
08.01.2026.
- marked all the animation tables and frames in IDA, seems there's some unused stuff there; started working
on a small script to generate animation tables from input description
...
16.01.2026.
- split the tables into structures referencing arrays, refined format a bit
17.01.2026.
- finalized the tables input file format
...
02.04.2026.
- noticed some animation tables are "short", and overlap with the next one (e.g. player tackled animation
table); this doesn't look safe, I think it could lead to crashes (since there's a "5" in next animation
table, if there wasn't the array of null pointers would keep things fine); could this be some failed attempt
to save space? but there are also some unused tables as well
...
31.07.2026.
- bought Codex subscription yesterday, and it immediately paid itself: fixed my TA Demo persistent crash in
<10 mins; I did prepare everything, but it was still pretty amazing; now applying it to some of the most
boring SWOS stuff I've been delaying since forever: first task done was to fully translate all the
documentation to English, and it did a good job there; had to fix some obsolete variables names and values
but it's quite presentable now
- expanded sprites C++ enum in preparation for animation table compiler; it might need some further
  expansion later, these boring jobs are perfect for AI ;)
01.08.2026.
- updated C++ style guide and added .clang-format file
- Codex generated a first version of animation table parser, and it already caught a bunch of errors in
  hand written files, what a conservation of mental energy ;) it discovered a range of frame tables (for
  headers) that are not in the common table memory range, added those to the input file now as well
- discovered an infinite loop possibility -- -100 value in frame table throws update routine into infinite
  loop, both original ASM and converted C++ (too faithful huh)
- tweaked syntax a bit
02.08.2026.
- put all frame table elements into a single big array, implemented removing duplicate frame tables and
  folding those that are suffixes of previous ones
- implemented initial version of new packed animation table structures
- allowed optional comma after frame delay in animation table
- introduces inline frame tables in animation tables inside [ .. ] braces
- table parser discovered some superfluous frames (situated after end animation marker), mostly in tackled
  frame tables, so I removed them, they really make no sense -- what this some testing left-over?
- while trying to sort out original SWOS frame/animation table mapping to new ones to keep the tests
  running hit an ida2asm bug: same function ended up in two cpp files, the boundary landed in unnamed data
  items before the function, and the previous chunk incorrectly picked up the function -- Codex fixed it
  rather quickly, it can handle complex bugs too o_o
03.08.2026.
- extracted all original frame and animation table values from swos.asm, in preparation for introducing
  SWOS_TEST code path
- added --no-frame-table-folding option to generateAnimationTables.py
- codex agrees that playerTackledAnimTable is too short ;) but only players are accessed (goalkeepers can't
  be tackled) so the game survives
...
07.08.2026.
- folded animations as well to big joint table together with frames
- implemented original SWOS frame/animation tables, to be used for tests
- added few more methods for external use
- bunch of small syntax and other fixes
- I think the animation table generation script might be perfect now ;)
- integrated table generation into the build
- started changing the code to only use animation and frame tables offset, but it will take some time
08.08.2026.
- unleashed Codex on that ida2asm bug where parsing error lines were reported incorrectly; it fixed it
almost immediately :P seems chunk limit adjustment caused the drift; Codex solution introduced linear
scanning of the input file until each chunk boundary start, but it seems to have not caused performance
issues at all, so I left it at that
- it just updated and expanded ida2asm documentation within minutes... stuff I couldn't bring myself to do
for years... I'm shedding tears...
- inventing some fun tasks for Codex, I've sent it to create an "ANIMATION MODE" for SWPE, let's have fun
with that, and later I will instruct it to add edit functionality, so we could experiment with changing
animation tables in the game
- there's now a nice little animation mode there, and it even fixed some crashes in pitch mode (haven't
tried since I don't use it much anymore but I'll take its word for it :P)
- removed old obsolete Windows 9x code path, as well as DirectX (it was failing on modern machines anyway);
full-screen mode gone too (has been broken in ages)
- updated documentation
- fixed that nasty build problem, of debug swos-port depending on release ida2asm but not building it
- got it to compile with new animation table system, but it's still long way to go
- expanded tests documentation
- fixed a bug in tests where a test timeout value parameter was actually used as a wake-up interval
09.08.2026.
- small fixes to test documentation
- bug fixed in animation table generator, it wasn't outputting correct offsets for SWOS_TEST branch
- fixed invalid order of groups (team 1/2 players, goalkeeper 1/2) in generated animation tables
- added ball animation to SWPE
- finally figured out that the speed is in 9.7 fixed point format, not 8.8, added proper values as comments
in many speed constants in the assembly
- stuck at converting UpdateBall() since it's messing with the ball sprite frame table in a custom way, but
it's sloooow
...
14.08.2026.
- added FixedPoint user-defined literals, so the syntax is much nicer and we can now write auto half =
  0.5_fp; auto two = 2.0_fp; etc.
- been working a bit on UpdateBall() previous days, only got past the half
...
17.08.2026.
- moving slowly with UpdateBall(), at least the high level structure is there; I'm gonna see if the
situation is well off enough for AI to take over, and see if it does a good enough job so I can just correct
the final output
- [ida2asm] improved error reporting: now it's reported which range was it that removed a symbol known to
be present in the input file (not a generic unknown symbols error anymore)
- [ida2asm] extended @insert-hook to be able to use local labels in addition to line numbers, since they're
  too fragile (they can even change if IDA randomly includes/does not include some comments)
- offset fixer for temporary automatically converted C++ code improved, it will now report an error if it
can't map a symbol to VM offset (which most likely means there were renames in swos.asm)
- Codex was nice and fixed the entire failing build and some of the test failures, I'll check changes
tomorrow and continue with fixing
18.08.2026.
- [ida2asm] added reporting of unreferenced items from swos.asm (always wanted to do this!); removed TONS
of stuff ;)
- added string pool checks as a test case in tests project
19.08.2026.
- [ida2asm] added a warning if two remove regions (or region + single symbol) could be folded, and
immediately folded 8 regions
- [ida2asm] fixed remove region @end syntax
- woah, all tests are passing o_O
- marked all of temporary generated C++ procedures and explained that they're only temporary and will be
removed, because people are stupid
- added a CPU vs CPU test game, passed immediately
- set up code coverage, will try to raise a it a little bit
- squeezed weekly token limit down all the way to 0% =P
20.08.2026.
- integrated assets compilation script into the build
- converted: initPlayersBeforeEnteringPitch, playersLeavingPitch, startPenalties, nextPenalty,
startFirstExtraTime, endFirstExtraTime and now game.cpp is fully cleansed from the filth!!
- recorded another game with 30+ shots at goal by Codex advice and managed to increase coverage a little bit
- converted getBallDestCoordinatesTable
- meson build updated
- proper project readme created
- applyBallAfterTouch() converted, only checkIfBallOutOfPlay() left in ball.cpp
21.08.2026.
- converted checkIfBallOutOfPlay(), ball.cpp is free!
22.08.2026.
- fixed memory corruption of shot chance tables (unfortunately they were allocated right before the match
  inside show stadium menu and tests skip this menu)
- researched image generation a bit; unfortunately most of it will have to be done manually, still thinking
  of the best approach; as for the game font, it might be best to find a similar looking existing TTF and
  render glyphs into given rectangles
- argh, tried pitches but AI keeps ruining the stitches, it's not usable
23.08.2026.
- found a nice game font and applied it to menus
- moved big sprite 225 from image to procedural drawing, added drawing of 226 too (this one was removed
  long ago for killing packed sprite atlas space)
- some more font fixes
- started menu walker tester, still a long way from what it should be
24.08.2026.
- got some decent menu/game overlay sprites out of ChatGPT, but it put some black area around them that I
  need to cut, it's not looking so good after the intervention; maybe I should add some alpha?
- Gemini is producing decent looking player sprites (style-wise), except it's a slop, with half the
  positions wrong, extra legs, hands... maybe I can use it as an input to some other AI to get proper poses?
25.08.2026.
- made a SWOS++ fix for joypads locking up on real hardware
...
28.08.2026.
- committed my old DOSBox debugger changes to a currently developing DOSBox-X project (seems they
  implemented almost everything so it boiled down to showing symbolic constants in debugger and allowing
  their use in expressions)
...
04.09.2026.
- was chopping the sprites today, did stars, false sign, red menu arrows up/down, and small soccer ball
05.09.2026.
- fixed bunch of digit sprites + a few more, mostly with AI
- fixed an overflow read in replays
