Maandelijkse archieven: juli, 2020

A jigsaw puzzle game

A game made in GFA Basic 3.6 TT. I got the idea for this game in 1995. The code from 1995 was for 640×480 in 16 colours because I couldn’t get the GFA editor running in higher colours then. The code was abandoned soon because I was not satisfied by the 16 colours.

I recently discovered how to get GFA basic running in 256 colour mode with Bastard from Run! software. http://www.run-software.de/bastard.php

After some time I managed to get 256 colour pictures with GFA basic on screen. Now was time to go back to the Jigsaw puzzle game!

This replacement PUT procedure uses GEM mfdb to put a “sprite” image block on screen.

Some checks are remarked out or simplified to enhance the speed a little bit.

> PROCEDURE put(x&,y&,a%,m&)
  $X put
  LOCAL w&,h&,s.mfdb%,d.mfdb%
  '   IF WORD{a%+4}=WORD{LONG{GB+4}+20} !blk planes matches scrn planes?
  INLINE s.mfdb%,20
  INLINE d.mfdb%,20
  w&=WORD{a%+0}
  h&=WORD{a%+2}
  LONG{s.mfdb%+0}=a%+6
  WORD{s.mfdb%+4}=w&
  WORD{s.mfdb%+6}=h&
  WORD{s.mfdb%+8}=SHR&(w&,4) !\16
  WORD{s.mfdb%+10}=0
  '  WORD{s.mfdb%+12}=WORD{a%+4}
  WORD{s.mfdb%+12}=8        ! bitplanes
  LONG{d.mfdb%+0}=0
  WORD{d.mfdb%+4}=WORK_OUT(0)+1
  WORD{d.mfdb%+6}=WORK_OUT(1)+1
  WORD{d.mfdb%+8}=SHR&(WORK_OUT(0)+1,4) !\16
  WORD{d.mfdb%+10}=0
  '  WORD{d.mfdb%+12}=WORD{a%+4}
  WORD{d.mfdb%+12}=8        ! bitplanes
  CONTRL(0)=109
  CONTRL(1)=4
  CONTRL(3)=1
  CONTRL(6)=V~H
  LONG{CONTRL+14}=s.mfdb%
  LONG{CONTRL+18}=d.mfdb%
  INTIN(0)=m&
  PTSIN(0)=0
  PTSIN(1)=0
  PTSIN(2)=w&-1
  PTSIN(3)=h&-1
  PTSIN(4)=x&
  PTSIN(5)=y&
  PTSIN(6)=x&+w&-1
  PTSIN(7)=y&+h&-1
  VDISYS
  ' ENDIF
RETURN

DMA sound was added with the help of an old listing from a dutch magazine and the explanation of the xbios functions in the book “Das Buch zum Atari Falcon030”, which is one of only 2 specific Falcon030 books I know of. The other one I think it was called “Atari Falcon030 Dream machine” I do not own.

This book is interesting because it has clear explanation of the XBIOS functions, hardware, AES 4.0.

For example:

In GFA you can create a sndstatus function which calls XBIOS (0x8c)

DEFFN sndstatus(a)=XBIOS(&H8C,a)

It gets the actual status of the codec and can reset it.

input a=1 reset the codec

You can call the function like this to reset the codec:

~@sndstatus(1)  
DEFFN sndstatus(a)=XBIOS(&H8C,a)

A more complete procedure to reset the Falcon sound system.

It sets volume and such with soundcmd, XBIOS (0x82)

> PROCEDURE reset_sound_system
  ~@sndstatus(1)
  ~@soundcmd(ltatten,prv_snd_state(ltatten))
  ~@soundcmd(rtatten,prv_snd_state(rtatten))
  ~@soundcmd(ltgain,prv_snd_state(ltgain))
  ~@soundcmd(rtgain,prv_snd_state(rtgain))
  ~@soundcmd(adderin,&H1)
  ~@soundcmd(adcinput,&H0)
DEFFN sndstatus(a)=XBIOS(&H8C,a)
DEFFN soundcmd(a,b)=XBIOS(&H82,a,b)