[stella] A question regarding write only addresses

Subject: [stella] A question regarding write only addresses
From: Nicolás Olhaberry <nolh@xxxxxxxxxxxxx>
Date: Tue, 20 Jul 1993 20:40:56 -0300
Hi. This is my first post, and I´m not really sure how to make a post...
hope this came up right!

Also excuse my english, I will try to be clear, but ...

Well, I have been working on an atari emulator for a while (as a hobby, the
world doesn´t need another atari emu) and I´m current having a problem with
the game "Haunted House" that I like to discuss. I´m using the 4k PAL
version, by the way.

Here is the state of the 6507:

 A=02  X=04  Y=18  S=FD  PC=1441          N=0 V=0 U=1 B=0 D=0 I=1 Z=0 C=1

 1441  E50F                SBC $0F      [000F]=00

Has you can see, when this opcode is executed, the accumulator will be
subtracted with the content of the address $000F. To my current knowledge
this address correspond to PF2 which is write only. Both PCAE and Z26, after
executing this opcode, leave the accumulator with $F3, so, the value
subtracted was $F.

In my emu, since is subtracting zero, the carry remains set which makes the
game to enter into an endless loop, look at this code:

   1440  C8                  INY
   1441  E50F              SBC $0F      [000F]=00
   1443  B0FB             BCS $1440


If I change the opcode in the ROM for SBC #$0F (E90F)  the game runs
perfect. My guess (and I´m not an expert in computer architecture, so I
might be very wrong) is that since the address $000F can´t be read, the data
bus isn´t updated, so the subtract is made with $0F which is the last value
loaded into the bus.

Can anyone confirm me this? What is the purpose of this weird subtraction?
Does
anybody knows if there is another game with this behavior?

Does this happens too with read addresses like INPT4? If I do LDA INPT4,
will
accum bits 6 to 0 contain the last bus value?

Thanks in advance,

            Nicolás




-
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread