Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ULAplus support
#1
since i'm seeing so many good games from MojonTwins supporting ULAplus, and its implementation looked so simple, i tried to code some library and example for that - be welcome testing it (i think would be a good idea if this could be implemented defaultly on zxbasic-compiler, what do you all think?)
(for now i'm testing this on SpectEmu on Wine, while there are no native emulators for LInux)

library/ulaplus.bas
Code:
dim tmpv as uinteger
dim fdbkv as ubyte

function ulapluscheck():
  tmpv=in(65339):pause 1:fdbkv=0
  out 48955,0:out 65339,0:pause 1
  if in(65339)<>tmpv then:fdbkv=1:out 48955,0:out 65339,tmpv:pause 1:end if
  return fdbkv
  end function

sub ulapluspalette(clv as ubyte, vlv as ubyte):
  out 48955,(clv band 63):out 65339,vlv:pause 1
  end sub

sub ulaplusswitch(flgv as ubyte):
  out 48955,64:out 65339,(flgv band 1):pause 1
  end sub

ulaplus_example.bas
Code:
#include "library/ulaplus.bas"

ulaplusswitch(1):cls

a$="ULAplus is not present"
if ulapluscheck()<>0 then:a$="ULAplus is present":end if
print at 0,0;a$

for fl=0 to 1
  flash fl
  for hb=0 to 1
    bright hb
    for pa=0 to 7
      paper pa:inverse 0
      print " ";
      next
    for ik=0 to 7
      ink ik:inverse 1
      print " ";
      next
    next:next

for i=0 to 63
  ulapluspalette(i, int(rnd*255) )
  next

pause 0
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)