Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"What I've done, of course, is total garbage." -- R. Willard, Pure Math 430a


devel / comp.sys.acorn.programmer / Saving a sprite in a sprite area

SubjectAuthor
* Saving a sprite in a sprite areaPaul Sprangers
`* Re: Saving a sprite in a sprite areadruck
 `* Re: Saving a sprite in a sprite areaPaul Sprangers
  `* Re: Saving a sprite in a sprite areaPaul Sprangers
   `* Re: Saving a sprite in a sprite areadruck
    `- Re: Saving a sprite in a sprite areaPaul Sprangers

1
Saving a sprite in a sprite area

<59f7d8d041Paul@sprie.nl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=159&group=comp.sys.acorn.programmer#159

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Paul@sprie.nl (Paul Sprangers)
Subject: Saving a sprite in a sprite area
Newsgroups: comp.sys.acorn.programmer
Date: Mon, 13 Jun 2022 11:51:47 +0200 (Custom)
Message-ID: <59f7d8d041Paul@sprie.nl>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 22
Injection-Date: Mon, 13 Jun 2022 11:51:52 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1329
 by: Paul Sprangers - Mon, 13 Jun 2022 09:51 UTC

Dear all,

I managed to use ChangeFSI in my BASIC program for rescaling a JPEG and
re-typing it to a sprite. The resulting sprite is saved to disk, as a
single sprite file.

However, what I want to achieve is that the resulting sprite is saved to an
existing sprite file that contains more than 60 sprites. It should thereby
overwrite a particular sprite with the same name in that file.

The most likely call seems to be SYS"OS_SpriteOP", but I can't find a
reason code that does exactly that. The reason codes that I tried
nevertheless, either cause a corrupt sprite file or don't do anything
noticeable at all. What should I do? (rather than giving up on trying to be
a programmer).

Kind regards,
Paul

--
https://riscos.sprie.nl

Re: Saving a sprite in a sprite area

<t89irm$r07$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=160&group=comp.sys.acorn.programmer#160

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: news@druck.org.uk (druck)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Saving a sprite in a sprite area
Date: Tue, 14 Jun 2022 10:02:46 +0100
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <t89irm$r07$1@dont-email.me>
References: <59f7d8d041Paul@sprie.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 14 Jun 2022 09:02:47 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a1643b7f52d1d2899bd0db47ebc0d740";
logging-data="27655"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/0a/xm3ldS78uJhwVN54kK"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.9.1
Cancel-Lock: sha1:bTKIPLUmZsMVE/eKBtkJUMLd+Dc=
In-Reply-To: <59f7d8d041Paul@sprie.nl>
Content-Language: en-GB
 by: druck - Tue, 14 Jun 2022 09:02 UTC

On 13/06/2022 10:51, Paul Sprangers wrote:
> Dear all,
>
> I managed to use ChangeFSI in my BASIC program for rescaling a JPEG and
> re-typing it to a sprite. The resulting sprite is saved to disk, as a
> single sprite file.
>
> However, what I want to achieve is that the resulting sprite is saved to an
> existing sprite file that contains more than 60 sprites. It should thereby
> overwrite a particular sprite with the same name in that file.
>
> The most likely call seems to be SYS"OS_SpriteOP", but I can't find a
> reason code that does exactly that. The reason codes that I tried
> nevertheless, either cause a corrupt sprite file or don't do anything
> noticeable at all. What should I do? (rather than giving up on trying to be
> a programmer).

Create a large enough sprite area for both sprites files with
OS_SpriteOp 9, load the 60 sprites file with OS_SpriteOp 10, and merge
in the new sprite with OS_SpriteOp 11, and save with OS_SpriteOp 12.

---druck

Re: Saving a sprite in a sprite area

<59f86074f3Paul@sprie.nl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=161&group=comp.sys.acorn.programmer#161

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Paul@sprie.nl (Paul Sprangers)
Subject: Re: Saving a sprite in a sprite area
Newsgroups: comp.sys.acorn.programmer
Date: Tue, 14 Jun 2022 12:33:23 +0200 (Custom)
Message-ID: <59f86074f3Paul@sprie.nl>
References: <59f7d8d041Paul@sprie.nl> <t89irm$r07$1@dont-email.me>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!feeder.usenetexpress.com!tr2.eu1.usenetexpress.com!94.232.112.244.MISMATCH!feed.abavia.com!abe004.abavia.com!abp003.abavia.com!news.kpn.nl!not-for-mail
Lines: 21
Injection-Date: Tue, 14 Jun 2022 12:33:32 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: Paul Sprangers - Tue, 14 Jun 2022 10:33 UTC

In article <t89irm$r07$1@dont-email.me>,
druck <news@druck.org.uk> wrote:

> Create a large enough sprite area for both sprites files with
> OS_SpriteOp 9, load the 60 sprites file with OS_SpriteOp 10, and merge
> in the new sprite with OS_SpriteOp 11, and save with OS_SpriteOp 12.

Ah... merge. Why didn't I think of that?

Is that one sprite area for both sprite files, or should both files have
their own area?

And is it really OS_SpriteOp 9 - 12, or should I add 256 to those numbers?
(That's what the StrongHelp manual suggests).

Thank you for putting my on the right track
Paul

--
https://riscos.sprie.nl

Re: Saving a sprite in a sprite area

<59f868670fPaul@sprie.nl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=162&group=comp.sys.acorn.programmer#162

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Paul@sprie.nl (Paul Sprangers)
Subject: Re: Saving a sprite in a sprite area
Newsgroups: comp.sys.acorn.programmer
Date: Tue, 14 Jun 2022 14:00:10 +0200 (Custom)
Message-ID: <59f868670fPaul@sprie.nl>
References: <59f7d8d041Paul@sprie.nl> <t89irm$r07$1@dont-email.me> <59f86074f3Paul@sprie.nl>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr2.eu1.usenetexpress.com!94.232.112.245.MISMATCH!abe005.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 44
Injection-Date: Tue, 14 Jun 2022 14:00:13 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
 by: Paul Sprangers - Tue, 14 Jun 2022 12:00 UTC

In article <59f86074f3Paul@sprie.nl>,
Paul Sprangers <Paul@sprie.nl> wrote:

To answer my own questions:

> Is that one sprite area for both sprite files, or should both files have
> their own area?

A bit of experimenting shows that one sprite area should do.

> And is it really OS_SpriteOp 9 - 12, or should I add 256 to those
> numbers? (That's what the StrongHelp manual suggests).

Another bit of experimenting shows that 256 should indeed be added to the
original reason code.

Some of the sprites that I merged to the sprite area have overwritten the
original one as intended, but a lot of others delete all sprites in the
sprite area, after which the file consists of the new sprite only. And I've
no idea where that comes from. Here is my code:

$spritepath% = path$
SYS "OS_SpriteOp, 265+11, sparea%, spritepath%
SYS "OS_SpriteOp, 256+12, sparea%, originalpath$

- spritepath% contains the path of the sprite to be merged.
- sparea% is the sprite pool that contains the 60 sprites file.
- originalpath$ is the path of that 60 sprites file.

The sprite to be merged has the same name as its file name (both "player"),
which is the name of a sprite in the large sprite file too. The latter
should be replaced by the new sprite. Sometimes it does, but mostly the new
sprite replaces all sprites, as said.

The new sprite is never larger than approximately 3500 bytes, reason why I
add a sufficient 5000 bytes to the length of the sprite pool (sparea%).
So, what am I still doing wrong?

Paul

--
https://riscos.sprie.nl

Re: Saving a sprite in a sprite area

<t8aq3u$v6u$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=163&group=comp.sys.acorn.programmer#163

  copy link   Newsgroups: comp.sys.acorn.programmer
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: news@druck.org.uk (druck)
Newsgroups: comp.sys.acorn.programmer
Subject: Re: Saving a sprite in a sprite area
Date: Tue, 14 Jun 2022 21:12:45 +0100
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <t8aq3u$v6u$1@dont-email.me>
References: <59f7d8d041Paul@sprie.nl> <t89irm$r07$1@dont-email.me>
<59f86074f3Paul@sprie.nl> <59f868670fPaul@sprie.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 14 Jun 2022 20:12:46 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="a1643b7f52d1d2899bd0db47ebc0d740";
logging-data="31966"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18oa5L9EbHeF6BiDwRXLIy0"
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.10.0
Cancel-Lock: sha1:1QClbZvnN57QBSCoQkV8nfdxKxE=
In-Reply-To: <59f868670fPaul@sprie.nl>
X-Antivirus-Status: Clean
Content-Language: en-GB
X-Antivirus: Avast (VPS 220614-6, 14/6/2022), Outbound message
 by: druck - Tue, 14 Jun 2022 20:12 UTC

On 14/06/2022 13:00, Paul Sprangers wrote:
> In article <59f86074f3Paul@sprie.nl>,
> Paul Sprangers <Paul@sprie.nl> wrote:
>
> To answer my own questions:
>
>> Is that one sprite area for both sprite files, or should both files have
>> their own area?
>
> A bit of experimenting shows that one sprite area should do.

One area to hold both the loaded and merged sprite files.
>
>
>> And is it really OS_SpriteOp 9 - 12, or should I add 256 to those
>> numbers? (That's what the StrongHelp manual suggests).
>
> Another bit of experimenting shows that 256 should indeed be added to the
> original reason code.

Yes, as it's a user sprite area.

> Some of the sprites that I merged to the sprite area have overwritten the
> original one as intended, but a lot of others delete all sprites in the
> sprite area, after which the file consists of the new sprite only. And I've
> no idea where that comes from. Here is my code:
>
> $spritepath% = path$
> SYS "OS_SpriteOp, 265+11, sparea%, spritepath%
> SYS "OS_SpriteOp, 256+12, sparea%, originalpath$
>
> - spritepath% contains the path of the sprite to be merged.
> - sparea% is the sprite pool that contains the 60 sprites file.
> - originalpath$ is the path of that 60 sprites file.
>
> The sprite to be merged has the same name as its file name (both "player"),
> which is the name of a sprite in the large sprite file too. The latter
> should be replaced by the new sprite. Sometimes it does, but mostly the new
> sprite replaces all sprites, as said.

I've no idea what is happening there. I would try debugging by saving
the area to different files before and after the merge, to check if it
really the merge going wrong and not something else.

> The new sprite is never larger than approximately 3500 bytes, reason why I
> add a sufficient 5000 bytes to the length of the sprite pool (sparea%).
> So, what am I still doing wrong?

That should be sufficient, there would be an error if it were not.

---druck

Re: Saving a sprite in a sprite area

<59f8d55e60Paul@sprie.nl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=164&group=comp.sys.acorn.programmer#164

  copy link   Newsgroups: comp.sys.acorn.programmer
From: Paul@sprie.nl (Paul Sprangers)
Subject: Re: Saving a sprite in a sprite area
Newsgroups: comp.sys.acorn.programmer
Date: Wed, 15 Jun 2022 09:50:22 +0200 (Custom)
Message-ID: <59f8d55e60Paul@sprie.nl>
References: <59f7d8d041Paul@sprie.nl> <t89irm$r07$1@dont-email.me>
<59f86074f3Paul@sprie.nl> <59f868670fPaul@sprie.nl> <t8aq3u$v6u$1@dont-email.me>
User-Agent: Pluto/3.18 (RISC OS/5.29) NewsHound/v1.52-32
Organization: None
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 16
Injection-Date: Wed, 15 Jun 2022 09:50:29 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1280
 by: Paul Sprangers - Wed, 15 Jun 2022 07:50 UTC

In article <t8aq3u$v6u$1@dont-email.me>,
druck <news@druck.org.uk> wrote:

> I've no idea what is happening there. I would try debugging by saving
> the area to different files before and after the merge, to check if it
> really the merge going wrong and not something else.

That appeared to be a very good advice: it went wrong *before* the merge,
because at some point in the routine I stupidly used the sprite pool for a
buffer, rather than a specific buffer. Thank you David, problem solved.

Paul

--
https://riscos.sprie.nl

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor