News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_redbox

16kb ROM decompression using Exomizer

Started by redbox, 13:57, 30 May 13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

redbox

I've got a 16kb background ROM ( ;) ) and I want to decompress it into RAM (using Exomizer) and then run the program from RAM.

What's the best way to do this?

I'm planning on:
- Copy exomizer decompresser into RAM
- Decompress the program data from the paged-in ROM (&C000 upwards)
- then execute program in RAM

So, do I need to page-out the ROM once I've done this?  And how's the best way to do it?

ralferoo

Quote from: redbox on 13:57, 30 May 13
So, do I need to page-out the ROM once I've done this?  And how's the best way to do it?
I used a different decompressor, but the following is code I've used in all my rom decompressors (entry point is do_unpack):


romoff:
        ld bc,#7f8d
        out (c),c               ; mode 1, disable roms
romofflen equ $-romoff

do_unpack:
        di
        ld de,unpack-romofflen
        push de
        ld hl,romoff
        ld bc,romofflen
        ldir
        ld hl,data_start
        jr decompress_hl_to_de

redbox

Well I've got the ROM and am trying to decompress to memory using exomizer.

I copy the exomizer decompressor routine from the ROM into RAM (&a000) because it uses a buffer.  I then try to decompress the data into RAM by reading it from the ROM (it's located at around &c100) but it doesn't work.

Does exomizer not like decompressing from a paged in ROM?

SyX

Exomizer works fine from rom, maybe your problem is when you copy the  exomizer decruncher to ram (only set its work buffer in ram should be enough), the labels using absolute address will jump to a wrong address.

In that case, you need to make the code relocatable or assembly it for the new memory address (using RORG or PHASE/DEPHASE in your assembler).

redbox

Quote from: SyX on 12:18, 01 June 13
Exomizer works fine from rom, maybe your problem is when you copy the  exomizer decruncher to ram (only set its work buffer in ram should be enough), the labels using absolute address will jump to a wrong address.

That'll be it  ;)

Thanks Syx, will try this out.

Powered by SMFPacks Menu Editor Mod