Annotation of hatari/src/ioMemTabTT.c, revision 1.1.1.11

1.1       root        1: /*
                      2:   Hatari - ioMemTabTT.c
                      3: 
1.1.1.8   root        4:   This file is distributed under the GNU General Public License, version 2
                      5:   or at your option any later version. Read the file gpl.txt for details.
1.1       root        6: 
                      7:   Table with hardware IO handlers for the TT.
1.1.1.9   root        8: 
                      9:   NOTE [NP] : contrary to some unofficial documentations, the TT doesn't have
                     10:   hardware scrolling similar to the STE. As such, registers FF820E,
                     11:   FF820F, FF8264 and FF8265 are not available and seem to return undefined values
                     12:   based on the data last seen on the bus (this would need more tests on a TT)
                     13:        move.b $ff820e,d0  -> FF
                     14:        move.b $ff820f,d0  -> 01
                     15:        move.b $ff8264,d0  -> 82
                     16:        move.b $ff8265,d0  -> 65
1.1       root       17: */
1.1.1.3   root       18: const char IoMemTabTT_fileid[] = "Hatari ioMemTabTT.c : " __DATE__ " " __TIME__;
1.1       root       19: 
                     20: #include "main.h"
1.1.1.10  root       21: #include "configuration.h"
1.1       root       22: #include "dmaSnd.h"
                     23: #include "fdc.h"
1.1.1.8   root       24: #include "acia.h"
1.1       root       25: #include "ioMem.h"
                     26: #include "ioMemTables.h"
                     27: #include "joy.h"
                     28: #include "mfp.h"
                     29: #include "midi.h"
                     30: #include "nvram.h"
                     31: #include "psg.h"
                     32: #include "rs232.h"
                     33: #include "rtc.h"
1.1.1.5   root       34: #include "screen.h"
1.1       root       35: #include "video.h"
                     36: #include "blitter.h"
1.1.1.11! root       37: #include "stMemory.h"
        !            38: 
1.1       root       39: 
1.1.1.10  root       40: /**
                     41:  * The register at $FF9200.b represents the DIP switches from the
                     42:  * TT motherboard. The meaning of the switches is as follows:
                     43:  *
                     44:  *   1      off (on = CaTTamaran installed, not an official setting)
                     45:  *   2 - 6  off
                     46:  *   7      on = 1.4mb HD floppy drive fitted
                     47:  *   8      off (on = Disables the DMA sound hardware)
                     48:  *
                     49:  * Switch 1 is represented by the lowest bit in the $FF9200 register,
                     50:  * and switch 8 is represented by the highest bit. Logic is inverted,
                     51:  * i.e. when the switch is "on", the bit is 0.
                     52:  */
                     53: static void IoMemTabTT_ReadDIPSwitches(void)
                     54: {
                     55:        IoMem_WriteWord(0xff9200, 0xbf00);
                     56: }
1.1       root       57: 
1.1.1.10  root       58: /**
                     59:  * List of functions to handle read/write hardware interceptions for a TT.
                     60:  */
