Unsurreal Posted May 14, 2004 Share Posted May 14, 2004 Somebody, please help me!!! I'm still getting used to Atari programming, actually, I have been learning asm for about one week, and I started a little simple project already. It's just a game based on classics like Pong and Arkanoid. But I am having headaches with the boucing thing. Here's a piece from my code that should do it: (it's positioned rigth below the end of Vblank routine) lda #%10000000 bit CXP1FB beq nobnp sta CXCLR lda HMP1 eor #%11100000 sta HMP1 nobnp (here goes the rest of the code....) I'm pretty sure that most of you understood what I meant there. The HMP1 data is changing from the one that moves right and left each time the collision happens. But there's a terrible bug somewhere, that makes the ball bounce normally at one side (the left side, because of it's first movement is toward left), and then it gets madly fast going to the right and don't bonce anymore, just "flying" around the screen... I hope someone can help me before I get crazy. Quote Link to comment Share on other sites More sharing options...
Ze_ro Posted May 14, 2004 Share Posted May 14, 2004 lda HMP1 You can't actually do this... the HMxx registers (along with most other TIA registers, unfortunately) are write-only. Attempting to read from it will probably just give you garbage data. What you'll probably have to do is use a "shadow" variable in RAM to keep track of the value. --Zero Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted May 14, 2004 Share Posted May 14, 2004 Yup...the same goes for many of the 2600's registers. Though it's unclear from that small snippet how exactly it's coded to function, that is the main problem. Quote Link to comment Share on other sites More sharing options...
Unsurreal Posted May 14, 2004 Author Share Posted May 14, 2004 Tanx a lot. See if is that what you meant: lda #%10000000 bit CXP1FB beq nobnp lda move ;read from move variable, that has the same initial· ;value of HMP1, in this case: 00010000· eor #%11100000 ;Execute eor and the result go to A· sta move ;write the A in move variable· sta HMP1 ;write the A in HMP1· nobnp sta CXCLR (here the code continues...) Well, anyway, it seems that it worked very well. As I said I'm new to this and even after your advice I still getting problems with "#" before the datas/adresses, but I think now I've finally learned. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.