{"id":320246,"date":"2021-03-25T15:01:15","date_gmt":"2021-03-25T15:01:15","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320246"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320246","title":{"rendered":"\u0420\u0435\u0432\u0435\u0440\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433 \u0442\u0435\u0442\u0440\u0438\u0441\u0430 \u043d\u0430 Nintendo \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f Hard Drop"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e8c\/089\/582\/e8c089582c8e19e78778645cf93612be.jpg\" width=\"980\" height=\"500\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Tetris_(NES_video_game)\">\u0422\u0435\u0442\u0440\u0438\u0441 \u043d\u0430 Nintendo<\/a> \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043c\u043e\u0438\u0445 \u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0442\u0435\u0442\u0440\u0438\u0441\u0430. \u041c\u043e\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0436\u0430\u043b\u043e\u0431\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u043c\u0443 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u00abHard Drop\u00bb \u2014 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u0438 \u0435\u0451 \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0438 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0435\u0451 \u0434\u043e\u0431\u0430\u0432\u0438\u043c<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0432\u043d\u0451\u0441 \u0432 \u0442\u0435\u0442\u0440\u0438\u0441, \u2014 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u00ab\u0432\u0432\u0435\u0440\u0445\u00bb \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0430\u0434\u0435\u043d\u0438\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e \u00ab\u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b\u00bb \u2014 \u0442\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0443\u0440 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439, \u0433\u0434\u0435 \u043e\u043d\u0430 \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u0438\u0442\u0441\u044f.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/966\/c9d\/8b9\/966c9d8b9f5e6ffdd6fbe0f7d535e048.jpg\" width=\"500\" height=\"439\"><figcaption><\/figcaption><\/figure>\n<h3>\u0423\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0435 \u0438 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u0443 \u043a\u043b\u0435\u0442\u043a\u0443 \u0432\u043d\u0438\u0437 \u0437\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043a \u0438\u0433\u0440\u044b. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0442\u0440\u0438\u0441\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u2014 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0435 \u0438 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \u0432\u043d\u0438\u0437 \u043d\u0430 \u043e\u0434\u043d\u0443 \u043f\u043e\u0437\u0438\u0446\u0438\u044e, \u0430 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442 \u0435\u0451 \u0443\u043f\u0430\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cab\/2ec\/723\/cab2ec7231e980dd548ef5c56120d791.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<p>Hard drop \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0435\u0451 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u0433\u0440\u043e\u043a\u0443 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u0430 \u043b\u0438 \u0444\u0438\u0433\u0443\u0440\u0430 \u0441 \u0442\u0435\u043c \u043c\u0435\u0441\u0442\u043e\u043c, \u043a\u0443\u0434\u0430 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u0438\u0442\u044c\u0441\u044f, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0442\u0440\u0438\u0441\u0430 \u0441 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u0430\u0434\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442 \u043a\u043e\u043d\u0442\u0443\u0440 \u044d\u0442\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439, \u0433\u0434\u0435 \u043e\u043d\u0430 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0451\u0442\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/07f\/bb8\/454\/07fbb84543c3602358b37426965b81a5.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043e \u043c\u043e\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 NES \u0422\u0435\u0442\u0440\u0438\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u0410\u0440\u0442\u0435\u0444\u0430\u043a\u0442<\/h3>\n<p>\u042f \u0441\u0434\u0435\u043b\u0430\u043b <a href=\"https:\/\/crates.io\/crates\/nes-tetris-hard-drop-patcher\">\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 rust<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b NES ROM \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <a href=\"https:\/\/wiki.nesdev.com\/w\/index.php\/INES\">INES<\/a>. \u0415\u0441\u043b\u0438 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0431\u044b\u043b NES Tetris (\u043e\u0431\u044b\u0447\u043d\u043e \u0444\u0430\u0439\u043b \u043d\u0430\u0437\u0432\u0430\u043d \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u00abTetris(U)[!].nes\u00bb), \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043e\u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b ROM NES, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 NES Tetris, \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0444\u0438\u0433\u0443\u0440\u044b.<\/p>\n<p>\u0412\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0445\u044d\u0448 sha1 a99f922e9da20b2a27e4398348505d2e9d15271b.<\/p>\n<pre><code class=\"bash\">$ cargo install nes-tetris-hard-drop-patcher   # install my tool $ nes-tetris-hard-drop-patcher &lt; 'Tetris (U) [!].nes' &gt; tetris-hd.nes   # patch a NES Tetris ROM $ fceux tetris-hd.nes   # run the result in an emulator<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442 ROM-\u0444\u0430\u0439\u043b NES Tetris. \u0412 \u043d\u0451\u043c \u043d\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0442\u0440\u0438\u0441\u0430. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b ROM \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438 NES \u2014 \u043e\u043d \u043d\u0435\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u043d \u0434\u043b\u044f fceux.<\/p>\n<h3>\u041f\u0430\u0442\u0447<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u043b\u044f \u043f\u0430\u0442\u0447\u0430 ROM (IPS), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0448\u0438\u0440\u043e\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043c\u043e\u0439 \u043f\u0430\u0442\u0447 <a href=\"https:\/\/gridbugs.org\/files\/reverse-engineering-nes-tetris-to-add-hard-drop\/tetris-hard-drop.ips\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h3>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h3>\n<p>\u041f\u0430\u0440\u0443 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u0441\u0434\u0435\u043b\u0430\u043b <a href=\"https:\/\/github.com\/stevebob\/mos6502\">\u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 NES<\/a>. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0435\u0432\u0435\u0440\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u043f\u0435\u0440\u0435\u043c\u0435\u0436\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0433\u0438\u0444\u043a\u0438, \u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440, \u044f \u0441\u043e\u0437\u0434\u0430\u043b <a href=\"https:\/\/crates.io\/crates\/mos6502_assembler\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/a> \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 \u00ab\u0430\u043a\u043a\u0443\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430\u00bb \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 12:<\/p>\n<pre><code class=\"rust\">b.inst(Clc, ());                  \/\/ clear carry flag b.inst(Rol(Accumulator), ());     \/\/ rotate accumulator 1 bit to the left (x2) b.inst(Rol(Accumulator), ());     \/\/ rotate accumulator 1 bit to the left (x4) b.inst(Sta(ZeroPage), 0x20);      \/\/ store current accumulator value at address 0x0020 b.inst(Rol(Accumulator), ());     \/\/ rotate accumulator 1 bit to the left (x8) b.inst(Adc(ZeroPage), 0x20);      \/\/ add the accumulator with the value at 0x0020 (x12)<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c rust \u043a\u0430\u043a \u044f\u0437\u044b\u043a \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0434\u043b\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c NES. \u0413\u0438\u0431\u043a\u043e\u0441\u0442\u044c Rust \u0432\u0430\u0436\u043d\u0430 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 1980-\u0445 \u0433\u043e\u0434\u0430\u0445.<\/p>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f <a href=\"https:\/\/www.gridbugs.org\/nes-emulator-debugging\">\u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430<\/a> \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c NES \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 NES \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/mesen.ca\/\">Mesen<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u0433\u0430\u0442\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0442\u043b\u0430\u0434\u043a\u0438. \u041e\u043d \u0431\u044b\u043b \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0447\u0438\u043f\u0430 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<h3>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0444\u0438\u0433\u0443\u0440\u044b<\/h3>\n<p>\u0412 NES \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u0444\u043e\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0435\u0442\u043a\u0443 \u0438\u0437 \u043f\u043b\u0438\u0442\u043e\u043a 8&#215;8 \u043f\u0438\u043a\u0441\u0435\u043b\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043f\u0440\u0430\u0439\u0442\u044b \u2014 \u044d\u0442\u043e \u043f\u043b\u0438\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0438\u0433\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u0444\u043e\u043d\u043e\u0432 \u0438 \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432, \u0438 \u0422\u0435\u0442\u0440\u0438\u0441 \u2014 \u043d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f99\/966\/f67\/f99966f67884ff0f3c709f0b84e19563.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043f\u0440\u0430\u0439\u0442\u044b \u0432 \u0442\u0435\u0442\u0440\u0438\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0444\u043e\u043d\u043e\u0432\u0443\u044e \u0433\u0440\u0430\u0444\u0438\u043a\u0443 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e. \u041d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u043d\u0438\u0436\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u0441 \u0444\u043e\u043d\u043e\u043c \u0432\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441\u043f\u0440\u0430\u0439\u0442\u0430\u043c\u0438 \u0432\u043d\u0438\u0437\u0443.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fa2\/673\/8ed\/fa26738ed07bdb084d24a07ba70c64a8.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/12b\/d3d\/b74\/12bd3db740a489975427eaf2860474fd.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0438\u0433\u0440\u0435 \u044f\u0432\u043d\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0430 \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0444\u0438\u0433\u0443\u0440\u044b, \u043f\u043e\u0445\u043e\u0436\u0435, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u043d\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438, \u0430 \u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0439.<\/p>\n<p>\u0413\u043e\u0432\u043e\u0440\u044f \u043e \u043a\u043e\u043d\u0442\u0443\u0440\u043d\u044b\u0445 \u043f\u043b\u0438\u0442\u043a\u0430\u0445, \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u0438\u0433\u0440\u0443 \u043d\u043e\u0432\u0443\u044e \u043f\u043b\u0438\u0442\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0434\u043b\u044f \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b:<\/p>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fdd\/148\/eba\/fdd148eba6e79d5d6125390eaf5b8564.png\" width=\"147\" height=\"143\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u043e\u044f \u0446\u0435\u043b\u044c \u0437\u0434\u0435\u0441\u044c \u2014 \u0432\u044b\u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0444\u0438\u0433\u0443\u0440\u044b.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432 \u043d\u0430 NES \u0432\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043f\u0440\u0430\u0439\u0442\u0430 (\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043b\u0438\u0442\u043a\u0430 \u0438 \u0442. \u0434.), \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <a href=\"https:\/\/wiki.nesdev.com\/w\/index.php\/PPU_registers#OAMDMA\">OAMDMA<\/a>. (\u041f\u0440\u044f\u043c\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u2014 OAM \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0440\u0430\u0439\u0442\u0430, \u0430 DMA \u2014 \u044d\u0442\u043e \u043e\u0431\u0449\u0438\u0439 \u0442\u0435\u0440\u043c\u0438\u043d \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c.) \u0417\u0430\u043f\u0438\u0441\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 OAMDMA \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435 NES \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432.<\/p>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440 OAMDMA \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0426\u041f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x4014. \u041f\u043e\u0438\u0441\u043a \u0432 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442:<\/p>\n<pre><code>0xAB63  Lda(Immediate) 0x02       # load accumulator with 2 0xAB65  Sta(Absolute) 0x4014      # write accumulator to 0x4014<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 2 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 OAMDMA, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u043e\u0442 0x0200 \u0434\u043e 0x02FF \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 OAM. \u0418 \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043a\u0430\u043a \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0437\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430. \u041e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 0x8A0A \u0438 \u043c\u043e\u0436\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0422\u0435\u0442\u0440\u0438\u0441.<\/p>\n<p>\u041e\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0447\u0442\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 0x0040 \u0438 0x0041, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430 8 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0445 \u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u043c. \u041d\u0430 NES \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u043b\u0438\u0442\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 8&#215;8 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439, \u0442\u0430\u043a \u0447\u0442\u043e \u044d\u0442\u043e, \u043f\u043e-\u0432\u0438\u0434\u0438\u043c\u043e\u043c\u0443, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u043b\u0438\u0442\u043a\u0438 \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u043f\u0438\u043a\u0441\u0435\u043b\u0430, \u0433\u0434\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u0438\u043a\u0441\u0435\u043b\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0433\u043b\u0430 \u0434\u043e\u0441\u043a\u0438. \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0443\u0442 \u043a\u043e\u043f\u0430\u043d\u0438\u044f \u0432 \u043c\u0435\u0437\u0435\u043d\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0442 \u044d\u0442\u043e: 0x40 \u2014 \u044d\u0442\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 x, \u0430 0x41 \u2014 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 Y \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 0x42. \u042d\u0442\u043e \u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 0 \u0434\u043e 12, \u043a\u043e\u0442\u043e\u0440\u043e\u0435, \u043f\u043e-\u0432\u0438\u0434\u0438\u043c\u043e\u043c\u0443, \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0444\u043e\u0440\u043c\u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0451 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435. \u0414\u043b\u044f \u0444\u0438\u0433\u0443\u0440 \u0441 \u0432\u0440\u0430\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0435\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0438\u0433\u0443\u0440\u0430 \u201cS\u201d) \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 0x42. \u042f \u0431\u0443\u0434\u0443 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u201c\u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0444\u043e\u0440\u043c\u044b\u201d.<\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u0432 \u0422\u0435\u0442\u0440\u0438\u0441\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 4 \u043f\u043b\u0438\u0442\u043e\u043a, \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0441\u043f\u0440\u0430\u0439\u0442. \u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 0x40 \u0438 0x41 \u2014 \u044d\u0442\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0444\u0438\u0433\u0443\u0440\u044b, \u043d\u043e \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438. \u0421 \u044d\u0442\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432 \u041f\u0417\u0423 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x8A9C, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0431\u0443\u0434\u0443 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u00ab\u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u0444\u043e\u0440\u043c\u00bb. \u041a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 13 \u0447\u0430\u0441\u0442\u0435\u0439 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f) \u0438\u043c\u0435\u0435\u0442 12-\u0431\u0430\u0439\u0442\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0444\u043e\u0440\u043c. \u0417\u0430\u043f\u0438\u0441\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0444\u043e\u0440\u043c \u0434\u043b\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u043e 3 \u0431\u0430\u0439\u0442\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 4 \u043f\u043b\u0438\u0442\u043e\u043a:<\/p>\n<ul>\n<li>\n<p>\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043b\u0438\u0442\u043a\u0438 \u043f\u043e \u043e\u0441\u0438 y (\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e 0x41);<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u0434\u0435\u043a\u0441 \u0441\u043f\u0440\u0430\u0439\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0435 \u043f\u043b\u0438\u0442\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043b\u0438\u0442\u043a\u0438 \u043f\u043e \u043e\u0441\u0438 x (\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e 0x40).<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0438\u043d\u0434\u0435\u043a\u0441 \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0431\u0443\u0444\u0435\u0440 OAM DMA \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439. \u0427\u0442\u043e\u0431\u044b \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443, \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u043f\u043b\u0438\u0442\u043a\u0443 \u0441 \u043a\u043e\u043d\u0442\u0443\u0440\u043e\u043c, \u0430 \u043d\u0435 \u043f\u043b\u0438\u0442\u043a\u043e\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0444\u043e\u0440\u043c, \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0444\u0438\u0433\u0443\u0440\u0443 \u0441 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c, \u0442\u0430\u043a \u0447\u0442\u043e \u0444\u0438\u0433\u0443\u0440\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0433\u0434\u0435 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 hard drop. \u0411\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u043e\u0431\u0449\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\/\u0432\u0441\u0442\u0430\u0432\u0438\u043b \u043a\u043e\u0434 \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u043b \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0441\u0442\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u2014 mesen, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u041f\u0417\u0423. \u042f \u043d\u0435 \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0434\u0435\u043b\u0430\u044e\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 0x00 \u0438 0xFF! \u0422\u0430\u043a\u0436\u0435 \u044f \u043d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0448\u0440\u0438\u0444\u0442 \u0432 mesen \u043d\u0430 <strong>Monospace<\/strong>!<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/13d\/6a5\/86b\/13d6a586b6bf7795911454020569e0b9.png\" width=\"643\" height=\"330\"><figcaption><\/figcaption><\/figure>\n<p>\u042f \u0432\u044b\u0434\u0435\u043b\u0438\u043b 512 \u0431\u0430\u0439\u0442 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0430\u0434\u0440\u0435\u0441\u0430 0xD6D0. \u041f\u0435\u0440\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u044d\u0442\u0443 \u043e\u0431\u043b\u0430\u0441\u0442\u044c, \u0431\u044b\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 DMA OAM:<\/p>\n<pre><code class=\"rust\">b.label(\"oam-dma-buffer-update\");  \/\/ Call original function b.inst(Jsr(Absolute), 0x8A0A); \/\/ Return b.inst(Rts, ());<\/code><\/pre>\n<p>\u041c\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0430\u0442\u0447\u0430 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (0x8A0A) \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 \u043d\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u044f \u0432\u0437\u044f\u043b \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 DMA OAM \u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0432\u0435\u043b \u0435\u0433\u043e \u043d\u0430 \u044f\u0437\u044b\u043a rust \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 NES.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<pre><code>0x8A0A  Lda(ZeroPage) 0x40 0x8A0C  Asl(Accumulator) 0x8A0D  Asl(Accumulator) 0x8A0E  Asl(Accumulator) 0x8A0F  Adc(Immediate) 0x60 0x8A11  Sta(ZeroPage) 0xAA ...<\/code><\/pre>\n<p>\u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432:<\/p>\n<pre><code class=\"rust\">b.label(\"render-ghost-piece\"); \/\/ function label so it can be called by name later  b.inst(Lda(ZeroPage), 0x40); b.inst(Asl(Accumulator), ()); b.inst(Asl(Accumulator), ()); b.inst(Asl(Accumulator), ()); b.inst(Adc(Immediate), 0x60); b.inst(Sta(ZeroPage), 0xAA); ...<\/code><\/pre>\n<p>\u042f \u0438\u0437\u043c\u0435\u043d\u0438\u043b \u0441\u0432\u043e\u044e \u043a\u043e\u043f\u0438\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 DMA OAM, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0443\u0440\u043d\u0443\u044e \u043f\u043b\u0438\u0442\u043a\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043b\u0438\u0442\u043a\u0438, \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0439 \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 \u0444\u043e\u0440\u043c\u044b. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435, \u044f \u043e\u0431\u043d\u043e\u0432\u0438\u043b oam-dma-buffer-update, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u043e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0430:<\/p>\n<pre><code class=\"rust\">b.label(\"oam-dma-buffer-update\");  \/\/ Call new function b.inst(Jsr(Absolute), \"render-ghost-piece\"); \/\/ Return b.inst(Rts, ());<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f7f\/3c2\/5a2\/f7f3c25a2e6a58c433df43aefeb1f17d.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u044f \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b \u043c\u043e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430. \u0412 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u043e\u0433\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0444\u0438\u0433\u0443\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044c\u0441\u044f \u0432\u043d\u0438\u0437 \u0434\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f, \u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439, \u0440\u0430\u0432\u043d\u043e\u0439 6.<\/p>\n<pre><code class=\"rust\">b.label(\"oam-dma-buffer-update\");  \/\/ Call original function first b.inst(Jsr(Absolute), 0x8A0A); \/\/ Render the ghost piece, passing the vertical offset argument in address 0x0028. b.inst(Lda(Immediate), 6); b.inst(Sta(ZeroPage), 0x28); b.inst(Jsr(Absolute), \"render-ghost-piece\"); \/\/ Return b.inst(Rts, ());b.label(\"oam-dma-buffer-update\");  \/\/ Call original function first b.inst(Jsr(Absolute), 0x8A0A); \/\/ Render the ghost piece, passing the vertical offset argument in address 0x0028. b.inst(Lda(Immediate), 6); b.inst(Sta(ZeroPage), 0x28); b.inst(Jsr(Absolute), \"render-ghost-piece\"); \/\/ Return b.inst(Rts, ());<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5a1\/ced\/8cc\/5a1ced8ccbd52d194df16a020394cc2c.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043c \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0435 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u0434\u043e \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u043e\u043d\u0430 \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u0438\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u044f. \u041d\u0430\u0431\u043b\u044e\u0434\u0430\u044f \u0437\u0430 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mesen, \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e, \u043f\u043e\u0445\u043e\u0436\u0435, \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043e\u0442 0x0020 \u0434\u043e 0x0028. \u041f\u0435\u0440\u0432\u044b\u0435 256 \u0431\u0430\u0439\u0442\u043e\u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u00ab\u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435\u0439\u00bb \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f, \u0447\u0435\u043c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u0438. \u041c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e 8 \u0431\u0430\u0439\u0442\u043e\u0432 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 X, Y \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u0434\u0438\u043d \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0431\u0430\u0439\u0442 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041d\u0430\u0447\u043d\u0438\u0442\u0435 \u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043e\u0442 0x20 \u0434\u043e 0x27 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 X, Y \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b:<\/p>\n<pre><code class=\"rust\">b.label(\"compute-hard-drop-distance\"); \/\/ function label so it can be called by name later  const SHAPE_TABLE: Address = 0x8A9C; const ZP_PIECE_COORD_X: u8 = 0x40; const ZP_PIECE_COORD_Y: u8 = 0x41; const ZP_PIECE_SHAPE: u8 = 0x42; \/\/ Multiply the shape by 12 to make an offset into the shape table, \/\/ storing the result in IndexRegisterX. b.inst(Lda(ZeroPage), ZP_PIECE_SHAPE);  \/\/ read shape index into accumulator b.inst(Clc, ());               \/\/ clear carry flag to prepare for arithmetic b.inst(Rol(Accumulator), ());  \/\/ rotate left: index * 2 b.inst(Rol(Accumulator), ());  \/\/ rotate left: index * 4 b.inst(Sta(ZeroPage), 0x20);   \/\/ store index * 4 at 0x0020 b.inst(Rol(Accumulator), ());  \/\/ rotate left: index * 8 b.inst(Adc(ZeroPage), 0x20);   \/\/ add to 0x0020: index * 12 b.inst(Tax, ());               \/\/ transfer accumulator to IndexRegisterX \/\/ Store absolute X,Y coords of each tile by reading relative coordinates from shape table \/\/ and adding the piece offset, storing the result in zero page 0x20..=0x27. for i in 0..4 { \/\/ this is a rust loop - the assembly generated inside will be generated 4 times     b.inst(Lda(AbsoluteXIndexed), Addr(SHAPE_TABLE)); \/\/ read Y offset from shape table     b.inst(Clc, ());                                  \/\/ clear carry flag to prepare for addition     b.inst(Adc(ZeroPage), ZP_PIECE_COORD_Y);          \/\/ add to Y coordinate of piece     b.inst(Sta(ZeroPage), 0x21 + (i  2));            \/\/ store the result in zero page     b.inst(Inx, ());                                  \/\/ increment IndexRegisterX to sprite index     b.inst(Inx, ());                                  \/\/ increment IndexRegisterX to X offset     b.inst(Lda(AbsoluteXIndexed), Addr(SHAPE_TABLE)); \/\/ read X offset from shape table     b.inst(Clc, ());                                  \/\/ clear carry flag to prepare for addition     b.inst(Adc(ZeroPage), ZP_PIECE_COORD_X);          \/\/ add to X coordinate of piece     b.inst(Sta(ZeroPage), 0x20 + (i  2));            \/\/ store the result in zero page     b.inst(Inx, ());                                  \/\/ increment IndexRegisterX to next tile }<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u0439! \u041d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0439\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Y \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u043b\u0438\u0442\u043a\u0438 \u0432 \u0430\u0434\u0440\u0435\u0441\u0430\u0445 \u043e\u0442 0x20 \u0434\u043e 0x27, \u043f\u043e\u043a\u0430 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043f\u043b\u0438\u0442\u043e\u043a \u043d\u0435 \u0441\u0442\u043e\u043b\u043a\u043d\u0451\u0442\u0441\u044f \u0441 \u0437\u0430\u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u043e\u0439 \u0438\u043b\u0438 \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442 \u0437\u0430 \u043d\u0438\u0436\u043d\u044e\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u043e\u043b\u044f. \u0418\u0437\u0443\u0447\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mesen, \u044f \u0443\u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u043e\u043b\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0441 0x0400, \u0438 \u0447\u0442\u043e 0xEF \u2014 \u044d\u0442\u043e \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043b\u0438\u0442\u043a\u0438 \u00ab\u043f\u0443\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u00bb. \u0421\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0432 \u044d\u0442\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435, \u0435\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0447\u0442\u043e-\u043b\u0438\u0431\u043e \u043a\u0440\u043e\u043c\u0435 0xEF.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u0430\u044f \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0430 \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u043d\u0438\u0436\u0435 \u043a\u043e\u0434\u0435 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0446\u0438\u043a\u043b \u0432 \u0441\u0431\u043e\u0440\u043a\u0435, \u043d\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0446\u0438\u043a\u043b for \u0432 rust, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u0431\u043e\u0440\u043a\u0443. \u042d\u0442\u0438 \u0434\u0432\u0430 \u0446\u0438\u043a\u043b\u0430 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439. \u0421\u0431\u043e\u0440\u043a\u0430 \u0432 \u0446\u0438\u043a\u043b\u0435 rust \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 4 \u0440\u0430\u0437\u0430, \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0435\u043b\u043e \u0446\u0438\u043a\u043b\u0430 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<pre><code class=\"rust\">const BOARD_TILES: Address = 0x0400; const EMPTY_TILE: u8 = 0xEF; const BOARD_HEIGHT: u8 = 20;  b.inst(Ldx(Immediate), 0);   \/\/ Load 0 into IndexRegisterX - this will be our loop counter  b.label(\"start-ghost-depth-loop\"); \/\/ This is a label - a target for branch instructions  for i in 0..4 { \/\/ the assembly in this rust loop will be emitted 4 times      \/\/ Increment the Y component of the coordinate     b.inst(Inc(ZeroPage), 0x21 + (i * 2));      \/\/ Break out of the loop if the tile is off the bottom of the board     b.inst(Lda(ZeroPage), 0x21 + (i * 2));     b.inst(Cmp(Immediate), BOARD_HEIGHT);     b.inst(Bpl, LabelRelativeOffset(\"end-ghost-depth-loop\"));      \/\/ Multiply the Y component of the coordinate by 10 (the number of columns)     b.inst(Asl(Accumulator), ());     b.inst(Sta(ZeroPage), 0x28); \/\/ store Y * 2     b.inst(Asl(Accumulator), ());     b.inst(Asl(Accumulator), ()); \/\/ accumulator now contains Y * 8     b.inst(Clc, ());     b.inst(Adc(ZeroPage), 0x28); \/\/ accumulator now contains Y * 10      \/\/ Now add the X component to get the row-major index of the cell     b.inst(Adc(ZeroPage), 0x20 + (i * 2));      \/\/ Load the tile at that coordinate     b.inst(Tay, ());     b.inst(Lda(AbsoluteYIndexed), BOARD_TILES);      \/\/ Test whether the tile is empty, breaking out of the loop if it is not     b.inst(Cmp(Immediate), EMPTY_TILE);     b.inst(Bne, LabelRelativeOffset(\"end-ghost-depth-loop\")); } \/\/ Increment counter and loop b.inst(Inx, ()); b.inst(Jmp(Absolute), \"start-ghost-depth-loop\");  b.label(\"end-ghost-depth-loop\");<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e IndexRegisterX \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0435\u043d\u0438\u0439 \u0446\u0438\u043a\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0430\u043a\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u0434\u043e \u0442\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430, \u0433\u0434\u0435 \u043e\u043d\u0430 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0435\u0440\u043d\u0451\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0430\u043a\u043a\u0443\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"rust\">\/\/ Return depth via accumulator b.inst(Txa, ());  \/\/ transfer IndexRegisterX to accumulator b.inst(Rts, ());  \/\/ return<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0437\u0430\u043c\u0435\u0449\u0430\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 DMA OAM:<\/p>\n<pre><code class=\"rust\">b.label(\"oam-dma-buffer-update\");  \/\/ Call original function first b.inst(Jsr(Absolute), 0x8A0A); \/\/ Compute distance from current piece to drop destination, placing result in accumulator b.inst(Jsr(Absolute), \"compute-hard-drop-distance\"); \/\/ Check if the distance is 0, and skip rendering the ghost piece in this case b.inst(Beq, LabelRelativeOffset(\"after-render-ghost-piece\")); \/\/ Render the ghost piece, passing the vertical offset argument in address 0x0028. b.inst(Sta(ZeroPage), 0x28); b.inst(Jsr(Absolute), \"render-ghost-piece\"); b.label(\"after-render-ghost-piece\"); \/\/ Return b.inst(Rts, ());<\/code><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/429\/f5a\/b03\/429f5ab03bdcace020d0e50bb51dec96.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<h3>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0434\u043b\u044f Hard Drop&nbsp;<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u00ab\u0432\u0432\u0435\u0440\u0445\u00bb \u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u043e \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u0435. \u041a\u043d\u043e\u043f\u043a\u0430 \u00ab\u0432\u0432\u0435\u0440\u0445\u00bb \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0422\u0435\u0442\u0440\u0438\u0441\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e \u043f\u043e\u0442\u0435\u0440\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c hard drop.<\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u043e\u0432 \u0444\u0438\u0433\u0443\u0440\u044b, \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u0439\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043c\u043e\u0433 \u0431\u044b \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u2014 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u0431\u044b\u043b\u0430 \u043b\u0438 \u043d\u0430\u0436\u0430\u0442\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u0432\u0432\u0435\u0440\u0445\u00bb, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u0444\u0438\u0433\u0443\u0440\u044b, \u0435\u0441\u043b\u0438 \u0434\u0430.<\/p>\n<p>\u041c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043b\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 0x4016, \u043d\u043e, \u043f\u043e\u0445\u043e\u0436\u0435, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u044b\u0445 \u0441\u0432\u044f\u0437\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438\u0433\u0440\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u044e\u0442\u0441\u044f.<\/p>\n<p>\u041c\u043e\u044f \u0432\u0442\u043e\u0440\u0430\u044f \u0438\u0434\u0435\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0434\u043b\u044f \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438. \u042f \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u0422\u0435\u0442\u0440\u0438\u0441 \u0438 \u043f\u0440\u043e\u0448\u0451\u043b\u0441\u044f \u043f\u043e \u043c\u0435\u043d\u044e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0438\u0433\u0440\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b \u0444\u0430\u0439\u043b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u0423 \u043c\u043e\u0435\u0433\u043e \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0430\u0434\u0440\u043e\u0432. \u042f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0435\u0433\u043e \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0432 20 \u043a\u0430\u0434\u0440\u043e\u0432, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u0444\u0430\u0439\u043b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u043b \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u043d\u0435 \u043d\u0430\u0436\u0438\u043c\u0430\u044f \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0417\u0430\u0442\u0435\u043c \u044f \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u043b \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u044f \u043d\u0430\u0436\u0438\u043c\u0430\u043b \u043b\u0435\u0432\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 20 \u043a\u0430\u0434\u0440\u043e\u0432. \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u043e \u0434\u0432\u0430 \u043b\u043e\u0433\u0430 \u043f\u043e\u0442\u043e\u043a\u0430 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u2014 \u043e\u0434\u0438\u043d \u0431\u0435\u0437 \u043d\u0430\u0436\u0430\u0442\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u0441 \u0438\u0445 \u043d\u0430\u0436\u0430\u0442\u0438\u0435\u043c. \u0421\u0430\u043c\u043e \u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u044d\u0442\u0438 \u043f\u043e\u0442\u043e\u043a\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0440\u0430\u0437\u0432\u0435\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043b\u0435\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0438.<\/p>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435:<\/p>\n<pre><code>@@ -116912,9 +116912,175 @@  0x89B8  Lda(ZeroPage) 0xB5  0x89BA  And(Immediate) 0x03  0x89BC  Bne(Relative) 0x15 -0x89BE  Lda(ZeroPage) 0xB6 -0x89C0  And(Immediate) 0x03 -0x89C2  Beq(Relative) 0x45 +0x89D3  Lda(Immediate) 0x00 +0x89D5  Sta(ZeroPage) 0x46 +0x89D7  Lda(ZeroPage) 0xB6 +0x89D9  And(Immediate) 0x01 +0x89DB  Beq(Relative) 0x0F ...<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u043a\u0440\u0451\u0441\u0442\u043d\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430 \u0441 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u041f\u0417\u0423, \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441:<\/p>\n<pre><code>0x89AE  Lda(ZeroPage) 0x40 0x89B0  Sta(ZeroPage) 0xAE 0x89B2  Lda(ZeroPage) 0xB6 0x89B4  And(Immediate) 0x04 0x89B6  Bne(Relative) 0x51 (relative: 0x51, absolute: 0x8A09) 0x89B8  Lda(ZeroPage) 0xB5 0x89BA  And(Immediate) 0x03 0x89BC  Bne(Relative) 0x15 (relative: 0x15, absolute: 0x89D3) 0x89BE  Lda(ZeroPage) 0xB6 0x89C0  And(Immediate) 0x03 0x89C2  Beq(Relative) 0x45 (relative: 0x45, absolute: 0x8A09) ...<\/code><\/pre>\n<p>\u042d\u0442\u043e \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u043e\u0432 0x00B5 \u0438 0x00B6. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f \u0437\u0430 \u044d\u0442\u0438\u043c\u0438 \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438 \u0432 mesen \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0442\u0438\u0440\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443 \u043c\u0435\u043d\u044f \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u0435, \u0447\u0442\u043e 0xB5 \u0445\u0440\u0430\u043d\u0438\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0434\u0440\u0430\u043c\u0438 \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0430 0xB6 \u0445\u0440\u0430\u043d\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e \u0447\u0442\u043e \u0442\u0435\u0442\u0440\u0438\u0441 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0435\u0451, \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u00ab\u0432\u0432\u0435\u0440\u0445\u00bb \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u044d\u0442\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445.<\/p>\n<p>\u042f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043c\u043e\u044e \u0437\u0430\u043c\u0435\u043d\u0443 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 DMA OAM. \u0412\u0441\u0451, \u0447\u0442\u043e \u043e\u043d \u0441\u0434\u0435\u043b\u0430\u043b, \u2014 \u044d\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u043b \u0438\u0441\u0445\u043e\u0434\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u0432\u0435\u0440\u043d\u0443\u043b:<\/p>\n<pre><code class=\"rust\">b.label(\"handle-controls\");  \/\/ Call the original function b.inst(Jsr(Absolute), 0x89AE);  \/\/ Return b.inst(Rts, ());<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443, \u043d\u0430\u0436\u0430\u0442\u0430 \u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0430 \u00ab\u0432\u0432\u0435\u0440\u0445\u00bb. \u0410 \u043f\u043e\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0435\u043b\u0435\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u044b \u043d\u0430 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432\u044b\u0441\u043e\u0442\u0443 \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438:<\/p>\n<pre><code class=\"rust\">b.label(\"handle-controls\");  const CONTROLLER_STATE: u8 = 0xB6; const CONTROLLER_BIT_UP: u8 = 0x08;  \/\/ Call the original function b.inst(Jsr(Absolute), 0x89AE);  \/\/ Skip to the end if the UP bit of the controller state is not set b.inst(Lda(ZeroPage), CONTROLLER_STATE); b.inst(And(Immediate), CONTROLLER_BIT_UP); b.inst(Beq, LabelRelativeOffset(\"controller-end\"));  \/\/ Set the current piece's Y coordinate to 7 b.inst(Lda(Immediate), 7); b.inst(Sta(ZeroPage), ZP_PIECE_COORD_Y);  b.label(\"controller-end\");  \/\/ Return b.inst(Rts, ());<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u043a\u043e\u0434 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u043d\u0430\u0436\u0438\u043c\u0430\u044e \u00ab\u0432\u0432\u0435\u0440\u0445\u00bb:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bad\/801\/a4e\/bad801a4e1f8e880effd9e50ee7e16ff.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 7 \u043d\u0430 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u0435\u0442\u0430\u043b\u044c \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0440\u0435\u0437\u043a\u043e\u0433\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e compute-hard-drop-distance, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0444\u0438\u0433\u0443\u0440\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0443\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 Y, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"rust\">b.label(\"handle-controls\");  const CONTROLLER_STATE: u8 = 0xB6; const CONTROLLER_BIT_UP: u8 = 0x08;  \/\/ Call the original function b.inst(Jsr(Absolute), 0x89AE);  \/\/ Skip to the end if the UP bit of the controller state is not set b.inst(Lda(ZeroPage), CONTROLLER_STATE); b.inst(And(Immediate), CONTROLLER_BIT_UP); b.inst(Beq, LabelRelativeOffset(\"controller-end\"));  \/\/ Compute distance from current piece to drop destination, placing result in accumulator b.inst(Jsr(Absolute), \"compute-hard-drop-distance\");  \/\/ Add the current piece's Y coordinate b.inst(Clc, ()); b.inst(Adc(ZeroPage), ZP_PIECE_COORD_Y);  \/\/ Update the current piece's Y coordinate with the result b.inst(Sta(ZeroPage), ZP_PIECE_COORD_Y);  b.label(\"controller-end\");  \/\/ Return b.inst(Rts, ());<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/422\/860\/934\/422860934766c9f7e7d3808232d39064.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e!<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e. \u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0438\u0433\u0440\u0430 \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u00ab\u0442\u0438\u043a\u0430\u00bb, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443. \u041f\u043e\u0441\u043b\u0435 hard drop\u2019a \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u0442\u0438\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u043d\u0435\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c\u0441\u044f \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0431\u0435\u0437 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438.<\/p>\n<p>\u0413\u043b\u044f\u0434\u044f \u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e mesen, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x0045, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0434\u0451\u0442 \u043e\u0442\u0441\u0447\u0451\u0442 \u0434\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0442\u0438\u043a\u0435 (\u043a\u043e\u0433\u0434\u0430 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0438\u0437 \u0441\u0430\u043c\u0430 \u043f\u043e \u0441\u0435\u0431\u0435). \u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435, \u044f \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u0432\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0438\u0433\u0440\u0443 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 13 \u0442\u0438\u043a\u043e\u0432. \u042f \u0432\u044b\u0431\u0440\u0430\u043b 13, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043c\u0430\u043b\u043e\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u044b\u043c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/060\/978\/a9e\/060978a9ec768b3beef12948cf4be985.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0442\u0430\u0439\u043c\u0435\u0440 \u0438\u0441\u0442\u0451\u043a \u0431\u044b 13 \u0440\u0430\u0437. \u0413\u0434\u0435-\u0442\u043e \u0432 \u043b\u043e\u0433\u0430\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u0435\u0441\u0442\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u0440\u043e\u0432\u043d\u043e 13 \u0440\u0430\u0437. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0439\u0434\u0451\u043c!<\/p>\n<p>\u041b\u043e\u0433\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \/tmp\/log.txt:<\/p>\n<pre><code class=\"bash\">cat \/tmp\/log.txt | sort | uniq --count | sort --numeric-sort<\/code><\/pre>\n<p>\u041c\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0447\u0430\u0441\u0442\u043e\u0442\u0435. \u041f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b 13 \u0440\u0430\u0437, \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b:<\/p>\n<pre><code>13 0x8958  Lda(Immediate) 0x00 13 0x895A  Sta(ZeroPage) 0x45<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0441 \u0442\u0430\u0439\u043c\u0435\u0440\u043e\u043c \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x0045!<\/p>\n<p>\u041e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u044d\u0442\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438:<\/p>\n<pre><code>0x8980  Lda(ZeroPage) 0x45    # load the timer value 0x8982  Cmp(ZeroPage) 0xAF    # compare with the value at 0x00AF 0x8984  Bpl(Relative) 0xD2 (relative: D2, absolute: 8958)  # branch if it was higher 0x8986  Jmp(Absolute) 0x8972 0x8972  Rts(Implied) 0x8958  Lda(Immediate) 0x00  # load 0 into the accumulator 0x895A  Sta(ZeroPage) 0x45   # store the accumulator (0) in the timer<\/code><\/pre>\n<p>\u0414\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u0432 0, \u0438 \u043e\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0440\u043e\u0432\u043d\u043e 13 \u0440\u0430\u0437. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u2014 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0442\u0432\u044c (0x8984), \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e 13 \u0440\u0430\u0437 \u2014 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0437\u0430 \u0442\u0430\u043a\u0442. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0442\u0430\u0439\u043c\u0435\u0440 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0430\u0434\u0440, \u0430 \u043a\u0430\u0434\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043d \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 0xAF, \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442 \u043a\u043e\u043d\u0435\u0446 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0442\u0438\u043a\u0430, \u0432 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u0430\u0439\u043c\u0435\u0440 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0438 \u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0438\u0437.<\/p>\n<p>\u041d\u0430\u0431\u043b\u044e\u0434\u0430\u0435\u043c \u0437\u0430 0x00AF \u0432 mesen, \u0438 \u044d\u0442\u043e, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442 \u0442\u0430\u0439\u043c\u0435\u0440 \u0432 0x0045. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0435 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0x00AF \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0438\u0433\u0440\u0443! \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u043b\u0435 hard drop \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u0439\u043c\u0435\u0440\u0430 \u043d\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0x00AF:<\/p>\n<pre><code class=\"rust\">b.label(\"handle-controls\");  const CONTROLLER_STATE: u8 = 0xB6; const CONTROLLER_BIT_UP: u8 = 0x08; const TIMER: u8 = 0x45; const TIMER_MAX: u8 = 0xAF;  \/\/ Call the original function b.inst(Jsr(Absolute), 0x89AE);  \/\/ Skip to the end if the UP bit of the controller state is not set b.inst(Lda(ZeroPage), CONTROLLER_STATE); b.inst(And(Immediate), CONTROLLER_BIT_UP); b.inst(Beq, LabelRelativeOffset(\"controller-end\"));  \/\/ Compute distance from current piece to drop destination, placing result in accumulator b.inst(Jsr(Absolute), \"compute-hard-drop-distance\");  \/\/ Add the current piece's Y coordinate b.inst(Clc, ()); b.inst(Adc(ZeroPage), ZP_PIECE_COORD_Y);  \/\/ Update the current piece's Y coordinate with the result b.inst(Sta(ZeroPage), ZP_PIECE_COORD_Y);  \/\/ Set the timer to its maximum value b.inst(Lda(ZeroPage), TIMER); b.inst(Sta(ZeroPage), TIMER_MAX);  b.label(\"controller-end\");  \/\/ Return b.inst(Rts, ());<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/79c\/372\/d18\/79c372d1802da770d103b4acacd07802.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430, \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0432\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0438\u043a\u0430. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u0435\u0440\u0432\u044b\u0439 \u0442\u0438\u043a \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0435\u043c \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043a\u0438. \u0413\u043b\u044f\u0434\u044f \u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c \u0432 mesen, \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0x004E \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0442\u0438\u043a\u0430. \u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0438\u043a\u043e\u0432 \u043e\u043d \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 0. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0435\u0433\u043e \u043d\u0430 0 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f hard drop\u2019a \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439.<\/p>\n<pre><code class=\"rust\">b.label(\"handle-controls\");  const CONTROLLER_STATE: u8 = 0xB6; const CONTROLLER_BIT_UP: u8 = 0x08; const TIMER: u8 = 0x45; const TIMER_MAX: u8 = 0xAF; const TIMER_FIRST_TICK: u8 = 0x4E;  \/\/ Call the original function b.inst(Jsr(Absolute), 0x89AE);  \/\/ Skip to the end if the UP bit of the controller state is not set b.inst(Lda(ZeroPage), CONTROLLER_STATE); b.inst(And(Immediate), CONTROLLER_BIT_UP); b.inst(Beq, LabelRelativeOffset(\"controller-end\"));  \/\/ Compute distance from current piece to drop destination, placing result in accumulator b.inst(Jsr(Absolute), \"compute-hard-drop-distance\");  \/\/ Add the current piece's Y coordinate b.inst(Clc, ()); b.inst(Adc(ZeroPage), ZP_PIECE_COORD_Y);  \/\/ Update the current piece's Y coordinate with the result b.inst(Sta(ZeroPage), ZP_PIECE_COORD_Y);  \/\/ Set the timer to its maximum value b.inst(Lda(ZeroPage), TIMER); b.inst(Sta(ZeroPage), TIMER_MAX);  \/\/ Clear the first tick timer b.inst(Lda(Immediate), 0x00); b.inst(Sta(ZeroPage), TIMER_FIRST_TICK);  b.label(\"controller-end\");  \/\/ Return b.inst(Rts, ());<\/code><\/pre>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/40a\/828\/187\/40a82818722db1f932157209e3c1c7a8.gif\" width=\"500\" height=\"469\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! <br \/>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 <a href=\"https:\/\/github.com\/stevebob\/mos6502\/tree\/master\/tetris-hard-drop-patcher\">github<\/a>. \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u043f\u0430\u0442\u0447 IPS, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435, <a href=\"https:\/\/gridbugs.org\/files\/reverse-engineering-nes-tetris-to-add-hard-drop\/tetris-hard-drop.ips\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0442\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 hard drop, \u043d\u043e \u043d\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0435 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0444\u0438\u0433\u0443\u0440\u044b, \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d <a href=\"https:\/\/gridbugs.org\/files\/reverse-engineering-nes-tetris-to-add-hard-drop\/tetris-hard-drop-no-ghost.ips\">\u0437\u0434\u0435\u0441\u044c<\/a>. <\/p>\n<p>\u0410 \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0431\u0435\u0441\u0442\u0441\u0435\u043b\u043b\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u043a\u0430\u043a \u0438 \u0434\u0435\u0442\u0438\u0449\u0435 \u0410\u043b\u0435\u043a\u0441\u0435\u044f \u041f\u0430\u0436\u0438\u0442\u043d\u043e\u0432\u0430 \u0432\u043e\u0439\u0434\u0451\u0442 \u0432 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u2014 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0435 \u043a \u043d\u0430\u043c \u043d\u0430 \u043a\u0443\u0440\u0441 <a href=\"https:\/\/skillfactory.ru\/game-dev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_GAMEDEV&amp;utm_term=regular&amp;utm_content=250321\">\u00ab\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430 Unity\u00bb<\/a>, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e \u0432\u0441\u0435 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0433\u0440.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/5dc\/d67\/e0b\/5dcd67e0bd804aed5ea7f488a557f4aa.jpg\" width=\"894\" height=\"120\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/skillfactory.ru\/courses\/?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_ALLCOURSES&amp;utm_term=regular&amp;utm_content=250321\">\u0423\u0437\u043d\u0430\u0439\u0442\u0435<\/a>, \u043a\u0430\u043a \u043f\u0440\u043e\u043a\u0430\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u0445 \u0438\u043b\u0438 \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u0438\u0445 \u0441 \u043d\u0443\u043b\u044f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/dstpro?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DSPR&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Scientist<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/dataanalystpro?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DAPR&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Data Analyst<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/dataengineer?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DEA&amp;utm_term=regular&amp;utm_content=250321\">\u041a\u0443\u0440\u0441 \u043f\u043e Data Engineering<\/a><\/p>\n<\/li>\n<\/ul>\n<details class=\"spoiler\">\n<summary>\u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 \u0438 \u043a\u0443\u0440\u0441\u044b<\/summary>\n<div class=\"spoiler__content\">\n<p><strong>\u041f\u0420\u041e\u0424\u0415\u0421\u0421\u0418\u0418<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-fullstack-web-developer?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_FPW&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Fullstack-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0430 Python<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/java?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_JAVA&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/java-qa-engineer?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_QAJA&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f QA-\u0438\u043d\u0436\u0435\u043d\u0435\u0440 \u043d\u0430 JAVA<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/frontend?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_FR&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/cybersecurity?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_HACKER&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u042d\u0442\u0438\u0447\u043d\u044b\u0439 \u0445\u0430\u043a\u0435\u0440<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/cplus?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_CPLUS&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/game-dev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_GAMEDEV&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430 Unity<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_WEBDEV&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/iosdev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_IOSDEV&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043d\u0443\u043b\u044f<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/android?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_ANDR&amp;utm_term=regular&amp;utm_content=250321\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043d\u0443\u043b\u044f<\/a><\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041a\u0423\u0420\u0421\u042b<\/strong><\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/ml-programma-machine-learning-online?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_ML&amp;utm_term=regular&amp;utm_content=250321\">\u041a\u0443\u0440\u0441 \u043f\u043e Machine Learning<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/ml-and-dl?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MLDL&amp;utm_term=regular&amp;utm_content=250321\">\u041a\u0443\u0440\u0441 &#171;Machine Learning \u0438 Deep Learning&#187;<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/math-stat-for-ds#syllabus?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MAT&amp;utm_term=regular&amp;utm_content=250321\">\u041a\u0443\u0440\u0441 &#171;\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0434\u043b\u044f Data Science&#187;<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/math_and_ml?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MATML&amp;utm_term=regular&amp;utm_content=250321\">\u041a\u0443\u0440\u0441 &#171;\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438 Machine Learning \u0434\u043b\u044f Data Science&#187;&nbsp;<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_PWS&amp;utm_term=regular&amp;utm_content=250321\">\u041a\u0443\u0440\u0441 &#171;Python \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438&#187;<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/algo?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_algo&amp;utm_term=regular&amp;utm_content=250321\">\u041a\u0443\u0440\u0441 &#171;\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445&#187;<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/analytics?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_SDA&amp;utm_term=regular&amp;utm_content=250321\">\u041a\u0443\u0440\u0441 \u043f\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/skillfactory.ru\/devops?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DEVOPS&amp;utm_term=regular&amp;utm_content=250321\">\u041a\u0443\u0440\u0441 \u043f\u043e DevOps<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/details>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/548952\/\"> https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/548952\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Tetris_(NES_video_game)\">\u0422\u0435\u0442\u0440\u0438\u0441 \u043d\u0430 Nintendo<\/a> \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043c\u043e\u0438\u0445 \u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0442\u0435\u0442\u0440\u0438\u0441\u0430. \u041c\u043e\u044f \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0436\u0430\u043b\u043e\u0431\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u043c\u0443 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u00abHard Drop\u00bb \u2014 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u0438 \u0435\u0451 \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0438 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0435\u0451 \u0434\u043e\u0431\u0430\u0432\u0438\u043c<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0432\u043d\u0451\u0441 \u0432 \u0442\u0435\u0442\u0440\u0438\u0441, \u2014 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u00ab\u0432\u0432\u0435\u0440\u0445\u00bb \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u043c\u0443 \u043f\u0430\u0434\u0435\u043d\u0438\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e \u00ab\u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b\u00bb \u2014 \u0442\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0443\u0440 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439, \u0433\u0434\u0435 \u043e\u043d\u0430 \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u0438\u0442\u0441\u044f.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<h3>\u0423\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0435 \u0438 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0434\u043d\u0443 \u043a\u043b\u0435\u0442\u043a\u0443 \u0432\u043d\u0438\u0437 \u0437\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0442\u0438\u043a \u0438\u0433\u0440\u044b. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0442\u0440\u0438\u0441\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043f\u0430\u0434\u0435\u043d\u0438\u0435 \u2014 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0435 \u0438 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \u0432\u043d\u0438\u0437 \u043d\u0430 \u043e\u0434\u043d\u0443 \u043f\u043e\u0437\u0438\u0446\u0438\u044e, \u0430 \u0443\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043d\u0438\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442 \u0435\u0451 \u0443\u043f\u0430\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>Hard drop \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443 \u0438 \u0444\u0438\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0435\u0451 \u043d\u0430 \u043c\u0435\u0441\u0442\u0435. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u0433\u0440\u043e\u043a\u0443 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432\u044b\u0440\u043e\u0432\u043d\u0435\u043d\u0430 \u043b\u0438 \u0444\u0438\u0433\u0443\u0440\u0430 \u0441 \u0442\u0435\u043c \u043c\u0435\u0441\u0442\u043e\u043c, \u043a\u0443\u0434\u0430 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u0438\u0442\u044c\u0441\u044f, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0442\u0435\u0442\u0440\u0438\u0441\u0430 \u0441 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u0430\u0434\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442 \u043a\u043e\u043d\u0442\u0443\u0440 \u044d\u0442\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439, \u0433\u0434\u0435 \u043e\u043d\u0430 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0451\u0442\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0414\u043e \u043c\u043e\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 NES \u0422\u0435\u0442\u0440\u0438\u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u043d\u043e\u0435 \u043f\u0430\u0434\u0435\u043d\u0438\u0435.<\/p>\n<h3>\u0410\u0440\u0442\u0435\u0444\u0430\u043a\u0442<\/h3>\n<p>\u042f \u0441\u0434\u0435\u043b\u0430\u043b <a href=\"https:\/\/crates.io\/crates\/nes-tetris-hard-drop-patcher\">\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 rust<\/a>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b NES ROM \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 <a href=\"https:\/\/wiki.nesdev.com\/w\/index.php\/INES\">INES<\/a>. \u0415\u0441\u043b\u0438 \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0431\u044b\u043b NES Tetris (\u043e\u0431\u044b\u0447\u043d\u043e \u0444\u0430\u0439\u043b \u043d\u0430\u0437\u0432\u0430\u043d \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u00abTetris(U)[!].nes\u00bb), \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043e\u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u043e\u0432\u044b\u0439 \u0444\u0430\u0439\u043b ROM NES, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 NES Tetris, \u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043f\u0430\u0434\u0435\u043d\u0438\u044f \u0444\u0438\u0433\u0443\u0440\u044b.<\/p>\n<p>\u0412\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0445\u044d\u0448 sha1 a99f922e9da20b2a27e4398348505d2e9d15271b.<\/p>\n<pre><code class=\"bash\">$ cargo install nes-tetris-hard-drop-patcher   # install my tool $ nes-tetris-hard-drop-patcher &lt; 'Tetris (U) [!].nes' &gt; tetris-hd.nes   # patch a NES Tetris ROM $ fceux tetris-hd.nes   # run the result in an emulator<\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442 ROM-\u0444\u0430\u0439\u043b NES Tetris. \u0412 \u043d\u0451\u043c \u043d\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u0442\u0440\u0438\u0441\u0430. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b ROM \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438 NES \u2014 \u043e\u043d \u043d\u0435\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u0435\u043d \u0434\u043b\u044f fceux.<\/p>\n<h3>\u041f\u0430\u0442\u0447<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0434\u043b\u044f \u043f\u0430\u0442\u0447\u0430 ROM (IPS), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0448\u0438\u0440\u043e\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430\u043c\u0438. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043c\u043e\u0439 \u043f\u0430\u0442\u0447 <a href=\"https:\/\/gridbugs.org\/files\/reverse-engineering-nes-tetris-to-add-hard-drop\/tetris-hard-drop.ips\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h3>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b<\/h3>\n<p>\u041f\u0430\u0440\u0443 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434 \u044f \u0441\u0434\u0435\u043b\u0430\u043b <a href=\"https:\/\/github.com\/stevebob\/mos6502\">\u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 NES<\/a>. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0440\u0435\u0432\u0435\u0440\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 \u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e, \u043f\u0435\u0440\u0435\u043c\u0435\u0436\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0435\u043e\u043f\u0430\u043c\u044f\u0442\u0438. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0433\u0438\u0444\u043a\u0438, \u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0435\u0433\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0439 \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440, \u044f \u0441\u043e\u0437\u0434\u0430\u043b <a href=\"https:\/\/crates.io\/crates\/mos6502_assembler\">\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443<\/a> \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Rust. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435 \u00ab\u0430\u043a\u043a\u0443\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430\u00bb \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 12:<\/p>\n<pre><code class=\"rust\">b.inst(Clc, ());                  \/\/ clear carry flag b.inst(Rol(Accumulator), ());     \/\/ rotate accumulator 1 bit to the left (x2) b.inst(Rol(Accumulator), ());     \/\/ rotate accumulator 1 bit to the left (x4) b.inst(Sta(ZeroPage), 0x20);      \/\/ store current accumulator value at address 0x0020 b.inst(Rol(Accumulator), ());     \/\/ rotate accumulator 1 bit to the left (x8) b.inst(Adc(ZeroPage), 0x20);      \/\/ add the accumulator with the value at 0x0020 (x12)<\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c rust \u043a\u0430\u043a \u044f\u0437\u044b\u043a \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u0434\u043b\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c NES. \u0413\u0438\u0431\u043a\u043e\u0441\u0442\u044c Rust \u0432\u0430\u0436\u043d\u0430 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 1980-\u0445 \u0433\u043e\u0434\u0430\u0445.<\/p>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f <a href=\"https:\/\/www.gridbugs.org\/nes-emulator-debugging\">\u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430<\/a> \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c NES \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 NES \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/mesen.ca\/\">Mesen<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0445\u0432\u0430\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u0433\u0430\u0442\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0442\u043b\u0430\u0434\u043a\u0438. \u041e\u043d \u0431\u044b\u043b \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0447\u0438\u043f\u0430 \u0432 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<h3>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0444\u0438\u0433\u0443\u0440\u044b<\/h3>\n<p>\u0412 NES \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u0444\u043e\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0435\u0442\u043a\u0443 \u0438\u0437 \u043f\u043b\u0438\u0442\u043e\u043a 8&#215;8 \u043f\u0438\u043a\u0441\u0435\u043b\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043f\u0440\u0430\u0439\u0442\u044b \u2014 \u044d\u0442\u043e \u043f\u043b\u0438\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0438\u0433\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u044f \u0444\u043e\u043d\u043e\u0432 \u0438 \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432, \u0438 \u0422\u0435\u0442\u0440\u0438\u0441 \u2014 \u043d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043f\u0440\u0430\u0439\u0442\u044b \u0432 \u0442\u0435\u0442\u0440\u0438\u0441\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0444\u043e\u043d\u043e\u0432\u0443\u044e \u0433\u0440\u0430\u0444\u0438\u043a\u0443 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e. \u041d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u043d\u0438\u0436\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0438, \u0441 \u0444\u043e\u043d\u043e\u043c \u0432\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441\u043f\u0440\u0430\u0439\u0442\u0430\u043c\u0438 \u0432\u043d\u0438\u0437\u0443.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0438\u0433\u0440\u0435 \u044f\u0432\u043d\u043e \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0430 \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0444\u0438\u0433\u0443\u0440\u044b, \u043f\u043e\u0445\u043e\u0436\u0435, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438, \u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0443\u0440\u043d\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438, \u0430 \u043d\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0439.<\/p>\n<p>\u0413\u043e\u0432\u043e\u0440\u044f \u043e \u043a\u043e\u043d\u0442\u0443\u0440\u043d\u044b\u0445 \u043f\u043b\u0438\u0442\u043a\u0430\u0445, \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u0438\u0433\u0440\u0443 \u043d\u043e\u0432\u0443\u044e \u043f\u043b\u0438\u0442\u043a\u0443, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0434\u043b\u044f \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b:<\/p>\n<figure class=\"float\"><figcaption><\/figcaption><\/figure>\n<p>\u041c\u043e\u044f \u0446\u0435\u043b\u044c \u0437\u0434\u0435\u0441\u044c \u2014 \u0432\u044b\u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0442\u0443 \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u044b, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0444\u0438\u0433\u0443\u0440\u044b.<\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432 \u043d\u0430 NES \u0432\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0435 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u043f\u0440\u0430\u0439\u0442\u0430 (\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043f\u043b\u0438\u0442\u043a\u0430 \u0438 \u0442. \u0434.), \u0430 \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0447\u0430\u043b\u0430 \u044d\u0442\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0430\u043c\u044f\u0442\u0438 \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <a href=\"https:\/\/wiki.nesdev.com\/w\/index.php\/PPU_registers#OAMDMA\">OAMDMA<\/a>. (\u041f\u0440\u044f\u043c\u043e\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0430\u043c\u044f\u0442\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u2014 OAM \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0440\u0430\u0439\u0442\u0430, \u0430 DMA \u2014 \u044d\u0442\u043e \u043e\u0431\u0449\u0438\u0439 \u0442\u0435\u0440\u043c\u0438\u043d \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c.) \u0417\u0430\u043f\u0438\u0441\u044c \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 OAMDMA \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435 NES \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438 \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432.<\/p>\n<p>\u0420\u0435\u0433\u0438\u0441\u0442\u0440 OAMDMA \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0426\u041f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x4014. \u041f\u043e\u0438\u0441\u043a \u0432 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442:<\/p>\n<pre><code>0xAB63  Lda(Immediate) 0x02       # load accumulator with 2 0xAB65  Sta(Absolute) 0x4014      # write accumulator to 0x4014<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 2 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 OAMDMA, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u044c \u043e\u0442 0x0200 \u0434\u043e 0x02FF \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 OAM. \u0418 \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0434\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 \u043a\u0430\u043a \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0437\u0430 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430. \u041e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 0x8A0A \u0438 \u043c\u043e\u0436\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0422\u0435\u0442\u0440\u0438\u0441.<\/p>\n<p>\u041e\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0447\u0442\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 0x0040 \u0438 0x0041, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0430 8 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0445 \u043a \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f\u043c. \u041d\u0430 NES \u043a\u0430\u0436\u0434\u0430\u044f \u043f\u043b\u0438\u0442\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 8&#215;8 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439, \u0442\u0430\u043a \u0447\u0442\u043e \u044d\u0442\u043e, \u043f\u043e-\u0432\u0438\u0434\u0438\u043c\u043e\u043c\u0443, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0438\u0437 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u043b\u0438\u0442\u043a\u0438 \u0432 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 \u043f\u0438\u043a\u0441\u0435\u043b\u0430, \u0433\u0434\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u0438\u043a\u0441\u0435\u043b\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0433\u043b\u0430 \u0434\u043e\u0441\u043a\u0438. \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0443\u0442 \u043a\u043e\u043f\u0430\u043d\u0438\u044f \u0432 \u043c\u0435\u0437\u0435\u043d\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044e\u0442 \u044d\u0442\u043e: 0x40 \u2014 \u044d\u0442\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 x, \u0430 0x41 \u2014 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 Y \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 0x42. \u042d\u0442\u043e \u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442 0 \u0434\u043e 12, \u043a\u043e\u0442\u043e\u0440\u043e\u0435, \u043f\u043e-\u0432\u0438\u0434\u0438\u043c\u043e\u043c\u0443, \u043a\u043e\u0434\u0438\u0440\u0443\u0435\u0442 \u0444\u043e\u0440\u043c\u0443 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u0451 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435. \u0414\u043b\u044f \u0444\u0438\u0433\u0443\u0440 \u0441 \u0432\u0440\u0430\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0435\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0438\u0433\u0443\u0440\u0430 \u201cS\u201d) \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u043e\u0434\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 0x42. \u042f \u0431\u0443\u0434\u0443 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u201c\u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0444\u043e\u0440\u043c\u044b\u201d.<\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430 \u0432 \u0422\u0435\u0442\u0440\u0438\u0441\u0435 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 4 \u043f\u043b\u0438\u0442\u043e\u043a, \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0441\u043f\u0440\u0430\u0439\u0442. \u041a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432 0x40 \u0438 0x41 \u2014 \u044d\u0442\u043e \u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0444\u0438\u0433\u0443\u0440\u044b, \u043d\u043e \u0434\u043b\u044f \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0441\u043f\u0440\u0430\u0439\u0442\u043e\u0432 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438. \u0421 \u044d\u0442\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0432 \u041f\u0417\u0423 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 0x8A9C, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u0431\u0443\u0434\u0443 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u00ab\u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u0444\u043e\u0440\u043c\u00bb. \u041a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 13 \u0447\u0430\u0441\u0442\u0435\u0439 (\u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f) \u0438\u043c\u0435\u0435\u0442 12-\u0431\u0430\u0439\u0442\u043e\u0432\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0444\u043e\u0440\u043c. \u0417\u0430\u043f\u0438\u0441\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0444\u043e\u0440\u043c \u0434\u043b\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0445\u0440\u0430\u043d\u0438\u0442 \u043f\u043e 3 \u0431\u0430\u0439\u0442\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 4 \u043f\u043b\u0438\u0442\u043e\u043a:<\/p>\n<ul>\n<li>\n<p>\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043b\u0438\u0442\u043a\u0438 \u043f\u043e \u043e\u0441\u0438 y (\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e 0x41);<\/p>\n<\/li>\n<li>\n<p>\u0438\u043d\u0434\u0435\u043a\u0441 \u0441\u043f\u0440\u0430\u0439\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043f\u0440\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0435 \u043f\u043b\u0438\u0442\u043a\u0438;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043f\u043b\u0438\u0442\u043a\u0438 \u043f\u043e \u043e\u0441\u0438 x (\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e 0x40).<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0438\u043d\u0434\u0435\u043a\u0441 \u0441\u043f\u0440\u0430\u0439\u0442\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0438\u0442\u043a\u0438 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0431\u0443\u0444\u0435\u0440 OAM DMA \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439. \u0427\u0442\u043e\u0431\u044b \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443, \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u043d\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u0443\u044e \u043f\u043b\u0438\u0442\u043a\u0443 \u0441 \u043a\u043e\u043d\u0442\u0443\u0440\u043e\u043c, \u0430 \u043d\u0435 \u043f\u043b\u0438\u0442\u043a\u043e\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0444\u043e\u0440\u043c, \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0444\u0438\u0433\u0443\u0440\u0443 \u0441 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c, \u0442\u0430\u043a \u0447\u0442\u043e \u0444\u0438\u0433\u0443\u0440\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0433\u0434\u0435 \u043e\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0438\u0437\u0435\u043c\u043b\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u0441\u043b\u0435 hard drop. \u0411\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430 \u043c\u0435\u0441\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u043e\u0431\u0449\u0435\u0439 \u0434\u043b\u044f \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u044f \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\/\u0432\u0441\u0442\u0430\u0432\u0438\u043b \u043a\u043e\u0434 \u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u043b \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u0441\u0442\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u2014 mesen, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043d\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u041f\u0417\u0423. \u042f \u043d\u0435 \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0434\u0435\u043b\u0430\u044e\u0442 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 0x00 \u0438 0xFF! \u0422\u0430\u043a\u0436\u0435 \u044f \u043d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0448\u0440\u0438\u0444\u0442 \u0432 mesen \u043d\u0430 <strong>Monospace<\/strong>!<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u042f \u0432\u044b\u0434\u0435\u043b\u0438\u043b 512 \u0431\u0430\u0439\u0442 \u043f\u0430\u043c\u044f\u0442\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0430\u0434\u0440\u0435\u0441\u0430 0xD6D0. \u041f\u0435\u0440\u0432\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u044d\u0442\u0443 \u043e\u0431\u043b\u0430\u0441\u0442\u044c, \u0431\u044b\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 DMA OAM:<\/p>\n<pre><code class=\"rust\">b.label(\"oam-dma-buffer-update\");  \/\/ Call original function b.inst(Jsr(Absolute), 0x8A0A); \/\/ Return b.inst(Rts, ());<\/code><\/pre>\n<p>\u041c\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u043f\u0430\u0442\u0447\u0430 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u0441\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (0x8A0A) \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 \u043d\u043e\u0432\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0417\u0430\u0442\u0435\u043c \u044f \u0432\u0437\u044f\u043b \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 DMA OAM \u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u0432\u0435\u043b \u0435\u0433\u043e \u043d\u0430 \u044f\u0437\u044b\u043a rust \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 NES.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043a\u043e\u0434:<\/p>\n<pre><code>0x8A0A  Lda(ZeroPage) 0x40 0x8A0C  Asl(Accumulator) 0x8A0D  Asl(Accumulator) 0x8A0E  Asl(Accumulator) 0x8A0F  Adc(Immediate) 0x60 0x8A11  Sta(ZeroPage) 0xAA ...<\/code><\/pre>\n<p>\u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432:<\/p>\n<pre><code class=\"rust\">b.label(\"render-ghost-piece\"); \/\/ function label so it can be called by name later  b.inst(Lda(ZeroPage), 0x40); b.inst(Asl(Accumulator), ()); b.inst(Asl(Accumulator), ()); b.inst(Asl(Accumulator), ()); b.inst(Adc(Immediate), 0x60); b.inst(Sta(ZeroPage), 0xAA); ...<\/code><\/pre>\n<p>\u042f \u0438\u0437\u043c\u0435\u043d\u0438\u043b \u0441\u0432\u043e\u044e \u043a\u043e\u043f\u0438\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 DMA OAM, \u0447\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0443\u0440\u043d\u0443\u044e \u043f\u043b\u0438\u0442\u043a\u0443 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043b\u0438\u0442\u043a\u0438, \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0439 \u0438\u0437 \u0431\u0443\u0444\u0435\u0440\u0430 \u0444\u043e\u0440\u043c\u044b. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435, \u044f \u043e\u0431\u043d\u043e\u0432\u0438\u043b oam-dma-buffer-update, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u043e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0430:<\/p>\n<pre><code class=\"rust\">b.label(\"oam-dma-buffer-update\");  \/\/ Call new function b.inst(Jsr(Absolute), \"render-ghost-piece\"); \/\/ Return b.inst(Rts, ());<\/code><\/pre>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u044f \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u043b \u043c\u043e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u0437\u0440\u0430\u0447\u043d\u0430\u044f \u0444\u0438\u0433\u0443\u0440\u0430. \u0412 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u043e\u0433\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0444\u0438\u0433\u0443\u0440\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044c\u0441\u044f \u0432\u043d\u0438\u0437 \u0434\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f, \u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439, \u0440\u0430\u0432\u043d\u043e\u0439 6.<\/p>\n<pre><code class=\"rust\">b.label(\"oam-dma-buffer-update\");  \/\/ Call original function<\/code><\/pre>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-320246","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=320246"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320246\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}