@@ -622,37 +622,31 @@ uint64_t ay38910_iorq(ay38910_t* ay, uint64_t pins) {
622
622
const uint8_t data = ay -> reg [ay -> addr ];
623
623
AY38910_SET_DATA (pins , data );
624
624
}
625
+ else {
626
+ // see: https://github.com/floooh/chips/pull/111
627
+ // https://worldofspectrum.org/forums/discussion/23327/
628
+ AY38910_SET_DATA (pins , 0 );
629
+ }
625
630
AY38910_SET_PA (pins , ay -> port_a );
626
631
AY38910_SET_PB (pins , ay -> port_b );
627
632
ay -> pins = pins ;
628
633
}
629
634
return pins ;
630
635
}
631
636
632
- /*
633
- uint64_t ay38910_tick(ay38910_t* ay, uint64_t pins) {
634
- if (pins & (AY38910_BDIR|AY38910_BC1)) {
635
- pins = _ay38910_iorq(ay, pins);
636
- }
637
- pins = _ay38910_tick(ay, pins);
638
- AY38910_SET_PA(pins, ay->port_a);
639
- AY38910_SET_PB(pins, ay->port_b);
640
- ay->pins = pins;
641
- return pins;
642
- }
643
- */
644
-
645
637
void ay38910_set_register (ay38910_t * ay , uint8_t addr , uint8_t data ) {
646
- CHIPS_ASSERT (ay && (addr < AY38910_NUM_REGISTERS ));
647
- ay -> reg [addr ] = data & _ay38910_reg_mask [addr ];
648
- _ay38910_update_values (ay );
649
- if (addr == AY38910_REG_ENV_SHAPE_CYCLE ) {
650
- _ay38910_restart_env_shape (ay );
638
+ CHIPS_ASSERT (ay );
639
+ if (addr < AY38910_NUM_REGISTERS ) {
640
+ ay -> reg [addr ] = data & _ay38910_reg_mask [addr ];
641
+ _ay38910_update_values (ay );
642
+ if (addr == AY38910_REG_ENV_SHAPE_CYCLE ) {
643
+ _ay38910_restart_env_shape (ay );
644
+ }
651
645
}
652
646
}
653
647
654
648
void ay38910_set_addr_latch (ay38910_t * ay , uint8_t addr ) {
655
- CHIPS_ASSERT (ay && ( addr < AY38910_NUM_REGISTERS ) );
649
+ CHIPS_ASSERT (ay );
656
650
ay -> addr = addr ;
657
651
}
658
652
0 commit comments