OSDN Git Service

[VM][WIP] Use namespace to devices per VMs.
[csp-qt/common_source_project-fm7.git] / source / src / vm / fp1100 / rompack.cpp
1 /*
2         CASIO FP-1100 Emulator 'eFP-1100'
3
4         Author : Takeda.Toshiya
5         Date   : 2010.06.18-
6
7         [ rom pack ]
8 */
9
10 #include "rompack.h"
11
12 namespace FP1100 {
13         
14 void ROMPACK::initialize()
15 {
16         memset(rom, 0xff, sizeof(rom));
17         
18         FILEIO* fio = new FILEIO();
19         if(fio->Fopen(create_local_path(_T("ROMPACK.ROM")), FILEIO_READ_BINARY)) {
20                 fio->Fread(rom, sizeof(rom), 1);
21                 fio->Fclose();
22         }
23         delete fio;
24 }
25
26 uint32_t ROMPACK::read_io8(uint32_t addr)
27 {
28         if(addr < 0x8000) {
29                 return rom[addr];
30         } else if(0xff00 <= addr && addr < 0xff80) {
31                 return 0x00; // device id
32         }
33         return 0xff;
34 }
35
36 }