Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #6041

Re: Saving animated sprites from a simple BASIC graphic program

Date 2020-03-19 21:10 +0000
From Matthew Phillips <spam2011m@yahoo.co.uk>
Newsgroups comp.sys.acorn.programmer
Subject Re: Saving animated sprites from a simple BASIC graphic program
Message-ID <cec7dc5358.Matthew@sinenomine.freeserve.co.uk> (permalink)
References <5852bdfc1cbasura@invalid.addr.uk> <mpro.q7d0hi02ez29u026f.news@stevefryatt.org.uk> <5853462123basura@invalid.addr.uk> <0a9d965358.Matthew@sinenomine.freeserve.co.uk> <5853b30d57basura@invalid.addr.uk>

Show all headers | View raw


In message <5853b30d57basura@invalid.addr.uk>
 on 19 Mar 2020 Richard Ashbery  wrote:

> In article <0a9d965358.Matthew@sinenomine.freeserve.co.uk>, Matthew
> Phillips <spam2011m@yahoo.co.uk> wrote:
> > In message <5853462123basura@invalid.addr.uk> on 18 Mar 2020
> >  Richard Ashbery  wrote:
> 
> > > In article <mpro.q7d0hi02ez29u026f.news@stevefryatt.org.uk>,
> > > Steve Fryatt <news@stevefryatt.org.uk> wrote:
> > > > On 17 Mar, Richard Ashbery wrote in message
> > > >     <5852bdfc1cbasura@invalid.addr.uk>:
> > > 
> > > > > How should I do this please? Some simple code examples would
> > > > > be appreciated.
> > > 
> > > > Is there any chance of seeing your current code? 
> 
> > [snip]
> 
> > > As suggested by Chris I've eliminated CLG and substituted the EOR
> > > GCOL 3,63. Running program displays an offset square as expected
> > > but when the sprites are saved the offset is missing and clearly
> > > absent when viewing sprites in !Paint. Could this be a problem
> > > with the way the program collects the sprite data?
> 
> > It sounds like it is.  I think Steve was hoping for the complete
> > code: if you can send the whole lot it will be much easier to tell
> > where the problem is. The code you copied into the message was
> > just for drawing the graphics.
> 
> It is complete honestly Matthew. You've missed the bit where the
> sprite group is created.

I do apologise.  I got interrupted when reading your example and when I came
back I forgot that I had meant to check what the VDU command did.  I confess
I would have had to look up what it was, though, as I am very unfamiliar with
VDU codes, and, it turns out that VDU 23,27 does not appear in the StrongHelp
VDU commands manual v 2.04 of 12 Nov 2016.  Very strange.

In the PRM, the index for "VDU drivers - list of codes" sends me to pages
4-551 and 4-552 where the entry for VDU 23,27 points to page 1-603.  That in
turn refers me to the Sprites chapter on page 1-745, which is unhelpful as
the actual information is a dozen pages in, on 1-759 where it explains that
VDU,27,1,n| is equivalent to *SGet n, and finally on page 1-824 we get the
explanation for that command!

If it had been an OS_SpriteOp call I'd have found the right bit of the code
straight away.  OS_SpriteOp is better-documented, but I still have to look up
the codes:

SYS"OS_SpriteOp",14,...

SYS"OS_SpriteOp",270,...

SYS"OS_SpriteOp",&10E,...

don't say "Get sprite from cursor" to me, because I usually access all this
stuff through C library routines.

> Apparently my method of generating the sprites is deprecated (went out with
> the arc I believe) - I'll have a look at Druck's SWI, OS_SpriteOP though I
> suspect I might need help understanding it.

What you need is

SYS"OS_SpriteOp",14,0,STR$(n),0

to replace the VDU command.  Or possibly

SYS"OS_SpriteOp",14,0,STR$(n),1

if you want to include a palette in the sprite, which VDU 23,27,1,n| does not
seem to do.

