PALSPLIT Oddness

STOS-related stuff in here please
Post Reply
User avatar
mrdalliard
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 118
Joined: Tue May 01, 2012 8:29 pm
Location: UK
Contact:

PALSPLIT Oddness

Post by mrdalliard »

OK, so I've got a random couple of questions about the PALSPLIT command. I've seen code examples using this, but can't for the life of me seem to get it to work. Two things:

What I want to do is have 192 lines of the ST low-res screen use one palette, using palsplit for the remaining lines at the bottom using a different palette from a neochrome image that I've got in a memory bank (in bank 8).

Like this (I think!)

Code: Select all

100 PALSPLIT 1,START(8),192,7,2
Does this work? Nope.

Also, I'm using the musplay command to play some tunes at the same time. Not only does the palette splitting not work, but the music coming through on one of the channels seems to trigger screen glitches. I have no idea why. I don't know whether PALSPLIT uses an interrupt and doesn't like the same for the music, but it's a weird effect! (I've also tried another music-playing routing that's been posted on here and it seems to give a similar result. (I know it's the music, as not playing it doesn't cause the issue).

Any suggestions?

Thanks,

M.
--
520 STFM Owner since 1988.
mlynn1974
Atari Super Hero
Atari Super Hero
Posts: 764
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: PALSPLIT Oddness

Post by mlynn1974 »

Hi mrdalliard,

To get this working I made the following example:
1. Reserve a memory bank (9) to store 2 palettes,
2. Copy top section palette to memory bank 9 and bottom section palette to bank 9,
3. Setup palette split with 2 calls:
130 palsplit 1,S9,1,191,1
140 palsplit 1,S9+32,192,7,1
4. On cleanup you should call:
190 palsplit 0,0,0,0,0

Notes:
1. The locate command can't print at line 24 unless scroll is set to scroll off.
I can't remember why so that might not be the best way to do it. I have changed the code to use the Missing Link text command instead.
2. If palsplit causes a bus error (e.g. using scanline >200) then the interrupt service routine will still be running.
3. The program compiles and runs OK as a .PRG when using the text command but using the print command causes the program to crash.
4. I didn't try using musplay but a Mad Max tune played using "call start(10)+8" is OK.
Memory seemed to be corrupted if the tune was loaded into a memory bank lower than the 8.
5. There is slight jitter on the palette split line but it's hardly visible.

Code: Select all

10 hide : key off : mode 0 : curs off : flash off : click off : mouseoff : scroll off 
20 rem ** SETUP PALETTES
30 get palette (8)
40 reserve as data 9,256
50 S9=start(9) : S9N=S9
60 for N=0 to 15 : doke S9N,colour(N) : S9N=S9N+2 : next N
70 doke S9N,$0 : S9N=S9N+2 : for N=1 to 15 : doke S9N,$700 : S9N=S9N+2 : next N
80 rem ** COPY SCREEN
90 screen copy 8 to physic
100 T$="0123456789012345678901234567890123456789"+chr$(0)
110 text physic,0,varptr(T$),0,24
120 rem ** SETUP PALSPLIT
130 palsplit 1,S9,1,191,1
140 palsplit 1,S9+32,192,7,1
150 rem ** MAIN LOOP
160 if hardkey=57 then goto 190
170 wait vbl : goto 150
180 rem ** CLEANUP
190 palsplit 0,0,0,0,0
200 erase 9
210 mouseon : default : stop 
You do not have the required permissions to view the files attached to this post.
Still got, still working: Atari 4Mb STe, MegaST 2, 520STFM (x2), 2.5Mb STF, Atari 2600JR, Flashback 8 Gold.
Hardware: PC720B, Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).
Post Reply

Return to “STOS”