Conversion of VIC-SSS-MMX to CBM prg Studio

You need an actual VIC.

Moderator: Moderators

User avatar
thegg
Vic 20 Amateur
Posts: 69
Joined: Mon Aug 30, 2021 4:49 am
Location: England
Occupation: retired

Conversion of VIC-SSS-MMX to CBM prg Studio

Post by thegg »

A while ago Mike suggested that I take a look at Robert Hurst's Software Sprite Stack (VIC-SSS-MMX). I finally found some time to take a closer look and convert the API and the demo configured in GitHub to a set of files that will compile in CBM prg Studio. The demo runs pretty much as it does when assembled using ca65.
I have added a extra Demo8 section to the program to show how the API currently copes with multicolour sprites. I'm still exploring how flexible the API is, but I thought I would share what I have done so far for other forum users of CBM prg Studio and general interest.

Regards
Dave
sss.zip
(461.91 KiB) Downloaded 63 times
User avatar
MrSterlingBS
Vic 20 Enthusiast
Posts: 174
Joined: Tue Jan 31, 2023 2:56 am
Location: Germany,Braunschweig

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by MrSterlingBS »

Good Morning Dave,

thank you very much to convert the VIC-SSS-MMX to CBM prg Studio.

But, the program does not work on my emulator.
I get 54 errors when i started the Basic file.

Do you have any tipps?

Best regards
Sven
User avatar
beamrider
Vic 20 Scientist
Posts: 1452
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by beamrider »

The API as it stands doesn't really support multi-color sprites per se, they unexpectedly disappear behind background graphics because of the simple XOR. See the original 2013 Pooyan.

I made some changes for Pooyan 2015.

http://sleepingelephant.com/ipw-web/bul ... 327#p80327

Also made some changes for Popeye to support 3x2 sprites and priorities and speed improvements for the hybrid XOR using lookup tables. If anyone's interested I'll see if I can dig them out at some point.
User avatar
thegg
Vic 20 Amateur
Posts: 69
Joined: Mon Aug 30, 2021 4:49 am
Location: England
Occupation: retired

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by thegg »

Sven:
Sorry to here you are having problems with my conversion. You say you get errors when loading the basic file. The program to load is sss.prg. The other files (including basic.asm) are the source files used in CBM prg Studio to create the program. Try loading sss.prg. If I have misunderstood your post, please let me know what emulator you are using and what steps you are using to load the program.

There is however an issue with my post. I assumed that the character mapping changes are held in the CBM prg Studio project file I supplied as part of the archive. Unfortunately, the custom mapping is held as part of the CBM prg Studio configuration. To build my conversion properly, it is necessary to enter the charmap codes in VIC-SSS-MMXH.asm into the custom character map tool in Tools/Options/Assembler. Otherwise all the text in the demo will be displayed in graphics characters.
User avatar
thegg
Vic 20 Amateur
Posts: 69
Joined: Mon Aug 30, 2021 4:49 am
Location: England
Occupation: retired

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by thegg »

beamrider:
Thanks for the link, I've copied your code snippet to merge with my code. I'm interested in any further developments, when you have time.
User avatar
MrSterlingBS
Vic 20 Enthusiast
Posts: 174
Joined: Tue Jan 31, 2023 2:56 am
Location: Germany,Braunschweig

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by MrSterlingBS »

The sss.prg file runs perferct in the VICE 3.7 emulator if i drag and drop the file there. No problems.
But, if i load the sss.cbmprj in the CBM Studio 3.14.0 it do not work.

The erros are "Invalid operand, label or variable ...

Maybe an error of the included files.

Because i have setup the CBM Studio to the same folder.

BR
Sven
User avatar
beamrider
Vic 20 Scientist
Posts: 1452
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by beamrider »

SSSMods.zip
(16.65 KiB) Downloaded 68 times
Here are my mods from Popeye: a few LUTs in the inner most loops for speed improvements and multi-color support (introduction of sssSPRITEDDEF2 for increased height 3x2).

You may need to add conditionals for non MC use as I wasn't interested in that.
User avatar
thegg
Vic 20 Amateur
Posts: 69
Joined: Mon Aug 30, 2021 4:49 am
Location: England
Occupation: retired

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by thegg »

MrSterlingBS wrote: Thu Mar 16, 2023 6:44 am But, if i load the sss.cbmprj in the CBM Studio 3.14.0 it do not work.

