@@ -709,7 +709,8 @@ static void _m6569_write(m6569_t* vic, uint64_t pins) {
709
709
/* start the graphics sequencer, this happens at the first g_access,
710
710
the graphics sequencer must be delayed by xscroll
711
711
*/
712
- static inline void _m6569_gunit_rewind (m6569_t * vic , uint8_t xscroll ) {
712
+ static inline void _m6569_gunit_rewind (m6569_t * vic ) {
713
+ const uint8_t xscroll = vic -> reg .ctrl_2 & M6569_CTRL2_XSCROLL ;
713
714
vic -> gunit .count = xscroll ;
714
715
vic -> gunit .shift = 0 ;
715
716
vic -> gunit .outp = 0 ;
@@ -1065,7 +1066,8 @@ static inline uint8_t _m6569_color_multiplex(uint16_t bmc, uint16_t sc, uint8_t
1065
1066
}
1066
1067
1067
1068
// decode the next 8 pixels
1068
- static inline void _m6569_decode_pixels (m6569_t * vic , uint8_t g_data , uint8_t * dst , uint8_t hpos ) {
1069
+ static inline void _m6569_decode_pixels (m6569_t * vic , uint8_t g_data , uint8_t * dst ) {
1070
+ const uint8_t hpos = vic -> rs .h_count ;
1069
1071
m6569_sprite_unit_t * su = & vic -> sunit ;
1070
1072
if (su -> disp_enabled != 0 ) {
1071
1073
for (size_t i = 0 ; i < 8 ; i ++ ) {
@@ -1126,8 +1128,9 @@ static inline void _m6569_decode_pixels(m6569_t* vic, uint8_t g_data, uint8_t* d
1126
1128
}
1127
1129
1128
1130
/* decode the next 8 pixels as debug visualization */
1129
- static void _m6569_decode_pixels_debug (m6569_t * vic , uint8_t g_data , bool ba_pin , uint8_t * dst , uint8_t hpos ) {
1130
- _m6569_decode_pixels (vic , g_data , dst , hpos );
1131
+ static void _m6569_decode_pixels_debug (m6569_t * vic , uint8_t g_data , bool ba_pin , uint8_t * dst ) {
1132
+ _m6569_decode_pixels (vic , g_data , dst );
1133
+ const uint8_t hpos = vic -> rs .h_count ;
1131
1134
uint8_t c = 0 ;
1132
1135
if (vic -> rs .badline ) {
1133
1136
c |= 0x10 ;
@@ -1491,7 +1494,7 @@ static uint64_t _m6569_tick(m6569_t* vic, uint64_t pins) {
1491
1494
pins = _m6569_ba (vic , pins );
1492
1495
pins = _m6569_aec (pins );
1493
1496
vic -> gunit .enabled = vic -> rs .display_state ;
1494
- _m6569_gunit_rewind (vic , vic -> reg . ctrl_2 & M6569_CTRL2_XSCROLL );
1497
+ _m6569_gunit_rewind (vic );
1495
1498
_m6569_sunit_update_mcbase (vic );
1496
1499
_m6569_c_access (vic );
1497
1500
g_data = _m6569_g_i_access (vic );
@@ -1594,15 +1597,15 @@ static uint64_t _m6569_tick(m6569_t* vic, uint64_t pins) {
1594
1597
const size_t x = vic -> rs .h_count ;
1595
1598
const size_t y = vic -> rs .v_count ;
1596
1599
uint8_t * dst = vic -> crt .fb + (y * M6569_FRAMEBUFFER_WIDTH ) + (x * M6569_PIXELS_PER_TICK );
1597
- _m6569_decode_pixels_debug (vic , g_data , 0 != (pins & M6569_BA ), dst , vic -> rs . h_count );
1600
+ _m6569_decode_pixels_debug (vic , g_data , 0 != (pins & M6569_BA ), dst );
1598
1601
}
1599
1602
else if ((vic -> crt .x >= vic -> crt .vis_x0 ) && (vic -> crt .x < vic -> crt .vis_x1 ) &&
1600
1603
(vic -> crt .y >= vic -> crt .vis_y0 ) && (vic -> crt .y < vic -> crt .vis_y1 ))
1601
1604
{
1602
1605
const size_t x = vic -> crt .x - vic -> crt .vis_x0 ;
1603
1606
const size_t y = vic -> crt .y - vic -> crt .vis_y0 ;
1604
1607
uint8_t * dst = vic -> crt .fb + (y * M6569_FRAMEBUFFER_WIDTH ) + (x * M6569_PIXELS_PER_TICK );
1605
- _m6569_decode_pixels (vic , g_data , dst , vic -> rs . h_count );
1608
+ _m6569_decode_pixels (vic , g_data , dst );
1606
1609
}
1607
1610
vic -> vm .vmli = vic -> vm .next_vmli ;
1608
1611
return pins ;
0 commit comments