13 June 2008, 20:04 | #1 |
Registered User
Join Date: Jun 2008
Location: Netherlands
Posts: 122
|
Imploder compression algo
I've been working on a level\image editor for Superfrog for a while now. The only thing standing in the way of making it complete is a way to compress levels using the File Imploder algorithm, with which all the Superfrog game data is compressed (both floppy and CD32 versions). It can already decompress such files, but aside from a dissasembly of the original FImp tool, I have not been able to find any code that can compress. I don't have the skills to write such a thing myself, even going from the decompression code... Has somebody come across it, can somebody do this or does anyone know of any other solution?
As a proof of concept so to speak, here is the current state of the editor; http://members.home.nl/meuwissenth/froggy_05a.zip It works, you can open levels from the CD32 version (L*M* files), select a tileset (L*BM files) and sprite graphics (L*BO) files. I've only added specials for the first three worlds so far, but other worlds and even Project-F will load with other configs and are fully editable. If you save the level, compress it with FImp and then change the first 4 bytes to "ATN!" Superfrog will be able to load the level and play it. You can move around by holding the right mouse button and moving about and select tiles from the map by holding down shift while dragging over them. Again, I hope somebody might have some leads or something into finding compression code or something, it would make the editor almost complete. Thanks. |
13 June 2008, 20:24 | #2 |
Registered User
Join Date: May 2004
Location: Somewhere secret
Age: 50
Posts: 366
|
The compression code is included in the "Beermon" monitor/debugger program, which was released with full source. Search the web, or pm me with an email addy and I'll send you a copy.
|
13 June 2008, 22:42 | #3 |
Registered User
Join Date: Jun 2008
Location: Netherlands
Posts: 122
|
I found it, but unfortunately the compression code is written in 68k assembler. Thanks though.
|
13 June 2008, 23:47 | #4 |
Registered User
Join Date: Jul 2005
Location: -
Posts: 1,698
|
Can't you just use Turbo Imploder and select the library option to compress data files?
|
14 June 2008, 00:55 | #5 |
Registered User
Join Date: May 2004
Location: Somewhere secret
Age: 50
Posts: 366
|
You could do what some other coders have done... take the really cheap way to port a packer from another architecture - emulation
I've seen some ZX Spectrum packers made into Windows cmdline versions, by simply running a z80 core + writing a tiny shell around it to start up the emulation in the correct way - surely you could do the same with starscream or some 68k core... probably no more than 20-30 lines of code. |
14 June 2008, 21:02 | #6 | |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,304
|
Quote:
I am interested in your project (since I'm a game remaker/extender myself). Post the 68k source code of the imploder packing routine and I'll try to convert it to C for you. And it would nicely fit in your editor this way |
|
14 June 2008, 23:03 | #7 | |||
Registered User
Join Date: Jun 2008
Location: Netherlands
Posts: 122
|
Quote:
Quote:
Quote:
|
|||
14 June 2008, 23:13 | #8 | |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,304
|
Quote:
|
|
15 June 2008, 00:21 | #9 |
Registered User
Join Date: Jun 2008
Location: Netherlands
Posts: 122
|
Sorry, it's getting late here See imploder.s in this archive, ftp://ftp.cs.tu-berlin.de/pub/atari/...r/imploder.lzh It's a "port" of Imploder for the Atari, but 68k code nonetheless.
|
15 June 2008, 20:43 | #10 | |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,304
|
Quote:
I guess I should write a pseudo emulation core like I did for 6502 instructions. That would allow to port other 68k only code (not games!) |
|
15 June 2008, 21:14 | #11 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,534
|
I have been trying to do transparent XFD slave decompression library support to winuae, it is already included in source archive but inactive, only missing part is very basic 68000 emulator
|
16 June 2008, 22:20 | #12 |
Registered User
Join Date: Jun 2008
Location: Netherlands
Posts: 122
|
That's a shame that it's too difficult. I didn't have much luck tinkering with the Starscream CPU core either, it is beyond me how I should get a particular piece of code to run on it. Are you planning on really making such a pseudo-emulation core?
|
18 June 2008, 21:16 | #13 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,304
|
I have started my 68k -> C translater. I think it will work on small pieces of code, with some manual rework.
Hopefully we can make a portable ATN cruncher in C without using emulation. Example of code: L000 MOVE.L D0,6(A0) LEA L245(PC),A0 MOVEQ #0,D0 LEA 10(A1),A0 LEA $10(A1,D0.W),A2 becomes in C: L000: MOVE_D_IND(D[0],6 + A[0],4); LEA(L245,A[0]); MOVEQ_IMM_D(0,D[0]); LEA(10 + A[1],A[0]); LEA(0x10 + A[1] + D[0] & 0xFFFF,A[2]); run-time symbolic 68k emulation will do the rest (hopefully) |
18 June 2008, 22:37 | #14 |
Registered User
Join Date: Jun 2008
Location: Netherlands
Posts: 122
|
That looks good! I found an attempt someone else was doing; http://www.devmaster.net/forums/showthread.php?t=5276
Sadly the link to his source doesn't work anymore, but it might be of interest. And maybe the assembler code used in Beermon to Implode files is more useful, I've uploaded it here. Imploder routine starts at line 9967. Don't know how else I can help out. Thanks though for the effort you're putting into it. |
19 June 2008, 11:12 | #15 | |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,304
|
Quote:
I have already made a simple bubble sort 68k code work with my technique. I've got to test my code on simple sources first, or bugs will be hard to find from imploder source simulation! Last edited by jotd; 20 June 2008 at 23:08. Reason: made some progress |
|
21 June 2008, 11:54 | #16 |
Registered User
Join Date: Jun 2008
Location: Netherlands
Posts: 122
|
Sounds good! Let me know if there is anything I can do to help.
|
24 June 2008, 23:39 | #17 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,304
|
I've got the "emulated" code compiling and running, but something is not right: nothing gets compressed in the end. I'm going to compare with an execution on WinUAE + AsmPro to try to find which instructions are wrongly emulated.
Sooooo close... |
25 June 2008, 10:32 | #18 |
Registered User
Join Date: Feb 2008
Location: warrington UK
Posts: 118
|
Sounds very interesting what you guys are up to. I am reverse engineering Ruff'n'Tumble with plans to hopefully write a cross platform engine and I have thought about going down the 68000->C converter route. (Saying that, I'm getting a sick enjoyment from disassembling the game which in theory wouldnt be entirely necessary if I went down the 68000->C route) In my travels around the net looking into it I found this guy who wrote a 68000->C converter for running Frontier.
http://www.tomatarium.pwp.blueyonder...lfrontier.html The source code for the converter is on the site. Might be useful? |
27 June 2008, 20:46 | #19 | |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,304
|
Quote:
On the other hand I have made some progress on my converter. It now creates ATN files, but they are corrupt. I suspect that some LSR or ROR operation is buggy. Will debug this week-end. I hope that it will work soon. |
|
28 June 2008, 20:50 | #20 |
Registered User
Join Date: Jun 2008
Location: planet earth
Posts: 1,115
|
hi,
hxxp://lclevy.free.fr/packers/ hxxp://lclevy.free.fr/packers/ulib4271_src.zip source code of unpacker.library which includes Imploder.S. maybe somewhat helpfull. regards, hit |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The Turbo Imploder | 1988 | request.Apps | 26 | 29 August 2022 22:31 |
Imploder | mai | request.Apps | 12 | 17 July 2016 20:22 |
Best Compression Methods For... | Lonewolf10 | Coders. General | 16 | 16 June 2013 17:31 |
Compression Suggestions | h0ffman | Coders. General | 2 | 31 December 2010 12:19 |
|
|