The erros are "Invalid operand, label or variable ...
Strange. As I say in the Readme file in the archive, the project was developed using CBM prg Studio Version 4.0.1. I don't think there are any differences in the Assembler between the two versions, but maybe there are. Can you possibly post me an example of the error, including the source file and the line number. In the meantime, I will see if I can find a copy of version 3.14.0 in my archive.

beamrider:
Many thanks.

Regards
Dave
User avatar
MrSterlingBS
Vic 20 Enthusiast
Posts: 174
Joined: Tue Jan 31, 2023 2:56 am
Location: Germany,Braunschweig

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by MrSterlingBS »

Hi Dave,

thank you for your answer. I found my error. (just press the generate project and launch button :lol: and not press the generate and launch current file button)
It works with Studio 3.14.0 and also with Studio 4.0.1.

But the Demo runs with an text error. I use the VICE 3.7 emulator with PAL and 16k+ memory.
DEMO.jpg

Best regards
Sven
User avatar
thegg
Vic 20 Amateur
Posts: 69
Joined: Mon Aug 30, 2021 4:49 am
Location: England
Occupation: retired

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by thegg »

Glad you sorted your problem.

I did address text issue in my post above:
thegg wrote: Thu Mar 16, 2023 4:36 am There is however an issue with my post. I assumed that the character mapping changes are held in the CBM prg Studio project file I supplied as part of the archive. Unfortunately, the custom mapping is held as part of the CBM prg Studio configuration. To build my conversion properly, it is necessary to enter the charmap codes in VIC-SSS-MMXH.asm into the custom character map tool in Tools/Options/Assembler. Otherwise all the text in the demo will be displayed in graphics characters.
To give a little more detail. The SSS library displays text using the reversed character set. In order to minimise the changes to the original ca65 assembler source, I needed some way of forcing the CBMpS Assembler to generate the reverse characters codes for source code character strings ("TEXT" or 'TEXT' ) in the generated program code. I tried using the charmap directive, which would be similar to the .charmap directive, but charmap only works on the custom mapping defined by the character map tool in Tools/Options/Assembler. So I set up set up the custom mapping in my installation of CBMpS. My mistake was in assuming the custom mapping would be held in the CBMpS Project file, but it wasn't. Therefore, to get the correct text display, you need to set up a custom mapping in your installation. You need to enter the commented out charmap codes in VIC-SSSMMXH.asm into the custom mapping (by pressing Configure) and tick the checkbox to make the Assembler use the mapping. Please note that the custom characters will remain in your system and will replace the normal characters any time the 'Use custom character map' checkbox is ticked.
User avatar
MrSterlingBS
Vic 20 Enthusiast
Posts: 174
Joined: Tue Jan 31, 2023 2:56 am
Location: Germany,Braunschweig

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by MrSterlingBS »

Sorry, i do not read carefully...
User avatar
MrSterlingBS
Vic 20 Enthusiast
Posts: 174
Joined: Tue Jan 31, 2023 2:56 am
Location: Germany,Braunschweig

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by MrSterlingBS »

And Dave, thank you very much vor your work.

Do you have a test how much SoftSprites the VIC can handle?
User avatar
thegg
Vic 20 Amateur
Posts: 69
Joined: Mon Aug 30, 2021 4:49 am
Location: England
Occupation: retired

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by thegg »

According to the VSS-SSS-MMX document (included in my archive and well worth a read), the maximum is 64. The document goes on to suggest a practical limit of 16 discrete sprites. However, there is a 'repeat sprite' facility which allows multiple sprites with the same shape and animation. These copies can all have different positions and colours. Thus, the 16 number can be extended.

I'm still investigating the SSS at the moment and am looking at including beamrider's extension for multicolour sprites. Given the extra processing required for overlaying multicolour sprites, I would expect the capacity to be reduced. But we will see.

Hope you find the conversion useful.
Dave
User avatar
beamrider
Vic 20 Scientist
Posts: 1452
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by beamrider »

For ballpark you'll get about 6 2x2 sprites chugging along nicely. I don't think multi-color slows it down much.

You'll notice most that the sprites tend to slow down when they transit non-empty background graphics.

If you can do stuff without them as well it helps, for instance in Pooyan, the chair/rope moving up and down does not use the sprites.
User avatar
MrSterlingBS
Vic 20 Enthusiast
Posts: 174
Joined: Tue Jan 31, 2023 2:56 am
Location: Germany,Braunschweig

Re: Conversion of VIC-SSS-MMX to CBM prg Studio

Post by MrSterlingBS »

Hello,

there is a little graphic error at the bottom of the screen.
If the heart sprite is a few pixels above the "PRESS ANY KEY" text the heart has a double pixel line.

Do you know the error?
Post Reply