Post by zanto on Nov 10, 2023 6:23:45 GMT
I was checking out some compression algorithms to test in my game, so I decided to take a shot at using ZX0. I tried to use elmer's ZX0 decompressor (from here). I compressing a .pcx file using the command
But when I use the decompression routine, the VRAM starts flickering. It shows for a frame the tile graphics from the UI, and then it goes black repeatedly. It seems to be changing back and forth the first color from the bg palette, for some reason. This code isn't inside a loop, but under the main routine, which is called by the reset vector.
The problem doesn't happen if I comment out the call to __si_to_mpr3, but the screen goes black. If I also remove zx0_to_vdc, everything goes back to normal, but without the tiles. What am I doing wrong?<script src="moz-extension://87392149-6dd1-4366-8905-13a8130c0df1/js/app.js" type="text/javascript"></script>
salvador -classic -w 512 moretiles.pcx tile_compressed.pcx
But when I use the decompression routine, the VRAM starts flickering. It shows for a frame the tile graphics from the UI, and then it goes black repeatedly. It seems to be changing back and forth the first color from the bg palette, for some reason. This code isn't inside a loop, but under the main routine, which is called by the reset vector.
UI_VRAM = $1000 + $10 ; each tile in vram is takes $10 space
TILE_VRAM = UI_VRAM + UI_VRAM_SIZE
(...)
map Test_Tiles
stw #Test_Tiles, _si
stb #BANK(Test_Tiles), __si_bank
stw #TILE_VRAM, _di
jsr __si_to_mpr3
jsr zx0_to_vdc
map SPR_Hero_CHR
init_satb satb ; initialize the local copy SATB in RAM (hide all the 64 sprites)
load_sprite_16x36_VRAM SPRITE_VRAM, SPR_Hero_CHR
load_sprite_16x36_VRAM SPRITE_VRAM+#$100, SPR_Hero2_CHR
set_sprpal #0, SPR_Hero_PAL, #1
set_sprpal #1, SPR_Hero2_PAL, #1
(...)
.bank SPRITE_BANK
.org $6000
SPR_Hero_CHR: .incspr "Graphics\Sprites\combined.pcx", 0, 0, 4, 1
SPR_Hero2_CHR: .incspr "Graphics\Sprites\combined2.pcx", 0, 0, 4, 1
SPR_Hero_PAL: .incpal "Graphics\Sprites\combined.pcx",0,1
SPR_Hero2_PAL: .incpal "Graphics\Sprites\combined2.pcx",0,1
.bank TILE_BANK
.org $8000
; load ui graphics and palette
UI_Tiles: .incchr "Graphics\ui.pcx"
UI_Pal: .incpal "Graphics\ui.pcx",0,1
; load some tiles
Test_Tiles: .VRAM TILE_VRAM
.incbin "Maps\tile_compressed.pcx"
The problem doesn't happen if I comment out the call to __si_to_mpr3, but the screen goes black. If I also remove zx0_to_vdc, everything goes back to normal, but without the tiles. What am I doing wrong?<script src="moz-extension://87392149-6dd1-4366-8905-13a8130c0df1/js/app.js" type="text/javascript"></script>