Re: [hatari-devel] Natfeats doc?

[ Thread Index | Date Index | More Archives ]


On 8.9.2021 17.07, Troed Sångberg wrote:
On Tuesday, September 7th, 2021 at 11:02 PM, Eero Tamminen <oak@xxxxxxxxxxxxxx> wrote:
Is using stack (register) a problem in demos?

When developing the best trigger is one that touches as little as possible of CPU state, register contents etc, and where I end up at the next instruction in the debugger. For example, with the Xbios method I had to step through restoring of the stack every time. I sort of assume from your example below that I will step through RTS every time is using Natfeat?

Or you inline the opcode.  It's up to you
how you want to call it.

Relevant NatFeat APIs args are pushed to stack,
but that does not change CPU state (flags) or
other regs besides stack pointer, so it's pretty
low impact.

I think invoking e.g. debugger is just:

pea nf_debugger_id
bsr _nf_call

Where nf_call is:
; call native feature by its ID

dc.w $7301

Where is the list of numbers/IDs? I searched for which 73xx would be "trigger debugger" but didn't find it.

At start of your program you query the IDs.
See "nf_detect" in the assembly examples and
nf_init() in the example C-code.

You need to do this to find out which of
the NatFeats APIs are actually available in
the runtime environment.

(Different emulators can implement different
features, available features may depend on
the version of the emulator & how user has
built it, and what options s/he has selected.)

	- Eero

Mail converted by MHonArc 2.6.19+