Annotation of previous/src/includes/nextMemory.h, revision 1.1

1.1     ! root        1: /*
        !             2:   Hatari - stMemory.h
        !             3: 
        !             4:   This file is distributed under the GNU Public License, version 2 or at
        !             5:   your option any later version. Read the file gpl.txt for details.
        !             6: */
        !             7: 
        !             8: #ifndef HATARI_STMEMORY_H
        !             9: #define HATARI_STMEMORY_H
        !            10: 
        !            11: #include "main.h"
        !            12: #include "sysdeps.h"
        !            13: #include "maccess.h"
        !            14: #include "memory.h"
        !            15: 
        !            16: extern Uint32 NEXTRamEnd;
        !            17: 
        !            18: extern Uint8 NEXTRam[64*1024*1024];
        !            19: extern Uint8 NEXTRom[0x20000];
        !            20: extern Uint8 NEXTIo[0x20000];
        !            21: 
        !            22: 
        !            23: 
        !            24: /* Offset NEXT address to PC pointer: */
        !            25: // # define NEXTRAM_ADDR(Var)  ((unsigned long)NEXTRam+((Uint32)(Var) & 0x03ffffff))
        !            26: 
        !            27: 
        !            28: /**
        !            29:  * Check whether given memory address and size are within
        !            30:  * valid memory area (i.e. read/write from/to there doesn't
        !            31:  * overwrite Hatari's own memory & cause potential segfaults)
        !            32:  * and that the size is positive.
        !            33:  * 
        !            34:  * If they are; return true, otherwise false.
        !            35:  */
        !            36: static inline bool NEXTMemory_ValidArea(Uint32 addr, int size)
        !            37: {
        !            38:        // we are a bit optimistic...
        !            39:                return true;
        !            40: }
        !            41: 
        !            42: 
        !            43: /**
        !            44:  * Write 32-bit word into ST memory space.
        !            45:  * NOTE - value will be convert to 68000 endian
        !            46:  */
        !            47: static inline void NEXTMemory_WriteLong(Uint32 Address, Uint32 Var)
        !            48: {
        !            49:        put_long(Address, Var);
        !            50: }
        !            51: 
        !            52: 
        !            53: /**
        !            54:  * Write 16-bit word into ST memory space.
        !            55:  * NOTE - value will be convert to 68000 endian.
        !            56:  */
        !            57: static inline void NEXTMemory_WriteWord(Uint32 Address, Uint16 Var)
        !            58: {
        !            59:        put_word(Address, Var);
        !            60: }
        !            61: 
        !            62: /**
        !            63:  * Write 8-bit byte into ST memory space.
        !            64:  */
        !            65: static inline void NEXTMemory_WriteByte(Uint32 Address, Uint8 Var)
        !            66: {
        !            67:        put_byte(Address, Var);
        !            68: }
        !            69: 
        !            70: 
        !            71: /**
        !            72:  * Read 32-bit word from ST memory space.
        !            73:  * NOTE - value will be converted to PC endian.
        !            74:  */
        !            75: static inline Uint32 NEXTMemory_ReadLong(Uint32 Address)
        !            76: {
        !            77:        return get_long(Address);
        !            78: }
        !            79: 
        !            80: 
        !            81: /**
        !            82:  * Read 16-bit word from ST memory space.
        !            83:  * NOTE - value will be converted to PC endian.
        !            84:  */
        !            85: static inline Uint16 NEXTMemory_ReadWord(Uint32 Address)
        !            86: {
        !            87:        return get_word(Address);
        !            88: }
        !            89: 
        !            90: 
        !            91: /**
        !            92:  * Read 8-bit byte from ST memory space
        !            93:  */
        !            94: static inline Uint8 NEXTMemory_ReadByte(Uint32 Address)
        !            95: {
        !            96:        return get_byte(Address);
        !            97: }
        !            98: 
        !            99: 
        !           100: extern void NEXTMemory_Clear(Uint32 StartAddress, Uint32 EndAddress);
        !           101: extern void NEXTMemory_MemorySnapShot_Capture(bool bSave);
        !           102: extern void NEXTMemory_SetDefaultConfig(void);
        !           103: 
        !           104: #endif

unix.superglobalmegacorp.com

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