Zap! notes Filetypes .DAT data files .SAD compressed data files .SPD graphics files .TCD sound or music data? .TZD ? if the filename does not match the exe, you get a WAVE file not found error .SAD format first 4 bytes are the extracted file size?,next is a single byte header followed by 8 or more bytes of data, the header byte gets shifted left and if the 1 bit is set, it reads the next byte and subtracts 0x14 and writes it, if the 1 bit is 0 then it reads the next bit (EBP-C) then the following bit (EBP-38)it ANDs with 0F0 and SHL by 4, then OR with the first one (EBP-C), ANDs it again with 0F and adds 3 (EBP-38) [so xx yz would look back yxx bytes and copy length z+3] Files DAT folder ACT.DAT B_PART.DAT BT_BIN.SAD text and data for cards, card text is four lines up to 48 half-width characters each (actually 50, but it goes past the text box) CARD_PIC.DAT COM_1.SAD AI scripting? COM_2.SAD AI scripting? COM_TBL.SAD AI scripting? COM_TBL2.SAD AI scripting? EVENT.SAD game events and dialog LIB_PART.DAT MAP_PART.DAT MG_TBL.SAD spell card data? MON_TRE.SAD tables for the monsters in each map and what treasure they drop OP_PARTS.DAT PAC_PART.DAT SEL_ACT.DAT SOP_PART.DAT PIC folder folders for different graphic files in SPD format SOUND folder .wav files for the SFX ZAP_manual folder html manual files readme_zap.txt SOUND.TCD ZAP.exe game executable, has some messages hard coded ZAP.TZD ZAP_SAVE.DAT EVENT.SAD scripting commands MULP # MUsic Load & Play track # MUST MUsic STop VOFF/VON HOFF/HON GLM filepath Graphics Load Map GLO filepath,x,y Graphics Load ? display the image in the center, coordinates optional GLB filepath Graphics Load Background GLFU filepath Graphics Load Face Up GLFD filepath Graphics Load Face Down GCLS Graphics CLear Screen GLWD filepath,x,y Graphics Load WinDow CLWD CLear WinDow CLMU CLear Message Up CLMD CLear Message Down nameU; text dialog box at the top of the screen nameD; text dialog box at the bottom of the screen SEL MOJI_E # displays next at # size ** comment? @T end of line @Z end dialog (wait for input) Glitches (mostly caused by Windows locale) The name lines go through until they hit a U, D, or H to determine whether they should display on the top or bottom, or during an H scene. This is what causes the error with Chiffon's nametag, because the Kernal32.IsDBCSLeadByte is not properly flagging the 2byte ShiftJIS characters, so each byte is checked individually and the second byte of one of the characters is the ASCII code for H. For this character, translating the text to english will circumvent the issue, but there is another character whose name starts with "H", Hashimoto-kun, who will then have the same problem. The two options there will be to rename the character so a capital H is not used, or change the character used to denote the command in the script. I didn't see any characters starting with D or U, so changing the H to X would do it, but would then break compatibility with the original event file. Kernal32.GetACP returns 4E4 instead of 3A4, causing display glitches where numbers need dynamically replaced. Replace 55AAD "81 3d 04 e9 48 00 a4 03 00 00" with "81 3d 04 e9 48 00 e4 04 00 00" to have it check for the Latin ANSI Page Code instead of Shift-JIS. ASM commands at 4181F, 4182B, 50CB8, and 50CC4 have hardcoded the position to print the slot number for the Load/Save data dialog. These two commands need different parameters to move the fullwidth number to the correct slot, changing "E2" and "E3" to FF-the distance from the end of the text box. (F4 and F5 are the values I currently use) There appears to be a glitch when damaging multiple mosters at once, where it removes the wrong monster or leaves some behind with 0 health. Not sure what causes that. Notable memory locations 004810a0 - some values that are checked for ? 0047caa0 - index table for ? 0048d7c0 - pointer? 0048d7bc - heap address? 00481108 - ? 0047e7f0 - index of 24 8-byte values?, first 4 are pointers, last 4 are single bit flag, if the flag is set, the pointer is set to 00481108 incrementing by 18 each time 00486460 - When card text or list is displayed, text is copied here.{2-byte display flag, 2-byte Xpos, 2-byte Ypos, string of text until 00 is hit(up to 0x46 bytes), special font modifiers?(0x40 bytes), 2bytes background color?} 004803b8 - 0004? 004803bc - if 20, jmp0043e18d 00485040 - 0047e050 - F42EE580 00471a18 - card type text 00486040 - 256 color palette, table of values xx xx xx 00 00486440 - pointer to image data? 0046e0a8 - pointers to filenames for talking graphics 0046e0c8 - table of 2-byte values 00480fb0 - value 00 to 0c, index for switch table at 45502c 0047f628 - data in blocks of b4 bytes 0048e904 - has to be A4 03 for certain things to display properly subroutines 0043e3a0 - clear display flag for line of text, preceded by a push of the line index 0043c020 - ? 0043e1a0 - print line of text 0043e0a0 - get text line and write to memory 0043e3a0 - 00432f90 - get card help text? 0043b670 - open .DAT file, arg1=?, arg2=filename 0043f300 - error loading file? 0043f650 - 004358d0 - get keyboard input 00452900 - ???, push 47e050 XOR EBP, write to heap PIC\CARD_LIB\CP1.SPD and a bunch of values, if 480fb0 < 0c then continue, jump to address at 45502c + 4*[480fb0] 0043d950 - set palette, if 0 was pushed before then set all to FFFFFF 0043d140 - copy a bunch of "00000000" (2EE00 times) to the address stored in 486440, plus 1 to 4 bytes of 00 (clear image?) 0044fd20 - 00401000 - 004551b0 - 00455640 - 00455aad - 00455440 - 00435c00 - 0043e3a0 - 0043c020 - 0043b670 - 0043bdb0 - 00436070 - 0043c630 - 0043c700 - 00451990 - 0043e050 - 0043cd60 - 00403390 - 00403300 - push ECX, read bytes 10x from 47f628, every b4 bytes, and if it is 01 then subtract 1 from the b0th byte, if that !=? 0 then push the index, call 004036a0 004036a0 - ? 0045575c - if [47e050] != ECX, then jump to 0045572b 0043f870 - 0043aac0 - load .spd image file? 0043da40 - load a bunch of values into 00486040? table for decoding .dat files 0043e640 - set up game windows 0043e7a0 - set mouse cursor 0043e820 - create application window 00452900 - see above 0043f650 - check if 484acc is 0,1,or 2,... 0045c0fd - create heap? 0045c0e3 - if 4810a0 = 2 and 4810ac >(?) 5, then XOR EAX,EAX, INC EAX; else PUSH 3, POP EAX 00458903/08 - 004589f2 - gets the time, process ID, thread ID, and tick count, stores a value in 47e050 (rng seed?) 0043e910 - 0043d190 - read .dat files? each byr of the DAT points to a trio of bytes in a table stored at 486040 0043d3f0 - same as above?