@@ -24,7 +24,7 @@ Cpu Cpu_new(void)
2424 };
2525}
2626
27- bool Cpu_read_cc (const Cpu * const restrict self , const CpuTableCc cc )
27+ bool Cpu_read_cc (const Cpu * const self , const CpuTableCc cc )
2828{
2929 switch (cc ) {
3030 case CpuTableCc_NZ :
@@ -40,7 +40,7 @@ bool Cpu_read_cc(const Cpu *const restrict self, const CpuTableCc cc)
4040 }
4141}
4242
43- u16 Cpu_read_rp (const Cpu * const restrict self , const CpuTableRp rp )
43+ u16 Cpu_read_rp (const Cpu * const self , const CpuTableRp rp )
4444{
4545 switch (rp ) {
4646 case CpuTableRp_BC :
@@ -56,7 +56,7 @@ u16 Cpu_read_rp(const Cpu *const restrict self, const CpuTableRp rp)
5656 }
5757}
5858
59- void Cpu_write_rp (Cpu * const restrict self , const CpuTableRp rp ,
59+ void Cpu_write_rp (Cpu * const self , const CpuTableRp rp ,
6060 const u16 value )
6161{
6262 switch (rp ) {
@@ -80,7 +80,7 @@ void Cpu_write_rp(Cpu *const restrict self, const CpuTableRp rp,
8080 }
8181}
8282
83- u16 Cpu_read_rp2 (const Cpu * const restrict self , const CpuTableRp rp )
83+ u16 Cpu_read_rp2 (const Cpu * const self , const CpuTableRp rp )
8484{
8585 switch (rp ) {
8686 case CpuTableRp2_BC :
@@ -96,7 +96,7 @@ u16 Cpu_read_rp2(const Cpu *const restrict self, const CpuTableRp rp)
9696 }
9797}
9898
99- void Cpu_write_rp2 (Cpu * const restrict self , const CpuTableRp rp ,
99+ void Cpu_write_rp2 (Cpu * const self , const CpuTableRp rp ,
100100 const u16 value )
101101{
102102 switch (rp ) {
@@ -121,65 +121,65 @@ void Cpu_write_rp2(Cpu *const restrict self, const CpuTableRp rp,
121121 }
122122}
123123
124- u8 Cpu_read_mem (Cpu * const restrict self , const Memory * const restrict mem ,
124+ u8 Cpu_read_mem (Cpu * const self , const Memory * const mem ,
125125 const u16 addr )
126126{
127127 self -> cycle_count ++ ;
128128 return mem -> read (mem -> ctx , addr );
129129}
130130
131- u16 Cpu_read_mem_u16 (Cpu * const restrict self , const Memory * const restrict mem ,
131+ u16 Cpu_read_mem_u16 (Cpu * const self , const Memory * const mem ,
132132 const u16 addr )
133133{
134134 const u8 lo = Cpu_read_mem (self , mem , addr );
135135 const u8 hi = Cpu_read_mem (self , mem , addr + 1 );
136136 return concat_u16 (hi , lo );
137137}
138138
139- void Cpu_write_mem (Cpu * const restrict self , Memory * const restrict mem ,
139+ void Cpu_write_mem (Cpu * const self , Memory * const mem ,
140140 const u16 addr , const u8 value )
141141{
142142 self -> cycle_count ++ ;
143143 mem -> write (mem -> ctx , addr , value );
144144}
145145
146- void Cpu_write_mem_u16 (Cpu * const restrict self , Memory * const restrict mem ,
146+ void Cpu_write_mem_u16 (Cpu * const self , Memory * const mem ,
147147 const u16 addr , const u16 value )
148148{
149149 Cpu_write_mem (self , mem , addr , value & 0xFF );
150150 Cpu_write_mem (self , mem , addr + 1 , value >> 8 );
151151}
152152
153- u8 Cpu_read_pc (Cpu * const restrict self , const Memory * const restrict mem )
153+ u8 Cpu_read_pc (Cpu * const self , const Memory * const mem )
154154{
155155 const u8 value = Cpu_read_mem (self , mem , self -> pc );
156156 self -> pc ++ ;
157157 return value ;
158158}
159159
160- u16 Cpu_read_pc_u16 (Cpu * const restrict self , const Memory * const restrict mem )
160+ u16 Cpu_read_pc_u16 (Cpu * const self , const Memory * const mem )
161161{
162162 const u16 value = Cpu_read_mem_u16 (self , mem , self -> pc );
163163 self -> pc += 2 ;
164164 return value ;
165165}
166166
167- void Cpu_stack_push_u16 (Cpu * const restrict self , Memory * const restrict mem ,
167+ void Cpu_stack_push_u16 (Cpu * const self , Memory * const mem ,
168168 const u16 value )
169169{
170170 self -> sp -= 2 ;
171171 Cpu_write_mem_u16 (self , mem , self -> sp , value );
172172 self -> cycle_count ++ ;
173173}
174174
175- u16 Cpu_stack_pop_u16 (Cpu * const restrict self , const Memory * restrict mem )
175+ u16 Cpu_stack_pop_u16 (Cpu * const self , const Memory * mem )
176176{
177177 const u16 value = Cpu_read_mem_u16 (self , mem , self -> sp );
178178 self -> sp += 2 ;
179179 return value ;
180180}
181181
182- u8 Cpu_read_r (Cpu * const restrict self , const Memory * const restrict mem ,
182+ u8 Cpu_read_r (Cpu * const self , const Memory * const mem ,
183183 const CpuTableR r )
184184{
185185 switch (r ) {
@@ -206,7 +206,7 @@ u8 Cpu_read_r(Cpu *const restrict self, const Memory *const restrict mem,
206206 }
207207}
208208
209- void Cpu_write_r (Cpu * const restrict self , Memory * const restrict mem ,
209+ void Cpu_write_r (Cpu * const self , Memory * const mem ,
210210 const CpuTableR r , const u8 value )
211211{
212212 switch (r ) {
@@ -241,7 +241,7 @@ void Cpu_write_r(Cpu *const restrict self, Memory *const restrict mem,
241241 }
242242}
243243
244- void Cpu_tick (Cpu * const restrict self , Memory * const restrict mem )
244+ void Cpu_tick (Cpu * const self , Memory * const mem )
245245{
246246 if (self -> mode != CpuMode_Running ) {
247247 self -> cycle_count ++ ; // Makes the frontend work lmao
@@ -257,7 +257,7 @@ void Cpu_tick(Cpu *const restrict self, Memory *const restrict mem)
257257 Cpu_execute (self , mem , opcode );
258258}
259259
260- void Cpu_interrupt (Cpu * const restrict self , Memory * const restrict mem ,
260+ void Cpu_interrupt (Cpu * const self , Memory * const mem ,
261261 const u8 handler_location )
262262{
263263 Cpu_stack_push_u16 (self , mem , self -> pc );
0 commit comments