@@ -106,9 +106,7 @@ class junofrst_state : public tutankhm_state
106
106
: tutankhm_state(mconfig, type, tag)
107
107
, m_audiocpu(*this , " audiocpu" )
108
108
, m_i8039(*this , " mcu" )
109
- , m_filter_0_0(*this , " filter.0.0" )
110
- , m_filter_0_1(*this , " filter.0.1" )
111
- , m_filter_0_2(*this , " filter.0.2" )
109
+ , m_filter(*this , " filter.0.%u" , 0U )
112
110
, m_blitrom(*this , " blitrom" )
113
111
{
114
112
}
@@ -121,7 +119,6 @@ class junofrst_state : public tutankhm_state
121
119
122
120
private:
123
121
void blitter_w (offs_t offset, uint8_t data);
124
- void bankselect_w (uint8_t data);
125
122
void sh_irqtrigger_w (uint8_t data);
126
123
void i8039_irq_w (uint8_t data);
127
124
void i8039_irqen_and_status_w (uint8_t data);
@@ -136,9 +133,7 @@ class junofrst_state : public tutankhm_state
136
133
137
134
required_device<cpu_device> m_audiocpu;
138
135
required_device<i8039_device> m_i8039;
139
- required_device<filter_rc_device> m_filter_0_0;
140
- required_device<filter_rc_device> m_filter_0_1;
141
- required_device<filter_rc_device> m_filter_0_2;
136
+ required_device_array<filter_rc_device, 3 > m_filter;
142
137
required_region_ptr<uint8_t > m_blitrom;
143
138
144
139
uint8_t m_blitterdata[4 ]{};
@@ -175,7 +170,7 @@ void junofrst_state::blitter_w(offs_t offset, uint8_t data)
175
170
offs_t src = ((m_blitterdata[2 ] << 8 ) | m_blitterdata[3 ]) & 0xfffc ;
176
171
offs_t dest = (m_blitterdata[0 ] << 8 ) | m_blitterdata[1 ];
177
172
178
- int copy = m_blitterdata[3 ] & 0x01 ;
173
+ bool const copy = BIT ( m_blitterdata[3 ], 0 ) ;
179
174
180
175
/* 16x16 graphics */
181
176
for (int i = 0 ; i < 16 ; i++)
@@ -184,50 +179,40 @@ void junofrst_state::blitter_w(offs_t offset, uint8_t data)
184
179
{
185
180
uint8_t data;
186
181
187
- if (src & 1 )
182
+ if (BIT ( src, 0 ) )
188
183
data = m_blitrom[src >> 1 ] & 0x0f ;
189
184
else
190
185
data = m_blitrom[src >> 1 ] >> 4 ;
191
186
192
- src += 1 ;
187
+ src++ ;
193
188
194
189
/* if there is a source pixel either copy the pixel or clear the pixel depending on the copy flag */
195
190
196
191
if (data)
197
192
{
198
- if (copy == 0 )
193
+ if (! copy)
199
194
data = 0 ;
200
195
201
- if (dest & 1 )
196
+ if (BIT ( dest, 0 ) )
202
197
m_videoram[dest >> 1 ] = (m_videoram[dest >> 1 ] & 0x0f ) | (data << 4 );
203
198
else
204
199
m_videoram[dest >> 1 ] = (m_videoram[dest >> 1 ] & 0xf0 ) | data;
205
200
}
206
-
207
- dest += 1 ;
201
+ dest++;
208
202
}
209
-
210
203
dest += 240 ;
211
204
}
212
205
}
213
206
}
214
207
215
208
216
- void junofrst_state::bankselect_w (uint8_t data)
217
- {
218
- m_mainbank->set_entry (data & 0x0f );
219
- }
220
-
221
-
222
209
uint8_t junofrst_state::portA_r ()
223
210
{
224
- int timer;
225
-
226
211
/* main xtal 14.318MHz, divided by 8 to get the CPU clock, further */
227
212
/* divided by 1024 to get this timer */
228
213
/* (divide by (1024/2), and not 1024, because the CPU cycle counter is */
229
214
/* incremented every other state change of the clock) */
230
- timer = (m_audiocpu->total_cycles () / (1024 / 2 )) & 0x0f ;
215
+ int const timer = (m_audiocpu->total_cycles () / (1024 / 2 )) & 0x0f ;
231
216
232
217
/* low three bits come from the 8039 */
233
218
@@ -237,20 +222,17 @@ uint8_t junofrst_state::portA_r()
237
222
238
223
void junofrst_state::portB_w (uint8_t data)
239
224
{
240
- filter_rc_device *filter[3 ] = { m_filter_0_0, m_filter_0_1, m_filter_0_2 };
241
- int i;
242
-
243
- for (i = 0 ; i < 3 ; i++)
225
+ for (int i = 0 ; i < 3 ; i++)
244
226
{
245
227
int C = 0 ;
246
228
247
- if (data & 1 )
229
+ if (BIT ( data, 0 ) )
248
230
C += 47000 ; /* 47000pF = 0.047uF */
249
- if (data & 2 )
231
+ if (BIT ( data, 1 ) )
250
232
C += 220000 ; /* 220000pF = 0.22uF */
251
233
252
234
data >>= 2 ;
253
- filter [i]->filter_rc_set_RC (filter_rc_device::LOWPASS_3R, 1000 , 2200 , 200 , CAP_P (C));
235
+ m_filter [i]->filter_rc_set_RC (filter_rc_device::LOWPASS_3R, 1000 , 2200 , 200 , CAP_P (C));
254
236
}
255
237
}
256
238
@@ -262,7 +244,6 @@ void junofrst_state::sh_irqtrigger_w(uint8_t data)
262
244
/* setting bit 0 low then high triggers IRQ on the sound CPU */
263
245
m_audiocpu->set_input_line_and_vector (0 , HOLD_LINE, 0xff ); // Z80
264
246
}
265
-
266
247
m_last_irq = data;
267
248
}
268
249
@@ -275,15 +256,15 @@ void junofrst_state::i8039_irq_w(uint8_t data)
275
256
276
257
void junofrst_state::i8039_irqen_and_status_w (uint8_t data)
277
258
{
278
- if (( data & 0x80 ) == 0 )
259
+ if (BIT (~ data, 7 ) )
279
260
m_i8039->set_input_line (0 , CLEAR_LINE);
280
261
m_i8039_status = (data & 0x70 ) >> 4 ;
281
262
}
282
263
283
264
284
265
void junofrst_state::main_map (address_map &map)
285
266
{
286
- map (0x0000 , 0x7fff ).ram ().share (" videoram " );
267
+ map (0x0000 , 0x7fff ).ram ().share (m_videoram );
287
268
map (0x8000 , 0x800f ).ram ().w (m_palette, FUNC (palette_device::write8)).share (" palette" );
288
269
map (0x8010 , 0x8010 ).portr (" DSW2" );
289
270
map (0x801c , 0x801c ).r (" watchdog" , FUNC (watchdog_timer_device::reset_r));
@@ -434,10 +415,9 @@ void junofrst_state::junofrst(machine_config &config)
434
415
m_screen->set_raw (GALAXIAN_PIXEL_CLOCK, GALAXIAN_HTOTAL, GALAXIAN_HBEND, GALAXIAN_HBSTART, GALAXIAN_VTOTAL, GALAXIAN_VBEND, GALAXIAN_VBSTART);
435
416
PALETTE (config, m_palette).set_format (1 , tutankhm_state::raw_to_rgb_func, 16 );
436
417
437
- m_screen->set_screen_update (FUNC (junofrst_state::screen_update_tutankhm_scramble ));
418
+ m_screen->set_screen_update (FUNC (junofrst_state::screen_update_scramble ));
438
419
m_screen->screen_vblank ().set (FUNC (junofrst_state::_30hz_irq));
439
420
440
-
441
421
/* sound hardware */
442
422
SPEAKER (config, " speaker" ).front_center ();
443
423
@@ -453,14 +433,14 @@ void junofrst_state::junofrst(machine_config &config)
453
433
454
434
DAC_8BIT_R2R (config, " dac" , 0 ).add_route (ALL_OUTPUTS, " speaker" , 0.25 ); // 100K (R56-63)/200K (R64-71) ladder network
455
435
456
- FILTER_RC (config, m_filter_0_0 ).add_route (ALL_OUTPUTS, " speaker" , 1.0 );
457
- FILTER_RC (config, m_filter_0_1 ).add_route (ALL_OUTPUTS, " speaker" , 1.0 );
458
- FILTER_RC (config, m_filter_0_2 ).add_route (ALL_OUTPUTS, " speaker" , 1.0 );
436
+ FILTER_RC (config, m_filter[ 0 ] ).add_route (ALL_OUTPUTS, " speaker" , 1.0 );
437
+ FILTER_RC (config, m_filter[ 1 ] ).add_route (ALL_OUTPUTS, " speaker" , 1.0 );
438
+ FILTER_RC (config, m_filter[ 2 ] ).add_route (ALL_OUTPUTS, " speaker" , 1.0 );
459
439
}
460
440
461
441
462
442
ROM_START ( junofrst )
463
- ROM_REGION ( 0x1c000 , " maincpu" , 0 ) /* code + space for decrypted opcodes */
443
+ ROM_REGION ( 0x20000 , " maincpu" , ROMREGION_ERASE00 ) /* code + space for decrypted opcodes */
464
444
ROM_LOAD ( " jfa_b9.bin" , 0x0a000 , 0x2000 , CRC(f5a7ab9d) SHA1(9603e797839290f8e1f93ccff9cc820604cc49ab) ) /* program ROMs */
465
445
ROM_LOAD ( " jfb_b10.bin" , 0x0c000 , 0x2000 , CRC(f20626e0) SHA1(46f58bdc1a613124e2c148b61f774fcc6c232868) )
466
446
ROM_LOAD ( " jfc_a10.bin" , 0x0e000 , 0x2000 , CRC(1e7744a7) SHA1(bee69833af886436016560295cddf0c8b4c5e771) )
@@ -472,7 +452,7 @@ ROM_START( junofrst )
472
452
ROM_LOAD ( " jfc5_a8.bin" , 0x18000 , 0x2000 , CRC(0539f328) SHA1(c532aaed7f9e6f564e3df0dc6d8fdbee6ed721a2) )
473
453
ROM_LOAD ( " jfc6_a9.bin" , 0x1a000 , 0x2000 , CRC(1da2ad6e) SHA1(de997d1b2ff6671088b57192bc9f1279359fad5d) )
474
454
475
- ROM_REGION ( 0x10000 , " audiocpu" , 0 ) /* 64k for Z80 sound CPU code */
455
+ ROM_REGION ( 0x1000 , " audiocpu" , 0 ) /* 4k for Z80 sound CPU code */
476
456
ROM_LOAD ( " jfs1_j3.bin" , 0x0000 , 0x1000 , CRC(235a2893) SHA1(b90251c4971f7ba12e407f86c32723d513d6b4a0) )
477
457
478
458
ROM_REGION ( 0x1000 , " mcu" , 0 ) /* 8039 */
@@ -485,7 +465,7 @@ ROM_START( junofrst )
485
465
ROM_END
486
466
487
467
ROM_START ( junofrstg )
488
- ROM_REGION ( 0x1c000 , " maincpu" , 0 ) /* code + space for decrypted opcodes */
468
+ ROM_REGION ( 0x20000 , " maincpu" , ROMREGION_ERASE00 ) /* code + space for decrypted opcodes */
489
469
ROM_LOAD ( " jfg_a.9b" , 0x0a000 , 0x2000 , CRC(8f77d1c5) SHA1(d47fcdbc47673c228661a3528fff0c691c76df9e) ) /* program ROMs */
490
470
ROM_LOAD ( " jfg_b.10b" , 0x0c000 , 0x2000 , CRC(cd645673) SHA1(25994210a8a424bdf2eca3efa19e7eeffc097cec) )
491
471
ROM_LOAD ( " jfg_c.10a" , 0x0e000 , 0x2000 , CRC(47852761 ) SHA1(eeef814b6ad681d4c2274f0a69d1ed9c5c1b9118) )
@@ -497,7 +477,7 @@ ROM_START( junofrstg )
497
477
ROM_LOAD ( " jfc5_a8.bin" , 0x18000 , 0x2000 , CRC(0539f328) SHA1(c532aaed7f9e6f564e3df0dc6d8fdbee6ed721a2) )
498
478
ROM_LOAD ( " jfc6_a9.bin" , 0x1a000 , 0x2000 , CRC(1da2ad6e) SHA1(de997d1b2ff6671088b57192bc9f1279359fad5d) )
499
479
500
- ROM_REGION ( 0x10000 , " audiocpu" , 0 ) /* 64k for Z80 sound CPU code */
480
+ ROM_REGION ( 0x1000 , " audiocpu" , 0 ) /* 4k for Z80 sound CPU code */
501
481
ROM_LOAD ( " jfs1_j3.bin" , 0x0000 , 0x1000 , CRC(235a2893) SHA1(b90251c4971f7ba12e407f86c32723d513d6b4a0) )
502
482
503
483
ROM_REGION ( 0x1000 , " mcu" , 0 ) /* 8039 */
0 commit comments