The Dink Network

Reply to Re: cannot run any version after 1.07

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
August 12th 2022, 07:38 AM
dinkdead.gif
millimeter
Peasant He/Him Canada
Millimeter is Wee-Lamm, Recording Artist. :-) 
Replying to your edit,
I haven't tried yet with the newest version of HD, I don't have freedink installed yet, but I've had mixed results storing values in unused sprite params. I admit I am inexperienced with this so I will give it a solid look. I will also attempt measure the performance hit of accessing a remote variable housed by a sprite param, especially if it relies on another external procedure that may access another remote variable.

It is an intriguing thought, the true hurdle may be in the parsing engine itself in that we would love to write oop procedures, but script parsing is linear.

My efforts so far avoid using base10 values, noting in binary math we can abuse the remainder after a Division operation to determine which bits are set.

Snippet for your opinion, I will make something more durable over the weekend after work.

bitmanip.c
void main (void)
{
//lets make a multi-bool
make_global_int("&mm_flags", 0);

//Give it a value for testing purposes, these 2 lines can go away after testing.
//&mm_flags = 1048575; The number below has bit 4 unset, so bits 1-9 are of interest here.
&mm_flags = 503;
kill_this_task();
}

void bit_value ()
{
// &caller = bit_value([int]);
// The int value is received in &arg1 in the called function
int &i = 0;
int &j = 1;
int &bit_value = 0;
iptr:
&bit_value = &j;
&bit_value /2;
&i += 1;
&j * 2;
if (&i < &arg1) goto iptr;
return (&bit_value);
kill_this_task();
}

void bit_check ()
{
//external("bitmanip", "bit_check",[your variable], [your bit]);
//This will return 1 if the bit is ON or set, 0 if the bit is OFF or not set
//This function is still a little messy, I'll clean it up a bit.
int &i = &arg2;
int &crap1 = &arg1;
notyet:
&crap1 / 2;
&i -= 1;
if (&i > 1) goto notyet;
int &crap2 = &crap1;
&crap1 / 2;
&crap1 * 2;
say_stop("&crap1 and &crap2", 1);
&crap2 -= &crap1;
//if &crap2 = 1, bit is set ... if ), is not set.
say_stop("&crap1 and &crap2", 1);
}

void test_bit_values ()
//You can call this function to confirm that all bits will return the correct bit value.
//Not much use, other than for testing the other functions but...
//You can write these down to know what to [/ or *] by to effect a specific bit, if you like base10 math =D.
{
int &caller = 0;
int &i = 1;
loop:
&caller = bit_value(&i);
wait(1);
say_stop("Count &i Bit is worth &caller", 1);
&i += 1;
if (&i < 32) goto loop;
kill_this_task;
}