* along with this program. If not, see <http://www.gnu.org/licenses/>.\r
*\r
* For further information please contact.\r
- * http://nyatla.jp/\r
- * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
+ * http://nyatla.jp/\r
+ * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
*\r
*********************************************************************************/\r
#include "NyLPC_cPtrStream_protected.h"\r
\r
struct NyLPC_TcRomPtrStream\r
{\r
- NyLPC_TcPtrStream_t _super;\r
- NyLPC_TChar* _rom; //ROMアドレス\r
- NyLPC_TInt32 _rom_size; //ROMサイズ\r
- NyLPC_TInt32 _ed; //読出し済みサイズ\r
- NyLPC_TInt16 _packet_size; //一度当たりの読出しサイズ制限\r
+ NyLPC_TcPtrStream_t _super;\r
+ NyLPC_TChar* _rom; //ROMアドレス\r
+ NyLPC_TInt32 _rom_size; //ROMサイズ\r
+ NyLPC_TInt32 _ed; //読出し済みサイズ\r
+ NyLPC_TInt16 _packet_size; //一度当たりの読出しサイズ制限\r
};\r
\r
NyLPC_TBool NyLPC_TcRomPtrStream_initialize(NyLPC_TcRomPtrStream_t* i_inst,void* i_rom_addr,NyLPC_TInt32 i_length,NyLPC_TInt16 i_packetsize);\r
//関数テーブル\r
static struct NyLPC_TcPtrStream_TInterface NyLPC_TcRomPtrStream_Interface=\r
{\r
- m_pread,\r
- NyLPC_cPtrStream_write_func,\r
- m_preadSeek_func,\r
- m_close\r
+ m_pread,\r
+ NyLPC_cPtrStream_write_func,\r
+ m_preadSeek_func,\r
+ m_close\r
};\r
\r
\r
\r
NyLPC_TBool NyLPC_TcRomPtrStream_initialize(NyLPC_TcRomPtrStream_t* i_inst,void* i_rom_addr,NyLPC_TInt32 i_length,NyLPC_TInt16 i_packetsize)\r
{\r
- NyLPC_ArgAssert(i_inst!=NULL);\r
- NyLPC_ArgAssert(i_rom_addr!=NULL);\r
- NyLPC_ArgAssert(i_length>0);\r
- NyLPC_ArgAssert(i_packetsize>0);\r
- i_inst->_super._interface=&NyLPC_TcRomPtrStream_Interface;\r
- i_inst->_rom=(NyLPC_TChar*)i_rom_addr;\r
- i_inst->_rom_size=i_length;\r
- i_inst->_packet_size=i_packetsize;\r
- return NyLPC_TBool_TRUE;\r
+ NyLPC_ArgAssert(i_inst!=NULL);\r
+ NyLPC_ArgAssert(i_rom_addr!=NULL);\r
+ NyLPC_ArgAssert(i_length>0);\r
+ NyLPC_ArgAssert(i_packetsize>0);\r
+ i_inst->_super._interface=&NyLPC_TcRomPtrStream_Interface;\r
+ i_inst->_rom=(NyLPC_TChar*)i_rom_addr;\r
+ i_inst->_rom_size=i_length;\r
+ i_inst->_packet_size=i_packetsize;\r
+ return NyLPC_TBool_TRUE;\r
}\r
\r
static void m_preadSeek_func(NyLPC_TcPtrStream_t* i_inst,NyLPC_TUInt16 i_seek)\r
{\r
- (void)i_inst;\r
- NyLPC_TcRomPtrStream_t* inst=(NyLPC_TcRomPtrStream_t*)i_inst;\r
- inst->_rom+=i_seek;\r
+ (void)i_inst;\r
+ NyLPC_TcRomPtrStream_t* inst=(NyLPC_TcRomPtrStream_t*)i_inst;\r
+ inst->_rom+=i_seek;\r
}\r
\r
\r
/*private*/\r
static NyLPC_TBool m_pread(NyLPC_TcPtrStream_t* i_inst,const void** o_buf_ptr,NyLPC_TUInt32 i_wait_msec)\r
{\r
- NyLPC_TInt32 size,psize;\r
- NyLPC_TcRomPtrStream_t* inst=(NyLPC_TcRomPtrStream_t*)i_inst;\r
- //引数\r
- NyLPC_ArgAssert(i_inst!=NULL);\r
- NyLPC_ArgAssert(o_buf_ptr!=NULL);\r
- //クローズしてない?\r
- NyLPC_Assert(inst->_rom!=NULL);\r
-\r
- size=inst->_rom_size-inst->_ed; //残り長さ計算\r
- psize=(size>inst->_packet_size)?inst->_packet_size:size; //パケットサイズ計算\r
- *o_buf_ptr=(inst->_rom+inst->_ed); //現在位置を返す\r
- inst->_ed+=psize;//読出し位置更新\r
- return psize;\r
+ NyLPC_TInt32 size,psize;\r
+ NyLPC_TcRomPtrStream_t* inst=(NyLPC_TcRomPtrStream_t*)i_inst;\r
+ //引数\r
+ NyLPC_ArgAssert(i_inst!=NULL);\r
+ NyLPC_ArgAssert(o_buf_ptr!=NULL);\r
+ //クローズしてない?\r
+ NyLPC_Assert(inst->_rom!=NULL);\r
+\r
+ size=inst->_rom_size-inst->_ed; //残り長さ計算\r
+ psize=(size>inst->_packet_size)?inst->_packet_size:size; //パケットサイズ計算\r
+ *o_buf_ptr=(inst->_rom+inst->_ed); //現在位置を返す\r
+ inst->_ed+=psize;//読出し位置更新\r
+ return psize;\r
}\r
\r
\r
static void m_close(NyLPC_TcPtrStream_t* i_inst)\r
{\r
- NyLPC_TcRomPtrStream_t* inst=(NyLPC_TcRomPtrStream_t*)i_inst;\r
- inst->_rom=NULL;\r
+ NyLPC_TcRomPtrStream_t* inst=(NyLPC_TcRomPtrStream_t*)i_inst;\r
+ inst->_rom=NULL;\r
}\r
\r
\r