OSDN Git Service

bc2b5f5c35a9e0903e819c85f5ffea21f42225a4
[csp-qt/common_source_project-fm7.git] / source / src / vm / fmtowns / msdosrom.cpp
1 /*
2         FUJITSU FM Towns Emulator 'eFMTowns'
3
4         Author : Kyuma.Ohta <whatisthis.sowhat _at_ gmail.com>
5         Date   : 2019.01.09 -
6
7         [MSDOS ROM]
8 */
9
10 #include "./towns_common.h"
11 #include "./msdosrom.h"
12
13 namespace FMTOWNS {
14         
15 void MSDOSROM::initialize()
16 {
17         memset(rom, 0xff, sizeof(rom));
18         FILEIO *fio;
19         if(fio->Fopen(create_local_path(_T("FMT_DOS.ROM")), FILEIO_READ_BINARY)) { // MSDOS
20                 fio->Fread(rom, sizeof(rom), 1);
21                 fio->Fclose();
22         }
23         delete fio;
24 }
25
26 uint32_t MSDOSROM::read_data8(uint32_t addr)    
27 {
28         uint8_t d = 0xff;
29         if((addr >= 0xc2000000) && (addr < 0xc2080000)) {
30                 d = rom[addr & 0x7ffff];
31         }
32         return (uint32_t)d;
33 }
34
35
36 }