Jump to content

Photo

What would a PRIOR statement look like in hex?

Atari 800 Atari 5200 PRIOR

7 replies to this topic

#1 doctorclu OFFLINE  

doctorclu

    ***Moon Patrol 5200*** *Moon Master2015* *Blue Max:Class 4*

  • 7,689 posts
  • *Star Raiders 2* **Captain -CL 2**
  • Location:*Star Raiders * *Star Commander -CL 1*

Posted Mon Sep 24, 2018 7:03 AM

Originally posted here:

 

FifthPlayer, on 23 Sept 2018 - 11:32 AM, said:snapback.png

 

This is very easy to do.  You only need to set bit 5 on GTIA's PRIOR register.  It's only a tiny change, but it is a code change. 

 

Where the two sprites overlap you will get a third color.

 

I realized this was the cool ability I discovered while hacking Miner 2049er where they had the green helmet for Bounty Bob.   I'd love to add this ability to the Moon Patrol sprite hack we are doing.  I work mostly with hex editors so I was wondering what this PRIOR register would look like in hex?

 

I found this reference on De Re Atari:

post-4709-0-76162800-1537787559.png

 

Another question I have is: would the fifth bit also be the fifth mode?   If so D6 and D7 would be 00?

 

But the main question so I can search for it in the code is what the hex code would be for the PRIOR statement?

 

-------

Below is the graphics hack of Moon Patrol for the Atari 800 where the colors and sprites have already been altered.  Combined color would offer a third color for the windshield on the moon buggy.

post-4709-0-13756000-1537764045.png

 

Here is the rom if you'd like to reference it for the above question on the PRIOR statement:

moon-test-n2b.bin
 


Edited by doctorclu, Mon Sep 24, 2018 7:14 AM.


#2 R0ger OFFLINE  

R0ger

    Moonsweeper

  • 374 posts
  • Location:Olomouc, Czech Republic

Posted Mon Sep 24, 2018 7:27 AM

Look for the PRIOR address, not the value. It's hard to tell what value might be used, lot of prior combinations have same results, or the function is different, but the difference cannot be seen in the image. Prior is typically set to static value, so the code should be simple

 

lda #x

sta prior

 

Prior has good description on Wiki: https://en.wikipedia...R_.24D01B_Write


Edited by R0ger, Mon Sep 24, 2018 7:27 AM.


#3 MaPa OFFLINE  

MaPa

    Dragonstomper

  • 960 posts
  • Location:Czech Republic

Posted Mon Sep 24, 2018 8:50 AM

Combined color would offer a third color for the windshield on the moon buggy.

 

Not in this case.. as one of the color is black (color 0) so it will not produce third color when ORed (ok, it will, but it will be the same as the second color - pink/purple).



#4 _The Doctor__ OFFLINE  

_The Doctor__

    Flux Capacitor Master Craftsman

  • 6,225 posts
  • Location:10-0-11-00:02

Posted Mon Sep 24, 2018 9:05 AM

I thought the background showing in the windshield gave the effect of it being a windshield either reflecting or being seen thru the window. It's looks like a window while it does that! but another color could be cool elsewhere.. lights etc.. who knows...


Edited by _The Doctor__, Mon Sep 24, 2018 10:46 AM.


#5 Xuel OFFLINE  

Xuel

    Dragonstomper

  • 739 posts
  • Location:US

Posted Mon Sep 24, 2018 9:23 AM

Here's a quick disassembly of your ROM using my disassembler, dis:
 
Attached File  moon-dis.zip   106.11KB   22 downloads
 
Looks like PRIOR is set at 82E9:
 
    lda #$11            ; 82E9: A9 11
    sta PRIOR           ; 82EB: 8D 1B D0

 

So you can edit location 82EA to change the PRIOR setting.



#6 doctorclu OFFLINE  

doctorclu

    ***Moon Patrol 5200*** *Moon Master2015* *Blue Max:Class 4*

  • Topic Starter
  • 7,689 posts
  • *Star Raiders 2* **Captain -CL 2**
  • Location:*Star Raiders * *Star Commander -CL 1*

Posted Mon Sep 24, 2018 10:03 AM

