MSX-O-Mizer v1.5f VRAM Depacker problems...

By CrazyBoss

Master (209)

CrazyBoss's picture

02-05-2013, 06:34

Hello.
I have problems using this one:
; -------------------------------------------------------
; MSX-O-Mizer v1.5f datas depacker
; Improved from Metalbrain's z80 version.
; -------------------------------------------------------

I only use MSX1, and it dont work in bluemsx.

I tried to put in extra wastetime between outs. I tried the code at Memotech MTX emulator, and it works here dont know why it dont work at MSX Sad

;-------------------------------------------------------
; MSX-O-Mizer v1.5f datas depacker *VRAM version*
; Improved from Metalbrain's z80 version.
; -------------------------------------------------------
; source in hl
; dest (in vram) in de
; (interrupts better be disabled during the depacking)

; 328 bytes which must be aligned on 8 bits boundary
mom_map_bits_vram = #E000
vdp1=#98
vdp2=#99
mom_depack_vram: push de
ld iy, mom_map_bits_vram + 0xf0
ld b, 52
mom_init_bits_vram: db #fd,#7d ;ld a, iyl
and 15
jr nz, mom_node_vram
ld de, 1
mom_node_vram: rrd
ld (iy), a
ld (iy + 36), e
ld (iy + 72), d
db #FD,#2C ;inc iyl
inc a
push hl
ld hl, 0
scf
mom_set_bit_vram: adc hl, hl
dec a
jr nz, mom_set_bit_vram
add hl, de
ex de, hl
pop hl
bit 0, b
jr z, mom_wait_step_vram
inc hl
mom_wait_step_vram: djnz mom_init_bits_vram
ld a, (hl)
inc hl
db #DD, #67 ;ld ixh, a
pop de
mom_lit_copy_vram: ld a, (hl)
inc hl
call mom_write_byte_vram
mom_main_loop_vram: call mom_get_bit_vram
jr c, mom_lit_copy_vram
ld c, -17
mom_get_index_vram: call mom_get_bit_vram
inc c
jr nc, mom_get_index_vram
ld a, c
ret z
push de
call mom_get_pair_vram
push bc
jr nz, mom_out_range_vram
ld de, 0x0220
dec c
jr z, mom_go_for_it_vram
ld de, 0x0410
dec c
jr z, mom_go_for_it_vram
mom_out_range_vram: ld de, 0x0400
mom_go_for_it_vram: pop af
ex af, af'
call mom_get_bits_vram
add a, e
call mom_get_pair_vram
pop de
push hl
ld h, d
ld l, e
sbc hl, bc
ex af, af'
push af
pop bc
mom_copy_bytes_to_vram:
ld a, l
out (vdp2), a
ld a, h
nop
out (vdp2), a
inc hl
ex (sp),hl
ex (sp),hl
in a, (vdp1)
ex (sp),hl
ex (sp),hl
call mom_write_byte_vram
dec bc
ld a, b
or c
jr nz, mom_copy_bytes_to_vram
pop hl
jr mom_main_loop_vram
mom_get_pair_vram: db #FD,#6F ;ld iyl, a
ld d, (iy)
call mom_get_bits_vram
add (iy + 36)
ld c, a
ld a, b
adc (iy + 72)
ld b, a
ret
mom_get_bits_vram: ld bc, 0
mom_getting_bits_vram:
dec d
ld a, c
ret m
call mom_get_bit_vram
rl c
rl b
jr mom_getting_bits_vram
mom_get_bit_vram: db #DD,#7C ;ld a, ixh
add a
jr nz, mom_byte_done_vram
ld a, (hl)
inc hl
rla
mom_byte_done_vram: db #DD,#67 ;ld ixh, a
ret
mom_write_byte_vram:
push af
ld a, e
out (vdp2), a
ld a, d
or 0x40
out (vdp2), a
ex (sp),hl
ex (sp),hl
pop af
inc de
out (vdp1), a

ex (sp),hl
ex (sp),hl
ret
any problems with the code???????????????

Login or register to post comments

By hit9918

Prophet (2864)

hit9918's picture

02-05-2013, 12:02

I don't see VDP timing issues.
did you disable interrupts as the comment says.

it ran on MTX, a not-MSX... some things could be different outside the code:
slots, getting the file properly loaded
maybe different nametable contents on screen 2
maybe different address setup of screen 2, nametable, patterntable, colortable, "BASE" in BASIC.

By Manuel

Ascended (15600)

Manuel's picture

03-05-2013, 09:57

Try on a real MSX also to be sure.

By hap

Paragon (2020)

hap's picture

03-05-2013, 19:41

and an assembled binary for lazy people like me and Manuel Smile

By inchl

Supporter (5)

inchl's picture

11-09-2019, 11:41

I'm having problems with the pc compressor part of this routine.... During our game development our editor rendered a scene graphics that we weren't able to compress. Does anybody have a solution or bug fix?

msx-o-mizer-compress.exe -r momError.data output.data

error:
Unhandled exception: page fault on read access to 0x22222228 in 32-bit code (0x004011bf)

file momError.data is located at: https://www.fivedolphins.com/msx/momError.data.zip

By Manuel

Ascended (15600)

Manuel's picture

11-09-2019, 13:44

If there is source code, it could be fixed....