Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadsides Does not Detect Mockingboard without Workaround #608

Closed
GreatHierophant opened this issue Jan 5, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@GreatHierophant
Copy link

commented Jan 5, 2019

The game Broadsides supports the Mockingboard, but it does not detect it as it should through AppleWin v1.27.13.0. You can get the game to detect the Mockingboard by entering the debug console and setting a breakpoint with BP, it does not matter the value, then reboot the system.

@tomcw tomcw self-assigned this Jan 6, 2019

@tomcw tomcw added the bug label Jan 6, 2019

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Jan 6, 2019

Thanks for reporting this.

I've reproduced with 1.27.13, 1.27.0 and 1.25.0.4 - so not a regression.
(Just set a bp at 0)

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Jan 6, 2019

Here's the Broadside ISR and Mockingboard detection code:

; IRQ loads PC with ($FFFE) = 0xC3FA on Enhanced //e.
; Which eventually vectors to the user ISR...
ISR:
5250:8A                   TXA        
5251:48                   PHA        
5252:98                   TYA        
5253:48                   PHA        
5254:A9 FF                LDA #$FF   
5256:85 06                STA $06    ; set interrupt flag
5258:A9 40                LDA #$40   
525A:8D 0E C4             STA $C40E  ; IER = disable TIMER1 interrupt
525D:68                   PLA        
525E:A8                   TAY        
525F:68                   PLA        
5260:AA                   TAX        
5261:A5 45                LDA A5H/ACC
5263:40                   RTI        ; TIMER1_COUNTER.w is 0xFF47, and time in interrupt is 0xBA cycles
; ...return to INTCX firmware, and then finally RTI to userland after a TOTAL time in interrupt is 0x143 cycles

MockingboardCheck:
5200:A9 00                LDA #$00    
5202:85 06                STA $06     ; clear interrupt flag
5204:A9 00                LDA #$00    
5206:8D 0B C4             STA $C40B   ; ACR = one-shot mode
5209:A9 50                LDA #$50    
520B:8D FE 03             STA IRQL    
520E:A9 52                LDA #$52    
5210:8D FF 03             STA IRQH    
5213:A9 C0                LDA #$C0    
5215:8D 0E C4             STA $C40E   ; IER = enable TIMER1 interrupt
5218:A9 01                LDA #$01    
521A:8D 04 C4             STA $C404   ; TIMER1_LATCH.l = 0x01
521D:A9 00                LDA #$00    
521F:8D 05 C4             STA $C405   ; TIMER1_LATCH.h = 0x00 && TIMER_COUNTER.w = 0x0001
5222:58                   CLI         ; (2)
; AppleWin: in stepping mode, IRQ occurs here
5223:60                   RTS         ; (6)
6BA6:4C 3C 03             JMP $033C	  ; (3)
033C:EA                   NOP         ; (2)
033D:EA                   NOP         ; (2)
033E:EA                   NOP         ; (2)
033F:A5 06                LDA $06
@tomcw

This comment has been minimized.

Copy link
Contributor

commented Jan 6, 2019

Fixed in ceb0416.

@tomcw

This comment has been minimized.

Copy link
Contributor

commented Jan 12, 2019

NB. Release of AppleWin 1.28.0 containing this fix is here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.