Conversion of VIC-SSS-MMX to CBM prg Studio

You need an actual VIC.

Moderator: Moderators

User avatar
MrSterlingBS
Vic 20 Afficionado
Posts: 302
Joined: Tue Jan 31, 2023 2:56 am

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

Post by MrSterlingBS »

beamrider wrote: Thu Feb 13, 2025 8:19 am
MrSterlingBS wrote: Thu Feb 13, 2025 2:18 am My biggest goal is to rewrite my very first purchased game, Fire Galaxy by KingSoft https://www.youtube.com/watch?v=XQPmRie_9gY. Preferably with soft scrolling and multicolor sprites. It's simply a childhood dream. If you are interested in the current code, I would be happy to send it to you via PM.
I don't think you will be able to use SSS if you want to have scrolling as well. That's a particularly hard nut to crack on the Vic. I'm not aware of any games other than Cheese&Onion on the Vic that combines pixel scrolling and software sprites.
Good to know, thank you. At the moment i use ony 12 chars for the softscrolling. It think the whole screen is not possible. (with my Knowledge today)
User avatar
thegg
Vic 20 Dabbler
Posts: 75
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 »

So there is a worthwhile challenge for you: integrate the SSS with a screen scroller.

As far as your current project goes, you are dealing with an API designed for others to build a program around. I would worry that extensive use of zero page in the API will deprive the program developer of a valuable resource. There is a balance between ease of use and performance that needs to be struck.

If your work is intended only for your own use, carry on and good luck to you. I look forward to seeing your childhood dream come true.
User avatar
MrSterlingBS
Vic 20 Afficionado
Posts: 302
Joined: Tue Jan 31, 2023 2:56 am

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

Post by MrSterlingBS »

Thank you. :D

A note on managing memory. It's up to everyone how they use it. With today's programming tools it only takes a few minutes to rewrite the variables in an assembler from normal to zero page memory. or am I seeing this wrong?
User avatar
thegg
Vic 20 Dabbler
Posts: 75
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 »

My immediate thought was that you were suggesting an update to the SSS to offer improved performance mainly by the greater use of the zero page. My understanding now is you are intending to use it as a customised package intended for your use only. Which is fine. As I said above good luck and enjoy your journey.
User avatar
MrSterlingBS
Vic 20 Afficionado
Posts: 302
Joined: Tue Jan 31, 2023 2:56 am

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

Post by MrSterlingBS »

Hello,

i have updated the VIC-SSS with all my knowledge. :idea:
But, there is an error in the pointer to the memory location to the charset.
I can write the normal text, but some chars are not perform correctly.
I changed PrintScont and add $40 to the loaded value if the value is <= $80.

Maybee someone can help?
vice-screen.png
vice-screen.png (3.79 KiB) Viewed 491 times

Code: Select all

;*********************************************************************
; Software Sprite Stack PRINT STRING FROM POINTER ON STACK
;
; Will print bytes, until a NULL, following the JSR call here.
; Carriage control and color codes are interpreted.
; Note that there is a limit of 256 bytes of data
;
SSSXYPRINTS 
                PLA
                STA VECTORFG
                PLA
                STA VECTORFG+1
                LDY #$01
                LDA (VECTORFG),Y
                ;PHA
		STA PHL0
                INY
                LDA (VECTORFG),Y
                TAY
                ;PLA
		LDA PHL0
                TAX
                JSR SSSPLOT
                LDY #3
                JMP DOSSSPRINTS
                
SSSPRINTS 
                PLA
                STA VECTORFG
                PLA
                STA VECTORFG+1
				
                LDY #$01
DOSSSPRINTS 
PRINTSloop      LDA (VECTORFG),Y ;limits data length to 256
                BEQ PRINTSfini
                CMP #$0D         ; carriage return
                BNE PRINTSctrl
                ;TYA
                ;PHA
		STY PHL0
                LDY CRSRROW
                INY
                LDX #0
                JSR SSSPLOT
                ;PLA
                ;TAY
		LDY PHL0
                JMP PRINTSnext
PRINTSctrl      
		CMP #$F0
                BCC PRINTScont               		; color code?
                AND #$0F                			; filter for 16-colors
                STA COLORCODE   			; 0=blk,1=wht,2=red,3=cyn,4=mag,5=grn,6=blu,7=yel
                JMP PRINTSnext
PRINTScont      
				CMP #$80
				BCS yesprint
				ADC #$40
yesprint:
		JSR SSSPRINT
PRINTSnext
		INY
                BNE PRINTSloop
                INC VECTORFG+1
                BNE PRINTSloop
                ;
PRINTSfini
		TYA
                CLC
                ADC VECTORFG
                BCC PRINTScc
                INC VECTORFG+1
PRINTScc
		STA VECTORFG
                LDA VECTORFG+1
                PHA
                LDA VECTORFG
                PHA
                RTS
                
User avatar
MrSterlingBS
Vic 20 Afficionado
Posts: 302
Joined: Tue Jan 31, 2023 2:56 am

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

Post by MrSterlingBS »

Hello,

I was able to make a few small improvements to the code. The slightly smoother execution time is due to the fact that many registers were moved to the zero page. There are also a few very minor adjustments to the code. For example, TYA/STA $0300,X can be changed to STY $30,X. Furthermore, where possible, three registers PHL0-2 were swapped to PHA/PLA or TYA/PHA, etc. Additionally, the code for reading the lookup table LSR3 was made more efficient. I hope it works in every situation.
VIC-SSS-ZP.zip
(27.79 KiB) Downloaded 12 times
BR
SVen
User avatar
beamrider
Vic 20 Scientist
Posts: 1470
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

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

Post by beamrider »

MrSterlingBS wrote: Wed Apr 23, 2025 1:12 am For example, TYA/STA $0300,X can be changed to STY $30,X
Is this a typo?
User avatar
MrSterlingBS
Vic 20 Afficionado
Posts: 302
Joined: Tue Jan 31, 2023 2:56 am

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

Post by MrSterlingBS »

No, it is no typo. I mean you can save a value with STY ZP,X with 4' but not STY MEM,X. There is no opcode available. Here you need to transfere from Y to A with TYA. Sorry for the misleading expression. This is a faster way of storing the value i think.

Code: Select all

;*********************************************************************
; Software Sprite Stack MOVE A SPRITE TO ABSOLUTE X,Y COORDINATES
;
; SSSUSE must be called prior to point to sprite register entry
; pass X,Y with the sprite coordinates
;
SSSMOVEXY 				
				; MEM $0300		ZP $30
	TXA			; 2'			2'	
	LDX sssNUM    		; 4' (3')		3'		If sssNUM is in zero page
	STA SPRITEX,X		; 5'			4'
	;TYA			; 2'			-
	;STA SPRITEY,X		; 5'			-
	STY SPRITEY,X		; 			4'		STY MEM,X is only possible for zero page
				; -----------------
				; 18' (17')		13'	
;*********************************************************************
Last edited by MrSterlingBS on Fri Apr 25, 2025 2:25 am, edited 2 times in total.
User avatar
tokra
Vic 20 Scientist
Posts: 1185
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

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

Post by tokra »

TYA/STA $0300,X can be changed to STY $30,X
$0300 != $30

or in other words

page 3 != zeropage
User avatar
beamrider
Vic 20 Scientist
Posts: 1470
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

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

Post by beamrider »

^
yes, this
Post Reply