Jump to content
Random Terrain

Need help compiling and updating DPC+ information

Recommended Posts

#1 - All of these apply to DPC+ kernel, except size, which only applies to the old multisprite kernel.

 

#2 - not sure. It was a workaround for a bug that caused the screen to bump whenever you did a goto to the start of a bank. It only showed up under Harmony, so I think it might have been a Harmony firmware bug in the DPC+ implementation.

 

#3 - the DPC+ stack isn't the actual ARM stack. Its 100% dedicated to your push and pull commands.

  • Like 1

Share this post


Link to post
Share on other sites

Speaking of that special stack, do you know why the 256 stack locations can't be variables themselves?

 

It would be cool if we could do something like this:

_

   dim _Monkey_Nipple = stack 200

Share this post


Link to post
Share on other sites

It's technically possible, so I can only offer some observations as to why I think batari chose to implement it as a stack...

 

-accessing DPC+ memory is much more expensive for rom space and cycles than memory access. Making the two look the same hides this, which will lead to rom and cycle issues.

-the "let" C code is already very complex. Adding dynamic DPC+ memory access would be a difficult and error prone process.

- DPC+ fetchers act like stacks. Implementing stack-like access in bB means the generated asm code can be minimal.

  • Like 1

Share this post


Link to post
Share on other sites

The whole stack thing sounds useful but hurts my head. I almost wish the extra memory could be accessed like separate pages of variables.

 

Something like:

 

varpage 2

 

Would swap out a range of variables with whatever is designated as the second set of values in the extended memory.

Share this post


Link to post
Share on other sites

Yeah, I hear both of you. Stack isn't exactly a basic concept.

 

When batari announced he was going to make some DPC+ memory available, I honestly expected to see peek and poke access to it. It could have operated more like a special array than a stack, with just a bit more asm code.

 

That said, I'll take a look at providing more stack examples.

  • Like 1

Share this post


Link to post
Share on other sites

When batari announced he was going to make some DPC+ memory available, I honestly expected to see peek and poke access to it. It could have operated more like a special array than a stack, with just a bit more asm code.

Yeah, at least what you poke will stay where you put it. I don't like the idea of not knowing where my variable values might be in the stack. Would it be hard to hack the stack so nothing moves? If I stick it at 100, it should stay at 100.

 

 

 

 

That said, I'll take a look at providing more stack examples.

If nothing can be easily hacked, at least more examples might make it easier to understand and use.

 

Thanks

Share this post


Link to post
Share on other sites

I don't think it's a good plan to change it, as it uses stack terminology and operates pretty much like every other stack.

 

The values actually stay wherever you put them... it's just that you use different stack pointer positions depending on if you're pushing or pulling.

 

I think for now its probably best just to go with some useful examples.

  • Like 1

Share this post


Link to post
Share on other sites

I thought I'd add 2 more things to the 13 Objects with Coordinates example program. The sprites flip without a problem, but that masking stuff doesn't seem to work correctly. I didn't try masking with player0 since I wasn't sure if it only worked with player1 through player9:

 

ex_dpc_13_objects_2013y_08m_31d_1100t.bin

 

ex_dpc_13_objects_2013y_08m_31d_1100t.bas

 

Move any sprite besides player0 off the screen to the left and it seems to work correctly. But move one of the sprites off the screen to the right and you'll see that masking isn't working properly. Now make any of those sprites larger and move off the screen in either direction and you'll see that masking doesn't seem to handle larger sprites correctly.

 

Share this post


Link to post
Share on other sites

The sprite reflection is throwing off batari's masking scheme. I'll take a look a fixing it.

 

Lack of masking for larger sprites is a known limitation, but if I get masking working cheaply for reflected sprites, I'll look at it.

  • Like 1

Share this post


Link to post
Share on other sites

If anyone wants to double check the missile section while I'm working on another example program, here it is:

 

randomterrain.com/atari-2600-memories-batari-basic-commands.html#dpc_missiles

 

If you notice any wrong or if you see that I forgot something, please let me know. (You might have to refresh/reload the page.)

Share this post


Link to post
Share on other sites

If anyone wants to double check the missile section while I'm working on another example program, here it is:

 

randomterrain.com/atari-2600-memories-batari-basic-commands.html#dpc_missiles

 

If you notice any wrong or if you see that I forgot something, please let me know. (You might have to refresh/reload the page.)

Looks good at a glance.

"contaminates" is a colourful negative word, unless you turn it into a feature!

Chuck there needed an arm, and to get a 9th pixel I use its missile. You can see the bottom of the arm is the shirt color and the top of the missile is the hand color.

gallery_29575_717_3639.jpg

  • Like 2

Share this post


Link to post
Share on other sites
"contaminates" is a colourful negative word, unless you turn it into a feature!

Chuck there needed an arm, and to get a 9th pixel I use its missile. You can see the bottom of the arm is the shirt color and the top of the missile is the hand color.

 

I just added this sentence under the contamination image:

 

"This contamination can be used to your advantage in some cases. For example, a missile of the right size could be placed next to a sprite to make part of that sprite seem wider than it actually is. Add a hand and arm, a nose, the brim of a hat, a piece of a spaceship, or whatever you can dream up."

  • Like 2

Share this post


Link to post
Share on other sites

The original chart from batari (and in this thread) says 176.

I, personally, leave the last line unset or black, because of that half scan line appears in the upper right.

attachicon.gifIMG_3348.PNG

 

EDIT: Not that there is anything wrong with this behavior, just depends on how OCD you are!!! :)

 

Its worth noting that the last line of color here actually serves as the score background color.

 

In my yet-to-be-released bB source I tracked down the source of this and fixed it by setting the background color to black as the kernel starts. Until I have something more to share, folks can do the same just by adding a "COLUBK=0" to their source, just prior to the drawscreen.

  • Like 1

Share this post


Link to post
Share on other sites

Please check out the program below and see if you'd like anything changed before I clean up the code and put it on the bB page:

 

ex_dpc_frac_2013y_09m_09d_1155t.bin

 

Press the joystick left or right to select DF6FRACINC, DF0FRACINC, DF1FRACINC, DF2FRACINC, DF3FRACINC or DF4FRACINC. Press the joystick up or down to increase or decrease the selected register. Press the fire button to slow things down when you get near a number that you'd like to stop on. Hit reset to go back to the default settings.

 

 

Thanks.

Share this post


Link to post
Share on other sites

I liked it as-is. It's a good way of confirming for the programmer exactly how the DF#FRACINC settings work! :thumbsup:

 

OK, thanks. I'll leave it the way it is. I'll just clean up the code.

Share this post


Link to post
Share on other sites

OK, I lied. I added one more feature. There are a few presets that you can choose with the select switch:

 

randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_dpc_frac

That's a great demo!

If only I could think of a game that uses 4 expanding and contracting columns.

It'a a 4 band equalizer display!

Share this post


Link to post
Share on other sites

I added the DPC+ section to the table of contents on the left side of the page. I can always add more subsections or move things around when people point out things that should be added or changed.

 

When you guys get a chance, you can look over the whole DPC+ section and see if anything needs to be changed or moved or if I forgot to add something:

 

randomterrain.com/atari-2600-memories-batari-basic-commands.html#dpcplus

 

 

Thanks.

  • Like 1

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

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...