Annotation of hatari/src/includes/stMemory.h, revision 1.1.1.3

1.1       root        1: /*
1.1.1.2   root        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.
1.1       root        6: */
                      7: 
1.1.1.2   root        8: #ifndef HATARI_STMEMORY_H
                      9: #define HATARI_STMEMORY_H
                     10: 
1.1.1.3 ! root       11: #include "sysdeps.h"
        !            12: #include "maccess.h"
        !            13: #include "main.h"
        !            14: 
        !            15: 
        !            16: extern Uint8 STRam[16*1024*1024];
        !            17: extern Uint32 STRamEnd;
        !            18: 
        !            19: 
        !            20: /* Offset ST address to PC pointer: */
        !            21: #define STRAM_ADDR(Var)  ((unsigned long)STRam+((Uint32)(Var) & 0x00ffffff))
        !            22: 
        !            23: 
        !            24: /*-----------------------------------------------------------------------*/
        !            25: /*
        !            26:   Write 32-bit word into ST memory space.
        !            27:   NOTE - value will be convert to 68000 endian
        !            28: */
        !            29: static inline void STMemory_WriteLong(Uint32 Address, Uint32 Var)
        !            30: {
        !            31:   Address &= 0xffffff;
        !            32:   do_put_mem_long((uae_u32 *)((Uint32)STRam+Address), Var);
        !            33: }
        !            34: 
        !            35: /*-----------------------------------------------------------------------*/
        !            36: /*
        !            37:   Write 16-bit word into ST memory space.
        !            38:   NOTE - value will be convert to 68000 endian.
        !            39: */
        !            40: static inline void STMemory_WriteWord(Uint32 Address, Uint16 Var)
        !            41: {
        !            42:   Address &= 0xffffff;
        !            43:   do_put_mem_word((uae_u16 *)((Uint32)STRam+Address), Var);
        !            44: }
        !            45: 
        !            46: /*-----------------------------------------------------------------------*/
        !            47: /*
        !            48:   Write 8-bit byte into ST memory space.
        !            49: */
        !            50: static inline void STMemory_WriteByte(Uint32 Address, Uint8 Var)
        !            51: {
        !            52:   Address &= 0xffffff;
        !            53:   *(Uint8 *)((Uint32)STRam+Address) = Var;
        !            54: }
        !            55: 
        !            56: 
        !            57: /*-----------------------------------------------------------------------*/
        !            58: /*
        !            59:   Read 32-bit word from ST memory space.
        !            60:   NOTE - value will be converted to PC endian.
        !            61: */
        !            62: static inline Uint32 STMemory_ReadLong(Uint32 Address)
        !            63: {
        !            64:   Address &= 0xffffff;
        !            65:   return do_get_mem_long((uae_u32 *)((Uint32)STRam+Address));
        !            66: }
        !            67: 
        !            68: /*-----------------------------------------------------------------------*/
        !            69: /*
        !            70:   Read 16-bit word from ST memory space.
        !            71:   NOTE - value will be converted to PC endian.
        !            72: */
        !            73: static inline Uint16 STMemory_ReadWord(Uint32 Address)
        !            74: {
        !            75:   Address &= 0xffffff;
        !            76:   return do_get_mem_word((uae_u16 *)((Uint32)STRam+Address));
        !            77: }
        !            78: 
        !            79: /*-----------------------------------------------------------------------*/
        !            80: /*
        !            81:   Read 8-bit byte from ST memory space
        !            82: */
        !            83: static inline Uint8 STMemory_ReadByte(Uint32 Address)
        !            84: {
        !            85:   Address &= 0xffffff;
        !            86:   return *(Uint8 *)((Uint32)STRam+Address);
        !            87: }
        !            88: 
        !            89: 
1.1       root       90: extern void STMemory_Clear(unsigned long StartAddress, unsigned long EndAddress);
1.1.1.2   root       91: 
                     92: #endif

unix.superglobalmegacorp.com

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