-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatariROM.c
179 lines (154 loc) · 24.1 KB
/
atariROM.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#include <stdint.h>
#include "pico/stdlib.h"
#include "hardware/pio.h"
#include "hardware/dma.h"
#include "eeprom.pio.h"
#define EEPROM_SIZE (1 << eeprom_addr_bus_width)
// Address pins.
#define A0 0
// Data pins.
#define D0 13
// EEPROM data
static uint8_t eeprom_data[EEPROM_SIZE] __attribute__ ((aligned (EEPROM_SIZE))) =
{0xD8,0x78,0xA2,0xFF,0x9A,0xE8,0x8A,0x95,0x00,0xE8,
0xD0,0xFB,0xA9,0x06,0x85,0x84,0x0A,0x85,0xEC,
0xCA,0x86,0x82,0x86,0xCB,0x20,0xF7,0xFB,0xA9,
0xCB,0x85,0xCC,0x4A,0x85,0xB6,0xA9,0xED,0x85,
0xCE,0xA9,0x0F,0x85,0xD0,0xA2,0x04,0x95,0xC0,0xCA,0xD0,0xFB,0x85,0x02,0xA9,0xF0,0x85,0x23,0xA9,0x80,0x85,0x24,0xA2,0x06,0xCA,0xD0,0xFD,
0x85,0x14,0x85,0x13,0x85,0x02,0x85,0x2A,0x85,0x02,0x85,0x2B,0x86,0xE7,0x86,0x98,0x4C,0xD9,0xF7,0xA9,0x00,0xE4,0xD9,0x30,0x09,0xA4,0xDC,0x30,0x05,0xB1,0xDF,0x88,0x84,0xDC,0x85,0x02,0x85,0x1C,0x60,0x20,0x53,0xF0,0xA9,0x00,0xE8,0xE4,0xD8,0x30,0x09,0xA4,0xDB,0x30,0x05,0xB1,0xDD,0x88,0x84,0xDB,0x85,0x02,0x85,0x1B,0x60,0x85,
0x02,0xA9,0x20,0x85,0x04,0xA2,0x00,0xA8,0xA5,0x80,0x29,0x08,0xD0,0x03,0xA2,0x09,0xEA,0xCA,0x10,0xFD,0x85,0x12,0x84,0x22,0x84,0x05,0xA2,0x01,0xA9,0x01,0x18,0x75,0xB0,0xA0,0x02,0x38,0xC8,0xE9,0x0F,0xB0,0xFB,0x49,0xFF,0xE9,0x06,0x0A,0x0A,0x0A,0x0A,0x85,0x02,0x88,0x10,0xFD,0x95,0x10,0x95,0x20,0xCA,0x10,0xDF,0x85,0x02,0x85,
0x2A,0xA0,0x01,0xA2,0x07,0xAD,0x84,0x02,0xD0,0xFB,0x85,0x02,0x84,0x01,0x85,0x2B,0xA5,0xF0,0x85,0x09,0x84,0xCA,0x88,0x84,0x87,0x86,0xC9,0xE8,0xA9,0x31,0x85,0x0A,0xA5,0xF1,0x85,0x08,0x20,0x6A,0xF0,0xA0,0xFF,0x84,0x0D,0x84,0x0E,0xA9,0x7F,0x85,0x0F,0x4C,0x13,0xF3,0xA9,0x00,0xE4,0xD9,0x30,0x09,0xA4,0xDC,0x30,0x05,0xB1,0xDF,
0x88,0x84,0xDC,0x85,0x02,0x85,0x1C,0xA4,0xCA,0x88,0xF0,0x6A,0xA4,0x87,0xB9,0x88,0x00,0x29,0x0F,0xA8,0xB9,0x4A,0xFD,0x85,0xD4,0x20,0x6A,0xF0,0xA9,0x00,0x85,0x1D,0xA4,0x87,0xB9,0x88,0x00,0x4A,0x4A,0x4A,0x4A,0x29,0x07,0xA8,0xB9,0x42,0xFD,0x85,0xD3,0x20,0x53,0xF0,0xA4,0x87,0xB9,0x88,0x00,0x10,0x04,0xA9,0x50,0xD0,0x02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xE2,0x85,0x1D,0x20,0x53,0xF0,0x20,
0x6A,0xF0,0xA4,0xCA,0xB9,0x44,0xFF,0x85,0x0D,0xB9,0x12,0xFE,0x85,0x0E,0xB9,0x14,0xFE,0x85,0x0F,0x20,0x53,0xF0,0xA5,0xE7,0xA4,0xC9,0xC0,0x03,0xF0,0x02,0xA9,0x00,0x85,0xE1,0x20,0x6A,0xF0,0x20,0x67,0xF0,0xA4,0xCA,0xB9,0x10,0xFE,0xA4,0xC9,0xC0,0x04,0xD0,0x02,0xA9,0x40,0x85,0xE3,0x20,0x53,0xF0,0xA9,0x00,0xE8,0xE4,0xD8,0x30,
0x09,0xA4,0xDB,0x30,0x05,0xB1,0xDD,0x88,0x84,0xDB,0x85,0x02,0x85,0x1B,0xA4,0xCA,0x85,0x1B,0xB9,0x0D,0xFE,0x85,0x0D,0xB9,0x0F,0xFE,0x85,0x0E,0xA5,0xE3,0x85,0x0F,0x4C,0xF4,0xF0,0xA9,0x00,0xE8,0xE4,0xD8,0x30,0x09,0xA4,0xDB,0x30,0x05,0xB1,0xDD,0x88,0x84,0xDB,0x85,0x02,0x85,0x1B,0x20,0x67,0xF0,0x20,0x67,0xF0,0x20,0x67,0xF0,
0xA9,0xFF,0x85,0x0D,0x85,0x0E,0xA9,0x7F,0x85,0x0F,0xA9,0x5F,0x8D,0x96,0x02,0x20,0x53,0xF0,0x20,0x6A,0xF0,0x20,0x53,0xF0,0xA9,0x03,0xA0,0x00,0x85,0x02,0x84,0x0D,0x84,0x0E,0x84,0x0F,0x84,0x0C,0x85,0x04,0x85,0x05,0x85,0x25,0x85,0x26,0x20,0x86,0xF4,0xA5,0x82,0x85,0x07,0x85,0x06,0xA2,0x07,0x85,0x02,0xCA,0xD0,0xFD,0xEA,0x85,
0x10,0x85,0x11,0xA9,0xF0,0x85,0x20,0x85,0x02,0x85,0x2A,0x86,0x09,0xA0,0x04,0xA5,0xF5,0x85,0xD2,0x20,0xF1,0xF3,0xA5,0xE6,0x0A,0x10,0x09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0x29,0x20,0xF0,0x01,0x88,0x84,0xEC,0xA5,0x82,0xF0,0x04,0xE6,0x82,0xF0,0xFC,
0x85,0x02,0xA9,0xFD,0x85,0xDE,0x85,0xE0,0xA5,0xB6,0x18,0x69,0x0C,0x85,0xD9,0xA2,0x07,0x86,0xDB,0xCA,0x86,0xDC,0xA2,0xFF,0xA9,0x08,0x2D,0x82,0x02,0xD0,0x02,0xA2,0x0F,0x8A,0xA6,0x82,0xF0,0x02,0x49,0x08,0x85,0xEF,0xA9,0x07,0x85,0xF0,0xA9,0x08,0x85,0xF1,0xA5,0xAF,0x85,0xF4,0xA9,0x3E,0x8D,0x96,0x02,0x85,0x02,0xA2,0x00,0x86,
0x00,0xA5,0x9B,0x85,0xF5,0xA5,0x82,0xF0,0x04,0xA5,0x3C,0x10,0x06,0xAD,0x82,0x02,0x6A,0xB0,0x31,0xA9,0xFF,0x85,0xCB,0x20,0x80,0xFC,0x85,0xAC,0x85,0x82,0xA9,0x08,0x85,0xE7,0xA9,0x0D,0xA6,0x84,0xE0,0x08,0x10,0x02,0xA9,0x0B,0x85,0xC0,0x20,0xF7,0xFB,0xA5,0xE6,0x29,0x7F,0x85,0xE6,0x0A,0x10,0x52,0x20,0xA2,0xFB,0x20,0xF7,0xFB,
0xE6,0xAC,0xD0,0x48,0x6A,0xB0,0x45,0xA5,0x83,0xD0,0x37,0xE6,0x84,0xA9,0x60,0x85,0xB6,0xA9,0x10,0x85,0xE7,0xA5,0xE6,0x49,0x40,0x85,0xE6,0x20,0x80,0xFC,0x85,0x19,0x85,0x1A,0x85,0xE8,0xA9,0x01,0x85,0x82,0x85,0x80,0xA5,0x84,0xC9,0x12,0xD0,0x02,0xA9,0x02,0x85,0x84,0x4A,0x38,0xE9,0x02,0x29,0x07,0xD0,0x02,0xA9,0x08,0x85,0xCC,
0x85,0xCD,0xE6,0x83,0xA5,0x83,0x29,0x1F,0xD0,0x06,0xF0,0xBF,0xA0,0x00,0x84,0x83,0xA9,0xDF,0x25,0x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xBB,0x29,0x10,0xD0,0x18,0xD6,0xB6,0xD0,0x67,0xB5,0xBB,0x30,0x04,0xA9,0x00,0xF0,0x02,0xA9,0x62,0x95,0xB6,0xB5,0xBB,0x09,0x10,0x95,0xBB,0xD0,0x53,0xB5,0xBB,0x2A,0xB0,0x52,0x10,0x37,0xF6,0xB6,0xB5,0xB6,0xC9,0x0B,0xD0,0x12,0xA9,0x00,0x95,0xB6,0xA9,
0x0B,0x99,0xD8,0x00,0xB5,0xBB,0x29,0x0F,0x09,0x80,0x95,0xBB,0x60,0xC9,0x06,0x10,0x13,0x99,0xDB,0x00,0xAA,0x18,0xBD,0x10,0xFF,0xBE,0x1C,0xFF,0x75,0xDD,0x95,0xDD,0xA9,0x08,0xD0,0x02,0xB5,0xB6,0x99,0xD8,0x00,0x60,0xF6,0xB6,0xA9,0x62,0xD5,0xB6,0xD0,0xF2,0xB5,0xBB,0x29,0x0F,0x09,0x60,0x95,0xBB,0xB9,0x28,0xFF,0x95,0xB6,0xA9,
0x70,0xD0,0xE3,0x30,0x16,0xD6,0xB6,0xA9,0x58,0xD5,0xB6,0xD0,0xD7,0xA9,0x4D,0x95,0xB6,0xB5,0xBB,0x29,0x0F,0x09,0xC0,0x95,0xBB,0xD0,0xE4,0xD6,0xB6,0x10,0x96,0xB5,0xBB,0x29,0x0F,0x09,0xA0,0x95,0xBB,0xD0,0xD1,0xB5,0xBB,0x29,0x0F,0x09,0x30,0x95,0xBB,0xA9,0x58,0xD0,0x0A,0xB5,0xBB,0x29,0x0F,0x09,0xF0,0x95,0xBB,0xA9,0x0B,0x95,
0xB6,0x60,0x08,0x0A,0x28,0x2A,0x88,0x8A,0xA8,0xAA,0x00,0x40,0x10,0x50,0x04,0x44,0x14,0x54,0x01,0x41,0x11,0x51,0x05,0x45,0x15,0x55,0x00,0x80,0x20,0xA0,0x01,0x05,0x11,0x15,0x41,0x45,0x51,0x55,0x80,0xA0,0x88,0xA8,0x82,0xA2,0x8A,0xAA,0x00,0x02,0x08,0x0A,0x20,0x22,0x28,0x2A,0x80,0x82,0x88,0x8A,0xA0,0xA2,0xA8,0xAA,0x08,0x88,
0x28,0xA8,0x09,0x89,0x29,0xA9,0x80,0x81,0x84,0x85,0x90,0x91,0x94,0x95,0xAA,0xFF,0xFF,0xFF,0x99,0xDD,0x7E,0x3C,0x55,0xFF,0xFF,0xFF,0x99,0xBB,0x7E,0x3C,0xAA,0xFF,0xFF,0xFF,0xBB,0x99,0x7E,0x3C,0x55,0xFF,0xFF,0xFF,0xDD,0x99,0x7E,0x3C,0x8E,0x96,0x9E,0xA6,0x38,0x7C,0xFE,0xFE,0xFE,0x6C,0x38,0x7C,0xFE,0xE0,0xFE,0x6C,0x38,0x7E,
0xE0,0xC0,0xE0,0x6C,0x38,0xB2,0xB8,0xBE,0xB8,0x00,0x00,0x00,0x00,0xE7,0xA5,0xE7,0x00,0x3C,0x7E,0xC3,0xC3,0xE7,0x66,0x24,0x18,0x3C,0x7E,0xE7,0xE7,0xC3,0xC3,0x3C,0x7E,0xE7,0xC3,0x00,0x00,0x00,0xFF,0x7E,0x00,0x00,0x00,0x00,0x00,0x14,0x08,0x14,0x00,0x00,0x22,0x14,0x00,0x14,0x22,0x00,0x41,0x00,0x41,0x00,0x22,0xF6,0xF1,0xEB,
0xEB,0xE6,0xE6,0xDF,0xDF,0xD8,0xD8,0xD1,0xD1,0xD1,0xB2,0xB2,0xB2,0x10,0x10,0x08,0x00,0x08,0xC9,0x39,0xC9,0xCF,0x80,0x20,0x01,0x00,0x45,0x00,0x29,0x00,0x0D,0x60,0x11,0x00,0x15,0x20,0x00,0x80,0x60,0x19,0x00,0x1D,0x03,0x00,0x67,0x00,0x80,0x20,0x0B,0x00,0x00,0x6F,0x00,0x13,0x20,0x17,0x40,0x1B,0x00,0x3F,0x00,0x80,0x80,0x40,
0x01,0x00,0x25,0x00,0x49,0x00,0x80,0x60,0x0D,0x00,0x11,0x40,0x15,0x00,0x79,0x00,0x1D,0x00,0x00,0x03,0x60,0x07,0x00,0x4B,0x00,0x0F,0x00,0x73,0x00,0x80,0x40,0x17,0x20,0x1B,0x00,0x5F,0x00,0x80,0x10,0x50,0x90,0xD0,0x40,0x00,0xC0,0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01,0x02,0x03,0x05,0x07,0x08,0x0A,0x0C,0x08,0x0C,0x03,0x07,
0x0B,0x0F,0x02,0x06,0x0A,0x0E,0x01,0x05,0x09,0x0D,0x00,0x04,0x79,0x85,0xB5,0xA5,0xB5,0x85,0x79,0x17,0x15,0x15,0x77,0x55,0x55,0x77,0x41,0x41,0x41,0x41,0x41,0x41,0x40,0x49,0x49,0x49,0xC9,0x49,0x49,0xBE,0x55,0x55,0x55,0xD9,0x55,0x55,0x99,0x3C,0x66,0x66,0x66,0x66,0x66,0x3C,0x66,0x66,0x7C,0x60,0x62,0x3C,0x66,0x66,0x3C,0x66,
0x66,0x3C,0x46,0x06,0x3E,0x66,0x66,0x3C,0x46,0x06,0x0C,0x06,0x46,0x3C,0x0C,0x0C,0x7E,0x4C,0x2C,0x1C,0x0C,0x18,0x18,0x08,0x04,0x02,0x62,0x7E,0x60,0x60,0x3C,0x06,0x46,0x7C,0x46,0x06,0x7C,0x60,0x60,0x7E,0x18,0x18,0x18,0x18,0x78,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x05,0x15,0x55,0xAF,0xE7,0xDB,0xC7,0xCE,0xE1,0xB5,
0xD5,0xBB,0xC1,0xEE,0xA8,0xA1,0x9A,0x93,0x8C,0x20,0x40,0x80,0x60,0x01,0x05,0x00,0x00,0x00,0x01,0x00,0x00,0x01,0x06,0x05,0x04,0x03,0x02,0x01,0x00,0x02,0x00,0x00,0x80,0xA0,0xA8,0xAA,0xAA,0xAA,0xAA,0xAA,0x13,0x4C,0x08,0x0A,0x0C,0x0E,0x6F,0x6F,0x6F,0x6F,0xDF,0xDA,0x2F,0xD4,0x2B,0x44,0x57,0x0E,0x0E,0x0E,0x0E,0x09,0x04,0x0F,
0x00,0x07,0x04,0x0A,0x90,0xF0,0xB9,0xEC,0xFF,0x25,0xE8,0xD0,0x0A,0xB9,0x71,0xFE,0x85,0xE8,0xB9,0xF0,0xFF,0x85,0xE9,0x60,0xA5,0xE8,0x4A,0x90,0x0D,0xA9,0x04,0x85,0xD3,0xA5,0xE9,0x29,0x1F,0xA8,0x49,0x0F,0xB0,0x1B,0x4A,0x90,0x04,0xA9,0x0D,0xD0,0x11,0x4A,0x90,0x03,0x4C,0x6D,0xFF,0x4A,0x90,0x1C,0xA0,0x09,0x84,0xD3,0xA5,0xE9,
0xD0,0x03,0xA8,0x85,0xD3,0xD6,0xE9,0xD0,
0x05,0xA9,0x00,0x85,0xE8,0x60,0x95,0x19,
0xA5,0xD3,0x95,0x15,0x94,0x17,0x60,0xA9,
0x08,0x24,0xE7,0x50,0x0C,0xA5,0xE4,0x85,
0x19,0x4A,0x85,0x17,0xA9,0x04,0x85,0x15,
0x60,0xF0,0x2B,0xA5,0xE4,0xD0,0x06,0xA9,
0xF7,0x25,0xE7,0x85,0xE7,0x4A,0x4A,0x4A,
0x29,0x07,0xAA,0xE0,0x04,0x10,0x2C,0xBD,
0xF4,0xFF,0x85,0x17,0xBD,0xF8,0xFF,0x85,
0x18,0xA9,0x04,0x85,0x15,0x85,0x16,0xA9,
0x08,0x85,0x19,0x85,0x1A,0x60,0xA5,0x9A,
0x0A,0x10,0x10,0xA9,0x04,0x85,0xD3,0xA5,
0x80,0x4A,0x29,0x0F,0xA8,0x49,0x0F,0x4A,
0x4C,0x8E,0xFF,0x60,0x07,0x03,0x01,0x00,
0x09,0x18,0x10,0x30,0x08,0x04,0x0C,0x04,
0x14,0x18,0x14,0x18,0x00,0xF0,0x00,0x00};
void init()
{
PIO pio = pio0;
// Our assembled program needs to be loaded into this PIO's instruction
// memory. This SDK function will find a location (offset) in the
// instruction memory where there is enough space for our program. We need
// to remember this location!
uint offsetAddr = pio_add_program(pio, &eeprom_program);
// Find a free state machine on our chosen PIO (erroring if there are
// none). Configure it to run our program, and start it, using the
// helper function we included in our .pio file.
uint smAddr = pio_claim_unused_sm(pio, true);
eeprom_init(pio, smAddr, offsetAddr, A0, D0);
// Pass the top bits of the EEPROM's base address to the state machine
pio_sm_put_blocking(pio, smAddr, ((uint32_t)eeprom_data) >> eeprom_addr_bus_width);
// We need two DMA channels
int addr_chan = dma_claim_unused_channel(true);
int data_chan = dma_claim_unused_channel(true);
// The address channel transfers the EEPROM address from the SM's RX FIFO
// to the data channel's read address trigger
dma_channel_config c = dma_channel_get_default_config(addr_chan);
channel_config_set_transfer_data_size(&c, DMA_SIZE_32);
channel_config_set_read_increment(&c, false);
channel_config_set_write_increment(&c, false);
channel_config_set_dreq(&c, pio_get_dreq(pio, smAddr, false));
dma_channel_configure(
addr_chan,
&c,
&dma_hw->ch[data_chan].al3_read_addr_trig, // Write to READ_ADDR_TRIG of data channel
&pio->rxf[smAddr], // Read from state machine's RX FIFO
1, // Halt after each read
false // Don't start yet
);
// The data channel reads a byte from the EEPROM memory (address is
// set by the address channel) and writes it to the SM's RX FIFO
c = dma_channel_get_default_config(data_chan);
channel_config_set_transfer_data_size(&c, DMA_SIZE_8);
channel_config_set_read_increment(&c, false);
channel_config_set_write_increment(&c, false);
channel_config_set_chain_to(&c, addr_chan); // Trigger the address channel again when done
dma_channel_configure(
data_chan,
&c,
&pio->txf[smAddr], // Write to state machine's TX FIFO
&eeprom_data[0], // Read from EEPROM memory (will be overwritten)
1, // Halt after each read
false // Don't start yet
);
// Everything is ready to go. Start listening for an address from the state machine.
dma_start_channel_mask(1u << addr_chan);
}
int main()
{
// Overclock a bit if you need to
// set_sys_clock_khz(270000, true);
init();
sleep_ms(1);
while(true)
tight_loop_contents();
}