You could go further than that and DIM a block of memory in the BASIC so that
you can define your own sprite area rather than the system sprite area.  Then
you would not have to mess around altering the system sprite area allocation,
which on most machines these days starts out as 0K.

> Ensure System sprites memory is set to 16.384 Mbytes in Tasks; Run program;
> Open a TaskWindow; type slist to check that the sprite group is created;
> type ssave [filename] to save it to root. Open the sprite to display the
> group in !Paint but I'm sure you know all this!! 

I don't think I have used *slist or *ssave this millennium -- it was very
helpful to have the extra instructions.  Part of the reason I thought that
the program was incomplete was because I couldn't see anywhere that was
saving the sprites to disc.  I didn't know you were typing some extra
commands after running it!

-- 
Matthew Phillips
Durham

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Saving animated sprites from a simple BASIC graphic program Richard Ashbery <basura@invalid.addr.uk> - 2020-03-17 16:57 +0000
  Re: Saving animated sprites from a simple BASIC graphic program "John Williams (News)" <UCEbin@tiscali.co.uk> - 2020-03-17 17:28 +0000
    Re: Saving animated sprites from a simple BASIC graphic program Richard Ashbery <basura@invalid.addr.uk> - 2020-03-17 20:30 +0000
      Re: Saving animated sprites from a simple BASIC graphic program "John Williams (News)" <UCEbin@tiscali.co.uk> - 2020-03-17 21:12 +0000
        Re: Saving animated sprites from a simple BASIC graphic program Richard Ashbery <basura@invalid.addr.uk> - 2020-03-17 21:23 +0000
      Re: Saving animated sprites from a simple BASIC graphic program News <chrisjohnson@spamcop.net> - 2020-03-17 23:39 +0000
  Re: Saving animated sprites from a simple BASIC graphic program Steve Fryatt <news@stevefryatt.org.uk> - 2020-03-17 22:44 +0000
    Re: Saving animated sprites from a simple BASIC graphic program Richard Ashbery <basura@invalid.addr.uk> - 2020-03-18 17:44 +0000
      Re: Saving animated sprites from a simple BASIC graphic program druck <news@druck.org.uk> - 2020-03-18 20:55 +0000
      Re: Saving animated sprites from a simple BASIC graphic program Steve Fryatt <news@stevefryatt.org.uk> - 2020-03-19 00:08 +0000
        Re: Saving animated sprites from a simple BASIC graphic program Steve Fryatt <news@stevefryatt.org.uk> - 2020-03-19 07:38 +0000
          Re: Saving animated sprites from a simple BASIC graphic program News <chrisjohnson@spamcop.net> - 2020-03-19 10:17 +0000
          Re: Saving animated sprites from a simple BASIC graphic program Richard Ashbery <basura@invalid.addr.uk> - 2020-03-19 20:05 +0000
            Re: Saving animated sprites from a simple BASIC graphic program Steve Fryatt <news@stevefryatt.org.uk> - 2020-03-19 21:10 +0000
              Re: Saving animated sprites from a simple BASIC graphic program Richard Ashbery <basura@invalid.addr.uk> - 2020-03-19 21:59 +0000
      Re: Saving animated sprites from a simple BASIC graphic program Matthew Phillips <spam2011m@yahoo.co.uk> - 2020-03-19 08:23 +0000
        Re: Saving animated sprites from a simple BASIC graphic program Richard Ashbery <basura@invalid.addr.uk> - 2020-03-19 13:34 +0000
          Re: Saving animated sprites from a simple BASIC graphic program Matthew Phillips <spam2011m@yahoo.co.uk> - 2020-03-19 21:10 +0000
            Re: Saving animated sprites from a simple BASIC graphic program Richard Ashbery <basura@invalid.addr.uk> - 2020-03-19 21:40 +0000
  Re: Saving animated sprites from a simple BASIC graphic program "Derek.Moody" <derek.moody@casterbridge.net> - 2020-03-17 18:05 +0000

csiph-web