Login
Search for:


Previous | Next

From: Marko_Mäkelä
Date: 2001-07-31
Subject: Re: Castle Master once again
On Tue, 31 Jul 2001, Almos Rajnai wrote:

> On 26 Jul 2001, at 10:42, Mike Dailly wrote:
>
> > I checked this game on my emulator... and it works fine... Digisound
> > and all... So, I can tell you that the bits IRQ are ONLY set until a
> > CLI, then once the CLI happens "IF" the irq is flagged to generate an
> > interrupt, one will happen directly after the CLI.
>
> You were right Mike, it is working for now in my emulator too.

Do you mean that a pending interrupt occurs "directly after CLI", in contrary to what I have measured on a Commodore 64 and in contrary to how VICE works? According to my measurements, a pending IRQ cannot occur directly following an instruction if interrupts were disabled before executing the instruction. Here is a short test program I used:

.C:c000 78 SEI
.C:c001 A9 34 LDA #$34
.C:c003 85 01 STA $01
.C:c005 A9 20 LDA #$20
.C:c007 8D FE FF STA $FFFE
.C:c00a A9 C0 LDA #$C0
.C:c00c 8D FF FF STA $FFFF
.C:c00f A2 00 LDX #$00
.C:c011 88 DEY
.C:c012 D0 FD BNE $C011
.C:c014 CA DEX
.C:c015 D0 FA BNE $C011
.C:c017 58 CLI
.C:c018 A9 01 LDA #$01
.C:c01a 02 JAM

.C:c020 A2 37 LDX #$37
.C:c022 86 01 STX $01
.C:c024 8D 20 D0 STA $D020
.C:c027 4C 27 C0 JMP $C027

The program turns the screen white (by writing $01 to $d020) and not black
(by writing $c0 to $d020) as would be the case if the interrupt occurred right after the CLI instruction.

Marko

Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon