Jump to content
IGNORED

Need optimization tips & advices


IuriNery

Recommended Posts

Hello everyone,

 

I'm a beginner on Atari programming and I'm creating an IDE to allow people to create Atari games without having to write a single line of code. I'm learning Assembly as I go through the IDE and add more stuff, it's helping me a lot.

 

This is what I've got so far:

post-59407-0-43498900-1518260912.jpg

 

A simple IDE that lets you draw the playfield and change the color of both playfield (COLUPF) and background (COLUBK).

 

 

If you hit the "Play" button, it will produce the following result on an emulator:

post-59407-0-23326000-1518260920_thumb.jpg

 

This also generates an assembly code file, please take a look at this file to help me with the questions:

atarix_result.asm

 

 

So, considering I've read a few articles about programming, I've come to a conclusion that every single line of code matters when you're programming for Atari. So I would like to ask a few questions:

 

1. Looking at the file (atarix_result.asm), is the generated code bad? What optimizations should I look forward? How can I optimize this code?

2. What kind of things should I avoid when drawing to the playfield?

3. Also, is there a way to get rid of the parts showed on the second screenshot? (Where the arrows point at). Or is this an expected behavior?

 

Thanks!

 

 

  • Like 1
Link to comment
Share on other sites

Creating something as complex as a game without any programming experience is going to be pretty much impossible on the 2600. Ultimately, you would be substituting one language (low-level assembly) for another (high-level Basic or something similar). bBasic is currently the go-to method there.

 

 

Since you are just plugging values into the PF registers line-by-line, there is no need to use such a large kernel to do it. You could cut this down by using an indexed loop.

  LDX #192
Loop:
   STA WYSNC
   LDA PF0data-1,X
   STA PF0
   LDA PF1data-1,X
   STA PF1
   LDA PF2data-1,X
   STA PF2
   DEX
   BNE Loop

...then include 3 192-byte data tables for the values. Also, delay timing is going to be needed if you include an asymmetrical option (i.e differing PF values for the left and right halves of the screen).

 

But there is really no need to reinvent the wheel. The TIA Playfield Painter already covers this.

 

 

Not sure what you are trying to indicate with the arrows...when the PF colors appear and are removed on the screen? Relocating your VBLANK calls would be that solution.

Edited by Nukey Shay
Link to comment
Share on other sites

Creating something as complex as a game without any programming experience is going to be pretty much impossible on the 2600. Ultimately, you would be substituting one language (low-level assembly) for another (high-level Basic or something similar). bBasic is currently the go-to method there.

 

 

Since you are just plugging values into the PF registers line-by-line, there is no need to use such a large kernel to do it. You could cut this down by using an indexed loop.

  LDX #192
Loop:
   STA WYSNC
   LDA PF0data-1,X
   STA PF0
   LDA PF1data-1,X
   STA PF1
   LDA PF2data-1,X
   STA PF2
   DEX
   BNE Loop

...then include 3 192-byte data tables for the values. Also, delay timing is going to be needed if you include an asymmetrical option (i.e differing PF values for the left and right halves of the screen).

 

But there is really no need to reinvent the wheel. The TIA Playfield Painter already covers this.

 

 

Not sure what you are trying to indicate with the arrows...when the PF colors appear and are removed on the screen? Relocating your VBLANK calls would be that solution.

Hi,

What I mean by creating a game without any programming experience is that the user will be able to add stuff to modify a default game template as they wish, my goal is to create something to prototype and introduce beginners into atari development.

 

Thanks for your suggestion about the indexed loop, is there a real difference on the final binary file using this method? Or is it only for making the code more compact?

 

I haven't heard about TIA Playfield Painter before, I would love to test it but it seems it's only available on DOS. Just to be clear, my IDE will be more than a playfield painter, the user will be able to add objets, manage actions and so on.

About the arrows, it seems that there are extra pixels on top/bottom of the screen whenever I test , I was asking if there was a way to remove/clear those pixels or if it's a normal behavior that happens when you play on an emulator.

 

Thanks for taking your time to answer my questions.

Link to comment
Share on other sites

Creating something as complex as a game without any programming experience is going to be pretty much impossible on the 2600.

 

The approach used by NESmaker is to provide a number of complete game engines for various game genres, that users can customize via the supplied tools. A lot of non-coders appear to be into that kind of thing, judging by the success of the Kickstarter campaign!

  • Like 1
Link to comment
Share on other sites

Hi again,

 

I have fixed the problem with the Top/Bottom edges of the screen by adding COLUPF & COLUBK to the Vertical Blank/Overscan.

 

post-59407-0-84049800-1518400265.jpg

 

post-59407-0-90932900-1518400270_thumb.jpg

 

 

