honza.c Posted April 29, 2010 Share Posted April 29, 2010 HelloI'm interested to port excelent Cryo's Dune to my self built arm (cortex-m3) based embedded board (like small gaming console).Is anybody in this thread still working on rewriting DUNE?Did you progress more, than unhsq? Do you have some kind of sources?I disassembled LOGO.EXE. After I fixed source, I assembled again with Turbo Assembler from Borland.It runs under DOSBOX. Now I rewriting it to C. It will soon run under DOSBOX compiled from C source.LOGO.EXE plays LOGO.HNM file and shows many tricks how graphics are organized and encoded in files.I say all DUNE was originaly writen in assembly because sources does'nt include entry/exit codes common in higher level languages.All values and params are passed in registers, it means there is no parameter stack frame in procedures.LOGO will soon also run under WIN32 with SDL library.Sorry, if my english is not good Quote Link to comment Share on other sites More sharing options...
yannismc Posted April 30, 2010 Share Posted April 30, 2010 I've read about the project and i really want to revive the dune 1 even if that's just to reveal it's secrets!there is a lot of progress since the project started but now i see that it has stopped.the experts have managed to finally extract the sound(or i misunderstood?)http://nyerguds.arsaneus-design.com/dune/dune1and the static iconshttp://www.bigs.fr/dune_old/i personally am interested in the map recreationhttp://www.cbm.eng.br/cbm/dune/map.htm@bigs:please can you give me a clue on (map2.hsq-->map2.___)-->map2.bmp Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted April 30, 2010 Share Posted April 30, 2010 the experts have managed to finally extract the sound(or i misunderstood?)http://nyerguds.arsaneus-design.com/dune/dune1I uploaded that for this thread. Look through the posts, I'm sure you'll find the accompanying information there. Quote Link to comment Share on other sites More sharing options...
honza.c Posted April 30, 2010 Share Posted April 30, 2010 HelloDid you noticed that files dune386.hsq, duneadl.hsq, duneagd.hsq,dunemid.hsq,dunesdb.hsq,dunevga.hsq are hsq packed drivers of respective devices?Upacked files contains entry table of different length at begining and entry addresses disassembles correctly. Quote Link to comment Share on other sites More sharing options...
segra Posted May 1, 2010 Share Posted May 1, 2010 Hey guys, recently i was taking a look at the CD version with ida...yes honza you are correct , they're drivers for the various hardwareincluded is an ida 4.9 db, it has the dunevga.hsq loaded to seg002. its not complete, but its a start... most of the loading routines are figured out, as well as the menu/interface system, main loop and some associated stuff.. but there is alot of work to be done,ive been considering implementing this as an engine for scummvm, but dont really have the time to dedicate myself fully to it (ive done the file loading routines)IDA DB:http://www.mediafire.com/?yoqlwgqmkqm Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted May 1, 2010 Share Posted May 1, 2010 Oh, hello Segra :) Long time no see ;D Quote Link to comment Share on other sites More sharing options...
honza.c Posted May 1, 2010 Share Posted May 1, 2010 I used this excelent adlib techdoc before 10 years ago, than I kept printed version.I found it again on net now.adlib.txtOPL3.TXT Quote Link to comment Share on other sites More sharing options...
honza.c Posted May 1, 2010 Share Posted May 1, 2010 upload for adlib continues Quote Link to comment Share on other sites More sharing options...
honza.c Posted May 2, 2010 Share Posted May 2, 2010 Do somebody have hsqpack routine or tool (source in c or c++) or have to be written?I disasembled duneadl, duneagd and dunesdb drivers and compiled again from new asm sources. I get same image as original drivers, I'm not afraid of than will not work correctly (or I will fix it). But I want to check to be sure and replace original drivers with new one. Problem is, that drivers have to be hsq-packed before testing.Thanks Quote Link to comment Share on other sites More sharing options...
Monsieur OUXX Posted May 11, 2010 Author Share Posted May 11, 2010 Wow guys!You're doing an incredible job!I have absolutely zero time for the project... But I think nobody needs me here anymore lol.Honza: no, we don't have the compression algorithm/source. Quote Link to comment Share on other sites More sharing options...
segra Posted May 13, 2010 Share Posted May 13, 2010 Hey MrFlibble, it has been hasnt it?I miss the Dune RE days :P it was alot of fun ;)Did recently however finish up another project,http://creep.sourceforge.net/port of an old Commodore64 GameHonza, you could try setting breakpoints before the unpack routine executes and merely adjust the EIP ahead once the file your testing has been loaded (ive mapped out most of the loading/unpack routines in the IDA db posted previously ). Quote Link to comment Share on other sites More sharing options...
dvalin Posted May 14, 2010 Share Posted May 14, 2010 Hey MrFlibble, it has been hasnt it?I miss the Dune RE days :P it was alot of fun ;)If you're getting nostalgic about the Dune RE days, you might just wanna take a quick look on how I've made use of and developed your OD 2 code further.I'd like to think that you'll be happy to see that your code was made actual use of and to great benefit for others directly,rather than being left behind abandoned and unused (worst fate I can think of for my code to suffer, I'm such a sentimental when it comes to it;)! :DHave nice weekend! :) Quote Link to comment Share on other sites More sharing options...
honza.c Posted May 15, 2010 Share Posted May 15, 2010 HelloI am sorry, I don't have a lot of free time now. Actualy I am programming hsq (compression) tool, but i still not finish. I also have to figure out how drivers works. I'll be back after some time with new uploads. I don't understand IDA disassembler. I'm using my dissassembler, which is able produce asm source. If somebody also trying disaasembly executables, have to be noticed that exe files are packed with lzexe (originated from Fabrice Bellard). You can see "LZ91" signature after ececutable header, so it's recomended to uncompress exe files before with unlzexe tool. I would like to continue after I get more free time. I attached unlzexe tool adapted for visualc/win32.unlzexe.zip Quote Link to comment Share on other sites More sharing options...
rymoah Posted May 16, 2010 Share Posted May 16, 2010 Hi, it's nice to see, even after all this time, that this project is slowly going on :)If I remember correctly, bigs came up with an hsq-compressor of his own, written in C, and, testing it on the BALCON.UNP uncompressed file, it seemed to produce the original BALCON.HSQ archive.Unfortunately, there is no link on www.bigs.fr/dune_old to download it... Maybe if we contact himhe still has the source...Rymoah Quote Link to comment Share on other sites More sharing options...
honza.c Posted May 19, 2010 Share Posted May 19, 2010 I wrote and attached c source of hsq (compression/decompression) utility. Enjoy archaic compression algorithm.hsq.zip Quote Link to comment Share on other sites More sharing options...
rymoah Posted May 20, 2010 Share Posted May 20, 2010 I wrote and attached c source of hsq (compression/decompression) utility. Enjoy archaic compression algorithm.Great! :) With this compressor, we could also begin to test some modifications on the game...Rymoah Quote Link to comment Share on other sites More sharing options...
honza.c Posted May 22, 2010 Share Posted May 22, 2010 HelloI can upload binary + source of hsq compressor/decompressor adapted for dos (working under dosbox) and precompiled binary for win32, if you are interested. Unfortunately I still have no much time to make more tool testing. This command line tool is simple to use:hsq -x infile outfile ... to extract packed file datahsq infile outfile ... to compress dataIf you enable selftest you would be able to extract hsq packed game data files. If you find some bugs, please let me to know. Your old source of unhsq tool seems doesn't proceess larger files under win32, my tool have to do. Actualy I'm disassembling duneprg - main executable.Keep a good work. Quote Link to comment Share on other sites More sharing options...
rymoah Posted May 23, 2010 Share Posted May 23, 2010 If you enable selftest you would be able to extract hsq packed game data files. If you find some bugs, please let me to know. Your old source of unhsq tool seems doesn't proceess larger files under win32, my tool have to do. Actualy I'm disassembling duneprg - main executable.Keep a good work.Exactly, what do you mean by "larger" files? I remember the old unhsq seemed to unpack all the hsq files contained in the game... and even the hnm videos (they are compressed with the same routine), which,considered those stored on the CD version, are very large.Rymoah Quote Link to comment Share on other sites More sharing options...
honza.c Posted May 23, 2010 Share Posted May 23, 2010 Hello rymoahWell, clear some mistakes now would be fair.>>>>I remember the old unhsq seemed to unpack all the hsq files contained in the game... and even the hnm videosHnm (256 color, paletized) video files are not hsq packed. Its impossible to unpack them with unhsq tool.unhsq tool cannot success, because checks header (6 heading bytes). Remember unhsq code:char unpack2(byte *src, byte *dst) { byte *src2 = src, *dst2 = dst; if (((src[0] + src[1] + src[2] + src[3] + src[4] + src[5]) & 0xff) != 171) return 0;Header bytes has special meaningbyte0 + (byte1 << 8) + (byte2 << 16) forms size of unpacked data (limited up to 16MB)byte3 + (byte4 << 8) forms size of packed data (limited up to 64kB)This means sum of 6 heading bytes must result 0xab => data are hsq packed. But some blocks of internal data would be hsq packed.There is special flag in high byte of image width (or height, I don't remember) signaling to apply unhsq method on current block.If you are interested about this old video format you may look wiki pages. I disassembled logo.exe (uses logo.hnm file).Logo.hnm start with first block size followed by palete data. Unhsq must always fail.Unhsq tool has several bugs which escalate to unpredictable results, memory corruption or tool colapse.Author generaly ignnores results of functions (nothing against him).for example: size = *((short *) src) ; dst = (byte *) malloc(size); ori_dst = dst;This code results in access violation (win32) during access to allocated memory, when requested memory is not available. This doesn't occure offten.>>>> Exactly, what do you mean by larger files ?   unsigned short size = 0;   fseek(f, 3, SEEK_SET);   fread(&size, 2, 1, f);   byte *data = (byte *) malloc(size);  printf("source =%xn",data);   fseek(f, 0, SEEK_SET);   fread(data, size, 1, f);Functions fread and fwrite (win32, visual c compiler) fail allways, if you try to read/write large blocks (about 64k in size) or specialy whole file. Try it.Sorry if I'm impreccise, sorry my english is not good.I wish you succes. Quote Link to comment Share on other sites More sharing options...
honza.c Posted May 23, 2010 Share Posted May 23, 2010 Hello rymoah.Sorry, I forgot very important think.Unhsq tool allocates memory for unpacked data, after reading size of data from header. Size value storage is 2 bytes. It means unhsq is able unpack files with maximal size 65535 bytes. You also have to get message "unpacking ... done" or "unpacking ... failed" on your screen. Quote Link to comment Share on other sites More sharing options...
rymoah Posted May 23, 2010 Share Posted May 23, 2010 Hi honza.c,My bad, I remembered incorrectly how hnm videos work (it's been a while since I don't spend time on this project).In facts, we were talking about two different video formats: hnm videos like logo.hnm (whichyou managed to disassemble its player, logo.exe) are coded with HNM version 0. Videos included in the CD version of the game are instead coded with HNM version 1.As you can see in this wiki pagehttp://wiki.multimedia.cx/index.php?title=HNM_%281%29an HNM-1 video file is splitted in several chunks, and each of them begins with a 6 bytes header. If the sum of these 6 bytes is 171 (that is, 0xAB) then the chunk represents a keyframe and it is hsq-compressed.Rymoah Quote Link to comment Share on other sites More sharing options...
honza.c Posted May 23, 2010 Share Posted May 23, 2010 I Agree. Thanks.Maybe I will write new hnm player based on tricks and algos figured out from logo.exe and on docs available. If I get more time. I tested hsq compression. Works well for files about 1MB under win32. Under dosbox - imposible. Very long time no response ...If will you want to unpack large files (>64kB) with my tool hsq, you must break unhsq compatible header checking.Look for decompress function and replace line: if (isize != bitstream_p->ifsize) {with: if (isize != (bitstream_p->ifsize & 0x0000ffff)) { Quote Link to comment Share on other sites More sharing options...
rymoah Posted May 24, 2010 Share Posted May 24, 2010 Honza, you are doing a great job :)About the hnm videos, if you look back in the pages of this thread I have attached c++ source fora program to decode them, written by Vladimir "VAG" Gneushev (unfortunately it is not a player but a frame dumper)... Maybe it could be useful to you. Be aware that it is designed only for HNM-1 videos; once, in facts, I tried to run it with logo.hnm which is HNM-0 formatted, and it gave me frames with messy colors.VAG was really surprised that the program didn't crash, since it told me that version 0 and 1 of HNM codec are quite different ;DRymoah Quote Link to comment Share on other sites More sharing options...
honza.c Posted May 24, 2010 Share Posted May 24, 2010 Good, I read wiki pages.Formats are realy different. I think organization of game data is most based on "cryo" vesion 0. I will tell more after I disassembly duneprg.exe and I build new game executables from asm sources. I partialy rewriten logo.asm to logo.c, but I stoped it for a while. I'm focussed to duneprg now. Quote Link to comment Share on other sites More sharing options...
Fuchsia Tude Posted June 9, 2010 Share Posted June 9, 2010 I think you guys have spent several times longer reverse engineering this game than Cryo did building it :DNot complaining, I'd love to see your eventual results. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.