Annotation of nono/vm/x68krom.cpp, revision 1.1

1.1     ! root        1: //
        !             2: // nono
        !             3: // Copyright (C) 2019 [email protected]
        !             4: //
        !             5: 
        !             6: #include "x68krom.h"
        !             7: #include "cgrom.h"
        !             8: #include "mystring.h"
        !             9: #include "pluto.h"
        !            10: #include "scheduler.h"
        !            11: 
        !            12: //
        !            13: // IPLROM(1)
        !            14: //
        !            15: 
        !            16: IPLROM1Device::IPLROM1Device()
        !            17: {
        !            18:        devname = "IPLROM(1)";
        !            19:        devaddr = 0xfe0000;
        !            20:        devlen  = 0x020000;
        !            21:        mask = devlen - 1;
        !            22: }
        !            23: 
        !            24: IPLROM1Device::~IPLROM1Device()
        !            25: {
        !            26: }
        !            27: 
        !            28: bool
        !            29: IPLROM1Device::Init()
        !            30: {
        !            31:        std::string name;
        !            32: 
        !            33:        // benchmark_mode は static 変数で main 側が代入しているので
        !            34:        // PlutoDevice とは関係なくアクセスできる。
        !            35:        if (PlutoDevice::benchmark_mode != 0) {
        !            36:                name = string_format("BENCH%02d.ROM", PlutoDevice::benchmark_mode);
        !            37:        } else {
        !            38:                name = "IPLROM30.DAT";
        !            39:        }
        !            40: 
        !            41:        if (LoadROM(name.c_str(), 128 * 1024) == false) {
        !            42:                return false;
        !            43:        }
        !            44:        return true;
        !            45: }
        !            46: 
        !            47: 
        !            48: //
        !            49: // IPLROM(2)
        !            50: //
        !            51: 
        !            52: IPLROM2Device::IPLROM2Device()
        !            53: {
        !            54:        devname = "IPLROM(2)";
        !            55:        devaddr = 0xfc0000;
        !            56:        devlen  = 0x020000;
        !            57:        mask = devlen - 1;
        !            58: }
        !            59: 
        !            60: IPLROM2Device::~IPLROM2Device()
        !            61: {
        !            62: }
        !            63: 
        !            64: bool
        !            65: IPLROM2Device::Init()
        !            66: {
        !            67:        // benchmark_mode は static 変数で main 側が代入しているので
        !            68:        // PlutoDevice とは関係なくアクセスできる。
        !            69:        if (PlutoDevice::benchmark_mode != 0) {
        !            70:                return true;
        !            71:        }
        !            72: 
        !            73:        if (LoadROM("ROM30.DAT", 128 * 1024) == false) {
        !            74:                return false;
        !            75:        }
        !            76:        return true;
        !            77: }
        !            78: 
        !            79: 
        !            80: //
        !            81: // CGROM
        !            82: //
        !            83: 
        !            84: CGROMDevice::CGROMDevice()
        !            85: {
        !            86:        devname = "CGROM";
        !            87:        devaddr = 0xf00000;
        !            88:        devlen  = 768 * 1024;
        !            89:        mask = 1024 * 1024 - 1;
        !            90: }
        !            91: 
        !            92: CGROMDevice::~CGROMDevice()
        !            93: {
        !            94: }
        !            95: 
        !            96: bool
        !            97: CGROMDevice::Init()
        !            98: {
        !            99: #if 0
        !           100:        mem = builtin_cgrom;
        !           101: #else
        !           102:        if (LoadROM("CGROM30.DAT", 768 * 1024) == false) {
        !           103:                return false;
        !           104:        }
        !           105: #endif
        !           106:        return true;
        !           107: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.