Look for the PRIOR address, not the value. It's hard to tell what value might be used, lot of prior combinations have same results, or the function is different, but the difference cannot be seen in the image. Prior is typically set to static value, so the code should be simple

 

lda #x

sta prior

 

Prior has good description on Wiki: https://en.wikipedia...R_.24D01B_Write

 

Some good information and what you had was spot on with what Xuel would confirm later.

 

Not in this case.. as one of the color is black (color 0) so it will not produce third color when ORed (ok, it will, but it will be the same as the second color - pink/purple).

 

Yeh the color combinations are not ideal that is true.  Still something that could be useful to learn and help in some graphical hack.

 

 

Here's a quick disassembly of your ROM using my disassembler, dis:
 
 
Looks like PRIOR is set at 82E9:
 
    lda #$11            ; 82E9: A9 11
    sta PRIOR           ; 82EB: 8D 1B D0

 

So you can edit location 82EA to change the PRIOR setting.

 

 

Thanks for introducing me to the 6502/6510 disassembler.  I tried to get that running under dos prompt in Wine (have a Mac) and so far no luck.  However I have worked with Distella on the 2600 and got that to work.  So with a bit more effort I should be able to get this to work too.

 

Didn't find 82E9, 82EB, or 82EA, but I did find A9 11 (3 occurrences) and 8D 1B D0 (1 occurrence).  This is really cool to see how this plays out.
 

Loved this bit of information:

    lda #$11            ; 82E9: A9 11
    sta PRIOR           ; 82EB: 8D 1B D0

 

In another hack I was given some good advice on how to look at a hex level to identify player missile objects in 2600 code.

 

In that case it was STA CXCLR" (85 2c)   Is this STA=8 and CXCLR=5 2c?

Here we have STA PRIOR  8D 1B D0           Is this STA=8 and PRIOR=D 1B D0?

 

For LDA #$11 would that be LDA=A   #$=9    11=11?

 

Changed 11 to 00 and had some fascinating results that show me perhaps why this featured was not turned on before now:

Screen Shot 2018-09-24 at 11.17.05 AM.png

 

And oddly characters layers did not blend:

Screen Shot 2018-09-24 at 11.18.58 AM.png

 

But certainly gives us something to play with.


Edited by doctorclu, Mon Sep 24, 2018 10:27 AM.


#7 Xuel OFFLINE  

Xuel

    Dragonstomper

  • 739 posts
  • Location:US

Posted Mon Sep 24, 2018 11:18 AM

Yeah, you're not looking for the sequence 82EA but rather looking the byte at that address. In the ROM it will be at location 2EA since the ROM starts at $8000.

 

The sequence A9 11 is broken down as:

 

A9 = LDA IMMEDIATE

11 = VALUE 

 

And 8D 1B D0 breaks down as:

 

8D = STA ABSOLUTE

1B = Low byte of absolute address

D0 = High byte of absolute address

 

Here you can see that PRIOR is located at address $D01B.

 

You can kinda break down the instruction bytes like you showed since generally all opcodes that start with A are some kind of LD instruction, e.g. LDA, LDX, etc. and all opcodes that start with 8 are some kind of ST instruction. But that's doesn't fully generalize. For example $A8 is TAY, i.e. transfer register A to register Y. This is a single-byte, 2 cycle instruction whereas LD instructions are all at least 2 bytes and 3 cycles.

 

The Altirra Hardware Reference Manual is the definitive guide. Trevin's page is a decent quick reference.

 

To get the players to blend you need to set bit 6 of PRIOR but note players 1&2 blend only with each other and likewise for players 3&4.



#8 Xuel OFFLINE  

Xuel

    Dragonstomper

  • 739 posts
  • Location:US

Posted Mon Sep 24, 2018 11:23 AM

Thanks for introducing me to the 6502/6510 disassembler.  I tried to get that running under dos prompt in Wine (have a Mac) and so far no luck.  However I have worked with Distella on the 2600 and got that to work.  So with a bit more effort I should be able to get this to work too.

 

On Mac, you should be able to run it from the shell. You don't need Wine. You may need to add execute permissions with "chmod +x dis". Then just type "dis".







Also tagged with one or more of these keywords: Atari 800, Atari 5200, PRIOR

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users