Jump to content
Sign in to follow this  
Thelen

atari 8 bit programming question

Recommended Posts

hi,

 

I have got register HPOSP0 and i want to change the horizental position of P0, and now i want to say :

 

INC HPOSP0

 

why can't i do this ?

i have to make it like this: (XPOSP0 is my variable for P0)

 

LDX XPOSP0

INX

STX XPOSP0

STX HPOSP0

 

 

I have this also with some other registers...like VSCROL

 

maybe it's a stupid question but i'm just starting...

 

Thanks, Thelen

Share this post


Link to post
Share on other sites

because there are some hardware registers which are "read only" and "write only"... (if you read hardware docs carefully you should find info on each hardware register...)

 

so... hposp0, position of player0, is write only... if you would do

a "INC hposp0" that would be CPU internally like

 

get old value stored in hposp0

add #1

store back old value

 

and this "get old value" is not possible... that's why you have to use

variables instead or so called "shadow registers"...

 

some of the guys here can tell you what kind of

register is selected when you "read" hposp0... i just can not remember it...

 

so be carefull in reading/writing hardware registers, esp. GTIA & ANTIC

 

hve

 

ps. you have the same "doubling" of registers in the Gameboy advance... it is a common way to get "more" registers while having a fixed amount of adress lines in the hardware...

Share this post


Link to post
Share on other sites

I need some help again.... :roll:

 

when i don't push the button the screen flashes with all colors (0-255 PF4), but when I push the button and hold it, the screen will only change the color something slower....why ?

 

 

 

 

 

LDA STRIG0

BNE NOBUTTO

JMP CLOOP3

 

NOBUTTO INC COLOR4

 

CLOOP3

 

maybe i'm doing something really stupid, but i don't understand why it is still flashing when i push the button...

 

Thanks,

 

Thelen

Share this post


Link to post
Share on other sites

This is funny....on a real atari 8 bit it work's the way it should do, but on the emulator it doesn't. probably because of the pc keyboard which emulates the joystick....

 

Thelen

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...