1.1       root       61: const INTERCEPT_ACCESS_FUNC IoMemTable_TT[] =
                     62: {
                     63:        { 0xff8000, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.11! root       64:        { 0xff8001, SIZE_BYTE, STMemory_MMU_Config_ReadByte, STMemory_MMU_Config_WriteByte },   /* Memory configuration */
1.1       root       65: 
                     66:        { 0xff8200, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.10  root       67:        { 0xff8201, SIZE_BYTE, IoMem_ReadWithoutInterception, Video_ScreenBase_WriteByte },     /* Video base high byte */
1.1       root       68:        { 0xff8202, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.10  root       69:        { 0xff8203, SIZE_BYTE, IoMem_ReadWithoutInterception, Video_ScreenBase_WriteByte },     /* Video base med byte */
1.1       root       70:        { 0xff8204, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
                     71:        { 0xff8205, SIZE_BYTE, Video_ScreenCounter_ReadByte, Video_ScreenCounter_WriteByte },
                     72:        { 0xff8206, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
                     73:        { 0xff8207, SIZE_BYTE, Video_ScreenCounter_ReadByte, Video_ScreenCounter_WriteByte },
                     74:        { 0xff8208, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
                     75:        { 0xff8209, SIZE_BYTE, Video_ScreenCounter_ReadByte, Video_ScreenCounter_WriteByte },
                     76:        { 0xff820a, SIZE_BYTE, Video_Sync_ReadByte, Video_Sync_WriteByte },
1.1.1.5   root       77:        { 0xff820b, SIZE_BYTE, IoMem_VoidRead_00, IoMem_VoidWrite },                            /* No bus error here : return 0 not ff */
                     78:        { 0xff820c, SIZE_BYTE, IoMem_VoidRead_00, IoMem_VoidWrite },                            /* No bus error here : return 0 not ff */
1.1.1.10  root       79:        { 0xff820d, SIZE_BYTE, Video_BaseLow_ReadByte, Video_ScreenBase_WriteByte },
1.1       root       80:        { 0xff820e, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.9   root       81:        { 0xff820f, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.10  root       82:        { 0xff8240, 16*SIZE_WORD, IoMem_ReadWithoutInterception, Video_TTColorRegs_STRegWrite },        /* 16 TT ST-palette entries */
                     83:        { 0xff8260, SIZE_BYTE, Video_Res_ReadByte, Video_Res_WriteByte },
1.1.1.5   root       84:        { 0xff8261, SIZE_BYTE, IoMem_VoidRead_00, IoMem_VoidWrite },                            /* No bus errors here : return 0 not ff */
1.1       root       85:        { 0xff8262, SIZE_WORD, IoMem_ReadWithoutInterception, Video_TTShiftMode_WriteWord },    /* TT screen mode */
1.1.1.10  root       86:        { 0xff8264, SIZE_BYTE, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception },
                     87:        { 0xff8265, SIZE_BYTE, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception }, /* Horizontal fine scrolling */
1.1.1.5   root       88:        { 0xff8266, 26,        IoMem_VoidRead_00, IoMem_VoidWrite },                            /* No bus errors here : return 0 not ff */
1.1       root       89: 
1.1.1.10  root       90:        { 0xff8400, 512,       IoMem_ReadWithoutInterception, Video_TTColorRegs_Write },        /* 256 TT palette entries */
1.1       root       91: 
                     92:        { 0xff8604, SIZE_WORD, FDC_DiskControllerStatus_ReadWord, FDC_DiskController_WriteWord },
                     93:        { 0xff8606, SIZE_WORD, FDC_DmaStatus_ReadWord, FDC_DmaModeControl_WriteWord },
                     94:        { 0xff8608, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.6   root       95:        { 0xff8609, SIZE_BYTE, FDC_DmaAddress_ReadByte, FDC_DmaAddress_WriteByte },             /* DMA base and counter high byte */
1.1       root       96:        { 0xff860a, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.6   root       97:        { 0xff860b, SIZE_BYTE, FDC_DmaAddress_ReadByte, FDC_DmaAddress_WriteByte },             /* DMA base and counter med byte  */
1.1       root       98:        { 0xff860c, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.6   root       99:        { 0xff860d, SIZE_BYTE, FDC_DmaAddress_ReadByte, FDC_DmaAddress_WriteByte },             /* DMA base and counter low byte  */
1.1       root      100:        { 0xff860e, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
                    101:        { 0xff860f, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
                    102: 
1.1.1.7   root      103:        { 0xff8780, 16, IoMem_VoidRead_00, IoMem_WriteWithoutInterception },                    /* TT SCSI controller */
1.1       root      104: 
1.1.1.7   root      105:        { 0xff8800, SIZE_BYTE, PSG_ff8800_ReadByte, PSG_ff8800_WriteByte },
                    106:        { 0xff8802, SIZE_BYTE, PSG_ff880x_ReadByte, PSG_ff8802_WriteByte },
1.1       root      107: 
                    108:        { 0xff8900, SIZE_WORD, DmaSnd_SoundControl_ReadWord, DmaSnd_SoundControl_WriteWord },   /* DMA sound control */
                    109:        { 0xff8902, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.5   root      110:        { 0xff8903, SIZE_BYTE, IoMem_ReadWithoutInterception, DmaSnd_FrameStartHigh_WriteByte },/* DMA sound frame start high */
1.1       root      111:        { 0xff8904, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.5   root      112:        { 0xff8905, SIZE_BYTE, IoMem_ReadWithoutInterception, DmaSnd_FrameStartMed_WriteByte }, /* DMA sound frame start med */
1.1       root      113:        { 0xff8906, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.5   root      114:        { 0xff8907, SIZE_BYTE, IoMem_ReadWithoutInterception, DmaSnd_FrameStartLow_WriteByte }, /* DMA sound frame start low */
1.1       root      115:        { 0xff8908, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.5   root      116:        { 0xff8909, SIZE_BYTE, DmaSnd_FrameCountHigh_ReadByte, DmaSnd_FrameCountHigh_WriteByte },/* DMA sound frame count high */
1.1       root      117:        { 0xff890a, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.5   root      118:        { 0xff890b, SIZE_BYTE, DmaSnd_FrameCountMed_ReadByte, DmaSnd_FrameCountMed_WriteByte }, /* DMA sound frame count med */
1.1       root      119:        { 0xff890c, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.5   root      120:        { 0xff890d, SIZE_BYTE, DmaSnd_FrameCountLow_ReadByte, DmaSnd_FrameCountLow_WriteByte }, /* DMA sound frame count low */
1.1       root      121:        { 0xff890e, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.5   root      122:        { 0xff890f, SIZE_BYTE, IoMem_ReadWithoutInterception, DmaSnd_FrameEndHigh_WriteByte },  /* DMA sound frame end high */
1.1       root      123:        { 0xff8910, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.5   root      124:        { 0xff8911, SIZE_BYTE, IoMem_ReadWithoutInterception, DmaSnd_FrameEndMed_WriteByte },   /* DMA sound frame end med */
1.1       root      125:        { 0xff8912, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1.1.5   root      126:        { 0xff8913, SIZE_BYTE, IoMem_ReadWithoutInterception, DmaSnd_FrameEndLow_WriteByte },   /* DMA sound frame end low */
1.1.1.4   root      127:        { 0xff8920, SIZE_BYTE, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception }, /* DMA sound mode control (contains 0) */
                    128:        { 0xff8921, SIZE_BYTE, DmaSnd_SoundModeCtrl_ReadByte, DmaSnd_SoundModeCtrl_WriteByte }, /* DMA sound mode control */
1.1       root      129:        { 0xff8922, SIZE_WORD, DmaSnd_MicrowireData_ReadWord, DmaSnd_MicrowireData_WriteWord }, /* Microwire data */
                    130:        { 0xff8924, SIZE_WORD, DmaSnd_MicrowireMask_ReadWord, DmaSnd_MicrowireMask_WriteWord }, /* Microwire mask */
                    131:        { 0xff8926, 26,        IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus errors here */
                    132: 
                    133:        { 0xff8961, SIZE_BYTE, NvRam_Select_ReadByte, NvRam_Select_WriteByte },                 /* NVRAM/RTC chip */
                    134:        { 0xff8963, SIZE_BYTE, NvRam_Data_ReadByte, NvRam_Data_WriteByte },                     /* NVRAM/RTC chip */
                    135: 
                    136:        /* Note: The TT does not have a blitter (0xff8a00 - 0xff8a3e) */
                    137: 
                    138:        //{ 0xff8c80, 8, IoMem_VoidRead, IoMem_WriteWithoutInterception },         /* SCC */
                    139: 
1.1.1.10  root      140:        { 0xff8e01, 1, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception },         /* SCU system interrupt mask */
                    141:        { 0xff8e03, 1, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception },         /* SCU system interrupt state */
                    142:        { 0xff8e05, 1, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception },         /* SCU system interrupter */
                    143:        { 0xff8e07, 1, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception },         /* SCU VME interrupter */
                    144:        { 0xff8e09, 1, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception },         /* SCU general purpose 1 */
                    145:        { 0xff8e0b, 1, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception },         /* SCU general purpose 2 */
                    146:        { 0xff8e0d, 1, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception },         /* SCU VME interrupt mask */
                    147:        { 0xff8e0f, 1, IoMem_ReadWithoutInterception, IoMem_WriteWithoutInterception },         /* SCU VME interrupt state */
1.1       root      148: 
1.1.1.10  root      149:        { 0xff9000, SIZE_WORD, IoMem_VoidRead, IoMem_VoidWrite },                /* No bus error here */
                    150:        { 0xff9200, SIZE_WORD, IoMemTabTT_ReadDIPSwitches, IoMem_VoidWrite },    /* DIP switches */
1.1       root      151: 
                    152:        { 0xfffa01, SIZE_BYTE, MFP_GPIP_ReadByte, MFP_GPIP_WriteByte },
                    153:        { 0xfffa03, SIZE_BYTE, MFP_ActiveEdge_ReadByte, MFP_ActiveEdge_WriteByte },
                    154:        { 0xfffa05, SIZE_BYTE, MFP_DataDirection_ReadByte, MFP_DataDirection_WriteByte },
                    155:        { 0xfffa07, SIZE_BYTE, MFP_EnableA_ReadByte, MFP_EnableA_WriteByte },
                    156:        { 0xfffa09, SIZE_BYTE, MFP_EnableB_ReadByte, MFP_EnableB_WriteByte },
                    157:        { 0xfffa0b, SIZE_BYTE, MFP_PendingA_ReadByte, MFP_PendingA_WriteByte },
                    158:        { 0xfffa0d, SIZE_BYTE, MFP_PendingB_ReadByte, MFP_PendingB_WriteByte },
                    159:        { 0xfffa0f, SIZE_BYTE, MFP_InServiceA_ReadByte, MFP_InServiceA_WriteByte },
                    160:        { 0xfffa11, SIZE_BYTE, MFP_InServiceB_ReadByte, MFP_InServiceB_WriteByte },
                    161:        { 0xfffa13, SIZE_BYTE, MFP_MaskA_ReadByte, MFP_MaskA_WriteByte },
                    162:        { 0xfffa15, SIZE_BYTE, MFP_MaskB_ReadByte, MFP_MaskB_WriteByte },
                    163:        { 0xfffa17, SIZE_BYTE, MFP_VectorReg_ReadByte, MFP_VectorReg_WriteByte },
                    164:        { 0xfffa19, SIZE_BYTE, MFP_TimerACtrl_ReadByte, MFP_TimerACtrl_WriteByte },
                    165:        { 0xfffa1b, SIZE_BYTE, MFP_TimerBCtrl_ReadByte, MFP_TimerBCtrl_WriteByte },
                    166:        { 0xfffa1d, SIZE_BYTE, MFP_TimerCDCtrl_ReadByte, MFP_TimerCDCtrl_WriteByte },
                    167:        { 0xfffa1f, SIZE_BYTE, MFP_TimerAData_ReadByte, MFP_TimerAData_WriteByte },
                    168:        { 0xfffa21, SIZE_BYTE, MFP_TimerBData_ReadByte, MFP_TimerBData_WriteByte },
                    169:        { 0xfffa23, SIZE_BYTE, MFP_TimerCData_ReadByte, MFP_TimerCData_WriteByte },
                    170:        { 0xfffa25, SIZE_BYTE, MFP_TimerDData_ReadByte, MFP_TimerDData_WriteByte },
                    171: 
                    172:        { 0xfffa27, SIZE_BYTE, RS232_SCR_ReadByte, RS232_SCR_WriteByte },   /* Sync character register */
                    173:        { 0xfffa29, SIZE_BYTE, RS232_UCR_ReadByte, RS232_UCR_WriteByte },   /* USART control register */
                    174:        { 0xfffa2b, SIZE_BYTE, RS232_RSR_ReadByte, RS232_RSR_WriteByte },   /* Receiver status register */
                    175:        { 0xfffa2d, SIZE_BYTE, RS232_TSR_ReadByte, RS232_TSR_WriteByte },   /* Transmitter status register */
                    176:        { 0xfffa2f, SIZE_BYTE, RS232_UDR_ReadByte, RS232_UDR_WriteByte },   /* USART data register */
                    177: 
                    178:        { 0xfffa31, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },           /* No bus error here */
                    179:        { 0xfffa33, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },           /* No bus error here */
                    180:        { 0xfffa35, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },           /* No bus error here */
                    181:        { 0xfffa37, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },           /* No bus error here */
                    182:        { 0xfffa39, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },           /* No bus error here */
                    183:        { 0xfffa3b, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },           /* No bus error here */
                    184:        { 0xfffa3d, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },           /* No bus error here */
                    185:        { 0xfffa3f, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },           /* No bus error here */
                    186: 
                    187:        { 0xfffa80, 48, IoMem_VoidRead, IoMem_WriteWithoutInterception },  /* 2nd TT MFP */
                    188: 
1.1.1.8   root      189:        { 0xfffc00, SIZE_BYTE, ACIA_IKBD_Read_SR, ACIA_IKBD_Write_CR },
                    190:        { 0xfffc02, SIZE_BYTE, ACIA_IKBD_Read_RDR, ACIA_IKBD_Write_TDR },
1.1       root      191:        { 0xfffc04, SIZE_BYTE, Midi_Control_ReadByte, Midi_Control_WriteByte },
                    192:        { 0xfffc06, SIZE_BYTE, Midi_Data_ReadByte, Midi_Data_WriteByte },
1.1.1.5   root      193:        { 0xfffc08, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
                    194:        { 0xfffc0a, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
                    195:        { 0xfffc0c, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
                    196:        { 0xfffc0e, SIZE_BYTE, IoMem_VoidRead, IoMem_VoidWrite },                               /* No bus error here */
1.1       root      197: 
                    198:        { 0, 0, NULL, NULL }
                    199: };

unix.superglobalmegacorp.com

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