Annotation of nono/vm/areaset.cpp, revision 1.1.1.6

1.1       root        1: //
                      2: // nono
1.1.1.2   root        3: // Copyright (C) 2020 nono project
                      4: // Licensed under nono-license.txt
1.1       root        5: //
                      6: 
1.1.1.6 ! root        7: //
        !             8: // エリアセット
        !             9: //
        !            10: 
1.1       root       11: #include "areaset.h"
1.1.1.3   root       12: #include "mpu.h"
1.1       root       13: 
1.1.1.6 ! root       14: // グローバル参照用
        !            15: AreaSetDevice *gAreaSet;
1.1.1.4   root       16: 
1.1.1.6 ! root       17: // コンストラクタ
1.1       root       18: AreaSetDevice::AreaSetDevice()
1.1.1.5   root       19:        : inherited("AreaSet")
1.1       root       20: {
                     21:        devaddr = baseaddr;
                     22:        devlen  = 0x2000;
                     23: }
                     24: 
1.1.1.6 ! root       25: // デストラクタ
1.1       root       26: AreaSetDevice::~AreaSetDevice()
                     27: {
1.1.1.6 ! root       28:        gAreaSet = NULL;
1.1       root       29: }
                     30: 
1.1.1.6 ! root       31: // リセット
1.1.1.3   root       32: void
1.1.1.6 ! root       33: AreaSetDevice::ResetHard(bool poweron)
1.1.1.3   root       34: {
                     35:        limit = 0;
                     36: }
                     37: 
1.1       root       38: uint64
                     39: AreaSetDevice::Read8(uint32 addr)
                     40: {
                     41:        switch (addr) {
                     42:         case 0xe86001:
                     43:                return limit;
                     44:        }
                     45:        return (uint64)-1;
                     46: }
                     47: 
                     48: uint64
                     49: AreaSetDevice::Read16(uint32 addr)
                     50: {
                     51:        return 0xff00 | Read8(addr + 1);
                     52: }
                     53: 
                     54: uint64
                     55: AreaSetDevice::Write8(uint32 addr, uint32 data)
                     56: {
1.1.1.3   root       57:        gMPU->AddCycle(7);      // InsideOut p.135
                     58: 
1.1       root       59:        switch (addr) {
                     60:         case 0xe86001:
                     61:                putlog(0, "未実装エリアセット書き込み $%02x", data);
                     62:                limit = data;
                     63:                return 0;
                     64:         default:
                     65:                break;
                     66:        }
                     67:        return (uint64)-1;
                     68: }
                     69: 
                     70: uint64
                     71: AreaSetDevice::Write16(uint32 addr, uint32 data)
                     72: {
                     73:        return Write8(addr + 1, data);
                     74: }
                     75: 
                     76: uint64
                     77: AreaSetDevice::Peek8(uint32 addr)
                     78: {
                     79:        switch (addr) {
                     80:         case 0xe86001:
                     81:                return limit;
                     82:         default:
                     83:                return 0xff;
                     84:        }
                     85: }

unix.superglobalmegacorp.com

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