AtariAge Forums: Reading INPT3 - AtariAge Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Reading INPT3

User is offline vdub_bobby Icon
Posted Fri Aug 5, 2005 3:13 PM

    • Boom bam.


  • Icon
  • Quadrunner
  • PM this member
  • View blog
  • Posts: 5,704
  • Joined: 24-November 04
  • Location: Meeferino, US of B
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.

This post has been edited by vdub_bobby: Fri Aug 5, 2005 3:24 PM

0

User is online supercat Icon
Posted Fri Aug 5, 2005 4:14 PM


  • Icon
  • Quadrunner
  • PM this member
  • View blog
  • Posts: 6,162
  • Joined: 01-June 05

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.
0

User is offline vdub_bobby Icon
Posted Fri Aug 5, 2005 4:19 PM

    • Boom bam.


  • Icon
  • Quadrunner
  • PM this member
  • View blog
  • Posts: 5,704
  • Joined: 24-November 04
  • Location: Meeferino, US of B

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?
0

User is online supercat Icon
Posted Fri Aug 5, 2005 5:24 PM


  • Icon
  • Quadrunner
  • PM this member
  • View blog
  • Posts: 6,162
  • Joined: 01-June 05

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'.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users