çè«
ãã®ã¡ãœããã®ã¢ã€ãã¢ã¯ãã²ãŒã å ã®ãã¹ãŠã®ãã€ããäžåºŠã«1ã€ãã€å€æŽãããããã®ãããããå€éšçã«ã¬ãã«ãå€æŽãããã©ããã確èªããããšã§ãã ãããèªåã®æã§è¡ãã«ã¯éåžžã«é·ãæéãããããããè£å©ããŒã«ãã€ãŸãFCEUXãšãã¥ã¬ãŒã¿ã«çµã¿èŸŒãŸããLuaã¹ã¯ãªããèšèªã䜿çšããå¿ èŠããããŸãããã®æ©èœãšå¶éã«ã€ããŠã¯ä»¥äžã§èª¬æããŸãã
ããã«ãçµæã確èªããããã»ã¹ã«ã¯å€å°ã®å°é£ã䌎ããŸããå€æŽãããROMã€ã¡ãŒãžããšãã¥ã¬ãŒã¿ãŒã«ããŒãããŠãããã²ãŒã ãæåã®ã¬ãã«ã®èµ·åãã€ã³ãã«ç§»åããå¿ èŠããããŸãã ããã«ãã¬ãã«ã®éå§çŽåŸã«å ã®ã€ã¡ãŒãžã§äœæãããæ¢è£œã®ãšãã¥ã¬ãŒã¿ãŒä¿åãåã«ããŒãããããšã¯äžå¯èœã§ã-ã€ã¡ãŒãžã®ããŒã¿ã¯ãã§ã«ãããªã¡ã¢ãªãšRAMã«ç§»åããæåã®ã¬ãã«ã®ç»é¢ã¯å€æŽãããªããŸãŸã§ãããå ã®ã€ã¡ãŒãžãšèŠèŠçã«åºå¥ããããšã¯ã§ããŸããã ãããã£ãŠãFCEUXãšãã¥ã¬ãŒã¿ãŒã§ãã¹ãŠã®ããŒã¹ãããŒã¯ã®ç¹°ãè¿ããèšé²ããå¿ èŠããããŸããFCEUXãšãã¥ã¬ãŒã¿ãŒã¯ãã²ãŒã ãéå§ç»é¢ããã¬ãã«ã®éå§ãŸã§å°ããŸãïŒããã¯ã[ ãã¡ã€ã« ]- > [ã ãŒã㌠]- > [ã ãŒããŒãèšé²... ]ã¡ãã¥ãŒã䜿çšããŠè¡ãããŸãïŒãç¬éè² è·ã¬ãã«ã ã¬ãã«ã®éå§åã«ãã²ãŒã ã®ã¡ã€ã³ã¡ãã¥ãŒã®[éå§ ]ãã¿ã³ãæŒããåŸãç»é¢äžã®ç»åãæ°ç§éæããªãããã®æç¹ã§ã¬ãã«ã®æåã®ã²ãŒã ç»é¢ãäœæãããŸãã
é©åãªæéã«ä¿åããã«ã¯ãæéãæ°åé ãããããšãã§ããŸãïŒã¡ãã¥ãŒNES->ãšãã¥ã¬ãŒã·ã§ã³é床->é床ããŠã³ ïŒã Config-> Map Hotkeysã¡ãã¥ãŒã§ãããããŒãèšå®ããŠãããŒããŒãããã²ãŒã ãç°¡åã«å é/æžéããããšããå§ãããŸã ç»é¢ãæããªãã®ãåŸ ã¡ããã®æç¹ã§ïŒã²ãŒã ç»é¢ã衚瀺ããããŸã§ïŒãã²ãŒã ãä¿åããŸãïŒããšãã°ã Shift + F1ããŒã®çµã¿åããã䜿çšããŠãã¹ããã1ã«ïŒã ããã«äœæ¥ãé²ããã«ã¯ãä¿åãè¡ããããã¬ãŒã ãšã²ãŒã ç»é¢ã衚瀺ããããã¬ãŒã ãæ€åºããå¿ èŠããããŸãïŒã¡ãã¥ãŒé ç®Config-> Display-> Frame Counterã䜿çšããŠãç»é¢äžã®çŸåšã®ãã¬ãŒã ãã¬ãŒã ã®è¡šç€ºãæå¹ã«ã§ããŸãïŒã ããã¯ã以åã«é»ãç»é¢ãåé€ããªãããã«ãæ¢ã«äœæãããŠããã¬ãã«ç»é¢ã®ã¹ã¯ãªãŒã³ã·ã§ãããæ®ãããã«å¿ èŠã«ãªããŸãã
ã¹ã¯ãªãŒã³ã·ã§ããã§ã¯ããã¬ãŒã 454ãš560ã®éã®ç¬éã«ã¬ãã«ããŒã¿ãç»åããã¡ã¢ãªã«ããŒããããŸãã
ãããã£ãŠãã¬ãã«ããŒã¿ãæ€çŽ¢ããã¢ã«ãŽãªãºã ã¯æ¬¡ã®ããã«ãªããŸãã
- ãšãã¥ã¬ãŒã¿ã§å€æŽãããROMãå®è¡ããŸã
- äºåã«æºåãããã¹ãã¬ãŒãžãå ã®ROMã€ã¡ãŒãžã«ããŒãããŸãïŒã€ã¡ãŒãžã®ããŒã¿ããããªã¡ã¢ãªã«ããŒãããŠãç»é¢ã®ã¬ãã«ãå€æŽãããšãïŒã
- 枬å®ããããã¬ãŒã æ°ãåŸ ã£ãŠããŸãïŒããã«ãããç»é¢ã«ç»åã衚瀺ãããç¬éã«ãã¬ãŒã ã«ãŠã³ã¿ãŒã®å€ãèŠã€ããŸããïŒã
- ã¹ã¯ãªãŒã³ã·ã§ãããæ®ããŸãã
- å€æŽãããROMã€ã¡ãŒãžã®æ¬¡ã®ããŒãžã§ã³ã«å¯ŸããŠããã»ã¹ãç¹°ãè¿ããŸãã
- æ®åœ±ãããã¹ã¯ãªãŒã³ã·ã§ãããåæããŸãïŒæ®åœ±ãããã¹ã¯ãªãŒã³ã·ã§ããã®ååã§ã¯ãå€æŽããããã€ãã®ã¢ãã¬ã¹ã瀺ãå¿ èŠããããããã©ã®å€æŽãã¹ã¯ãªãŒã³äžã®ããŒã¿ãå€æŽããããšããäºå®ã«ã€ãªãã£ãããæ確ã§ãïŒã
ã»ãšãã©ã®å Žåãç»é¢äžã®ç»åã¯å€æŽãããããŸã£ããå€æŽãããªãããšããããŸããROMç»åã®äžéšã®ããŒãžã§ã³ã§ã¯ãã²ãŒã ã³ãŒããå¿ ç¶çã«å£ããç»é¢ã«ã¿ã€ã«ã®å¥åŠãªæ··ä¹±ãçããããšããããããæçµçãªç®æšã¯ç»é¢ãå€æŽãããããŒãžã§ã³ãèŠã€ããããšã§ããã¯ããããã¯ã¯1ã€ã ãã§ãïŒNESã®ã¬ãã«ç»é¢ã¯ãã¯ããããã¯ã§æ§æãããŠããŸãïŒã ãã®ãããªã¹ã¯ãªãŒã³ã·ã§ãããèŠã€ãããšãç»é¢ã説æãããããã¯çªå·ã®é åãä¿åãããŠããã¢ãã¬ã¹ãæ確ã«ãªããŸãã
ãšãã¥ã¬ãŒã¿ã«çµã¿èŸŒãŸããLuaèšèªã䜿çšãããšãããã»ããµã®ã¡ã¢ãªãšã¬ãžã¹ã¿ãæäœã§ããŸãããæ¢ã«ããŒããããŠããROMã«ãŒããªããžã€ã¡ãŒãžã§åäœããããã«èšèšãããŠãããããROMã€ã¡ãŒãžã®å€æŽããŒãžã§ã³ãããŒãããããããŒãåŸã«ã€ã¡ãŒãžèªäœãå€æŽãããããããšã¯ã§ããŸãããã䜿çšããããšã¯ã§ããŸãã¢ã«ãŽãªãºã ã®ã¹ããã2ã3ã4ãå®è£ ããŸãã
èªåè æã®æåã®ããŒãžã§ã³ã®æ®ãã®éšåã¯ãPythonèšèªã䜿çšããããšã«ããŸããã ãã ãããã®ããŒãžã§ã³ã«ã¯ããã€ãã®é倧ãªæ¬ ç¹ããããŸãã-çæãããæ°åã®ROMã€ã¡ãŒãžã¯å€ãã®ã¹ããŒã¹ãå æãããšãã¥ã¬ãŒã¿ã¯ã³ãã³ãã©ã€ã³ããå¥ã®ã¢ããªã±ãŒã·ã§ã³ãšããŠåžžã«èµ·åãããéããããŠãããããããã«ãã©ãŒã«ã¹ãåãæ¿ãããããããå®è¡äžã®ã¹ã¯ãªããã§ãã·ã³ã§äœæ¥ããã®ã¯äžäŸ¿ã§ããããäœæ¥äžã«éããŸãã ãã®ããããã®èšäºã§ã¯ããšãã¥ã¬ãŒã¿ããçŽæ¥ROMã€ã¡ãŒãžå ã®ãã€ããå€æŽããããã«ãå¿ èŠãªæ©èœãLuaã¢ãžã¥ãŒã«ã«è¿œå ããããšã«ããŸããã
å·¥å ·è£œäœ
幞ããªããšã«ãFCEUXãšãã¥ã¬ãŒã¿ãŒã®ãœãŒã¹ã³ãŒããå©çšã§ããããããœãŒã¹ãããŠã³ããŒãããŠå€æŽãè¿œå ã§ããŸãã
ROMã€ã¡ãŒãžãããã€ããèªã¿åãé¢æ°ïŒ fceu.cpp ãé¢æ°FCEU_ReadRomByte ïŒãèŠã€ããæžã蟌ã¿çšã«åãããŒãžã§ã³ãè¿œå ããŸãã
//æ°ãã
void FCEU_WriteRomByte ïŒ uint32 iã uint8 value ïŒ
{
if ïŒ i < 16 + PRGsize [ 0 ] ïŒ PRGptr [ 0 ] [ i - 16 ] = value ;
else if ïŒ i < 16 + PRGsize [ 0 ] + CHRsize [ 0 ] ïŒ CHRptr [ 0 ] [ i - 16 - PRGsize [ 0 ] ] = value ;
}
次ã«ããã®é¢æ°ãLuaïŒãã¡ã€ã«lua_engine.cpp ïŒããåŒã³åºãæ©èœãã転éãããŸãã
static int rom_writebyte ïŒ lua_State * L ïŒ
{
FCEU_WriteRomByte ïŒ luaL_checkinteger ïŒ Lã 1 ïŒ ãluaL_checkinteger ïŒ Lã 2 ïŒ ïŒ
1ã è¿ã ãŸãã
}
static const struct luaL_reg romlib [ ] = {
{ "readbyte" ãrom_readbyte } ã
{ "readbytesigned" ãrom_readbytesigned } ã
//眲åãªãã®ä»£æ¿åœåã¹ããŒã
{ "readbyteunsigned" ãrom_readbyte } ã
{ "writebyte" ãrom_writebyte } ã //æ°ããé¢æ°
{ "gethash" ãrom_gethash } ã
{ NULL ã NULL }
} ;
ãããã£ãŠãã¹ã¯ãªããããããŒã¿ã®ãã€ããå€æŽããæ©äŒãåŸãŠãæ°åã®ç°ãªãããŒãžã§ã³ã®ROMã€ã¡ãŒãžãäœæããŠããŒãããå¿ èŠæ§ãåãé€ããŸããã
次ã®ã¹ãããã¯ãã¹ã¯ãªãŒã³ã·ã§ãããä¿åããåã«åæããããLuaã«æããããšã§ãã ãããè¡ãã«ã¯ã gui.savescreenshotïŒïŒé¢æ°ã䜿çšããŠã¹ã¯ãªãŒã³ã·ã§ãããæšæºãã¡ã€ã«ã«ä¿åãã代ããã«ã gui.gdscreenshotïŒïŒé¢æ°ã䜿çšããŠã¡ã¢ãªã«æ®ããåãã¹ã¯ãªãŒã³ã·ã§ãããæ¢ã«ååŸãããŠãããã©ããã確èªããŸãïŒããã«ã¯ããã§ã«ååŸããããã¹ãŠã®ã¹ã¯ãªãŒã³ã·ã§ããã®ããã·ã¥ãä¿åããå¿ èŠããããŸãïŒãäžæã®ãã£ã¹ã¯ã®ã¿ã«ä¿åããŸãã ããã«ããã1ãã€ããå€æŽããŠãã²ãŒã ã®æåã®ç»é¢ã«åœ±é¿ãäžããªãã£ãäœåãã®åäžã®ã¹ã¯ãªãŒã³ã·ã§ãããä¿åã§ããªããªããŸãã
ã¹ã¯ãªãŒã³ã·ã§ãããä¿åããããã«ã gdã©ã€ãã©ãªã䜿çšããŸããïŒ ããã§ã³ã³ãã€ã«æžã¿ããŒãžã§ã³ãå ¥æãããããœãŒã¹ããèªåã§ã³ã³ãã€ã«ã§ããŸãïŒã解åããããã¡ã€ã«ã¯ããšãã¥ã¬ãŒã¿ãŒããã«ãããããã©ã«ããŒã«å ¥ããå¿ èŠããããŸãã ããã·ã¥ãèšç®ããããã«ãã¡ãã£ãšããããªãã¯ã䜿çšããŸãã-ãšãã¥ã¬ãŒã¿ãŒèªäœããèšç®é¢æ°ãæããŸããïŒROMã€ã¡ãŒãžã®ãã§ãã¯ãµã ã®èšç®ã«äœ¿çšãããŸããïŒïŒ
// lua_engine.cppãã¡ã€ã«
static int calchash ïŒ lua_State * L ïŒ {
const char * buffer = luaL_checkstring ïŒ Lã 1 ïŒ ;
intãµã€ãº= luaL_checkinteger ïŒ Lã 2 ïŒ ;
int hash = CalcCRC32 ïŒ 0 ã ïŒ uint8 * ïŒãããã¡ãŒããµã€ãºïŒ ;
lua_pushinteger ïŒ Lãããã·ã¥ïŒ ;
1ã è¿ã ãŸãã
}
static const struct luaL_reg emulib [ ] = {
//ã³ãŒãã®äžéšãæ¬ èœããŠããŸã
// ...
{ "readonly" ãmovie_getreadonly } ã
{ "setreadonly" ãmovie_setreadonly } ã
{ "print" ãprint } ã //確ãã«ããªã
{ "calchash" ãcalchash } ã
{ NULL ã NULL }
} ;
ç Žæããã¹ã¯ãªãããšãã®äœ¿çš
ããã§æºåäœæ¥ãããããå®äºããã€ã¡ãŒãžç Žæã®Luaã¹ã¯ãªãããäœæã§ããŸãïŒè¡æ«ã®ã³ã¡ã³ããå®å šã«è¡šç€ºãããªãå Žåã¯ãgithubã§ã³ã¡ã³ãä»ãã¹ã¯ãªããã確èªã§ããŸããèšäºã®æåŸã«ãªã³ã¯ããããŸãïŒã
-gdã©ã€ãã©ãªãããŠã³ããŒãããŸã
ãgdãã å¿ èŠ
-ç Žæã®åæã¢ãã¬ã¹ïŒROMã€ã¡ãŒãžããããŒããçŽæ¥ïŒ
START_ADDR = 0x10
-ç Žæã®çµäºã¢ãã¬ã¹ïŒã«ãŒããªããžãäœæãããããããŒã«å¿ããŠããã¡ã€ã«ãµã€ãºãç°¡åã«èšå®ã§ããŸãïŒ
END_ADDR = 0x20010
CUR_ADDR = START_ADDR
-æçµçãªãã¬ãŒã çªå·ããã®åŸãã¹ã¯ãªãŒã³ã·ã§ãããæ®ãå¿ èŠããããŸãïŒãã¬ãŒã€ãŒã®ã²ãŒã ç»é¢ãæ¢ã«è¡šç€ºãããŠããå Žåãäœæãããã»ãŒãã®æ°ã枬å®ãããŸãïŒ
FRAME_FOR_SCREEN = 7035
-ã²ãŒã ãã€ãã®ä»£ããã«æžã蟌ãŸãããã¹ãå€
WRITE_VALUE = 0x33
-æ€çŽ¢æéãç¯çŽããããã®ä¿®æ£ãå®è¡ãããã¹ããã
-ïŒç»é¢äžã®åãã€ããå€æŽããå¿ èŠã¯ãããŸãããå€æ°ã®ãã¯ããããã¯ãç»é¢ã«è¡šç€ºã§ããŸããå°ãªããšã1ã€ãæ€åºããã°ååã§ãïŒã
ã¹ããã= 8
-ãã¹ãŠã®äžæã®ã¹ã¯ãªãŒã³ã·ã§ããã®ããã·ã¥ãä¿åããããã®ããŒãã«
shas = { }
-åŸã§åŸ©å ããããã«ãç Žæã«ãã£ãŠç Žæããå€ããªã¢ãŒã
lastValue = rom ã readbyte ïŒ START_ADDR ïŒ
-äºåã«æºåãããã¹ãã¬ãŒãžãæåã®ã¹ãããããããŒãããŸãïŒãšãã¥ã¬ãŒã¿ãŒã®ã¹ãããã®çªå·ã¯0ããå§ãŸããLuaã§ã¯1ããå§ãŸããŸãïŒã
s = savestate ã äœæïŒ 2 ïŒ
savestate ã è² è·ïŒ s ïŒ
while ïŒ true ïŒ do
-ç»é¢ãããŒãããããã§ã«è¡šç€ºãããŠããå Žå
if ïŒ emuãframecount ïŒ ïŒ > FRAME_FOR_SCREEN ïŒ then
-ã¹ã¯ãªãŒã³ã·ã§ãããã¡ã¢ãªã«ä¿å
ããŒã«ã« gdStr = gui ã gdscreenshot ïŒ ïŒ ;
-ããã·ã¥ãèšç®ãã
ããŒã«ã«ããã·ã¥= emu calchash ïŒ gdStr ã string.len ïŒ gdStr ïŒ ïŒ ;
-ã¹ã¯ãªãŒã³ã·ã§ããããŸã ãªãå Žå
if ïŒ shas [ hash ] ïŒã§ 㯠ãªã å Žå
print ïŒ "Found new screen" .. tostring ïŒ hash ïŒ ïŒ ;
local fname = string.format ïŒ "ïŒ 05X" ã CUR_ADDR ïŒ .. ".png" ;
ããŒã«ã« gdImg = gd createFromGdStr ïŒ gdStr ïŒ ;
-å€æŽããããã€ãã®ååã«ã¢ãã¬ã¹ãä»ããŠã¹ã¯ãªãŒã³ã·ã§ããããã£ã¹ã¯ã«ä¿åããŸã
gdImg ïŒ png ïŒ fname ïŒ
shas [ããã·ã¥] = true ;
çµãã ;
-åã®ãã€ãå€ã埩å ãã
rom ã writebyte ïŒ CUR_ADDR ã lastValue ïŒ ;
CUR_ADDR = CUR_ADDR + STEP ;
-次ã®ãã€ãã®ç Žæ
lastValue = rom ã readbyte ïŒ CUR_ADDR ïŒ ;
rom ã writebyte ïŒ CUR_ADDR ã WRITE_VALUE ïŒ ;
-åã³ã»ãŒããããŒãããŠãã²ãŒã ãæ°ããã€ã¡ãŒãžããã¡ã¢ãªã«ããŒã¿ãããŒãã§ããããã«ããŸã
s = savestate ã äœæïŒ 2 ïŒ
-é²è¡ç¶æ³ã®è¡šç€º
savestate ã è² è·ïŒ s ïŒ
gui ã text ïŒ 20ã20 ã string.format ïŒ "ïŒ 05X" ã CUR_ADDR ïŒ ïŒ ;
-ãã¹ãŠã®ã¢ãã¬ã¹ãåŠçããããããšãã¥ã¬ãŒã¿ãŒãåæ¢ããŸã
if ïŒ CUR_ADDR > END_ADDR ïŒ then
ãšãã¥ãŒ äžæåæ¢ïŒ ïŒ ;
çµãã
çµãã ;
-次ã®ãã¬ãŒã ãŸã§ãšãã¥ã¬ãŒã·ã§ã³ãã©ãããã
ãšãã¥ãŒ frameadvance ïŒ ïŒ ;
çµãã ;
ã¹ã¯ãªããã§ãšãã¥ã¬ãŒã¿ãå®è¡ããã«ã¯ã次ã®ã³ã³ãã³ãã®ããããã¡ã€ã«ã䜿çšã§ããŸãã
fceux -turbo 1 -luaç Žæ.luaããžã£ãã«ã«ïŒUïŒ[ïŒ]ãnesã
ïŒ ã¿ãŒãããŒã䜿çšãããšããšãã¥ã¬ãŒã¿ãæãé«éãªã¢ãŒãã§èµ·åã§ããŸãïŒã
ç§ã®ãã·ã³ã®ã¹ã¯ãªããã¯ããã¹ãŠã®ããŒã¿ã8åã§åŠçããŸãã åäœæéãé·ãããå Žåã¯ã STEPã¹ããããç»é¢ããšã«æ倧64ãŸã§å€§ããããŠãã²ãŒã ãããæ£ç¢ºã«ããããšãã§ããŸãããã®å Žåãèµ·åãã¬ãŒã ãšã¹ã¯ãªãŒã³ã·ã§ãããæ®ããããã¬ãŒã ã®éã®æéã¯æå°éã«ãªããŸãã
ããŸããŸãªã²ãŒã çšã®ã¹ã¯ãªãããèšå®ããããã®ããã€ãã®æšå¥šäºé ïŒç»é¢äžã®ããŒã¿ã¯ãå€ãã®å Žåãéè¡ã®å é ïŒ 0x2000ãŸãã¯0x4000ã®åæ°ã®ã¢ãã¬ã¹ïŒããå§ãŸãããããããã®ãŸãŒã³ã詳现ã«èª¿ã¹ãããšãã§ããŸãã ROMã€ã¡ãŒãžã«ãããªãã³ã¯ïŒ CHR-ROM ïŒãããå Žåããããªã¡ã¢ãªã®ã¿ãä¿åããããã調æ»ããããšã¯ã§ããŸããã ãããªãã³ã¯ã¯åžžã«ROMã€ã¡ãŒãžã®æåŸã«ããããã®çªå·ã¯ããããŒïŒROMã€ã¡ãŒãžã®æåã®16ãã€ãïŒã§ã確èªã§ããŸãã
ã²ãŒã "Jackal"ã®å Žåãã¹ã¯ãªããã¯235ã®ãŠããŒã¯ãªã¹ã¯ãªãŒã³ã·ã§ãããèŠã€ããŸãããããã®ã¹ã¯ãªãŒã³ã·ã§ããã¯ãããŸããŸãªã°ã©ãã£ãã¯ã®äžå ·åãå¹ åºã瀺ããŠããŸãã ãã ããã¢ãã¬ã¹0x105C8ã0x105D8ã0x105E8ã§å€æŽããããã€ããæã€ç»åããååŸããã¹ã¯ãªãŒã³ã·ã§ããã¯èå³æ·±ããã®ã§ãã
ããããããããã¯æããã§ãïŒ
- ã²ãŒã ã¯2x2ãããã¯ãµã€ãºã®ãã¯ããããã¯ã·ã¹ãã ïŒ4x4ã¿ã€ã«ïŒã䜿çšããŸãã
- ç»é¢ã¯ã16ãã¯ããããã¯å¹ ã®è¡ïŒ2ã€ã®é£æ¥ããã¢ãã¬ã¹ã®éãïŒã§èšè¿°ãããŸãã
- è¡ã¯ãäžããäžã®é ã«ROMã€ã¡ãŒãžã«ä¿åãããŸãã
åä¿¡ããããŒã¿ã§äœãã§ããŸããïŒ ããšãã°ãã¬ãã«ã®ãã¹ãŠã®ãã¯ããããã¯ã®åçãæºåãã CadEditorãããã¯ãšãã£ã¿ãŒã§ãããã䜿çšããŠã¬ãã«ããããšãã£ã¿ãŒãäœæããŸãã
ãããè¡ãã«ã¯ãã¹ã¯ãªããã¹ã¯ãªãããå°ãæžãçŽããŠãå¯èœæ§ã®ãããã¹ãŠã®ãã€ãå€ãã¢ãã¬ã¹ã«æžã蟌ã¿ãŸããããã«ãããç»é¢äžã®ãããã¯ïŒããšãã°ã 0x105C8 ïŒãå€æŽããããã¹ãŠã®ãããã¯ã®ã¹ã¯ãªãŒã³ã·ã§ãããæ®ãããŸãã ã¹ã¯ãªããã®å šæã¯æäŸããŸãããèšäºã®æåŸã«ãããµã³ãã«ã¢ãŒã«ã€ãïŒ corrupt_byte.lu a ïŒã«ãããŸãã æ®å¿µãªããã gdã©ã€ãã©ãªã¯ç»åã®äžéšã䟿å©ã«åŠçããããšãç®çãšããŠããªããããã¹ã¯ãªãŒã³ã·ã§ãããããã¯ããããã¯ç»åããåãã§ãã1ã€ã®é·ããããŒããã«ãŸãšããããã«ãå¥ã®Pythonã¹ã¯ãªãããäœæããå¿ èŠããããŸããïŒ PILã©ã€ãã©ãªãç»ååŠççšã«ã€ã³ã¹ããŒã«ããŸãïŒïŒ
ïŒ-*-ã³ãŒãã£ã³ã°ïŒutf-8-*-
ã€ã³ããŒãç»å
def cutBlock ïŒ pp ïŒ ïŒ
im =ã€ã¡ãŒãžã ãªãŒãã³ ïŒ pp ïŒ
ïŒä»»æã®ç»åãšãã£ã¿ãŒã«ã¹ã¯ãªãŒã³ã·ã§ãããã¢ããããŒãããŠããããã¯ã®å é ã®åº§æšã確èªããŸã
X = 96
Y = 96
ïŒã¹ã¯ãªãŒã³ã·ã§ããããæå®ããã座æšã§ãããã¯ãåãåããŸã
imCut = imã crop ïŒ ïŒ X ã Y ã X + 32 ã Y + 32 ïŒ ïŒ
imCutã ä¿å ïŒ "_" + pp ïŒ
xrange å ã® x ïŒ 256 ïŒ ïŒ
cutBlock ïŒ r "ïŒ 03d.png" ïŒ x ïŒ
BLOCK_COUNT = 102
MAX_BLOCK_COUNT = 256
imBig =ã€ã¡ãŒãžã æ°èŠ ïŒ "RGB" ã ïŒ 32 * MAX_BLOCK_COUNT ã 32 ïŒ ïŒ
xrange å ã® x ïŒ BLOCK_COUNT ïŒ ïŒ
im =ã€ã¡ãŒãžã ãªãŒãã³ ïŒ "_ïŒ 03d.png" ïŒ x ïŒ
imBigã 貌ãä»ã ïŒ im ã ïŒ 32 * x ã 0ã32 * x + 32ã32 ïŒ ïŒ
ïŒCadEditorã§äœ¿çšããããã®èŠä»¶ã§ãããã¯ããããã¯ãµã€ãºã64x64ã«å¢å
imBig64 = imBigã ãµã€ãºå€æŽ ïŒ ïŒ MAX_BLOCK_COUNT * 64ã64 ïŒ ïŒ
imBig64ã ä¿å ïŒ "outStrip.png" ïŒ
ã¬ãã«ãšãã£ã¿ãŒã«ã²ãŒã ãè¿œå ãã
æåŸã®éšåã¯æ®ããŸã-CadEditorãšãã£ã¿ãŒã®æ§æãã¡ã€ã«ãäœæããå¿ èŠããããŸããããã¯ãçµæã®ã€ã¡ãŒãžã䜿çšããŸãã CïŒãã¹ã¯ãªããèšèªãšããŠäœ¿çšããŸãïŒ CSScriptã©ã€ãã©ãªã䜿çšïŒã
ã¹ã¯ãªãŒã³ã·ã§ããã«ããã°ããã¯ããããã¯ãããã®è¡ã®å é ãèšç®ããŸããã¢ãã¬ã¹0x105C8ãè¡ã®4çªç®ã®ãã¯ããããã¯ãå€æŽããå Žåãã¢ãã¬ã¹0x105C5ãæåã®ãæ åœããŸãã 次ã«ããã³ãã¬ãŒãæ§æãäœæããŸãã
CadEditor ã䜿çšã ãŸã ã
System ã䜿çšã ãŸã ã
System.Collections.Generic ã䜿çšã ãŸãã
System.Drawing ã䜿çšã ãŸãã
ãããªã㯠ã¯ã©ã¹ããŒã¿
{
/ *è¡ã®å¢çãäžäžã«äº€äºã«ã·ããããŠãæ£ããã¢ãã¬ã¹ãèšç®ããŸã
ããŠã£ã³ããŠãã«æ£ãããã¬ãã«ããããã衚瀺ããããŸã§ã
éå§ã¢ãã¬ã¹0x10625ããã96è¡äžã«åŸéããŸãã
1-ã¬ãã«ããšã®ã²ãŒã ç»é¢ã®æ°ã
16 * 96-1ã²ãŒã ç»é¢ã®ãã€ãåäœã®ãµã€ãº
* /
public OffsetRec getScreensOffset ïŒ ïŒ { æ°ãã OffsetRec ïŒ 0x10625-16 * 96ã1ã16 * 96 ïŒã è¿ã ãŸãã }
public int getScreenWidth ïŒ ïŒ { 16ã è¿ã ; } //ç»é¢ã®å¹ ãèšå®ãã
public int getScreenHeight ïŒ ïŒ { return 96 ; } //ç»é¢ã®é«ããèšå®ãã
public int getBigBlocksCount ïŒ ïŒ { 256ã è¿ã ; }
//ã¹ããªããããã¯ããããã¯ç»åã«æ¥ç¶ããŸã
public string getBlocksFilename ïŒ ïŒ { return "jackal_1.png" ; }
//ãã®ã²ãŒã ã«å®è£ ãããŠããªããã¯ããããã¯ãšæµã®ãµããšãã£ã¿ãŒããªãã«ããŸã
public bool isBigBlockEditorEnabled ïŒ ïŒ { falseãè¿ã ; }
public bool isBlockEditorEnabled ïŒ ïŒ { falseãè¿ã ; }
public bool isEnemyEditorEnabled ïŒ ïŒ { falseãè¿ã ; }
}
ãã®ãããªæ§æã§ãšãã£ã¿ãŒã«ããŒããããã¬ãã«ãããã¯å¥åŠã«èŠããŸãããå®éã®ã¬ãã«ãããã«äŒŒãŠããŸãã
çµæã調ã¹ãåŸã16x8ãã¯ããããã¯ã®ãµã€ãºã®ç»é¢ã®è¡ã¯äžããäžã«é çªã«æ ŒçŽãããŸãããç»é¢èªäœã¯äžããäžã«æ ŒçŽãããŸããã€ãŸããç»é¢ã®8è¡ããšã«åé 眮ãããŸãã 幞ããªããšã«ããšãã£ã¿ãŒã«ã¯ãã€ã¡ãŒãžããROMã¬ãã«ãããŒãããæ¹æ³ãæå®ã§ããå€æ°ã®ã¡ãœããããããŸãã ãã®å Žåããã¯ããããã¯çªå·ãã«ãŒãããæ£ç¢ºã«èªã¿åãããæ¹æ³ãšãããã«å¿ããŠãšãã£ã¿ãŒã«ãã£ãŠæžãæ»ãããæ¹æ³ãå¶åŸ¡ãã2ã€ã®ç¹å¥ãªæ©èœãèšå®ããå¿ èŠããããŸãã
//ç¹å¥ãªé¢æ°ã䜿çšããŠãã¯ããããã¯çªå·ãååŸãããããšãã£ã¿ãŒã«æ瀺ããŸã
//ãããããŠèšé²ããŸã
public GetBigTileNoFromScreenFunc getBigTileNoFromScreenFunc ïŒ ïŒ { return getBigTileNoFromScreen ; }
public SetBigTileToScreenFunc setBigTileToScreenFunc ïŒ ïŒ { setBigTileToScreenãè¿ã; }
public int getBigTileNoFromScreen ïŒ int [ ] screenDataã int index ïŒ
{
int w = getScreenWidth ïŒ ïŒ ;
int noY = index / w ;
noY = ïŒ noY / 8 ïŒ * 8 + 7- ïŒ noY ïŒ 8 ïŒ ; //ãã¯ããããã¯ã®Y座æšã®å€æ
int noX =ã€ã³ããã¯ã¹ïŒ w ;
return screenData [ noY * w + noX ] ;
}
public void setBigTileToScreen ïŒ int [ ] screenDataã int indexã int value ïŒ
{
int w = getScreenWidth ïŒ ïŒ ;
int noY = index / w ;
noY = ïŒ noY / 8 ïŒ * 8 + 7- ïŒ noY ïŒ 8 ïŒ ; //ãã¯ããããã¯ã®Y座æšã®å€æ
int noX =ã€ã³ããã¯ã¹ïŒ w ;
screenData [ noY * w + noX ] = value ;
}
ããã§ããããæ£ãã衚瀺ãããã¬ãã«ãžãªã¡ããªãåæç»ã§ããŸãã
æ€çŽ¢æ¹æ³ã¯ãã»ãŒãã¹ãŠã®NESã²ãŒã ã«é©çšã§ããŸããã¢ãŒã«ã€ãã®ã¹ã¯ãªããã䜿çšããŠããæ°ã«å ¥ãã®ã²ãŒã ãåŠç¿ããããšãã§ããŸãã
ããã«ãããã€ãã®å€æŽãå ãããšããã®æ¹æ³ã¯ãSega Mega Driveãããã³ãSNESããã©ãããã©ãŒã ã«ãé©çšã§ããŸãïŒå€æŽããå¿ èŠãããã®ã¯ROMã€ã¡ãŒãžèªäœã§ã¯ãªããã³ã³ãœãŒã«ã®RAMãå€ãã®å Žåãå±éãããŠããªãã¬ãã«ã«ãŒããæ ŒçŽãããããšã§ãïŒ
次ã®èšäºã§ã¯ãã²ãŒã ã®äŸãšããŠãã²ãŒã ããžãã¯ããã€ã¹ãšãã²ãŒã ãªããžã§ã¯ããæ€çŽ¢ããŠãããäžã«è¡šç€ºããã³é 眮ããæ¹æ³ã瀺ããŸãã
åç §ïŒ
äŸä»ãã®ã¢ãŒã«ã€ã
ã³ã¡ã³ãä»ãã¹ã¯ãªãã