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

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: // コンストラクタ
1.1       root       15: AreaSetDevice::AreaSetDevice()
1.1.1.8 ! root       16:        : inherited(OBJ_AREASET)
1.1       root       17: {
                     18: }
                     19: 
1.1.1.6   root       20: // デストラクタ
1.1       root       21: AreaSetDevice::~AreaSetDevice()
                     22: {
                     23: }
                     24: 
1.1.1.6   root       25: // リセット
1.1.1.3   root       26: void
1.1.1.6   root       27: AreaSetDevice::ResetHard(bool poweron)
1.1.1.3   root       28: {
                     29:        limit = 0;
                     30: }
                     31: 
1.1       root       32: uint64
                     33: AreaSetDevice::Read8(uint32 addr)
                     34: {
                     35:        switch (addr) {
                     36:         case 0xe86001:
                     37:                return limit;
                     38:        }
                     39:        return (uint64)-1;
                     40: }
                     41: 
                     42: uint64
                     43: AreaSetDevice::Read16(uint32 addr)
                     44: {
                     45:        return 0xff00 | Read8(addr + 1);
                     46: }
                     47: 
                     48: uint64
                     49: AreaSetDevice::Write8(uint32 addr, uint32 data)
                     50: {
1.1.1.8 ! root       51:        mpu->AddCycle(7);       // InsideOut p.135
1.1.1.3   root       52: 
1.1       root       53:        switch (addr) {
                     54:         case 0xe86001:
1.1.1.7   root       55:                putlog(0, "Write $%02x (NOT IMPLEMENTED)", data);
1.1       root       56:                limit = data;
                     57:                return 0;
                     58:         default:
                     59:                break;
                     60:        }
                     61:        return (uint64)-1;
                     62: }
                     63: 
                     64: uint64
                     65: AreaSetDevice::Write16(uint32 addr, uint32 data)
                     66: {
                     67:        return Write8(addr + 1, data);
                     68: }
                     69: 
                     70: uint64
                     71: AreaSetDevice::Peek8(uint32 addr)
                     72: {
                     73:        switch (addr) {
                     74:         case 0xe86001:
                     75:                return limit;
                     76:         default:
                     77:                return 0xff;
                     78:        }
                     79: }

unix.superglobalmegacorp.com

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