Viewing Issue Advanced Details Jump to Notes ] xain.cpp
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
06499 Gameplay Major Always 14 days ago 4 days ago
Tester StHiryu View Status Public Platform MAME (Unofficial Binary)
Assigned To cuavas Resolution Fixed OS Windows Vista/7/8 (64-bit)
Status [?] Resolved   Driver xain.cpp
Version 0.182 Fixed in Version 0.183 Build 64-bit
Summary 06499: xsleena and clones: Some enemies in the second stage has disappeared
Description According this post in the mameworld forum, there is a regression in Xain'd Sleena. The insects in stage 2 doesn't appear anymore:

http://www.mameworld.info/ubbthreads/showflat.php?Cat=&Number=363359&page=0&view=collapsed&sb=5&o=&fpart=1&vc=1&new=1486652757#Post363343
Steps To Reproduce Start to play, select stage 2 (Lagto Soa), and walk a little: No insects attack us.
Additional Information Provide a video from previous mame version (179) to compare:

Flags
Regression Version 0.182
Affected Sets / Systems xsleena and clones
Attached Files
 


-  Notes
User avatar
No.13616
cuavas
(Administrator)
14 days ago
This is interesting. The game enables the MCU timer interrupt (programmable mode, internal clock source, external input disabled, prescale = 2^7). Before moving to the 68705-with-peripherals, the MCU for this game wasn't receiving timer interrupts at all. Somehow the trigger that spawns these enemies is getting lost now, but I don't know how. I'll investigate it further at some point.
User avatar
No.13617
cuavas
(Administrator)
14 days ago
The timer interrupt handler is pretty simple, it operates on bytes at $21, $22 and $23:

 1AB tst   $21                                          3D 21
 1AD beq   $1BA                                         27 0B
 1AF dec   $22                                          3A 22
 1B1 beq   $1B6                                         27 03
 1B3 bclr  7,TCR                                        1F 09
 1B5 rti                                                80
 1B6 inc   $23                                          3C 23
 1B8 bra   $1B3                                         20 F9
 1BA bclr  0,PORTB                                      11 01
 1BC bset  0,PORTB                                      10 01
 1BE bra   $1B3                                         20 F3

Or in C++:

void timer_handler()
{
    if (!*(unsigned char *)0x21)
    {
        PORTB &= 0xfe;
        PORTB |= 0x01;
    }
    else  if (!--*(unsigned char *)0x22)
    {
        ++*(unsigned char *)0x23;
    }
    TCR &= 0x7f
}
User avatar
No.13618
cuavas
(Administrator)
14 days ago
https://github.com/mamedev/mame/commit/9ae0bf812b54c2a66a2039389cd3f7cfa40851ee - it was a problem with spurious timer overflow interrupts being generated when TDR=0x00.