Jump to content
IGNORED

Testing the new Stella TIA core


stephena

Recommended Posts

Great! Was busy working on Draconian today, just finished posting the latest build.

 

All of my changes to Stella are in the pre5 source archive I downloaded from the releases page. I need to figure this out. I've not used git before, do you suggest using command line or a GUI client? If GUI, any Mac recommendations?

Link to comment
Share on other sites

Git has a very rich CLI interface with excellent documentation for each subcommand accessible via "--help" that I prefer to graphical frontends, but that comes down to personal taste I guess ;-) If you're looking for an OSX gui, there's sourcetree (https://www.sourcetreeapp.com/) which seems to be pretty good (most mac people at my workplace use it), and gitkraken (https://www.gitkraken.com/) also looks promising. If you're going for the CLI and have some time to spare, the official tutorial (https://git-scm.com/docs/gittutorial) should be more than enough to get you started.

 

Actually, beyond first looks, git and svn are very different. In particular,

 

  • Git is decentral. Each clone is a full-fledged copy of the cloned repo, and you can work and commit offline without restrictions.
  • Git has a true branches and tags (which are just lazy copies in SVN)
  • Changes are either "pushed" to the remote repository in batches, or you put your branch - either master (that's what SVN's trunk is) or a feature branch - for a pull request. The latter is the workflow advocated by github, and it offers a web interface for exactly that: you fork a repository, make your changes, either on master or on a feature branch, and then use the web interface to make a pull request. This workflow is what's described in the stella docu.
Edited by DirtyHairy
Link to comment
Share on other sites

Installed SourceTree, didn't like that it wanted me to create yet another account so installed GitKracken.

 

After reading step 2, I figured I needed to make a "Clone" and found the File->Clone Repo menu option. Plugged in a new local path (different from my other copies of Stella source) and the URL from Step 2. Source is now on my machine and I was able to compile as usual.

 

Added my CDF files and right away spotted something in Xcode I'd not seen before:

post-3056-0-50269100-1489977873_thumb.png

 

After clicking on the files the ? changed to A, the tooltip for which is "Added":

post-3056-0-58393600-1489978666_thumb.png

 

In my other Stella projects files I've added looked just like the others:

post-3056-0-02985200-1489977899_thumb.png

 

There's a Source Control menu that I'm used to seeing like this:

post-3056-0-88046300-1489977966_thumb.png

 

it's now like this:

post-3056-0-38747500-1489977974_thumb.png

 

Seleting History shows this:

post-3056-0-90810800-1489978374_thumb.png

 

So Xcode appears to have native support for GitHub!

Link to comment
Share on other sites

;-) Forgot about that one, yep, Xcode (as most IDEs and editors) has native git support (github is only a particular hosting platform). In order to contribute back your changes, you'll have to create a github accout and fork the Stella repository (using the button in the upper right corner of the interface). You can then checkout your own fork and commit and push your changes there. Once you are ready, you do a pull request against the main repo (using the web gui) that then can be merged back.

Edited by DirtyHairy
Link to comment
Share on other sites

In order to contribute back your changes, you'll have to create a github accout and fork the Stella repository (using the button in the upper right corner of the interface).

 

 

Oops - I did create a github account, but didn't get past step 3! I'll take care of that this evening.

Link to comment
Share on other sites

Made the TIMER 1 changes in Thumbulator and DPC+. Hopefully I did the pull request correctly.

 

Made a quick test program, DPC+Timer, based on Collect 2 from my unfinished DPC+ ARM Development tutorial. It was handy because it already had the TV TYPE in the menu along with the color logic. I also overwrote the START menu option with the results of the timer.

 

When run it'll default to NTSC due to 262 scanlines:
post-3056-0-57344700-1490065332_thumb.png

  1. TAB for in game menu
  2. GAME PROPERTIES
  3. DISPLAY
  4. change FORMAT to PAL60
  5. OK
  6. EXIT MENU
  7. CONTROL-R to reload

post-3056-0-22331800-1490065415_thumb.png

 

Repeat above but change FORMAT to SECAM60:

post-3056-0-91025200-1490065445_thumb.png

DPC+Timer.zip

dpc+timer.bin

  • Like 1
Link to comment
Share on other sites

I should note if you "start" the game it's non-playable. It does show information at the bottom of the arena based on the state of the difficulty switches:
BB - score and time example
post-3056-0-88335800-1490066122_thumb.png

AB - time remaining in vertical blank and overscan
post-3056-0-89768100-1490066152_thumb.png

BA - test pattern
post-3056-0-11051400-1490066229_thumb.png

AA- joystick input state

post-3056-0-69985500-1490066464_thumb.png

 

  • First digit - F if fire held on a joystick, or B if primary is held on gamepad
  • Second digit - C if secondary held on gamepad
  • Third digit - U, D, B* or blank for up/down state
  • Fourth digit - L, R, B* or blank for left/right state

* B means both directions were held, which could happen when using a Starplex controller.

Link to comment
Share on other sites

Awesome! Received the github email, so was just checking out the site. I see this:

post-3056-0-98497600-1490101067_thumb.png

 

I suspect I should reconcile that before making additional changes, but don't know what to do. Would it make more sense to worry about that after you've addressed the issue?

Link to comment
Share on other sites

I am a shell dweller, so I do not know how to do this with Xcode, but here's what you have to do on the CLI:

 

1) Add a remote that points to the upstream stella repo (a git repository can track and merge from arbitrarily many remote repositories):

git remote add upstream git@github.com:stella-emu/stella.git

You only have to do this once.

2) Fetch upstream changes

git fetch upstream

At this point, the upstream changes are avaiable locally, but they're not integrated into your own code yet.

3) Make sure that you are on the branch you want to merge the remote changes into (master I guess)

