ʸ»úÎó¤ò°Å¹æ²½¤·¤ÆÊݸ¤¹¤ë¥â¥¸¥å¡¼¥ë¤òºî¤Ã¤Æ¤ß¤Þ¤·¤¿¡£
¤³¤ì¤Ç¥á¥âÄ¢Åù¤Ë´ØÏ¢¤Å¤±¤µ¤ì¤Æ¤Ê¤¤¤è¤¦¤Ê³ÈÄ¥»Ò¤ò»È¤Ã¤ÆÊݸ¤¹¤ì¤Ð¡¢
¡Êµ¤¹ç¤¤¤òÆþ¤ì¤Æ°Å¹æ¤ò²òÆɤ·¤è¤¦¤È¤¹¤ë¿Í¤¬Áê¼ê¤Ç¤â¤Ê¤¤¸Â¤ê¤Ï¡Ë
¥á¥âÄ¢Åù¤ÇÃæ¿È¤òÇÁ¤«¤ì¤ë¿´ÇۤϤʤ¤¤È»×¤¤¤Þ¤¹¡£
¤¿¤À¤·¡¢¤¢¤¯¤Þ¤Ç¤âxor¤ò»È¤Ã¤¿´Ê°×Ū¤Ê½èÍý¤Ê¤Î¤Ç¡¢¤¢¤Þ¤ê¶¯¤¤°Å¹æ²½¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¤³¤ì¤Ç¤ÏÉÔ¤ʤ褦¤Ê¤é¤â¤Ã¤È¶¯¤¤°Å¹æ²½½èÍý¤¬É¬Íפˤʤ뤫¤â¤·¤ì¤Þ¤»¤ó¡£
//¡¦savetext p1,p2,p3
//ʸ»úÎóp2¤ÎÆâÍƤòp1¤È¤¤¤¦Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤ËÊݸ¤¹¤ë¡£
//p3¤Ï°Å¹æ¸°¤òÀ°¿ô¤Ç»ØÄꤹ¤ë¡£¾Êά²Äǽ¤Ç¡¢¾Êά»þ¤â¤·¤¯¤Ï0¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï°Å¹æ²½¤·¤Ê¤¤¡£
//¡Êxor¤ò»È¤Ã¤¿´Ê°×Ū¤Ê°Å¹æ²½½èÍý¤Ç¤¹¡£
//¡¡°Å¹æ¸°¤Ë¤Ï¡Ø0¤È1¤Î¥Ó¥Ã¥È¤¬¤ª¤è¤½È¾¡¹¤°¤é¤¤Â¸ºß¤·¤Æ¥Ð¥é¤±¤Æ¤¤¤ë¡ÙÃͤò¿ä¾©¤·¤Þ¤¹¡Ë
//
//¡¦loadtext p1,p2,p3
//p1¤È¤¤¤¦Ì¾Á°¤Î¥Æ¥¥¹¥È¥Õ¥¡¥¤¥ë¡¢¤â¤·¤¯¤Ïsavetext¤Ç°Å¹æ²½¤·¤ÆÊݸ¤·¤¿¥Æ¥¥¹¥È¤òÊÑ¿ôp2¤ËÆɤ߹þ¤à¡£
//°Å¹æ²½¤·¤¿¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à¾ì¹ç¤Ïp3¤Ë°Å¹æ¸°¤òÀ°¿ô¤Ç»ØÄꤹ¤ë¡£
//°Å¹æ²½¤·¤Æ¤¤¤Ê¤¤¥Æ¥¥¹¥È¤Î¾ì¹ç¤Ïp3¤ò¾Êά¤¹¤ë¤«0¤ò»ØÄꤹ¤ë¡£
#module
#define shift(%1) %1=(%1>>31)&0x1|(%1<<1)^0xFFFFFFFF //%1¤òº¸¤Ë1¥Ó¥Ã¥È¥í¡¼¥Æ¡¼¥È¤µ¤»¤ÆÁ´ÂΤòȿž¤¹¤ë
#define global savetext(%1,%2,%3=0) _savetext %1,%2,%3
#deffunc _savetext str fn1,str _text,int key1,local text,local buf1
k=key1 : f=k : text=_text
x=strlen(text) : y=(x+3)/4 : z=y*4
sdim buf1,z : memcpy buf1,text,x,0,0
repeat y
lpoke buf1,cnt*4,lpeek(buf1,cnt*4)^k
if f : shift k
loop
bsave fn1,buf1,x
return
#define global loadtext(%1,%2,%3=0) _loadtext %1,%2,%3
#deffunc _loadtext str fn2,var v,int key2,local buf2
exist fn2 : x=strsize : if x=-1 : return
k=key2 : f=k : y=(x+3)/4 : z=y*4
sdim buf2,z : bload fn2,buf2,x
repeat y
lpoke buf2,cnt*4,lpeek(buf2,cnt*4)^k
if f : shift k
loop
sdim v,x+1 : memcpy v,buf2,x,0,0
return
#global
//°Ê²¼¡¢»ÈÍÑÎã
test="¤¢¤¤¤¦¤¨¤ª\n¤«¤¤¯¤±¤³\n¤µ¤·¤¹¤»¤½\n¤¿¤Á¤Ä¤Æ¤È\n¤Ê¤Ë¤Ì¤Í¤Î\n123" //¤³¤Î¥Æ¥¥¹¥È¤òÊݸ¤·¤¿¤¤
savetext "test.hog",test,0xDE39DFCA //¥Æ¥¥¹¥È¤ò°Å¹æ²½¤·¤ÆÊݸ¡£Âè3¥Ñ¥é¤Ï°Å¹æ¸°¡£
loadtext "test.hog",test2,0xDE39DFCA //°Å¹æ²½¤·¤¿¥Æ¥¥¹¥È¤òÆɤ߹þ¤à(¸µ¡¹¤ÎÊÑ¿ô¤È¤ÏÊ̤ÎÊÑ¿ô¤Ë)
mes test2 //Æɤ߹þ¤ó¤À¥Æ¥¥¹¥È¤òɽ¼¨