Jump to content

Reading INPT3


3 replies to this topic

#1  

    Quadrunner

  • 5,831 posts
  • Joined: 24-November 04
  • Boom bam.
  • Location:Seattle, WA

Posted Fri Aug 5, 2005 3:13 PM

Can I reliably count on the value in INPT3 if I never write a 1 to bit 7 of VBLANK?

EDIT: To be specific, I want to replace this:
   sta HMCLR
   sec
with this:
   asl HMCLR
Which should strobe HMCLR and shift INPT3 into the carry.

ANOTHER EDIT:
I just realized that this will work as well:
   lsr HMCLR
Which will strobe HMCLR and shift bit 0 of HMCLR ($2B) into the carry - which should always be the lowest bit of %x0101011. Right? That seems to work in z26 and Stella, and checking a trace log of z26 seems to confirm that the value is consistent.

Edited by vdub_bobby, Fri Aug 5, 2005 3:24 PM.


#2  

    Quadrunner

  • 6,366 posts
  • Joined: 01-June 05

Posted Fri Aug 5, 2005 4:14 PM

vdub_bobby, on Fri Aug 5, 2005 4:13 PM, said:

Can I reliably count on the value in INPT3 if I never write a 1 to bit 7 of VBLANK?
I wouldn't.

Quote

   lsr HMCLR
Which will strobe HMCLR and shift bit 0 of HMCLR ($2B) into the carry - which should always be the lowest bit of %x0101011.  Right?  That seems to work in z26 and Stella, and checking a trace log of z26 seems to confirm that the value is consistent.

I wouldn't recommend that either. Although a floating data bus will usually read the last thing that appeared on it, relying upon such behavior is IMHO begging for trouble. I know there have been some carts in the past that have relied upon such things, but things like bus capacitance, crosstalk, cartridge-selector boxes, ribbon cables (think Flashback II), etc. can all throw such expected behaviors out the window.

#3  

    Quadrunner

  • 5,831 posts
  • Joined: 24-November 04
  • Boom bam.
  • Location:Seattle, WA

Posted Fri Aug 5, 2005 4:19 PM

supercat, on Fri Aug 5, 2005 3:14 PM, said:

Quote

   lsr HMCLR
Which will strobe HMCLR and shift bit 0 of HMCLR ($2B) into the carry - which should always be the lowest bit of %x0101011.  Right?  That seems to work in z26 and Stella, and checking a trace log of z26 seems to confirm that the value is consistent.

I wouldn't recommend that either. Although a floating data bus will usually read the last thing that appeared on it, relying upon such behavior is IMHO begging for trouble. I know there have been some carts in the past that have relied upon such things, but things like bus capacitance, crosstalk, cartridge-selector boxes, ribbon cables (think Flashback II), etc. can all throw such expected behaviors out the window.

View Post

Will it be consistent in the emulators?

#4  

    Quadrunner

  • 6,366 posts
  • Joined: 01-June 05

Posted Fri Aug 5, 2005 5:24 PM

vdub_bobby, on Fri Aug 5, 2005 5:19 PM, said:

Will it be consistent in the emulators?

View Post


I believe older emulators would return the 'undefined' bits as zero, even though when using real hardware they will usually hold the last thing that was on the bus. I believe newer emulators will return the last thing that was on the bus, though I don't know if they all monitor such things carefully. For example:
  ldx #$80
  lda $FF80,x
The last thing on the bus prior to the load would be the contents of ROM address $1F00. On the other hand:
  ldx #$80
  lda $0480,x
here the last thing on the bus should be the $04 of the instruction although it will have had an extra cycle to 'fade away'.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users