git checkout master

4) Merge remote branch (usually master) into your own branch

git merge upstream/master

5) Push the changes back into your own repo

git push 

Github themselves has a pretty good documentation of these steps at https://help.github.com/articles/syncing-a-fork/

Edited by DirtyHairy
Link to comment
Share on other sites

I'll leave this to yourself and DirtyHairy to discuss, since I don't know git that well. I would have assumed that once I did the merge in stella master, you could simply re-sync to it and continue working on new code (at least that's the way SVN worked). I've never been on that end of a pull request, so I'm not sure what to do.

 

As for the change I have to make, don't worry about that for now; it's just an optimization thing that can wait for a while.

Link to comment
Share on other sites

When I tried to upload the changes to github via Xcode it ended up creating a whole new project in another directory, which was not what I was expecting. I ended up deleting that new project, then muddled my way through GitKraken to upload the changes instead.

 

I noticed the Compare option to the right of This branch is 1 commit behind stella-emu:master, so clicked it:

post-3056-0-06670000-1490105870_thumb.png

 

not what I was expecting to see, so clicked switching the base:

post-3056-0-11804000-1490106174_thumb.png

 

So it looks like the commit I'm behind on is my own?!?! Confusing. I suspect it's safe to let it be for now.

Link to comment
Share on other sites

So it looks like the commit I'm behind on is my own?!?! Confusing. I suspect it's safe to let it be for now.

:) The commit you are behind is Stephen's merge request. Merging a branch into another will create a merge commit which has two ancestors and which updates all affected files to their merged versions.

Link to comment
Share on other sites

Thanks, I'm sure it'll eventually make sense :)

 

I'll add in the BUS and CDF support next. At this time the in-cart audio doesn't work - 3 voice sounds wrong while digital sample support has yet to be written. Do y'all want me to do a pull request before I finish those routines so people can try out the Bus Stuffing demos and new builds of Draconian, or would you prefer I wait until I can finish the audio?

  • Like 1
Link to comment
Share on other sites

I've now updated the code so that if a device (ie, a cart) wants to know about console timing changes, it simply has to implement the consoleChanged() method. Also, this fix is now applied to the DPC+ class. Spice, take note of how its done, since I assume you need the same thing in BUS and/or CDF.

  • Like 1
Link to comment
Share on other sites

Sounds like I've a fun night ahead of me. I'll need to figure out how to get your changes over to my repository, then figure out how to reconcile them with my pending changes. Adding support for BUS and CDF required a few changes to the Thumbulator and DPC+, for instance reset() differs based on size of the Harmony/Melody driver so the Thumbulator needs to know what to configure for.

int Thumbulator::reset()
{
  std::fill(reg_norm, reg_norm+12, 0);
  reg_norm[13] = 0x40001FB4;
  
  switch(configuration)
  {
      // future 2K Harmony/Melody drivers will most likely use these settings
    case ConfigureFor::BUS:
    case ConfigureFor::CDF:
      reg_norm[14] = 0x00000800; // Link Register
      reg_norm[15] = 0x0000080B; // Program Counter
      break;
      
      // future 3K Harmony/Melody drivers will most likely use these settings
    case ConfigureFor::DPCplus:
      reg_norm[14] = 0x00000C00; // Link Register
      reg_norm[15] = 0x00000C0B; // Program Counter
      break;
  }
 
...

}
Link to comment
Share on other sites

Git is usually pretty smart about changes made by different people, and it can merge pretty well (unless of course we both change the exact same lines in two different ways).

 

EDIT: You could of course do a pull request that has conflicts, and leave it to me to resolve them before I do a merge :) I normally don't recommend to do that, but if you get to a point where you just can't get it working, I'll take whatever you have and fix it on my end.

Link to comment
Share on other sites

Not sure what I did, but GitKraken crashed while I was trying to get the changes for consoleChanged(). In the process my local changes disappeared. Thankfully it'll be easy to recover from as all those changes are in another directory in the project I'd downloaded before I signed up for github (could also have recovered them via Time Machine).

So I started over from scratch and decided to try out Xcode's built in support for git. Connected Xcode to my repository and checked stella out from there. I then set up the stella-emu repository, did a Source Control->Pull from it, and obtained the consoleChanged() functionality.

I then did Source Control->Push to my repository. It appears to have worked correctly as I'm now even with stella-emu.

post-3056-0-67941200-1490227950_thumb.png

 

Link to comment
Share on other sites

Oooh - I think I'm going to like this Xcode/GitHub integration!

Finished importing the BUS and CDF changes - the M characters after some of the files denote a source-control status of modified. The - means there's source-control status files inside that folder:
post-3056-0-42173300-1490322551_thumb.png

Click the symbol on the bottom left to show only those files with a Source-Control Status:
post-3056-0-29431800-1490322615_thumb.png

Change the view to Comparison to see what changed:
post-3056-0-02366800-1490322621_thumb.png

That's actually a dropdown:
post-3056-0-55351400-1490322624.png

that lets you see who to Blame:
post-3056-0-43399700-1490322631_thumb.png

or view the Log:
post-3056-0-40537800-1490322637_thumb.png

Using the Source Control->Commit menu option to send the changes up to GitHub:
post-3056-0-79196300-1490322643_thumb.png

 

Lastly I logged into GitHub and initiated the Pull Request :)

Link to comment
Share on other sites

Spice, I've integrated your changes. Everything is basically fine, but I had to do another commit to fix a few compile warnings and whitespace/tab issues. In future commits, could you use a tab size of 2 spaces (so width=2, format=space).

 

Otherwise, everything is working great. Thanks for the code :)

 

EDIT: You will have to re-sync your code to main git codebase before you make any further changes on your end.

  • Like 1
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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