{"id":106,"date":"2019-07-15T19:39:55","date_gmt":"2019-07-15T19:39:55","guid":{"rendered":"https:\/\/blogs.scummvm.org\/pantherengine\/?p=106"},"modified":"2022-05-23T19:41:39","modified_gmt":"2022-05-23T19:41:39","slug":"week-7-2","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/pantherengine\/2019\/07\/15\/week-7-2\/","title":{"rendered":"Week 7"},"content":{"rendered":"<p>This week I have spent all time reversing dialogs bytecode format.<\/p>\n<p>I have almost reversed and implemented it.<\/p>\n<p>Let\u2019s look at opcode format.<\/p>\n<p>The opcodes in dialog format have size of 4 bytes.\u00a0<img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/blogs.scummvm.org\/pantherengine\/wp-content\/uploads\/sites\/31\/2022\/05\/carbon-3-2.png\" \/><\/p>\n<p>There are at least 10 opcodes:<\/p>\n<ul>\n<li>BREAK<\/li>\n<li>MENU<\/li>\n<li>GOTO<\/li>\n<li>MENURET<\/li>\n<li>0x05<\/li>\n<li>RETURN<\/li>\n<li>PLAY<\/li>\n<li>CIRCLE<\/li>\n<li>0x09<\/li>\n<li>0xA<\/li>\n<\/ul>\n<p>For example, PLAY opcode contains index of struct which contains speaker id, sound\u00a0 name and subtitle. The engine executes this opcode and when the sound ends the next opcode is executed.<\/p>\n<p>For now the only thing that I doesn\u2019t understand why the file with dialogs contains data which is not used. But I assume this was used to display some useful info for developers.<\/p>\n<p>Small video showing the current state of first game scene.<\/p>\n<div class=\"jetpack-video-wrapper caption-big\">\n<div style=\"width: 580px;\" class=\"wp-video\"><!--[if lt IE 9]><script>document.createElement('video');<\/script><![endif]-->\n<video class=\"wp-video-shortcode\" id=\"video-106-1\" width=\"580\" height=\"290\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/blogs.scummvm.org\/pantherengine\/wp-content\/uploads\/sites\/31\/2022\/05\/Red-Comrades-Dialogs-in-ScummVM-1A2h07mZymQ.mp4?_=1\" \/><a href=\"https:\/\/blogs.scummvm.org\/pantherengine\/wp-content\/uploads\/sites\/31\/2022\/05\/Red-Comrades-Dialogs-in-ScummVM-1A2h07mZymQ.mp4\">https:\/\/blogs.scummvm.org\/pantherengine\/wp-content\/uploads\/sites\/31\/2022\/05\/Red-Comrades-Dialogs-in-ScummVM-1A2h07mZymQ.mp4<\/a><\/video><\/div>\n<p><em>(Source: https:\/\/www.youtube.com\/watch?v=1A2h07mZymQ)<\/em><\/p>\n<\/div>\n<p>The next week I plan to implement drawing subtitles and polish dialogs, so that intro dialog in first game scene can be continued.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week I have spent all time reversing dialogs bytecode format. I have almost reversed and implemented it. Let\u2019s look at opcode format. The opcodes in dialog format have size of 4 bytes.\u00a0 There are at least 10 opcodes: BREAK MENU GOTO MENURET 0x05 RETURN PLAY CIRCLE 0x09 0xA For example, PLAY opcode contains index [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-106","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/pantherengine\/wp-json\/wp\/v2\/posts\/106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/pantherengine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/pantherengine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/pantherengine\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/pantherengine\/wp-json\/wp\/v2\/comments?post=106"}],"version-history":[{"count":1,"href":"https:\/\/blogs.scummvm.org\/pantherengine\/wp-json\/wp\/v2\/posts\/106\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/blogs.scummvm.org\/pantherengine\/wp-json\/wp\/v2\/posts\/106\/revisions\/108"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/pantherengine\/wp-json\/wp\/v2\/media?parent=106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/pantherengine\/wp-json\/wp\/v2\/categories?post=106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/pantherengine\/wp-json\/wp\/v2\/tags?post=106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}