@@ -29,7 +29,6 @@ Sprinter Sp2000 (Peters Plus Ltd)
29
29
- ISA memory slots
30
30
- fully untied from Spectrum parent
31
31
- better rendering (currently not fully discovered) in Game Configuration
32
- - ? detect loading Configuration by checksum, not by presents in fastram
33
32
34
33
*******************************************************************************************/
35
34
@@ -248,6 +247,8 @@ class sprinter_state : public spectrum_128_state
248
247
u8 m_conf;
249
248
bool m_conf_loading;
250
249
bool m_starting;
250
+ u16 m_bitstream_count;
251
+ u32 m_bitstream_hash;
251
252
bool m_dos; // 0-on, 1-off
252
253
bool m_cash_on;
253
254
@@ -753,13 +754,9 @@ void sprinter_state::dcp_w(offs_t offset, u8 data)
753
754
update_video (dcpp & 1 );
754
755
break ;
755
756
case 0x2e :
756
- if (m_conf)
757
- machine ().schedule_hard_reset ();
758
- else
759
- {
760
- m_conf_loading = 1 ;
761
- machine ().schedule_soft_reset ();
762
- }
757
+ m_conf = 0 ;
758
+ m_conf_loading = 1 ;
759
+ machine ().schedule_soft_reset ();
763
760
break ;
764
761
765
762
case 0x88 :
@@ -779,7 +776,17 @@ void sprinter_state::dcp_w(offs_t offset, u8 data)
779
776
m_cbl_wa = 0 ;
780
777
m_cbl_wae = cbl_mode16 ();
781
778
const u8 divs[16 ] = {13 , 9 , 0 , 0 , 0 , 0 , 0 , 0 , 27 , 19 , 13 , 9 , 6 , 4 , 3 , 1 };
782
- const attotime rate = (cbl_mode () && divs[m_cbl_xx & 15 ]) ? attotime::from_ticks (divs[m_cbl_xx & 15 ] + 1 , X_SP / 192 ) : attotime::never;
779
+ attotime rate;
780
+ if (cbl_mode () && divs[m_cbl_xx & 15 ])
781
+ {
782
+ rate = attotime::from_ticks (divs[m_cbl_xx & 15 ] + 1 , X_SP / 192 );
783
+ }
784
+ else
785
+ {
786
+ rate = attotime::never;
787
+ if (m_hold_irq)
788
+ m_irq_off_timer->adjust (attotime::zero);
789
+ }
783
790
m_cbl_timer->adjust (rate, 0 , rate);
784
791
break ;
785
792
}
@@ -1110,15 +1117,23 @@ u8 sprinter_state::bootstrap_r(offs_t offset)
1110
1117
1111
1118
void sprinter_state::bootstrap_w (offs_t offset, u8 data)
1112
1119
{
1113
- if (m_conf_loading)
1120
+ if (! m_conf_loading)
1114
1121
{
1115
- m_conf_loading = 0 ;
1116
- m_conf = !(m_maincpu->csbr_r () & 0x0f ); // cs0 disabled => loader reads config from fastram (which is Game Config)
1117
- m_ram_pages[0x2e ] = m_conf ? 0x41 : 0x00 ;
1118
- machine ().schedule_soft_reset ();
1122
+ m_program.write_byte (0x10000 | u16 (offset), data);
1119
1123
}
1120
1124
else
1121
- m_program.write_byte (0x10000 | u16 (offset), data);
1125
+ {
1126
+ m_fastram[offset & 0xffff ] = data;
1127
+ m_bitstream_hash += data << (8 * (m_bitstream_count % 4 ));
1128
+ if (++m_bitstream_count > 0xfff )
1129
+ {
1130
+ m_conf_loading = 0 ;
1131
+ m_conf = !(m_maincpu->csbr_r () & 0x0f ); // cs0 disabled => loader reads config from fastram
1132
+ m_conf &= m_bitstream_hash == 0x3861cfa4 ; // Game Config
1133
+ m_ram_pages[0x2e ] = m_conf ? 0x41 : 0x00 ;
1134
+ machine ().schedule_soft_reset ();
1135
+ }
1136
+ }
1122
1137
}
1123
1138
1124
1139
u8 sprinter_state::ram_r (offs_t offset)
@@ -1397,6 +1412,8 @@ void sprinter_state::machine_start()
1397
1412
save_item (NAME (m_joy2_ctrl));
1398
1413
save_item (NAME (m_conf));
1399
1414
save_item (NAME (m_conf_loading));
1415
+ save_item (NAME (m_bitstream_count));
1416
+ save_item (NAME (m_bitstream_hash));
1400
1417
save_item (NAME (m_starting));
1401
1418
save_item (NAME (m_dos));
1402
1419
save_item (NAME (m_cash_on));
@@ -1506,6 +1523,8 @@ void sprinter_state::machine_reset()
1506
1523
1507
1524
if (m_conf_loading)
1508
1525
{
1526
+ m_bitstream_count = 0 ;
1527
+ m_bitstream_hash = 0 ;
1509
1528
m_bank_rom[0 ]->set_entry (0x0c );
1510
1529
m_bank_view0.select (1 );
1511
1530
m_bank_view3.disable ();
0 commit comments