Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user fredrikr ! (Registered 2018-01-18) You are not logged in 
CSDb User Forums


Forums > C64 Coding > SHX/SHY
2012-11-26 15:30
Oswald

Registered: Apr 2002
Posts: 4142
SHX/SHY

I cant seem to get them working. I'm not sure wether the value for the AND comes from the PC counter or from the destination address, anyway neither running code at $ff00 or storing to $ff00 does work. maybe vice does not support this illegal?

edit: vice 2.2 unstable, x64 on win7.
 
... 15 posts hidden. Click here to view all posts....
 
2017-11-17 18:16
Cruzer

Registered: Dec 2001
Posts: 921
Quoting Frantic
Whoever feels like it, please go ahead and write a few lines about SHX/SHY and put it in the following section of Codebase64
I felt like it the other day. :)

Btw, I also tried what happens with page crossing, and it turned out much weirder than expected, since it stores the value to a completely different page. Double confirmed on VICE and real hardware. Gotta do some more testing before I can figure out the logic behind which page it ends up on, since I can't find anything online. But since VICE emulates it, I guess the knowledge has to be out there somewhere. :)
2017-11-17 18:41
Frantic

Registered: Mar 2003
Posts: 1324
Quote: Quoting Frantic
Whoever feels like it, please go ahead and write a few lines about SHX/SHY and put it in the following section of Codebase64
I felt like it the other day. :)

Btw, I also tried what happens with page crossing, and it turned out much weirder than expected, since it stores the value to a completely different page. Double confirmed on VICE and real hardware. Gotta do some more testing before I can figure out the logic behind which page it ends up on, since I can't find anything online. But since VICE emulates it, I guess the knowledge has to be out there somewhere. :)


Nice :)
2017-11-17 18:49
Krill

Registered: Apr 2002
Posts: 928
Quoting Cruzer
Double confirmed on VICE and real hardware. Gotta do some more testing before I can figure out the logic behind which page it ends up on, since I can't find anything online. But since VICE emulates it, I guess the knowledge has to be out there somewhere. :)
So, why don't you simply take a look at the VICE source code? Avoiding confirmation bias and expecting to come up with different results? :)
2017-11-17 21:39
Groepaz

Registered: Dec 2001
Posts: 8367
or why not just read No More Secrets v0.91 ? :)
2017-11-17 21:54
Cruzer

Registered: Dec 2001
Posts: 921
Because experimenting is fun. :) And I guess I could have just read Groepaz' earlier comment saying that the page becomes the value stored. I.e. for SHX: Page = (H + 1) & X and for SHY: Page = (H + 1) & Y. Codebase article updated.
2017-11-17 23:26
Copyfault

Registered: Dec 2001
Posts: 220
Both the No more secrets-document and the codebase entry still have some vague phrasing so I dare to ask:

1. Does
Sometimes the AND "#<adr_hi>+1" drops off
actually mean
iff the write-cycle of the SH*-command is processed during an "X"-cycle (DMA-bus-overtake-cycle), the AND drops off?
Or are there more dependencies for the AND to drop off?


2. My understanding is that
The page where the value is stored may be equal to the value stored
actually means
iff there is a page break, the page where the value is stored is (<adr_hi> + 1) & y (ex. for SHY).
Or are there other occasions where the page is miscalculated?


3. Does the page miscalculation as described under 2. also happen on an "X"-cycle? My C64-intuition would say that also the page break fixup works normally on those "X"-cycles, but I did not test anything so far...


@Cruzer: Hurray for doing the tests and for feeding insights to codebase!!!
2017-11-17 23:31
Groepaz

Registered: Dec 2001
Posts: 8367
1) yes. see the test programs
2) this seems to be unstable behaviour and it didnt happen at all on any of my C64s :) hence - please provide a proper testprogram for this behaviour, so it can be tested and verified further.

(i'll also have to update the ANE behaviour... found one CPU where it doesnt work as advertised. blarg)
2017-11-19 18:58
Bitbreaker

Registered: Oct 2002
Posts: 430
Seems like i also got this wrong with the page cross, thought it just drops off the +1 component on the highbyte. But then however this resolves to a pretty powerful opcode that might be misused in funny ways?

Means i could do stuff like sty yy00,x-1 by doing a shy $00ff,x with x being 1. I'm curious if this could be misused for something funky, usually you could only influence the highbyte easily when doing indirect adressing, what could be done faster that way when it is to set highbyte only (and it is okay to live with the given y-value)

As for normal Hi+1-behaviour, i had used shx + shy heavily in one of the carpet effects.
2017-11-19 19:58
Cruzer

Registered: Dec 2001
Posts: 921
Quoting Bitbreaker
I'm curious if this could be misused for something funky
Yes, if you have a funky idea where you only need to store $00 in page $00, $01 in page $01 ... $ff in page $ff. Just can't think of a usecase right now.
2017-11-19 21:29
Copyfault

Registered: Dec 2001
Posts: 220
Maybe some funny way to initialize sprite pointers? Could even save some LDA's (depends on the no. of different spr-pointers used) ;)
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
hend
Fresh
MP Software
hedning/G★P
Knoeki
CA$H/TRiAD
sP0CkEr2
c0zmo/BLiSS
Dymo/G★P
ΛΛdZ
Andy/AEG Soft
Holy Moses/Role
Poison/Singular Crew
V-12/Tropyx
Guests online: 60
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 The Shores of Reflec..  (9.6)
5 Comaland 100%  (9.6)
6 Lunatico  (9.6)
7 Incoherent Nightmare  (9.5)
8 Wonderland XII  (9.5)
9 Comaland  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 Pandemoniac Part 2 o..  (9.6)
2 FMX Music Demo  (9.6)
3 Merry Xmas 2017  (9.5)
4 Synthesis  (9.5)
5 Daah, Those Acid Pil..  (9.5)
6 Dawnfall V1.1  (9.5)
7 Dawnfall  (9.4)
8 Treu Love [reu]  (9.4)
9 Field Sort  (9.4)
10 Pro Memoria 4  (9.3)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.3)
4 The Judges  (9.3)
5 Crest  (9.3)
Top Cover Designers
1 Duce  (9.8)
2 Junkie  (9.7)
3 Electric  (9.6)
4 The Elegance  (9.4)
5 Cuc  (9.2)

Home - Disclaimer
Copyright © No Name 2001-2018
Page generated in: 0.444 sec.