NIRVANA NIRVANA_spriteT routine… where?

The place for codemasters or beginners to talk about programming any language for the Spectrum.
Post Reply
DoctorRad
Drutt
Posts: 27
Joined: Mon Mar 18, 2024 4:40 pm

NIRVANA NIRVANA_spriteT routine… where?

Post by DoctorRad »

I've been looking at the ASM code of NIRVANA, and while NIRVANAENGINE.txt mentions NIRVANA_spriteT, it doesn't appear in the ASM listing. I can see the (presumably modified elsewhere) code for the eight tiles of drawing near the top of main_engine, but I can't see either NIRVANA_spriteT nor any other code that appears to modify the tile drawing calls.

Have I missed something? Is there better documentation or examples / tutorials somewhere?
User avatar
R-Tape
Site Admin
Posts: 6409
Joined: Thu Nov 09, 2017 11:46 am

Re: NIRVANA NIRVANA_spriteT routine… where?

Post by R-Tape »

This is one for @Einar Saukas.

I don't know why that section of the code isn't labelled, but knowing Einar I suspect there will be a reason for it. Whenever I've used Nirvana, I used my own routine the poke the addresses in the draw routine from 56468.
DoctorRad
Drutt
Posts: 27
Joined: Mon Mar 18, 2024 4:40 pm

Re: NIRVANA NIRVANA_spriteT routine… where?

Post by DoctorRad »

I just found there's a serviceable NIRVANAspriteT routine in the ZX Basic interface linked to from here.
User avatar
Einar Saukas
Bugaboo
Posts: 3145
Joined: Wed Nov 15, 2017 2:48 pm

Re: NIRVANA NIRVANA_spriteT routine… where?

Post by Einar Saukas »

My apologies for not explaining it better in the manual!

The section of the manual about "NIRVANA API" doesn't refer to the source code. It refers to the provided API for ZX Basic (available from the link you mentioned) and z88dk (currently inside the official z88dk distribution).

If you are programming in Assembly and looking directly at the NIRVANA source code, it's more straightforward to POKE these "sprites" directly, instead of calling a routine to POKE them for you.

Anyway using the ZX Basic interface as reference is a great idea. Notice that this API shows 2 different ways to calculate these POKE addresses: reimplementing function NIRVANAspriteT or POKEing addresses provided by macros SPRITECOL, SPRITELIN, SPRITEVAL.
Post Reply