Nugget
Loading...
Searching...
No Matches
hwregs.h
Go to the documentation of this file.
1/*
2
3MIT License
4
5Copyright (c) 2019 PCSX-Redux authors
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26
27#pragma once
28
29#include <stdint.h>
30
32
33struct SIO {
34 uint8_t fifo;
35 uint8_t preview[3];
36 uint16_t stat;
37 uint16_t padding;
38 uint16_t mode;
39 uint16_t ctrl;
40 uint16_t reserved;
41 uint16_t baudRate;
42};
43
44#define HW_U8(x) (*(volatile uint8_t *)(x))
45#define HW_U16(x) (*(volatile uint16_t *)(x))
46#define HW_U32(x) (*(volatile uint32_t *)(x))
47#define HW_S8(x) (*(volatile int8_t *)(x))
48#define HW_S16(x) (*(volatile int16_t *)(x))
49#define HW_S32(x) (*(volatile int32_t *)(x))
50
51#define SBUS_DEV4_CTRL HW_U32(0x1f801014)
52#define SBUS_DEV5_CTRL HW_U32(0x1f801018)
53#define SBUS_COM_CTRL HW_U32(0x1f801020)
54
55#define SIOS ((volatile struct SIO *)0x1f801040)
56
57#define RAM_SIZE HW_U32(0x1f801060)
58
59#define IREG HW_U32(0xbf801070)
60#define IMASK HW_U32(0xbf801074)
61
62#define DPCR HW_U32(0x1f8010f0)
63#define DICR HW_U32(0x1f8010f4)
64
65#define GPU_DATA HW_U32(0x1f801810)
66#define GPU_STATUS HW_U32(0x1f801814)
67
68#define ATCONS_STAT HW_U8(0x1f802000)
69#define ATCONS_FIFO HW_U8(0x1f802002)
70#define ATCONS_IRQ HW_U8(0x1f802030)
71#define ATCONS_IRQ2 HW_U8(0x1f802032)
72
73#define SYS573_WATCHDOG HW_U16(0x1f5c0000)
74#define SYS573_7SEG_POST HW_U16(0x1f640010)
75
76#define POST HW_U8(0xbf802041)
Definition hwregs.h:33
uint16_t stat
Definition hwregs.h:36
uint8_t preview[3]
Definition hwregs.h:35
uint16_t reserved
Definition hwregs.h:40
uint16_t mode
Definition hwregs.h:38
uint16_t ctrl
Definition hwregs.h:39
uint16_t padding
Definition hwregs.h:37
uint16_t baudRate
Definition hwregs.h:41
uint8_t fifo
Definition hwregs.h:34