I've also added the suggestion made by Nukey Shay.

Here is the generated assembly file:

atarix_result.asm

 

 


The approach used by NESmaker is to provide a number of complete game engines for various game genres, that users can customize via the supplied tools. A lot of non-coders appear to be into that kind of thing, judging by the success of the Kickstarter campaign!

Exactly! I have a lot of friends who would like to start making games for Atari but are too scared of Assembly.

Link to comment
Share on other sites

I love this project, but Nukey is right about the limitations of the Atari 2600.

 

I agree that probably the best way forward for this project would be to have some set made kernels which beginners and drag and drop some limited customisation onto.

 

Like you could have a Tank game, a Defender-like game, a Jungle Hunt game...

 

I guess I'm also a lot stricter about how I like people to approach computers. I personally would like people to develop their computer literacy. I suppose this would be like a "gateway drug" for that.

 

I think you should teach beginners about branching, indexing graphics in ROM, about variables, about loops and conditional statements... The beginner should probably also eventually come to learn about what makes the 2600 so unique (racing the beam).

 

Like Chairman Mao said, "let a thousand flowers bloom' - in other words, we should always encourage people to finish their projects and let many diverse plans be set.

 

I suppose I am a very smart person, but I don't see 2600 kernel writing as terribly difficult - really you're just writing to hardwired registers on a timer.

 

I'm here if you want some help!

Link to comment
Share on other sites

Great project, looking forward to seeing this develop! :)

 

bB still requires a lot of programming knowledge, would be cool to see more game maker programs where coding is optional, imo the limitations of the 2600, don't cross over to the mainframe running the IDE.

 

Checkout the links in my signature for some related ideas - Flashback BASIC and SuperCharger BASIC support programming visuals and sound without any code required, as well as high level BASIC and also an old school BASIC mode like bitd.

Link to comment
Share on other sites

Hi again,

 

I've added the possibility to paint the lines with different colors, added a button to change the way the Playfield is drawn and I've also added a shortcut to use a Color Picker.

 

Here are the results:

 

1. Screenshot

post-59407-0-41463500-1518549235.jpg

 

2. Code

atarix_result_3.asm

 

3. Binary

atarix_result_3_bin.bin

 

There is still something weird happening to the playfield though, if you run the binary file you will see that there are some lines on the left of the screen that doesn't have the correct size or is at the wrong position (I don't know what is causing it yet).

 

 

I love this project, but Nukey is right about the limitations of the Atari 2600.

 

I agree that probably the best way forward for this project would be to have some set made kernels which beginners and drag and drop some limited customisation onto.

 

Like you could have a Tank game, a Defender-like game, a Jungle Hunt game...

 

I guess I'm also a lot stricter about how I like people to approach computers. I personally would like people to develop their computer literacy. I suppose this would be like a "gateway drug" for that.

 

I think you should teach beginners about branching, indexing graphics in ROM, about variables, about loops and conditional statements... The beginner should probably also eventually come to learn about what makes the 2600 so unique (racing the beam).

 

Like Chairman Mao said, "let a thousand flowers bloom' - in other words, we should always encourage people to finish their projects and let many diverse plans be set.

 

I suppose I am a very smart person, but I don't see 2600 kernel writing as terribly difficult - really you're just writing to hardwired registers on a timer.

 

I'm here if you want some help!

Thanks!

Yeah, I will have to study a lot to optimize the code, and having different game templates may be the way to go.

 

My IDE will have 2 options for the programmer to choose (Drag & Drop and Assembly), the Assembly is just a text editor with syntax hilighting, the Drag & Drop will feature more tools and will be much easier for the developer to add stuff into the game.

What I want to do is to add different pre-defined movements and actions so the programmer can choose which to use for each object. For example: if the programmer wanted to move the "Hero" around the playfield in 8 directions, the only thing he/she would need to do is to add a "8 Direction Movement" into that object, and adjust it's speed accordingly.

 

 

Great project, looking forward to seeing this develop! :)

 

bB still requires a lot of programming knowledge, would be cool to see more game maker programs where coding is optional, imo the limitations of the 2600, don't cross over to the mainframe running the IDE.

 

Checkout the links in my signature for some related ideas - Flashback BASIC and SuperCharger BASIC support programming visuals and sound without any code required, as well as high level BASIC and also an old school BASIC mode like bitd.

Thanks!

Cool, I will take a look into your project, looks pretty good from what I've seen.

 

 

If anyone wants to take a look and test the IDE, this is what I've got so far:

https://www.dropbox.com/s/z3jcqebknju0k2r/AtariX.zip?dl=0

 

To use the Color Picker, just hold the "LEFT CONTROL" and click on the desired color on the playfield.

 

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