Common Source Code Project for Qt (a.k.a for FM-7).
Revision | a242cd86aa4dbc2e52fed779f7b7e8ce7947c887 (tree) |
---|---|
Time | 2018-10-22 04:03:18 |
Author | K.Ohta <whatisthis.sowhat@gmai...> |
Commiter | K.Ohta |
[VM] .
@@ -17,6 +17,8 @@ | ||
17 | 17 | #define APU_TO_FIXED(x) ((x) << 16) |
18 | 18 | #define APU_FROM_FIXED(x) ((x) >> 16) |
19 | 19 | |
20 | +namespace FAMILYBASIC { | |
21 | + | |
20 | 22 | static const uint8_t vbl_length[32] = { |
21 | 23 | 5, 127, |
22 | 24 | 10, 1, |
@@ -935,3 +937,4 @@ bool APU::process_state(FILEIO* state_fio, bool loading) | ||
935 | 937 | return true; |
936 | 938 | } |
937 | 939 | |
940 | +} |
@@ -15,6 +15,9 @@ | ||
15 | 15 | #include "../../emu.h" |
16 | 16 | #include "../device.h" |
17 | 17 | |
18 | + | |
19 | +namespace FAMILYBASIC { | |
20 | + | |
18 | 21 | #define APUQUEUE_SIZE 4096 |
19 | 22 | #define APUQUEUE_MASK (APUQUEUE_SIZE - 1) |
20 | 23 |
@@ -193,5 +196,6 @@ public: | ||
193 | 196 | void initialize_sound(int rate, int samples); |
194 | 197 | }; |
195 | 198 | |
199 | +} | |
196 | 200 | #endif |
197 | 201 |
@@ -22,9 +22,14 @@ | ||
22 | 22 | #include "../debugger.h" |
23 | 23 | #endif |
24 | 24 | |
25 | -#include "memory.h" | |
26 | -#include "apu.h" | |
27 | -#include "ppu.h" | |
25 | +#include "./memory.h" | |
26 | +#include "./apu.h" | |
27 | +#include "./ppu.h" | |
28 | + | |
29 | +using FAMILYBASIC::MEMORY; | |
30 | +using FAMILYBASIC::APU; | |
31 | +using FAMILYBASIC::PPU; | |
32 | + | |
28 | 33 | |
29 | 34 | // ---------------------------------------------------------------------------- |
30 | 35 | // initialize |
@@ -48,7 +53,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu) | ||
48 | 53 | // cpu = new M6502(this, emu); |
49 | 54 | opll = new YM2413(this, emu); |
50 | 55 | |
51 | - memory = new FAMILYBASIC_MEMORY(this, emu); | |
56 | + memory = new MEMORY(this, emu); | |
52 | 57 | apu = new APU(this, emu); |
53 | 58 | ppu = new PPU(this, emu); |
54 | 59 | cpu = new N2A03(this, emu); // cpu shoud be reset after other device |
@@ -86,8 +86,6 @@ typedef struct header_s { | ||
86 | 86 | } |
87 | 87 | } header_t; |
88 | 88 | |
89 | -class csp_state_utils; | |
90 | - | |
91 | 89 | class EMU; |
92 | 90 | class DEVICE; |
93 | 91 | class EVENT; |
@@ -96,9 +94,11 @@ class DATAREC; | ||
96 | 94 | class N2A03; |
97 | 95 | class YM2413; |
98 | 96 | |
99 | -class FAMILYBASIC_MEMORY; | |
100 | -class APU; | |
101 | -class PPU; | |
97 | +namespace FAMILYBASIC { | |
98 | + class MEMORY; | |
99 | + class APU; | |
100 | + class PPU; | |
101 | +} | |
102 | 102 | |
103 | 103 | class VM : public VM_TEMPLATE |
104 | 104 | { |
@@ -113,9 +113,9 @@ protected: | ||
113 | 113 | N2A03* cpu; |
114 | 114 | YM2413* opll; |
115 | 115 | |
116 | - FAMILYBASIC_MEMORY* memory; | |
117 | - APU* apu; | |
118 | - PPU* ppu; | |
116 | + FAMILYBASIC::MEMORY* memory; | |
117 | + FAMILYBASIC::APU* apu; | |
118 | + FAMILYBASIC::PPU* ppu; | |
119 | 119 | |
120 | 120 | int boot_mode; |
121 | 121 |
@@ -13,9 +13,11 @@ | ||
13 | 13 | #include "../datarec.h" |
14 | 14 | #include "../ym2413.h" |
15 | 15 | |
16 | +namespace FAMILYBASIC { | |
17 | + | |
16 | 18 | #define EVENT_DMA_DONE 0 |
17 | 19 | |
18 | -void FAMILYBASIC_MEMORY::initialize() | |
20 | +void MEMORY::initialize() | |
19 | 21 | { |
20 | 22 | key_stat = emu->get_key_buffer(); |
21 | 23 | joy_stat = emu->get_joy_buffer(); |
@@ -24,7 +26,7 @@ void FAMILYBASIC_MEMORY::initialize() | ||
24 | 26 | register_vline_event(this); |
25 | 27 | } |
26 | 28 | |
27 | -void FAMILYBASIC_MEMORY::load_rom_image(const _TCHAR *file_name) | |
29 | +void MEMORY::load_rom_image(const _TCHAR *file_name) | |
28 | 30 | { |
29 | 31 | FILEIO* fio = new FILEIO(); |
30 | 32 |
@@ -75,7 +77,7 @@ void FAMILYBASIC_MEMORY::load_rom_image(const _TCHAR *file_name) | ||
75 | 77 | save_ram_crc32 = get_crc32(save_ram, sizeof(save_ram)); |
76 | 78 | } |
77 | 79 | |
78 | -void FAMILYBASIC_MEMORY::save_backup() | |
80 | +void MEMORY::save_backup() | |
79 | 81 | { |
80 | 82 | if(save_ram_crc32 != get_crc32(save_ram, sizeof(save_ram))) { |
81 | 83 | FILEIO* fio = new FILEIO(); |
@@ -87,7 +89,7 @@ void FAMILYBASIC_MEMORY::save_backup() | ||
87 | 89 | } |
88 | 90 | } |
89 | 91 | |
90 | -void FAMILYBASIC_MEMORY::release() | |
92 | +void MEMORY::release() | |
91 | 93 | { |
92 | 94 | if(rom != NULL) { |
93 | 95 | free(rom); |
@@ -96,7 +98,7 @@ void FAMILYBASIC_MEMORY::release() | ||
96 | 98 | save_backup(); |
97 | 99 | } |
98 | 100 | |
99 | -void FAMILYBASIC_MEMORY::reset() | |
101 | +void MEMORY::reset() | |
100 | 102 | { |
101 | 103 | memset(ram, 0, sizeof(ram)); |
102 | 104 |
@@ -118,7 +120,7 @@ void FAMILYBASIC_MEMORY::reset() | ||
118 | 120 | vrc7_reset(); |
119 | 121 | } |
120 | 122 | |
121 | -void FAMILYBASIC_MEMORY::write_data8(uint32_t addr, uint32_t data) | |
123 | +void MEMORY::write_data8(uint32_t addr, uint32_t data) | |
122 | 124 | { |
123 | 125 | addr &= 0xffff; |
124 | 126 |
@@ -205,7 +207,7 @@ void FAMILYBASIC_MEMORY::write_data8(uint32_t addr, uint32_t data) | ||
205 | 207 | } |
206 | 208 | } |
207 | 209 | |
208 | -uint32_t FAMILYBASIC_MEMORY::read_data8(uint32_t addr) | |
210 | +uint32_t MEMORY::read_data8(uint32_t addr) | |
209 | 211 | { |
210 | 212 | addr &= 0xffff; |
211 | 213 |
@@ -378,7 +380,7 @@ uint32_t FAMILYBASIC_MEMORY::read_data8(uint32_t addr) | ||
378 | 380 | } |
379 | 381 | } |
380 | 382 | |
381 | -void FAMILYBASIC_MEMORY::event_vline(int v, int clock) | |
383 | +void MEMORY::event_vline(int v, int clock) | |
382 | 384 | { |
383 | 385 | // 525 -> 262.5 |
384 | 386 | if(v & 1) { |
@@ -400,13 +402,13 @@ void FAMILYBASIC_MEMORY::event_vline(int v, int clock) | ||
400 | 402 | } |
401 | 403 | } |
402 | 404 | |
403 | -void FAMILYBASIC_MEMORY::event_callback(int event_id, int err) | |
405 | +void MEMORY::event_callback(int event_id, int err) | |
404 | 406 | { |
405 | 407 | // dma done |
406 | 408 | d_cpu->write_signal(SIG_CPU_BUSREQ, 0, 1); |
407 | 409 | } |
408 | 410 | |
409 | -void FAMILYBASIC_MEMORY::set_rom_bank(uint8_t bank, uint32_t bank_num) | |
411 | +void MEMORY::set_rom_bank(uint8_t bank, uint32_t bank_num) | |
410 | 412 | { |
411 | 413 | bank_ptr[bank] = rom + 0x2000 * (bank_num & rom_mask); |
412 | 414 | banks[bank] = bank_num; |
@@ -417,7 +419,7 @@ void FAMILYBASIC_MEMORY::set_rom_bank(uint8_t bank, uint32_t bank_num) | ||
417 | 419 | |
418 | 420 | // mmc5 |
419 | 421 | |
420 | -void FAMILYBASIC_MEMORY::mmc5_reset() | |
422 | +void MEMORY::mmc5_reset() | |
421 | 423 | { |
422 | 424 | if(header.mapper() == 5) { |
423 | 425 | mmc5_set_wram_bank(3, 0); |
@@ -443,7 +445,7 @@ void FAMILYBASIC_MEMORY::mmc5_reset() | ||
443 | 445 | } |
444 | 446 | } |
445 | 447 | |
446 | -uint32_t FAMILYBASIC_MEMORY::mmc5_lo_read(uint32_t addr) | |
448 | +uint32_t MEMORY::mmc5_lo_read(uint32_t addr) | |
447 | 449 | { |
448 | 450 | uint8_t data = (uint8_t)(addr >> 8); |
449 | 451 |
@@ -462,7 +464,7 @@ uint32_t FAMILYBASIC_MEMORY::mmc5_lo_read(uint32_t addr) | ||
462 | 464 | return data; |
463 | 465 | } |
464 | 466 | |
465 | -void FAMILYBASIC_MEMORY::mmc5_lo_write(uint32_t addr, uint32_t data) | |
467 | +void MEMORY::mmc5_lo_write(uint32_t addr, uint32_t data) | |
466 | 468 | { |
467 | 469 | switch(addr) { |
468 | 470 | case 0x5100: |
@@ -556,12 +558,12 @@ void FAMILYBASIC_MEMORY::mmc5_lo_write(uint32_t addr, uint32_t data) | ||
556 | 558 | } |
557 | 559 | } |
558 | 560 | |
559 | -//uint32_t FAMILYBASIC_MEMORY::mmc5_save_read(uint32_t addr) | |
561 | +//uint32_t MEMORY::mmc5_save_read(uint32_t addr) | |
560 | 562 | //{ |
561 | 563 | // return bank_ptr[3][addr & 0x1fff]; |
562 | 564 | //} |
563 | 565 | |
564 | -void FAMILYBASIC_MEMORY::mmc5_save_write(uint32_t addr, uint32_t data) | |
566 | +void MEMORY::mmc5_save_write(uint32_t addr, uint32_t data) | |
565 | 567 | { |
566 | 568 | if(mmc5_wram_protect0 == 0x02 && mmc5_wram_protect1 == 0x01) { |
567 | 569 | if(mmc5_wram_bank[3] < 8) { |
@@ -570,7 +572,7 @@ void FAMILYBASIC_MEMORY::mmc5_save_write(uint32_t addr, uint32_t data) | ||
570 | 572 | } |
571 | 573 | } |
572 | 574 | |
573 | -void FAMILYBASIC_MEMORY::mmc5_hi_write(uint32_t addr, uint32_t data) | |
575 | +void MEMORY::mmc5_hi_write(uint32_t addr, uint32_t data) | |
574 | 576 | { |
575 | 577 | if(mmc5_wram_protect0 == 0x02 && mmc5_wram_protect1 == 0x01) { |
576 | 578 | if(addr < 0xa000) { |
@@ -593,7 +595,7 @@ void FAMILYBASIC_MEMORY::mmc5_hi_write(uint32_t addr, uint32_t data) | ||
593 | 595 | } |
594 | 596 | } |
595 | 597 | |
596 | -void FAMILYBASIC_MEMORY::mmc5_hsync(int v) | |
598 | +void MEMORY::mmc5_hsync(int v) | |
597 | 599 | { |
598 | 600 | if(v <= 240) { |
599 | 601 | if(v == mmc5_irq_line) { |
@@ -609,7 +611,7 @@ void FAMILYBASIC_MEMORY::mmc5_hsync(int v) | ||
609 | 611 | } |
610 | 612 | } |
611 | 613 | |
612 | -void FAMILYBASIC_MEMORY::mmc5_set_cpu_bank(uint8_t bank, uint32_t bank_num) | |
614 | +void MEMORY::mmc5_set_cpu_bank(uint8_t bank, uint32_t bank_num) | |
613 | 615 | { |
614 | 616 | if(bank_num & 0x80) { |
615 | 617 | if(mmc5_prg_size == 0) { |
@@ -673,7 +675,7 @@ void FAMILYBASIC_MEMORY::mmc5_set_cpu_bank(uint8_t bank, uint32_t bank_num) | ||
673 | 675 | } |
674 | 676 | } |
675 | 677 | |
676 | -void FAMILYBASIC_MEMORY::mmc5_set_wram_bank(uint8_t bank, uint32_t bank_num) | |
678 | +void MEMORY::mmc5_set_wram_bank(uint8_t bank, uint32_t bank_num) | |
677 | 679 | { |
678 | 680 | if(bank_num < 8) { |
679 | 681 | bank_ptr[bank] = save_ram + 0x2000 * bank_num; |
@@ -683,7 +685,7 @@ void FAMILYBASIC_MEMORY::mmc5_set_wram_bank(uint8_t bank, uint32_t bank_num) | ||
683 | 685 | } |
684 | 686 | } |
685 | 687 | |
686 | -void FAMILYBASIC_MEMORY::mmc5_set_ppu_bank(uint8_t mode) | |
688 | +void MEMORY::mmc5_set_ppu_bank(uint8_t mode) | |
687 | 689 | { |
688 | 690 | if(mmc5_chr_size == 0) { |
689 | 691 | d_ppu->set_ppu_bank(0, mmc5_chr_reg[7][mode] * 8 + 0); |
@@ -724,7 +726,7 @@ void FAMILYBASIC_MEMORY::mmc5_set_ppu_bank(uint8_t mode) | ||
724 | 726 | } |
725 | 727 | } |
726 | 728 | |
727 | -uint8_t FAMILYBASIC_MEMORY::mmc5_ppu_latch_render(uint8_t mode, uint32_t addr) | |
729 | +uint8_t MEMORY::mmc5_ppu_latch_render(uint8_t mode, uint32_t addr) | |
728 | 730 | { |
729 | 731 | uint8_t data = 0; |
730 | 732 |
@@ -749,7 +751,7 @@ uint8_t FAMILYBASIC_MEMORY::mmc5_ppu_latch_render(uint8_t mode, uint32_t addr) | ||
749 | 751 | |
750 | 752 | // vrc7 |
751 | 753 | |
752 | -void FAMILYBASIC_MEMORY::vrc7_reset() | |
754 | +void MEMORY::vrc7_reset() | |
753 | 755 | { |
754 | 756 | if(header.mapper() == 85) { |
755 | 757 | vrc7_irq_enabled = 0; |
@@ -765,26 +767,26 @@ void FAMILYBASIC_MEMORY::vrc7_reset() | ||
765 | 767 | } |
766 | 768 | } |
767 | 769 | |
768 | -//uint32_t FAMILYBASIC_MEMORY::vrc7_lo_read(uint32_t addr) | |
770 | +//uint32_t MEMORY::vrc7_lo_read(uint32_t addr) | |
769 | 771 | //{ |
770 | 772 | // return 0xff; |
771 | 773 | //} |
772 | 774 | |
773 | -//void FAMILYBASIC_MEMORY::vrc7_lo_write(uint32_t addr, uint32_t data) | |
775 | +//void MEMORY::vrc7_lo_write(uint32_t addr, uint32_t data) | |
774 | 776 | //{ |
775 | 777 | //} |
776 | 778 | |
777 | -//uint32_t FAMILYBASIC_MEMORY::vrc7_save_read(uint32_t addr) | |
779 | +//uint32_t MEMORY::vrc7_save_read(uint32_t addr) | |
778 | 780 | //{ |
779 | 781 | // return bank_ptr[3][addr & 0x1fff]; |
780 | 782 | //} |
781 | 783 | |
782 | -//void FAMILYBASIC_MEMORY::vrc7_save_write(uint32_t addr, uint32_t data) | |
784 | +//void MEMORY::vrc7_save_write(uint32_t addr, uint32_t data) | |
783 | 785 | //{ |
784 | 786 | // bank_ptr[3][addr & 0x1fff] = data; |
785 | 787 | //} |
786 | 788 | |
787 | -void FAMILYBASIC_MEMORY::vrc7_hi_write(uint32_t addr, uint32_t data) | |
789 | +void MEMORY::vrc7_hi_write(uint32_t addr, uint32_t data) | |
788 | 790 | { |
789 | 791 | switch(addr & 0xf038) { |
790 | 792 | case 0x8000: |
@@ -862,7 +864,7 @@ void FAMILYBASIC_MEMORY::vrc7_hi_write(uint32_t addr, uint32_t data) | ||
862 | 864 | } |
863 | 865 | } |
864 | 866 | |
865 | -void FAMILYBASIC_MEMORY::vrc7_hsync(int v) | |
867 | +void MEMORY::vrc7_hsync(int v) | |
866 | 868 | { |
867 | 869 | if(vrc7_irq_enabled & 0x02) { |
868 | 870 | if(vrc7_irq_counter == 0xff) { |
@@ -876,7 +878,7 @@ void FAMILYBASIC_MEMORY::vrc7_hsync(int v) | ||
876 | 878 | |
877 | 879 | #define STATE_VERSION 2 |
878 | 880 | |
879 | -bool FAMILYBASIC_MEMORY::process_state(FILEIO* state_fio, bool loading) | |
881 | +bool MEMORY::process_state(FILEIO* state_fio, bool loading) | |
880 | 882 | { |
881 | 883 | if(!state_fio->StateCheckUint32(STATE_VERSION)) { |
882 | 884 | return false; |
@@ -947,4 +949,4 @@ bool FAMILYBASIC_MEMORY::process_state(FILEIO* state_fio, bool loading) | ||
947 | 949 | return true; |
948 | 950 | } |
949 | 951 | |
950 | - | |
952 | +} |
@@ -15,9 +15,13 @@ | ||
15 | 15 | #include "../../emu.h" |
16 | 16 | #include "../device.h" |
17 | 17 | |
18 | -class PPU; | |
18 | +namespace FAMILYBASIC { | |
19 | + class PPU; | |
20 | +} | |
19 | 21 | |
20 | -class FAMILYBASIC_MEMORY : public DEVICE | |
22 | +namespace FAMILYBASIC { | |
23 | + | |
24 | +class MEMORY : public DEVICE | |
21 | 25 | { |
22 | 26 | private: |
23 | 27 | DEVICE *d_cpu, *d_apu, *d_drec, *d_opll; |
@@ -96,11 +100,11 @@ private: | ||
96 | 100 | void vrc7_hsync(int v); |
97 | 101 | |
98 | 102 | public: |
99 | - FAMILYBASIC_MEMORY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) | |
103 | + MEMORY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) | |
100 | 104 | { |
101 | 105 | set_device_name(_T("Memory Bus")); |
102 | 106 | } |
103 | - ~FAMILYBASIC_MEMORY() {} | |
107 | + ~MEMORY() {} | |
104 | 108 | |
105 | 109 | // common functions |
106 | 110 | void initialize(); |
@@ -146,4 +150,5 @@ public: | ||
146 | 150 | uint8_t mmc5_ppu_latch_render(uint8_t mode, uint32_t addr); |
147 | 151 | }; |
148 | 152 | |
153 | +} | |
149 | 154 | #endif |
@@ -8,8 +8,12 @@ | ||
8 | 8 | [ PPU ] |
9 | 9 | */ |
10 | 10 | |
11 | -#include "ppu.h" | |
12 | -#include "memory.h" | |
11 | +#include "./ppu.h" | |
12 | +#include "./memory.h" | |
13 | + | |
14 | +using FAMILYBASIC::MEMORY; | |
15 | + | |
16 | +namespace FAMILYBASIC { | |
13 | 17 | |
14 | 18 | static const uint8_t palette[64][3] = { |
15 | 19 | {0x75, 0x75, 0x75}, {0x27, 0x1b, 0x8f}, {0x00, 0x00, 0xab}, {0x47, 0x00, 0x9f}, |
@@ -729,3 +733,5 @@ bool PPU::process_state(FILEIO* state_fio, bool loading) | ||
729 | 733 | } |
730 | 734 | return true; |
731 | 735 | } |
736 | + | |
737 | +} |
@@ -19,13 +19,16 @@ | ||
19 | 19 | #define MIRROR_VERT 1 |
20 | 20 | #define MIRROR_4SCREEN 2 |
21 | 21 | |
22 | -class FAMILYBASIC_MEMORY; | |
22 | +namespace FAMILYBASIC { | |
23 | + class MEMORY; | |
24 | +} | |
23 | 25 | |
26 | +namespace FAMILYBASIC { | |
24 | 27 | class PPU : public DEVICE |
25 | 28 | { |
26 | 29 | private: |
27 | 30 | DEVICE *d_cpu; |
28 | - FAMILYBASIC_MEMORY *d_memory; | |
31 | + FAMILYBASIC::MEMORY *d_memory; | |
29 | 32 | |
30 | 33 | scrntype_t palette_pc[64]; |
31 | 34 | uint8_t screen[240][256 + 16]; // 2*8 = side margin |
@@ -82,7 +85,7 @@ public: | ||
82 | 85 | { |
83 | 86 | d_cpu = device; |
84 | 87 | } |
85 | - void set_context_memory(FAMILYBASIC_MEMORY* device) | |
88 | + void set_context_memory(FAMILYBASIC::MEMORY* device) | |
86 | 89 | { |
87 | 90 | d_memory = device; |
88 | 91 | } |
@@ -108,5 +111,6 @@ public: | ||
108 | 111 | void set_mirroring(int mirror); |
109 | 112 | void set_mirroring(uint32_t nt0, uint32_t nt1, uint32_t nt2, uint32_t nt3); |
110 | 113 | }; |
114 | +} | |
111 | 115 | |
112 | 116 | #endif |
@@ -7,8 +7,10 @@ | ||
7 | 7 | [ cmos ] |
8 | 8 | */ |
9 | 9 | |
10 | -#include "cmos.h" | |
10 | +#include "./cmos.h" | |
11 | 11 | |
12 | +namespace FM16BETA { | |
13 | + | |
12 | 14 | void CMOS::initialize() |
13 | 15 | { |
14 | 16 | // load cmos image |
@@ -62,3 +64,5 @@ bool CMOS::process_state(FILEIO* state_fio, bool loading) | ||
62 | 64 | state_fio->StateBool(modified); |
63 | 65 | return true; |
64 | 66 | } |
67 | + | |
68 | +} |
@@ -14,6 +14,8 @@ | ||
14 | 14 | #include "../../emu.h" |
15 | 15 | #include "../device.h" |
16 | 16 | |
17 | +namespace FM16BETA { | |
18 | + | |
17 | 19 | class CMOS : public DEVICE |
18 | 20 | { |
19 | 21 | private: |
@@ -35,5 +37,6 @@ public: | ||
35 | 37 | bool process_state(FILEIO* state_fio, bool loading); |
36 | 38 | }; |
37 | 39 | |
40 | +} | |
38 | 41 | #endif |
39 | 42 |
@@ -35,6 +35,11 @@ | ||
35 | 35 | #include "mainbus.h" |
36 | 36 | #include "sub.h" |
37 | 37 | |
38 | +using FM16BETA::CMOS; | |
39 | +using FM16BETA::KEYBOARD; | |
40 | +using FM16BETA::MAINBUS; | |
41 | +using FM16BETA::SUB; | |
42 | + | |
38 | 43 | // ---------------------------------------------------------------------------- |
39 | 44 | // initialize |
40 | 45 | // ---------------------------------------------------------------------------- |
@@ -68,11 +73,6 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu) | ||
68 | 73 | cmos = new CMOS(this, emu); |
69 | 74 | keyboard = new KEYBOARD(this, emu); |
70 | 75 | mainbus = new MAINBUS(this, emu); |
71 | - | |
72 | - | |
73 | - | |
74 | - | |
75 | - | |
76 | 76 | subbus = new SUB(this, emu); |
77 | 77 | |
78 | 78 | // set contexts |
@@ -69,7 +69,6 @@ static const _TCHAR *sound_device_caption[] = { | ||
69 | 69 | }; |
70 | 70 | #endif |
71 | 71 | |
72 | -class csp_state_utils; | |
73 | 72 | class EMU; |
74 | 73 | class DEVICE; |
75 | 74 | class EVENT; |
@@ -86,10 +85,12 @@ class MC6840; | ||
86 | 85 | class MSM58321; |
87 | 86 | class PCM1BIT; |
88 | 87 | |
89 | -class CMOS; | |
90 | -class KEYBOARD; | |
91 | -class MAINBUS; | |
92 | -class SUB; | |
88 | +namespace FM16BETA { | |
89 | + class CMOS; | |
90 | + class KEYBOARD; | |
91 | + class MAINBUS; | |
92 | + class SUB; | |
93 | +} | |
93 | 94 | |
94 | 95 | class VM : public VM_TEMPLATE |
95 | 96 | { |
@@ -113,10 +114,10 @@ protected: | ||
113 | 114 | MSM58321* rtc; |
114 | 115 | PCM1BIT* pcm; |
115 | 116 | |
116 | - CMOS* cmos; | |
117 | - MAINBUS* mainbus; | |
118 | - KEYBOARD* keyboard; | |
119 | - SUB* subbus; | |
117 | + FM16BETA::CMOS* cmos; | |
118 | + FM16BETA::MAINBUS* mainbus; | |
119 | + FM16BETA::KEYBOARD* keyboard; | |
120 | + FM16BETA::SUB* subbus; | |
120 | 121 | |
121 | 122 | public: |
122 | 123 | // ---------------------------------------- |
@@ -7,10 +7,11 @@ | ||
7 | 7 | [ keyboard ] |
8 | 8 | */ |
9 | 9 | |
10 | -#include "keyboard.h" | |
11 | -#include "mainbus.h" | |
10 | +#include "./keyboard.h" | |
11 | +#include "./mainbus.h" | |
12 | 12 | #include "../../fifo.h" |
13 | 13 | |
14 | +namespace FM16BETA { | |
14 | 15 | |
15 | 16 | void KEYBOARD::initialize() |
16 | 17 | { |
@@ -237,3 +238,4 @@ static const int scan_code[] = { | ||
237 | 238 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
238 | 239 | }; |
239 | 240 | |
241 | +} |
@@ -29,6 +29,7 @@ | ||
29 | 29 | 取消 F11 |
30 | 30 | COPY |
31 | 31 | */ |
32 | +namespace FM16BETA { | |
32 | 33 | |
33 | 34 | static const int key_table[256] = { |
34 | 35 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x10,0x00,0x00,0x00,0x1D,0x00,0x00, |
@@ -48,9 +49,11 @@ static const int key_table[256] = { | ||
48 | 49 | 0x00,0x00,0x34,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, |
49 | 50 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 |
50 | 51 | }; |
52 | +} | |
51 | 53 | |
52 | 54 | class FIFO; |
53 | 55 | |
56 | +namespace FM16BETA { | |
54 | 57 | class KEYBOARD : public DEVICE |
55 | 58 | { |
56 | 59 | private: |
@@ -84,4 +87,5 @@ public: | ||
84 | 87 | void key_up(int code); |
85 | 88 | }; |
86 | 89 | |
90 | +} | |
87 | 91 | #endif |
@@ -7,9 +7,10 @@ | ||
7 | 7 | [ main system ] |
8 | 8 | */ |
9 | 9 | |
10 | -#include "mainbus.h" | |
11 | -#include "sub.h" | |
12 | -#include "keyboard.h" | |
10 | +#include "./mainbus.h" | |
11 | +#include "./sub.h" | |
12 | +#include "./keyboard.h" | |
13 | + | |
13 | 14 | #include "../disk.h" |
14 | 15 | #include "../i8237.h" |
15 | 16 | #include "../i8259.h" |
@@ -20,6 +21,10 @@ | ||
20 | 21 | #include "../i286.h" |
21 | 22 | #endif |
22 | 23 | |
24 | +using ::MEMORY; | |
25 | + | |
26 | +namespace FM16BETA { | |
27 | + | |
23 | 28 | void MAINBUS::initialize() |
24 | 29 | { |
25 | 30 | MEMORY::initialize(); |
@@ -436,3 +441,4 @@ bool MAINBUS::process_state(FILEIO* state_fio, bool loading) | ||
436 | 441 | // return true; |
437 | 442 | } |
438 | 443 | |
444 | +} |
@@ -43,7 +43,8 @@ class I286; | ||
43 | 43 | class I8237; |
44 | 44 | class MB8877; |
45 | 45 | |
46 | -//class csp_state_utils; | |
46 | +namespace FM16BETA { | |
47 | + | |
47 | 48 | class MAINBUS : public MEMORY |
48 | 49 | { |
49 | 50 | private: |
@@ -153,4 +154,5 @@ public: | ||
153 | 154 | } |
154 | 155 | }; |
155 | 156 | |
157 | +} | |
156 | 158 | #endif |
@@ -11,6 +11,10 @@ | ||
11 | 11 | #include "mainbus.h" |
12 | 12 | #include "../pcm1bit.h" |
13 | 13 | |
14 | +using ::MEMORY; | |
15 | + | |
16 | +namespace FM16BETA { | |
17 | + | |
14 | 18 | void SUB::initialize() |
15 | 19 | { |
16 | 20 | MEMORY::initialize(); |
@@ -943,3 +947,5 @@ bool SUB::process_state(FILEIO* state_fio, bool loading) | ||
943 | 947 | } |
944 | 948 | return MEMORY::process_state(state_fio, loading); |
945 | 949 | } |
950 | + | |
951 | +} |
@@ -19,15 +19,15 @@ | ||
19 | 19 | #define SIG_SUB_HALT 4 |
20 | 20 | #define SIG_SUB_MAINACK 5 |
21 | 21 | |
22 | -//class csp_state_utils; | |
22 | + | |
23 | +namespace FM16BETA { | |
24 | + | |
23 | 25 | class SUB : public MEMORY |
24 | 26 | { |
25 | 27 | |
26 | 28 | private: |
27 | 29 | DEVICE *d_crtc, *d_pcm, *d_main, *d_subcpu, *d_keyboard; |
28 | 30 | |
29 | -// csp_state_utils *state_entry; | |
30 | - | |
31 | 31 | uint8_t gvram[0x30000]; |
32 | 32 | uint8_t dummy[0x8000]; // dummy plane |
33 | 33 | uint8_t cvram[0x1000]; |
@@ -140,4 +140,6 @@ public: | ||
140 | 140 | void draw_screen(); |
141 | 141 | }; |
142 | 142 | |
143 | +} | |
144 | + | |
143 | 145 | #endif |
@@ -30,7 +30,9 @@ | ||
30 | 30 | #include "../debugger.h" |
31 | 31 | #endif |
32 | 32 | |
33 | -#include "sub.h" | |
33 | +#include "./sub.h" | |
34 | + | |
35 | +using FM16PI::SUB; | |
34 | 36 | |
35 | 37 | // ---------------------------------------------------------------------------- |
36 | 38 | // initialize |
@@ -51,7 +51,6 @@ static const _TCHAR *sound_device_caption[] = { | ||
51 | 51 | }; |
52 | 52 | #endif |
53 | 53 | |
54 | -class csp_state_utils; | |
55 | 54 | class EMU; |
56 | 55 | class DEVICE; |
57 | 56 | class EVENT; |
@@ -68,7 +67,9 @@ class MSM58321; | ||
68 | 67 | class NOT; |
69 | 68 | class PCM1BIT; |
70 | 69 | |
71 | -class SUB; | |
70 | +namespace FM16PI { | |
71 | + class SUB; | |
72 | +} | |
72 | 73 | |
73 | 74 | class VM : public VM_TEMPLATE |
74 | 75 | { |
@@ -91,7 +92,7 @@ protected: | ||
91 | 92 | NOT* not_pit; |
92 | 93 | PCM1BIT* pcm; |
93 | 94 | |
94 | - SUB* sub; | |
95 | + FM16PI::SUB* sub; | |
95 | 96 | |
96 | 97 | // memory |
97 | 98 | uint8_t ram[0x80000]; |
@@ -7,7 +7,7 @@ | ||
7 | 7 | [ sub system ] |
8 | 8 | */ |
9 | 9 | |
10 | -#include "sub.h" | |
10 | +#include "./sub.h" | |
11 | 11 | #include "../../fifo.h" |
12 | 12 | #include "../i8255.h" |
13 | 13 | #include "../i8259.h" |
@@ -17,6 +17,8 @@ | ||
17 | 17 | |
18 | 18 | #define EVENT_KEYSCAN 0 |
19 | 19 | |
20 | +namespace FM16PI { | |
21 | + | |
20 | 22 | static const int key_table[256] = { |
21 | 23 | // EXT -> END, GRAPH -> ALT |
22 | 24 | -1, -1, -1, -1, -1, -1, -1, -1,0x0E,0x0F, -1, -1, -1,0x1C, -1, -1, |
@@ -202,3 +204,5 @@ bool SUB::process_state(FILEIO* state_fio, bool loading) | ||
202 | 204 | state_fio->StateUint8(rtc_data); |
203 | 205 | return true; |
204 | 206 | } |
207 | + | |
208 | +} |
@@ -18,6 +18,8 @@ | ||
18 | 18 | |
19 | 19 | class FIFO; |
20 | 20 | |
21 | +namespace FM16PI { | |
22 | + | |
21 | 23 | class SUB : public DEVICE |
22 | 24 | { |
23 | 25 | private: |
@@ -82,4 +84,5 @@ public: | ||
82 | 84 | void draw_screen(); |
83 | 85 | }; |
84 | 86 | |
87 | +} | |
85 | 88 | #endif |
@@ -7,9 +7,7 @@ | ||
7 | 7 | * Jan 03, 2015 : Initial |
8 | 8 | * |
9 | 9 | */ |
10 | - | |
11 | 10 | #include "fm7.h" |
12 | -#include "fm7_mainio.h" | |
13 | 11 | |
14 | 12 | #include "../mc6809.h" |
15 | 13 | #include "../z80.h" |
@@ -22,6 +20,8 @@ | ||
22 | 20 | # if defined(_FM77AV20) || defined(_FM77AV40) || defined(_FM77AV20EX) || defined(_FM77AV40EX) || defined(_FM77AV40SX) |
23 | 21 | #include "../and.h" |
24 | 22 | #endif |
23 | + | |
24 | +#include "fm7_mainio.h" | |
25 | 25 | #include "./fm7_mainmem.h" |
26 | 26 | #include "./fm7_display.h" |
27 | 27 | #include "./fm7_keyboard.h" |
@@ -7,7 +7,9 @@ | ||
7 | 7 | [ cmos ] |
8 | 8 | */ |
9 | 9 | |
10 | -#include "cmos.h" | |
10 | +#include "./cmos.h" | |
11 | + | |
12 | +namespace FMR30 { | |
11 | 13 | |
12 | 14 | void CMOS::initialize() |
13 | 15 | { |
@@ -62,3 +64,5 @@ bool CMOS::process_state(FILEIO* state_fio, bool loading) | ||
62 | 64 | state_fio->StateBool(modified); |
63 | 65 | return true; |
64 | 66 | } |
67 | + | |
68 | +} |
@@ -14,6 +14,8 @@ | ||
14 | 14 | #include "../../emu.h" |
15 | 15 | #include "../device.h" |
16 | 16 | |
17 | +namespace FMR30 { | |
18 | + | |
17 | 19 | class CMOS : public DEVICE |
18 | 20 | { |
19 | 21 | private: |
@@ -41,5 +43,6 @@ public: | ||
41 | 43 | } |
42 | 44 | }; |
43 | 45 | |
46 | +} | |
44 | 47 | #endif |
45 | 48 |
@@ -7,11 +7,13 @@ | ||
7 | 7 | [ floppy ] |
8 | 8 | */ |
9 | 9 | |
10 | -#include "floppy.h" | |
10 | +#include "./floppy.h" | |
11 | 11 | #include "../disk.h" |
12 | 12 | #include "../i8259.h" |
13 | 13 | #include "../mb8877.h" |
14 | 14 | |
15 | +namespace FMR30 { | |
16 | + | |
15 | 17 | void FLOPPY::initialize() |
16 | 18 | { |
17 | 19 | fdcr = 6; |
@@ -116,3 +118,5 @@ bool FLOPPY::process_state(FILEIO* state_fio, bool loading) | ||
116 | 118 | } |
117 | 119 | return true; |
118 | 120 | } |
121 | + | |
122 | +} |
@@ -18,6 +18,8 @@ | ||
18 | 18 | |
19 | 19 | class MB8877; |
20 | 20 | |
21 | +namespace FMR30 { | |
22 | + | |
21 | 23 | class FLOPPY : public DEVICE |
22 | 24 | { |
23 | 25 | private: |
@@ -59,5 +61,6 @@ public: | ||
59 | 61 | } |
60 | 62 | }; |
61 | 63 | |
64 | +} | |
62 | 65 | #endif |
63 | 66 |
@@ -44,6 +44,18 @@ | ||
44 | 44 | #include "system.h" |
45 | 45 | #include "timer.h" |
46 | 46 | |
47 | +//using FMR50::BIOS; | |
48 | +using FMR30::CMOS; | |
49 | +using FMR30::FLOPPY; | |
50 | +using FMR30::KEYBOARD; | |
51 | +using FMR30::MEMORY; | |
52 | +using FMR30::RTC; | |
53 | +using FMR30::SCSI; | |
54 | +using FMR30::SERIAL; | |
55 | +using FMR30::SYSTEM; | |
56 | +using FMR30::TIMER; | |
57 | + | |
58 | + | |
47 | 59 | // ---------------------------------------------------------------------------- |
48 | 60 | // initialize |
49 | 61 | // ---------------------------------------------------------------------------- |
@@ -97,7 +109,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu) | ||
97 | 109 | cmos = new CMOS(this, emu); |
98 | 110 | floppy = new FLOPPY(this, emu); |
99 | 111 | keyboard = new KEYBOARD(this, emu); |
100 | - memory = new FMR30_MEMORY(this, emu); | |
112 | + memory = new MEMORY(this, emu); | |
101 | 113 | rtc = new RTC(this, emu); |
102 | 114 | scsi = new SCSI(this, emu); |
103 | 115 | serial = new SERIAL(this, emu); |
@@ -80,15 +80,17 @@ class SCSI_HOST; | ||
80 | 80 | class SN76489AN; |
81 | 81 | |
82 | 82 | class BIOS; |
83 | -class CMOS; | |
84 | -class FLOPPY; | |
85 | -class KEYBOARD; | |
86 | -class FMR30_MEMORY; | |
87 | -class RTC; | |
88 | -class SCSI; | |
89 | -class SERIAL; | |
90 | -class SYSTEM; | |
91 | -class TIMER; | |
83 | +namespace FMR30 { | |
84 | + class CMOS; | |
85 | + class FLOPPY; | |
86 | + class KEYBOARD; | |
87 | + class MEMORY; | |
88 | + class RTC; | |
89 | + class SCSI; | |
90 | + class SERIAL; | |
91 | + class SYSTEM; | |
92 | + class TIMER; | |
93 | +} | |
92 | 94 | |
93 | 95 | class VM : public VM_TEMPLATE |
94 | 96 | { |
@@ -117,15 +119,15 @@ protected: | ||
117 | 119 | SN76489AN* psg; |
118 | 120 | |
119 | 121 | BIOS* bios; |
120 | - CMOS* cmos; | |
121 | - FLOPPY* floppy; | |
122 | - KEYBOARD* keyboard; | |
123 | - FMR30_MEMORY* memory; | |
124 | - RTC* rtc; | |
125 | - SCSI* scsi; | |
126 | - SERIAL* serial; | |
127 | - SYSTEM* system; | |
128 | - TIMER* timer; | |
122 | + FMR30::CMOS* cmos; | |
123 | + FMR30::FLOPPY* floppy; | |
124 | + FMR30::KEYBOARD* keyboard; | |
125 | + FMR30::MEMORY* memory; | |
126 | + FMR30::RTC* rtc; | |
127 | + FMR30::SCSI* scsi; | |
128 | + FMR30::SERIAL* serial; | |
129 | + FMR30::SYSTEM* system; | |
130 | + FMR30::TIMER* timer; | |
129 | 131 | |
130 | 132 | public: |
131 | 133 | // ---------------------------------------- |
@@ -7,7 +7,7 @@ | ||
7 | 7 | [ keyboard ] |
8 | 8 | */ |
9 | 9 | |
10 | -#include "keyboard.h" | |
10 | +#include "./keyboard.h" | |
11 | 11 | #include "../i8251.h" |
12 | 12 | |
13 | 13 | /* |
@@ -23,6 +23,7 @@ | ||
23 | 23 | 取消 F11 |
24 | 24 | COPY |
25 | 25 | */ |
26 | +namespace FMR30 { | |
26 | 27 | |
27 | 28 | static const int key_table[256] = { |
28 | 29 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x10,0x00,0x00,0x00,0x1D,0x00,0x00, |
@@ -71,3 +72,4 @@ void KEYBOARD::key_up(int code) | ||
71 | 72 | // } |
72 | 73 | } |
73 | 74 | |
75 | +} |
@@ -16,6 +16,8 @@ | ||
16 | 16 | |
17 | 17 | class FIFO; |
18 | 18 | |
19 | +namespace FMR30 { | |
20 | + | |
19 | 21 | class KEYBOARD : public DEVICE |
20 | 22 | { |
21 | 23 | private: |
@@ -41,4 +43,5 @@ public: | ||
41 | 43 | void key_up(int code); |
42 | 44 | }; |
43 | 45 | |
46 | +} | |
44 | 47 | #endif |
@@ -13,6 +13,8 @@ | ||
13 | 13 | #include "../i8237.h" |
14 | 14 | #include "../i286.h" |
15 | 15 | |
16 | +namespace FMR30 { | |
17 | + | |
16 | 18 | static const uint8_t bios1[] = { |
17 | 19 | 0xFA, // cli |
18 | 20 | 0xDB,0xE3, // fninit |
@@ -58,7 +60,7 @@ static const uint8_t bios2[] = { | ||
58 | 60 | } \ |
59 | 61 | } |
60 | 62 | |
61 | -void FMR30_MEMORY::initialize() | |
63 | +void MEMORY::initialize() | |
62 | 64 | { |
63 | 65 | // init memory |
64 | 66 | memset(ram, 0, sizeof(ram)); |
@@ -105,7 +107,7 @@ void FMR30_MEMORY::initialize() | ||
105 | 107 | register_frame_event(this); |
106 | 108 | } |
107 | 109 | |
108 | -void FMR30_MEMORY::reset() | |
110 | +void MEMORY::reset() | |
109 | 111 | { |
110 | 112 | // reset crtc |
111 | 113 | lcdadr = 0; |
@@ -120,19 +122,19 @@ void FMR30_MEMORY::reset() | ||
120 | 122 | update_bank(); |
121 | 123 | } |
122 | 124 | |
123 | -void FMR30_MEMORY::write_data8(uint32_t addr, uint32_t data) | |
125 | +void MEMORY::write_data8(uint32_t addr, uint32_t data) | |
124 | 126 | { |
125 | 127 | addr &= 0xffffff; |
126 | 128 | wbank[addr >> 12][addr & 0xfff] = data; |
127 | 129 | } |
128 | 130 | |
129 | -uint32_t FMR30_MEMORY::read_data8(uint32_t addr) | |
131 | +uint32_t MEMORY::read_data8(uint32_t addr) | |
130 | 132 | { |
131 | 133 | addr &= 0xffffff; |
132 | 134 | return rbank[addr >> 12][addr & 0xfff]; |
133 | 135 | } |
134 | 136 | |
135 | -void FMR30_MEMORY::write_io8(uint32_t addr, uint32_t data) | |
137 | +void MEMORY::write_io8(uint32_t addr, uint32_t data) | |
136 | 138 | { |
137 | 139 | switch(addr & 0xffff) { |
138 | 140 | // memory controller |
@@ -207,7 +209,7 @@ void FMR30_MEMORY::write_io8(uint32_t addr, uint32_t data) | ||
207 | 209 | } |
208 | 210 | } |
209 | 211 | |
210 | -uint32_t FMR30_MEMORY::read_io8(uint32_t addr) | |
212 | +uint32_t MEMORY::read_io8(uint32_t addr) | |
211 | 213 | { |
212 | 214 | uint32_t val = 0xff; |
213 | 215 |
@@ -244,12 +246,12 @@ uint32_t FMR30_MEMORY::read_io8(uint32_t addr) | ||
244 | 246 | return 0xff; |
245 | 247 | } |
246 | 248 | |
247 | -void FMR30_MEMORY::event_frame() | |
249 | +void MEMORY::event_frame() | |
248 | 250 | { |
249 | 251 | blinkcnt++; |
250 | 252 | } |
251 | 253 | |
252 | -void FMR30_MEMORY::update_bank() | |
254 | +void MEMORY::update_bank() | |
253 | 255 | { |
254 | 256 | if(!(mcr2 & 1)) { |
255 | 257 | // $c0000-$cffff: vram |
@@ -269,7 +271,7 @@ void FMR30_MEMORY::update_bank() | ||
269 | 271 | } |
270 | 272 | } |
271 | 273 | |
272 | -void FMR30_MEMORY::draw_screen() | |
274 | +void MEMORY::draw_screen() | |
273 | 275 | { |
274 | 276 | // render screen |
275 | 277 | memset(screen_txt, 0, sizeof(screen_txt)); |
@@ -298,7 +300,7 @@ void FMR30_MEMORY::draw_screen() | ||
298 | 300 | } |
299 | 301 | } |
300 | 302 | |
301 | -void FMR30_MEMORY::draw_text40() | |
303 | +void MEMORY::draw_text40() | |
302 | 304 | { |
303 | 305 | uint8_t *ank8 = ipl; |
304 | 306 | uint8_t *ank16 = ipl + 0x800; |
@@ -396,7 +398,7 @@ void FMR30_MEMORY::draw_text40() | ||
396 | 398 | } |
397 | 399 | } |
398 | 400 | |
399 | -void FMR30_MEMORY::draw_text80() | |
401 | +void MEMORY::draw_text80() | |
400 | 402 | { |
401 | 403 | uint8_t *ank8 = ipl; |
402 | 404 | uint8_t *ank16 = ipl + 0x800; |
@@ -494,7 +496,7 @@ void FMR30_MEMORY::draw_text80() | ||
494 | 496 | } |
495 | 497 | } |
496 | 498 | |
497 | -void FMR30_MEMORY::draw_cg() | |
499 | +void MEMORY::draw_cg() | |
498 | 500 | { |
499 | 501 | uint8_t* plane = vram + ((dcr1 >> 8) & 3) * 0x8000; |
500 | 502 | int ptr = 0; |
@@ -518,7 +520,7 @@ void FMR30_MEMORY::draw_cg() | ||
518 | 520 | |
519 | 521 | #define STATE_VERSION 2 |
520 | 522 | |
521 | -bool FMR30_MEMORY::process_state(FILEIO* state_fio, bool loading) | |
523 | +bool MEMORY::process_state(FILEIO* state_fio, bool loading) | |
522 | 524 | { |
523 | 525 | if(!state_fio->StateCheckUint32(STATE_VERSION)) { |
524 | 526 | return false; |
@@ -549,3 +551,5 @@ bool FMR30_MEMORY::process_state(FILEIO* state_fio, bool loading) | ||
549 | 551 | } |
550 | 552 | return true; |
551 | 553 | } |
554 | + | |
555 | +} |
@@ -17,7 +17,9 @@ | ||
17 | 17 | #define SIG_MEMORY_DISP 0 |
18 | 18 | #define SIG_MEMORY_VSYNC 1 |
19 | 19 | |
20 | -class FMR30_MEMORY : public DEVICE | |
20 | +namespace FMR30 { | |
21 | + | |
22 | +class MEMORY : public DEVICE | |
21 | 23 | { |
22 | 24 | private: |
23 | 25 | DEVICE *d_cpu, *d_dma; |
@@ -54,11 +56,11 @@ private: | ||
54 | 56 | void draw_cg(); |
55 | 57 | |
56 | 58 | public: |
57 | - FMR30_MEMORY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) | |
59 | + MEMORY(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) | |
58 | 60 | { |
59 | 61 | set_device_name(_T("Memory Bus")); |
60 | 62 | } |
61 | - ~FMR30_MEMORY() {} | |
63 | + ~MEMORY() {} | |
62 | 64 | |
63 | 65 | // common functions |
64 | 66 | void initialize(); |
@@ -94,5 +96,6 @@ public: | ||
94 | 96 | void draw_screen(); |
95 | 97 | }; |
96 | 98 | |
99 | +} | |
97 | 100 | #endif |
98 | 101 |
@@ -7,7 +7,7 @@ | ||
7 | 7 | [ rtc ] |
8 | 8 | */ |
9 | 9 | |
10 | -#include "rtc.h" | |
10 | +#include "./rtc.h" | |
11 | 11 | #include "../i8259.h" |
12 | 12 | |
13 | 13 | #define EVENT_1HZ 0 |
@@ -26,6 +26,8 @@ | ||
26 | 26 | DLL_PREFIX_I struct cur_time_s cur_time; |
27 | 27 | #endif |
28 | 28 | |
29 | +namespace FMR30 { | |
30 | + | |
29 | 31 | void RTC::initialize() |
30 | 32 | { |
31 | 33 | // load rtc regs image |
@@ -235,3 +237,5 @@ bool RTC::process_state(FILEIO* state_fio, bool loading) | ||
235 | 237 | state_fio->StateBuffer(regs, sizeof(regs), 1); |
236 | 238 | return true; |
237 | 239 | } |
240 | + | |
241 | +} |
@@ -14,6 +14,8 @@ | ||
14 | 14 | #include "../../emu.h" |
15 | 15 | #include "../device.h" |
16 | 16 | |
17 | +namespace FMR30 { | |
18 | + | |
17 | 19 | class RTC : public DEVICE |
18 | 20 | { |
19 | 21 | private: |
@@ -59,5 +61,6 @@ public: | ||
59 | 61 | } |
60 | 62 | }; |
61 | 63 | |
64 | +} | |
62 | 65 | #endif |
63 | 66 |
@@ -14,6 +14,9 @@ | ||
14 | 14 | #include "../i8259.h" |
15 | 15 | #include "../scsi_host.h" |
16 | 16 | |
17 | + | |
18 | +namespace FMR30 { | |
19 | + | |
17 | 20 | // control register |
18 | 21 | #define CTRL_SWEN 0x80 |
19 | 22 | #define CTRL_IMSK 0x40 |
@@ -178,3 +181,5 @@ bool SCSI::process_state(FILEIO* state_fio, bool loading) | ||
178 | 181 | state_fio->StateBool(eop_status); |
179 | 182 | return true; |
180 | 183 | } |
184 | + | |
185 | +} |
@@ -18,6 +18,8 @@ | ||
18 | 18 | #define SIG_SCSI_DRQ 1 |
19 | 19 | #define SIG_SCSI_TC 2 |
20 | 20 | |
21 | +namespace FMR30 { | |
22 | + | |
21 | 23 | class SCSI : public DEVICE |
22 | 24 | { |
23 | 25 | private: |
@@ -54,5 +56,6 @@ public: | ||
54 | 56 | } |
55 | 57 | }; |
56 | 58 | |
59 | +} | |
57 | 60 | #endif |
58 | 61 |
@@ -11,6 +11,8 @@ | ||
11 | 11 | #include "../i8251.h" |
12 | 12 | #include "../i8259.h" |
13 | 13 | |
14 | +namespace FMR30 { | |
15 | + | |
14 | 16 | void SERIAL::initialize() |
15 | 17 | { |
16 | 18 | memset(sioctrl, sizeof(sioctrl), 1); |
@@ -160,3 +162,5 @@ bool SERIAL::process_state(FILEIO* state_fio, bool loading) | ||
160 | 162 | } |
161 | 163 | return true; |
162 | 164 | } |
165 | + | |
166 | +} |
@@ -23,6 +23,8 @@ | ||
23 | 23 | #define SIG_SERIAL_TXRDY_CH1 6 |
24 | 24 | #define SIG_SERIAL_TXRDY_CH2 7 |
25 | 25 | |
26 | +namespace FMR30 { | |
27 | + | |
26 | 28 | class SERIAL : public DEVICE |
27 | 29 | { |
28 | 30 | private: |
@@ -64,5 +66,6 @@ public: | ||
64 | 66 | } |
65 | 67 | }; |
66 | 68 | |
69 | +} | |
67 | 70 | #endif |
68 | 71 |
@@ -7,8 +7,10 @@ | ||
7 | 7 | [ system ] |
8 | 8 | */ |
9 | 9 | |
10 | -#include "system.h" | |
10 | +#include "./system.h" | |
11 | 11 | |
12 | +namespace FMR30 { | |
13 | + | |
12 | 14 | void SYSTEM::initialize() |
13 | 15 | { |
14 | 16 | arr = nmistat = 0; |
@@ -70,3 +72,5 @@ bool SYSTEM::process_state(FILEIO* state_fio, bool loading) | ||
70 | 72 | state_fio->StateUint8(nmimask); |
71 | 73 | return true; |
72 | 74 | } |
75 | + | |
76 | +} |
@@ -7,13 +7,15 @@ | ||
7 | 7 | [ system ] |
8 | 8 | */ |
9 | 9 | |
10 | -#ifndef _SYSTEM_H_ | |
11 | -#define _SYSTEM_H_ | |
10 | +#ifndef _FMR30_SYSTEM_H_ | |
11 | +#define _FMR30_SYSTEM_H_ | |
12 | 12 | |
13 | 13 | #include "../vm.h" |
14 | 14 | #include "../../emu.h" |
15 | 15 | #include "../device.h" |
16 | 16 | |
17 | +namespace FMR30 { | |
18 | + | |
17 | 19 | class SYSTEM : public DEVICE |
18 | 20 | { |
19 | 21 | private: |
@@ -34,5 +36,6 @@ public: | ||
34 | 36 | bool process_state(FILEIO* state_fio, bool loading); |
35 | 37 | }; |
36 | 38 | |
39 | +} | |
37 | 40 | #endif |
38 | 41 |
@@ -7,9 +7,11 @@ | ||
7 | 7 | [ timer ] |
8 | 8 | */ |
9 | 9 | |
10 | -#include "timer.h" | |
10 | +#include "./timer.h" | |
11 | 11 | #include "../i8259.h" |
12 | 12 | |
13 | +namespace FMR30 { | |
14 | + | |
13 | 15 | void TIMER::initialize() |
14 | 16 | { |
15 | 17 | ctrl = status = 0; |
@@ -75,3 +77,5 @@ bool TIMER::process_state(FILEIO* state_fio, bool loading) | ||
75 | 77 | state_fio->StateUint8(status); |
76 | 78 | return true; |
77 | 79 | } |
80 | + | |
81 | +} |
@@ -17,6 +17,8 @@ | ||
17 | 17 | #define SIG_TIMER_CH0 0 |
18 | 18 | #define SIG_TIMER_CH1 1 |
19 | 19 | |
20 | +namespace FMR30 { | |
21 | + | |
20 | 22 | class TIMER : public DEVICE |
21 | 23 | { |
22 | 24 | private: |
@@ -46,5 +48,6 @@ public: | ||
46 | 48 | } |
47 | 49 | }; |
48 | 50 | |
51 | +} | |
49 | 52 | #endif |
50 | 53 |