⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 memtable.h

📁 linux下的任天堂模拟器代码。供大家参考。
💻 H
字号:
/*Copyright (C) 1997-2007 ZSNES Team ( zsKnight, _Demo_, pagefault, Nach )http://www.zsnes.comhttp://sourceforge.net/projects/zsneshttps://zsnes.bountysource.comThis program is free software; you can redistribute it and/ormodify it under the terms of the GNU General Public Licenseversion 2 as published by the Free Software Foundation.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/#ifndef MEMTABLE_H#define MEMTABLE_Hextern void (*memtabler8[256])();extern void (*memtablew8[256])();extern void (*memtabler16[256])();extern void (*memtablew16[256])();typedef struct{  void (*memr8)();  void (*memw8)();  void (*memr16)();  void (*memw16)();} mrwp;extern mrwp regbank, membank, wrambank, srambank, erambank, sramsbank;extern mrwp sa1regbank, sa1rambank, sa1rambankb;extern mrwp dsp1bank, dsp2bank, dsp3bank, dsp4bank;extern mrwp setabank, setabanka, seta11bank, seta11banka;extern mrwp sfxbank, sfxbankb, sfxbankc, sfxbankd;extern mrwp obc1bank, c4bank, SPC7110bank, SPC7110SRAMBank;extern mrwp stbanka, stbankb;/*rep_stosd is my name for a 'copy <num> times a function pointer <func_ptr> intoa function pointer array <dest>' function, in honour of the almighty asminstruction rep stosd, which is able to do that (and much more).Since ZSNES is just full of func pointer arrays, it'll probably come in handy.*/static void rep_stosd(void (**dest)(), void (*func_ptr), size_t num){  while (num--) { dest[num] = func_ptr; }}static void map_mem(size_t dest, mrwp *src, size_t num){  rep_stosd(memtabler8+dest, src->memr8, num);  rep_stosd(memtablew8+dest, src->memw8, num);  rep_stosd(memtabler16+dest, src->memr16, num);  rep_stosd(memtablew16+dest, src->memw16, num);}#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -