GeorgRottensteiner / C64Studio

C64Studio is a .NET based IDE specializing in game development for the C64 in assembler and BASIC
Other
243 stars 36 forks source link

!media pseudo opcode won't export sprite data of SpritePad C64 Pro V3.52 sprite project file (.spd) #118

Closed hkramer70 closed 1 month ago

hkramer70 commented 1 month ago

Studio V7.8

I'm trying to export sprites from a SpritePad spd file directly into the assembly file with the !media pseudo opcode. But I'm not able to "see" those sprites.

In my SpritePad Pro project I have defined two sprites. In the assembly code I'm trying to export them with the following code:

`sprNum !byte spriteBank/64, (spriteBank/64)+1

*=$2000 charset !source "charset03.asm"

*=$3800 levelData !source "level03.asm"

!align 63, 0 spriteBank !media "Sprites.spd", sprite `

I also tried out the "sprite" command with index/count and the "spritedata" command with index/count/offset/bytes. But none of them works. Even if I set the "count" to 2 (because the project contains 2 sprites), the assembler won't assemble my source code and shows an error message: "Invalid sprite count 2".

Do I use that !media opcode wrongly?

GeorgRottensteiner commented 1 month ago

That's exactly how it's supposed to be used.

How big is your level data? Could it be that the sprites are put into the next VIC bank? (>= $4000) Remember the VIC can only use chars, screen and sprites inside on 16kB block.

hkramer70 commented 1 month ago

No, I am lower than $4000.

I rearranged that DATA block to make sure that I didn't go behind the scenes... (see screenshot). In the screenshot you can see, that the amount of bytes of the sprite project (!media) is set to only 64 bytes (see the assembler output left to the line #106).

You can see the sprites in the Spritepad project in the second screenshot. There are 3 and the first is a multicolor sprite.

The third screenshot shows the 3*64 bytes (as sprites) that is in RAM when it runs (the fourth picture shows the memory in $2800).

I hope the problem sits before my monitor :).

Screenshot 2024-06-17 103448

Screenshot 2024-06-17 103754

Screenshot 2024-06-17 103812

Screenshot 2024-06-17 103849

hkramer70 commented 1 month ago

As I can see on the SpritePad Editors homepage, they changed the name of it from SpritePadPro to SpritePad C64 Pro. And it seems that they changed their project file format... :(. Is it possible that you are referencing the SpritePadPro up to Version 3.20 only?

GeorgRottensteiner commented 1 month ago

The version could well be the issue. I can see the sprite data is nearly there, just shifted by a few bytes. Could you attach that .spd here? Unfortunately I didn't write down the version I've implemented this for.

Edit: I'm currently checking out various versions of the Spritepad format. Looks like I'm having issues with version 3 and probably 5. I've fixed it for version 4 so far. The documentation of the formats mostly vanished from the internet.

GeorgRottensteiner commented 1 month ago

I managed to fix the import for version 2, 3 and 4 now. New WIP version is up. I couldn't get my hands on a version 5, but it should work as I've got the documentation for its format.

Let me know if it fixes the problem with your Spritepad file.

hkramer70 commented 1 month ago

Sprites.zip

hkramer70 commented 1 month ago

Where can I find the WIP version? ... got it...

GeorgRottensteiner commented 1 month ago

Ah, sorry, WIP version is always this link: https://www.georg-rottensteiner.de/webmisc/C64StudioRelease.zip

I'm so used to having that in my signature.

From a short test it seems to work. And it's the missing version 5. Thanks!

hkramer70 commented 1 month ago

The WIP version (V7.8.8) reads the project file. At least, it shows the 192 byte for the 3 sprites of the SpritePadPro sprite file correctly. But there is still an issue with the first sprite (multicolor). But, who knows, maybe I didn't setup the MC mode on sprite #0 properly!? I will have more time at evening...

Thanks for your great support!!!

hkramer70 commented 1 month ago

YES...the problem sits in front of the monitor... I made a mistake on setting up the MC mode on sprite #0 :/

All works fine now. That issue is solved IMHO.

GeorgRottensteiner commented 1 month ago

Awesome, thanks for testing!