Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SamCoupé palette support
#1
Some people here may know that zx-spectrum stuff can run on sam coupé machines, and these stuff can write on its palette as well.

This is based on the library i added to support ULAplus, and did the enough changes for the SamCoupé - i didn't test it yet.

There are differences - while ULAplus has 64 palette colours from 256, SamCoupé has 16 from 128, and arranged in a different way. And anyway, SamCoupé palette seems to be simpler to use, since there are no need for tricky subroutines like "ulaplusattr(ikv as ubyte,pav as ubyte)"

Besides the ULAplus version, i don't know or i have no way to get the palette values back, or test if the machine uses SamCoupé palette

I didn't test this code yet - SimCoupé seems to be a good emulator for testing it:

library/samcoupepalette.bas
Code:
dim tmpv as uinteger

sub samcoupepalette(clv as ubyte, vlv as ubyte):
  out (clv*256)bor 248,vlv:pause 1
  end sub

function samcoupehexcolour(hxcv as uinteger):
  tmpv=(hxcv band 4)/4
  tmpv=tmpv bor ((hxcv band 64)/16)
  tmpv=tmpv bor ((hxcv band 8)*2)
  tmpv=tmpv bor ((hxcv band 128)/2)
  tmpv=tmpv bor ((hxcv band 32)/4)
  hxcv=int(hxcv/256)
  tmpv=tmpv bor ((hxcv band 64)/16)
  tmpv=tmpv bor ((hxcv band 8)*2)
  return tmpv
  end function

the information on the code above is based on the reply i got from Velesoft at <!-- m --><a class="postlink" href="http://www.worldofspectrum.org/forums/showthread.php?p=583022#post583022">http://www.worldofspectrum.org/forums/s ... post583022</a><!-- m -->
Reply
#2
btw, 'samcoupeattr(ikv as ubyte,pav as ubyte)' were really missing - the updated version is below:
(it's much more simpler than from ULAplus, since it only works on 'bright', because only using those 16 colours)

library/samcoupepalette.bas
Code:
'- SamCoupé palette library for Boriel's zxbasic-compiler
'- 20111221201251 - (ↄ) Paulo Silva - http://nitrofurano.altervista.org
'- This file is released under the GPL v3 License

dim tmpv as uinteger

sub samcoupepalette(clv as ubyte, vlv as ubyte):
  out (clv*256)bor 248,vlv:pause 1
  end sub

function samcoupehexcolour(hxcv as uinteger):
  tmpv=(hxcv band 4)/4
  tmpv=tmpv bor ((hxcv band 64)/16)
  tmpv=tmpv bor ((hxcv band 8)*2)
  tmpv=tmpv bor ((hxcv band 128)/2)
  tmpv=tmpv bor ((hxcv band 32)/4)
  hxcv=int(hxcv/256)
  tmpv=tmpv bor ((hxcv band 64)/16)
  tmpv=tmpv bor ((hxcv band 8)*2)
  return tmpv
  end function

sub samcoupeattr(ikv as ubyte,pav as ubyte):
  '- usage: ink priority (from 0 to 15), and only using 3 bits lsb from paper
  ink(ikv band 7):paper(pav band 7)
  bright((ikv band 16)/16)
  end sub
Reply
#3
<!-- m --><a class="postlink" href="https://skydrive.live.com/?cid=1c842d5b23e1e0e2&sc=documents&id=1C842D5B23E1E0E2%21714">https://skydrive.live.com/?cid=1c842d5b ... E0E2%21714</a><!-- m -->

+ d disc with tasword +2 (128) version
load p5 on speccy emualtor should load it and runit
theres some text files on the disc press sym shift A
to get to load save menu
tascon +d converted it for +d from indug format
nothing for sam coupe so far
had lovely 32 column text and dreadful illegible 64 column neither proportional though bother pretty quick
anyone help
<!-- e --><a href="mailto:larspp@hotmail.com">larspp@hotmail.com</a><!-- e -->, <!-- e --><a href="mailto:exclusive@tiscali.cz">exclusive@tiscali.cz</a><!-- e -->, <!-- e --><a href="mailto:exclusive@atlas.cz">exclusive@atlas.cz</a><!-- e -->, <!-- e --><a href="mailto:exclusive.cz@seznam.cz">exclusive.cz@seznam.cz</a><!-- e -->, <!-- e --><a href="mailto:velesoft@seznam.cz">velesoft@seznam.cz</a><!-- e -->
some of these should eb able to understand
was hoping to run 48 snap top 32768 in external ram area of 1-4mb but cant use mem$ apparently
Reply
#4
rogerjowett Wrote:had lovely 32 column text and dreadful illegible 64 column neither proportional though bother pretty quick
anyone help
<!-- e --><a href="mailto:larspp@hotmail.com">larspp@hotmail.com</a><!-- e -->, <!-- e --><a href="mailto:exclusive@tiscali.cz">exclusive@tiscali.cz</a><!-- e -->, <!-- e --><a href="mailto:exclusive@atlas.cz">exclusive@atlas.cz</a><!-- e -->, <!-- e --><a href="mailto:exclusive.cz@seznam.cz">exclusive.cz@seznam.cz</a><!-- e -->, <!-- e --><a href="mailto:velesoft@seznam.cz">velesoft@seznam.cz</a><!-- e -->
some of these should eb able to understand
was hoping to run 48 snap top 32768 in external ram area of 1-4mb but cant use mem$ apparently
This looks like spam. Why are you posting these email addresses? :roll:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)