Export RLE from akusprite editor

Post programming questions related to the CPC Here!
Post Reply
vasper
Posts: 3
Joined: Tue Sep 20, 2022 12:13 pm

Export RLE from akusprite editor

Post by vasper » Wed Sep 21, 2022 7:26 am

Just a quick question, if you have any tips what to look for. I am using your akusprite editor and export to rle asm an image (mode 0), but when I show it, the colours are not correct. I use only 3 colours of the available 16 on the sprite, but I get several when the decompression is done on the screen.


This is the data from the output:

Code: Select all

SpriteBull_Start:
      db 0xF,0x3C,0xF1,0x3,0xF1,0xF,0x14,0xF1,0x2,0xF2,0xF,0x13,0xF1,0x2,0xF3,0xF
      db 0x11,0xF3,0x1,0xF3,0xF,0x10,0xF3,0x2,0xF3,0xF,0x10,0xF8,0xF,0x10,0xF1,0x4
      db 0xF3,0xF,0x11,0xF2,0x3,0xF3,0xF,0xF,0x10,0x33,0xF3,0x2,0xF3,0xF,0xD,0xC3
      db 0xF9,0xC1,0xF,0x4,0xC9,0xF1,0x10,0xFC,0x1,0xF5,0x10,0xCC,0xC1,0xF,0x3,0xC7
      db 0xF7,0x1,0xF4,0x10,0xCC,0xC1,0xF,0x1,0xC3,0xFE,0x2,0xF4,0xC2,0xD,0xC3,0xFF
      db 0x8,0xC2,0x9,0xC3,0xFF,0xC,0xC2,0x7,0xFF,0x12,0x7,0xFF,0x12,0x6,0xFF,0x13
      db 0x6,0xFF,0x10,0xC2,0xF1,0x5,0xFF,0xA,0xC1,0xF4,0xC3,0x7,0xFF,0xA,0xC1,0xF4
      db 0xC1,0x9,0xFF,0xA,0xC2,0xF3,0xC1,0x8,0xC1,0xFF,0xB,0xC1,0x10,0xCC,0xC2,0x7
      db 0xC2,0xFF,0xB,0xC2,0x1,0xF1,0x8,0xC2,0xFF,0xE,0x8,0xC2,0x1,0xFF,0xE,0x7
      db 0xC2,0x2,0xFF,0xF,0x6,0xC1,0x3,0xFF,0xF,0x5,0xC2,0x3,0xFC,0xC1,0x10,0xF3
      db 0xFF,0x1,0x4,0xC3,0x2,0xFA,0xC6,0xFF,0x0,0x5,0xC2,0x3,0xF7,0xC8,0xFF,0x1
      db 0x9,0xF7,0xCA,0xF6,0xC1,0x20,0xF3,0xF3,0xF3,0xB,0xF6,0x4,0xC5,0xF1,0x10,0xFC
      db 0xC9,0xF3,0xB,0xF8,0x2,0xCD,0x4,0xF2,0xC,0xF2,0x1,0xF4,0x3,0xCC,0x10,0xC0
      db 0x1,0xF3,0xE,0xF4,0xC3,0x3,0xC9,0x1,0xC2,0xF4,0xF,0x3,0xC4,0x4,0xC6,0x2
      db 0xC2,0xF3,0xF,0x14,0xC2,0xF2,0xF,0xFF,0x5E
SpriteBull_End:
Thank you for your work. I am now starting to learn z80 assembly for the CPC and I find your lessons and tools very helpful.
Attachments
wrong output
wrong output
bullCPC.JPG (10.04 KiB) Viewed 1717 times
correct image
correct image
bull.JPG (2 KiB) Viewed 1717 times

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Export RLE from akusprite editor

Post by akuyou » Sat Sep 24, 2022 1:22 am

I don't really ever use 16 color mode so it's not had much testing.

If you provide the example source program, and the Akusprite file your trying to export, I can look and see what the problem is.
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

vasper
Posts: 3
Joined: Tue Sep 20, 2022 12:13 pm

Re: Export RLE from akusprite editor

Post by vasper » Sun Oct 23, 2022 3:12 pm

Hi, I import in AkuSprite the attached png, I go to Z80 -> Amstrad CPC -> File -> RLE Asm

The code is here:
https://github.com/vaspervnp/projectKaptara
You can use this link to run it online and view the code:
http://8bitworkshop.com/redir.html?plat ... e=main.asm

Just press "S" to skip to where the rle is showing on screen
Attachments
bull.png
bull.png (768 Bytes) Viewed 1647 times

User avatar
akuyou
Posts: 563
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Export RLE from akusprite editor

Post by akuyou » Tue Oct 25, 2022 7:58 am

Sorry, but I don't think that RLE encoder is going to work for you, it was coded for ChibiAkumas, and designed to work at the pixel pair level in Mode 1 (for dithered images).

It simply doesn't understand Mode 0, either from the point of view of encoding an image, or actually producing efficient results, as it's treating the mode 0 bytes as if they are mode 1.

I think you'll be better using the simpler RLE encoder I cover here, which works at the byte level, so doesn't care about screen mode - I think you'll have more luck with it, and as it's simpler, it's what I favor for my coding these days.

https://www.chibiakumas.com/z80/multipl ... #LessonM11
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

vasper
Posts: 3
Joined: Tue Sep 20, 2022 12:13 pm

Re: Export RLE from akusprite editor

Post by vasper » Thu Oct 27, 2022 2:24 pm

Thanks Keith,
I will take a look at it and write here when I have it working

Post Reply

Return to “Amstrad CPC Assembly Programming”