Remind me - mem_set()?

new topic     » topic index » view thread      » older message » newer message

If I allocate(2000) and want to initialise that to 500 identical (non-null) dwords, in this specific case an #AARRGGBB colour, what's the best way?

I'm thinking mem_set() is missing a size=1 parameter, which (with atom v instead of integer byte_value) can also be 2/4/8, and maybe -4/-8 to poke float32/64...
I realise that mem_copy() would work, but would perform 499 unnecessary reads, or would modern cpus make that completely irrelevant?
I also realise that poke4(addr,repeat(v,500)) would also work, but clearly suboptimal, maybe it is poke4() that is missing a times=1 parameter?

It seems to be one of those rare things I find easier in assembly than Eu/Phix...

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu