Jewel Bem Hunter Lime 1-12 Each episode uses a different version of SGS.COM LIME.01 SGS 386 v1.00 LIME.02 SGS 386 v1.01 LIME.03 SGS 386 v1.10 LIME.04 SGS 386 v1.21 LIME.05 SGS 386 v1.40 LIME.06 SGS 386 v2.10 LIME.07 SGS 386 v2.13 LIME.08 SGS 386 v2.20 LIME.09 SGS 386 v2.30 LIME.10 SGS 386 v2.50 LIME.11 SGS 386 v2.51 LIME.12 SGS 386 v3.00 Exciting Milk MILK1 & 2 SUPER GAME SYSTEM 386 v3.50 MILK SIL format: STARTUP.SIL copied to memory address 0bcf:6000. address table starts at 0bcf:0399. opcodes 5, 12, 13, 15, 17, 23, 24, 43, 44, 4d, 82, & 8c are jumps Size limit of 0x4000 bytes. 0450 00 ** menu block 06bb 01 xx yy aa bb set menu parameters; write 4 bytes to [2c49] 06c4 02 ** 00 text block 0895 03 xx yy aa bb set dialog box parameters, set [2c4d] and [2c51] to yyxx, [2c4f] to bbaa, calculates value to [2c5f] 08c3 04 xx yy set text display speed (skippable), [2c56] to yyxx 08d2 05 xx yy sets SI to 6000+yyxx 08d9 06 ** 00 writes filename ** to [2c63] and loads the **.SIL file 0902 07 xx ** 00 writes filename ** to [2c7f] and loads the **.SZH file into slot xx 0b0f 08 xx draw image loaded in slot xx 1053 09 xx yy scene transition 1165 0A xx set [3018] to xx 123a 0B set [3024] and [3026] to 00 !new! 116a 0C xx yy zzzz ww (aa bb cc dd)*ww 127a 0D xx yy copy yyxx to [2fce] 1310 0E stop music, If [3019] != FF, 0205 > INT 60. 127f 0F ** 00 writes filename ** to [1930] and loads the **.M file 1301 10 play music, If [3019] != FF, 0100 > INT 60. 131f 11 xx play sfx, If [3019] != FF, 0Cxx > INT 60. 13ec 12 xx yy aa bb compare yy to address 2daf+xx, if == set SI to 6000+bbaa? 13ff 13 xx yy aa bb compare yy to address 2daf+xx, if != set SI to 6000+bbaa 1497 14 xx copies the value at 2daf+xx to [2faf] 14a6 15 xx aa bb compare xx to [2faf], if != set SI to 6000+bbaa 14b2 16 xx yy writes the value yy to address 2daf+xx (16 08 00 would write 00 to 2db7) 14cc 17 xx yy sets the pointer at [300a] for skipping the intro 14e6 18 text box pause, waiting on input 15a7 19 xx yy wait timer? 1c55 1A ??? 15b3 1B xx ** 00 load error message, xx=00:load to [2cbf],xx=01:load to [2d0f],else load to[2d5f] 15cc 1C xx yy copy yyxx to [2c45] (location to draw image) 15d7 1D xx yy copy yyxx to [3028] 15dc 1E xxxx yy zzzz clear image (draw black box, position x, width 8y, height z) 1696 1F xx yy aaaa bbbb ??? displays and scrolls image !new! 1a45 20 ** 00 load game, copy GYNA2_0/1/2 files to [1910] (save files) 1ab5 21 ** 00 save game to ** file 14bf 22 xx yy ORs the value yy with address 1a40+xx 1b29 23 xx yy gosub? copy SI to the address stored at [3c90] and then set SI to 6000+yyxx !new! 1b3b 24 return from sub !new! 1b47 25 clear menu box 1b63 26 xx ** 00 load nametag to slot xx 08c8 27 xx yy Set text display speed (minimum), [2c58] to yyxx 1b74 28 xx ??? set [3023] to xx !new! 15ae 29 xx ??? set [2fcc] to xx, checked during SCR/ANM display and Wait Timer, 01 during intro and 00 after 0bee 2A xx yy zzzz advance animation frame 11fe 2B xx yy zz initialize palette, sets [3024] to 00, [3bb0] to xx00 yy00 zz00, copy forward 2d times 0ca7 2C xx yy ** 00 play ANM? load palette from [3030] to [3bb0], extract ** to [400e] (copy first byte, take next byte*1046\0682 and copy AX) !new! 0d16 2D move 00 to [1b95] 122f 2E ??? set [3024] to 00, set [3026] to ff 1517 2F display wait prompt, move ff to [18ec] 151d 30 clear wait prompt 164b 31 ...6bytes ??? draws frame between flashback images 1245 32 ??? sets [3024] and [3025] to 00 !new! 1333 33 xx yy ** 00 ??? load .PM4? 137e 34 1568 35 xxxx ??? set [2fca] to xxxx*3e8\682 1578 36 ??? 138a 37 xxxx 13a1 38 xx 0d1c 39 wait while [301e] = ff? 13ae 3a xx yy aaaa bbbb ??? 13db 3b 1b79 3c 0979 3d 1bef 3e xx ??? wait for input, move [2fac] to [2daf+xx], 1ba5 3f 1480 40 xx yy copy value from [2daf+yy] to [2daf+xx] 1bc4 41 set [3013] to ff, set [3014] to ff and wait 1bd6 42 set [3013] to 00 1412 43 xx yy aa bb compare yy to address 2daf+xx, if > set SI to 6000+bbaa 1425 44 xx yy aa bb compare yy to address 2daf+xx, if < set SI to 6000+bbaa 1438 45 xx yy ??? 144b 46 xx increment [2daf+xx] 1475 47 ??? clear 78 bytes at [2dbf] 125c 48 xx yy ??? 12f3 49 ??? test[3019],int60? 132e 4a xx set [301b] to xx 15d1 4b 14e0 4c set [300c] to 00 1c49 4d xxxx if [3022]==ff, set SI to 6000+xxxx 08cd 4e xx ??? set [2c55] to xx 1505 4f ??? wait for input 0bd5 50 xx yy zzzz ??? replace yy with [2daf+yy], set[301c] to xx,... 1455 51 xx decrement [2daf+xx] 145f 52 xx yy add yy to [2daf+xx] 146a 53 xx yy subtract yy from [2daf+xx] 1bdc 54 xx ??? set [3015] and [3016] to xx 1be4 55 ??? [3017] XOR 01, out a6 1a7d 56 ** 00 load LIME.SAV 1aef 57 ** 00 save LIME.SAV 0f99 58 xx ??? 1250 59 set [3026] to ff 1256 5a set [3026] to 00 ver. 1.10+ 1F xx yy zz aaaa (bbbb cccc) dddd ??? displays and scrolls image, if xx=0, don't read bbbb and cccc !new! 130d 5b 05db 5c 174d 5d xxxx yy zzzz aa 177c 5e 1795 5f set [31ee] to 00 ver. 1.21+ 26 xx **(ff yyyy zzzz) 00 0f01 5f xxxx yyyy zzzz aaaa bbbb cccc dddd 0e8e 60 ??? 0eab 61 0ecf 62 xxxx yyyy zzzz aaaa ver, 1.40+ 10ff 63 xx yy zz aa bb cc 1186 64 xx 275f 65 xxxx 11ac 66 ??? test [39ca] and wait 1379 67 xx yyyy zzzz aaaa bbbb cccc dddd eeee 0f97 68 set [39b3],[39db],[39ca],[39cb] to 00 0fa8 69 set [39b3] and [39db] to 80 12d4 6a xx 20e6 6b ver. 2.10+ 2843 6c xx set [3d14] to xx 2848 6d xx set [3d15] to xx 284d 6e xx set [3d16] to xx 2857 6f xx ??? 2886 70 xx ??? test[3d31],03xx int60 2852 71 xx set [3d17] to xx 0bb9 72 ** 00 copy SI to [5160], read until 00 0bc3 73 ??? display text pointer loaded by 72 with mouth flaps? 23ec 74 xxxx ??? red flash? ver. 2.13+ 2919 75 xxxx ??? 10e2 76 xx set [3de5] to xx ver. 2.20+ 21fb 77 xx ??? 2225 78 ??? 0670 79 **(0x40bytes) set filepath? ver. 2.30+ 3421 7a xxxx ??? set [5d6c] to address 8000+xxxx, jump on right-click/ESC 138b 7b xx ??? 3473 7c xx ??? ver. 2.50+ 3320 7d xx set [4afb] to xx 15d1 7e 15d8 7f 310d 80 xxxx ??? 24d1 81 xx yy set [4ad6] to xx and [4ad7] to yy 3a3a 82 xxxx if xxxx!=0000, set SI to 8000+xxxx ver. 2.51+ 1d35 83 xx ??? ver. 3.00 2d69 84 3111 85 xxxx yy (zz **)? for yy items, skip zz*4 bytes 3ae8 86 xx 3b05 87 xxxx yyyy zzzz aaaa 3b29 88 xxxx yyyy zzzz aaaa bbbb cccc dddd eeee ffff 3c55 89 xxxx yyyy 3c6e 8a xxxx yyyy zzzz 3cde 8b xx yy zz aa ver. 3.50 MILK 3ae6 8c xx yyyy if [5b1e]==xx, jump to 9800+yyyy 390d 8d xx 3c0d 8e ** 00 copies 4 bytes at a time to [663b] 2c35 8f xxxx yyyy zzzz aaaa bbbb 123a 90 xx ** 00 3b08 91 xx yy 10eb 92 xx 50e2 93 5121 94 512e 95 5175 96 xx yyyy zzzz aaaa bbbb 3858 97 xx yyyy 5302 98 xxxx yyyy zz 3586 99 xx yy zz aa bb cc 0ac8 9a xx set text mode. 00 uses the TEXT VRAM functions, 01 uses graphical text 174b 9b xx yy zz aaaa bb 12fa 9c xx version diffs version SIL address table/data (in RAM) different codes 1.00 CS:0399 / 6000 1.01 CS:03b1 / 1.10 CS:03b1 / 1F, 5b-5f are new 1.21 CS:03d4 / 26, 60-62 are new 1.40 CS:056c / 63-6b are new 2.10 CS:057b / 8000 6c-74 are new 2.13 CS:057b / 8000 75-76 are new 2.20 CS:057b / 8000 77-79 are new 2.30 CS:0581 / 8000 7a-7c are new 2.50 CS:05d4 / 8000 7d-82 are new 2.51 CS:05d4 / 8000 83 is new 3.00 CS:0600 / 8000 84-8b are new 3.50 MILK CS:069e / 9800 8c-9c are new assembly hack for single-byte halfwidth text original: hack: //find+replace will find a third location, but that is for the text wait prompt and should remain 2c20 sub al,20 aa stosb 247f and al,7f 32c0 xor al,al ab stosw aa stosb 0c80 or al,80 86e0 xchg al,ah ab stosw ab stosw 90 nop Note: Ver. 3.50 MILK only has this code in two places, as it reuses the normal text box subroutine with the wait prompt. The solution would be to either change the wait prompt to something that displays with ASCII characters or duplicate the original routine in unused memory and reroute it to that. Solution? Try copying subroutine from 0d10 to 8d00 with minor tweaks: 558becf606af5bff90908b4606268885002026888502208b46042c20247fab0c80ab5dc20400 Then edit 3b40 from e8cdd1 to e8bd51 in order to point to it 3.50 MILK also uses command 9A to change text modes, 00 being the standard mode using TEXT VRAM, 01 using graphical text. It sets [5BAF] to store this value, sets AX to 1Bxx and calls int 18. If [5BAF] is not 00, the text subroutine at 0e10 jumps to 0e35. It uses Int 18 (AH=14) to read the character attributes/data to 669C/E and then copies that to VRAM. If this is only used in the intro, we can just set it to use mode 00 instead and ignore the rest: after inserting english text to the SIL, but before compressing to SZH, delete the 9A 01 before the text and the 9A 00 after, then between the 19 90 01 and the 09 00 01 after the text, insert 02 21 30 00. allowing pauses in the intro (ep 1) the code to skip the intro watches two values, 2fac and 300c. 300c is a flag set to ff by opcode 17 which sets the skip address. 2fac holds a value based on the last keypress, for the keys it actually checks for. The code tests that value in a couple places with a0, checking for 80 for space/left click or 20 for ESC/right click. Need to change the value in a couple of places to ignore space to skip, replacing F6 06 AC 2F A0 with F6 06 AC 2F 20 at cs:0370, 1d4a, and 1d71.