Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Astrosynthesist

#16
Code Swap / Re: Vecci graphics user export script
December 30, 2017, 01:46:00 AM
Here it is with end of line correction.
StringBuffer buffer = new StringBuffer();
StringBuffer line = new StringBuffer();
Vector allvectors = vecci.getVectors();
GFXVector onvector =(GFXVector)  allvectors.elementAt(0);
Vertex start = onvector.start;
int linelength = 100;
line.append("{{MoveTo,"+(int)start.x()+","+(int)start.y()+"}");
Vertex old_end = start;
for (int i=0; i<allvectors.size(); i++)
{
  onvector =(GFXVector)  allvectors.elementAt(i);
  start = onvector.start;
  Vertex end = onvector.end;
  if ( start.x() != old_end.x() || start.y() != old_end.y() )
  {    if (line.length() >= linelength )
    {
      buffer.append(line + ",_\n    ");
      line.setLength(0);
      linelength = 179;
    }
    else
    {
      line.append(",");
    }
    line.append("{MoveTo,"+(int)start.x()+","+(int)start.y()+"}");
  }
  if (line.length() >= linelength)
  {
    buffer.append(line + ",_\n    ");
    line.setLength(0);
    linelength = 179;
  }
  else
  {
    line.append(",");
  }
  line.append("{DrawTo,"+(int)end.x()+","+(int)end.y()+"}");
  old_end = end;
}
buffer.append(line + "}");
out += buffer.toString();
#17
Code Swap / Vecci graphics user export script
December 28, 2017, 07:40:53 PM
Hi everyone.

I got tired of manually writing my own vector lists after fleshing them out in vecci (the vide vector drawing utility), so I wrote my own script to manually output the vectorlists in user export mode. The only issue is that it does not account for lists longer than 200 characters. I'm not super familiar with working in what I assume is javascript (this is javascript, right?) I just wrote this based on the other exports as examples.
StringBuffer b = new StringBuffer();
Vector allvectors = vecci.getVectors();
GFXVector onvector =(GFXVector)  allvectors.elementAt(0);
Vertex start = onvector.start;
b.append("{{MoveTo,"+(int)start.x()+","+(int)start.y()+"}");
Vertex old_end = start;
for (int i=0; i<allvectors.size(); i++)
{
  onvector =(GFXVector)  allvectors.elementAt(i);
  start = onvector.start;
  Vertex end = onvector.end;
  if ( start.x() != old_end.x() || start.y() != old_end.y() )
  {
    b.append(",{MoveTo,"+(int)start.x()+","+(int)start.y()+"}");
  }
  b.append(",{DrawTo,"+(int)end.x()+","+(int)end.y()+"}");
  old_end = end;
}
b.append("}");
  out += b.toString();


If anyone wants to add the 200 character correction (adds an underscore and newline for every 170 characters) I would be very grateful if you reply to this post with it but this as it is is still much more convenient. Enjoy!
#18
Silly me. This is great though, thank you!
#19
Feature Requests and Bug Reports / Janky Sprite Rotation
December 27, 2017, 08:36:40 PM
Hello again. I will include a small code snippet to illustrate my issue. Not sure if this is a bug or just an inevitability of the way the floating point unit works...
call setFrameRate(30)
lockArray = {{MoveTo,2,10},{DrawTo,0,5},{DrawTo,-2,10},{DrawTo,2,10},{MoveTo,2,-10},{DrawTo,0,-5},{DrawTo,-2,-10},{DrawTo,2,-10},_
    {MoveTo,10,2},{DrawTo,5,0},{DrawTo,10,-2},{DrawTo,10,2},{MoveTo,-10,2},{DrawTo,-5,0},{DrawTo,-10,-2},{DrawTo,-10,2}}
call scaleSprite(255)
call returnToOriginSprite()
lock = linesSprite(lockArray)
while True
call waitForFrame(0,0,0)
call spriteRotate(lock, 1)
endwhile

But yeah, on my Vectrex that sprite just dances all over the place while rotating, probably the same on others too. Please let me know if this can be avoided!
#20
General Discussion / Re: Large arrays
December 27, 2017, 08:15:45 PM
Ah yes, the almighty underscore! Thanks.
#21
General Discussion / Large arrays
December 27, 2017, 11:50:52 AM
I'm having a few issues, which I hope can be easily addressed, and both of which have to do with arrays.
First; Suppose I have a very large array in order to define a complex sprite. Is there some way to hardcode the vector list into the array in spite of the 200 character limit? I cannot find a convenient way to create a sprite over multiple lines unless I just create multiple sprites and overlap them or initialize an empty array and populate it over multiple lines, which I could do but would prefer not to.
Secondly, I cannot find a way to extract rows from multidimensional arrays;
I can define an array like this:
array1 = {{1,2,3},{4,5,6}}
but then I can only index single values from that array:
print array1[1,2]
2
print array1[1]
print array1[1]
      ^ Wrong number of indices inside []

Now I cannot reference rows in that array, I would have to iterate over them in a for loop.
Alternatively I could define the array like this:
array2 = {({1,2,3}),({4,5,6})}
But now I cannot subindex single values of that array without assigning each row to another variable:
myrow = array2[1]
print myrow
{1,2,3}
print myrow[2]
2
print array2[1,2]
      ^ Wrong number of indices inside []
print array2[1][2]
               ^ Expected end of line

So as far as I understand it I cannot have my cake and eat it too, I can either have my cake or eat it. :)
I'm just wondering if I'm missing something in the syntax or if this is how it needs to be worked with.

Thanks!
#22
It's in the mail. Let me know if you would like the tracking number.
#23
I am back!

First of all, I'm sad to see very little community involvement since I left. I hope to change that!
I am excited by the prospect of the V-prize and just attempted to install v1.15 in preparation for making my ports of those games... I got to the screen saying I successfully updated the V32, but now whenever I reboot the Vectrex I go straight to minestorm and my computer doesn't see a drive with the contents of the V32. Uh oh!

Please let me know if I can provide more information. I really want to see this project flourish and would like to get my V32 up and running again so I can bash out these ports! :)
#24
Now that you've fixed reading controller 2 Y axis, does it exhibit the same behaviour?
If not, could it be some kind of memory conflict?
#25
Awesome!

Any luck with the weird Controller 1 Y axis behaviour?
#26
I hadn't considered that possibility but yes the problem occurs with all instances of text being drawn, including the vector font.

I'm a bit confused as to how this whole frame thing works - is it possible that the time it takes to draw one frame is longer than whatever the frame rate would allow, say it's set to 60 fps and the frame takes 1/50th of a second to draw? Is there any way for the Vectrex32 to figure it out and fall back to the highest available framerate?

I could run some timing tests on how long it takes to draw one frame with text to see if my first theory works out, but I don't have any experience in programming the Vectrex in its native assembly (I don't have a flash cart yet!) so as to my second question I'd need to do some "manual digging" if you can't think of anything off hand. (Rereading this I see it's unclear... I mean if there is no way for the Vectrex32 to figure out the max framerate on its own, potentially the Vectrex might have some method for figuring this out) It seems to me that in the original software it doesn't have a fixed frame rate, it changes on the fly based on how many lines are being drawn (however that's completely anecdotal, I have no proof whether it's true or not). If we programmed for the Vectrex32 such that all timing calculations weren't frame-based, would it be possible to compensate for the frame rate issues by not setting a fixed frame rate to begin with?
#27
Awesome, and it's a lot of fun so no worries!
#28
Okay, I'm back with further insight.

Try the version of lunar.bas but with the included diff applied to it (or just lunarmod2.bas, which is just that).

Now I'm hitting the frame rate limit you were speaking of before. Specifically, it is 96 fps. (that's the setting from my diff). In my previous post I was testing at 120 fps and that was why the timing was all wrong.
The game now runs perfectly well at 60fps and I recommend playing it at that speed. But pushing it to its limits at 96fps reveals something interesting - a flicker appears on my Vectrex every once in a while, where it misses a frame or two. I'm not sure why.
So by cutting out the TextListSprite references I boosted the maximum possible frame rate from 35 to 96.
I'm wondering if there's another function being called in the program which is another limiting factor. When I adjust the frame rate you can actually hear the scans slow down when changing between 96 and 97 fps. This one will be a bit harder to isolate (at least on my end, only playing with the basic side) but as it stands I think 96 fps is more than adequate for most applications.
Also be aware that all of the data omitted from the screen is now printed to terminal (and the stats appear once per second, mostly as a cheat so I could visually "tick" every second and check that one second for the vectrex is one second in real life. You can change it to frame by frame prints by removing the if statement at the end of the main while loop (exposing the print statement).
#29
This post should probably be moved to bug reports...

A few notes:
In lunar.bas, after breaking, you can increase frame rate to 35 and the frame rate will increase. Once you hit 36, it slows down again (and increases from there such that setting to 60 is equal to setting to 30).
This is strange but it gets stranger.
I've narrowed part of the problem to the TextListSprite function.
If you comment all references to those sprites (instructions, stats, msg) out the vectrex is able to boost the frame rate to 120 no problem.
The next weird thing I'm noticing after that is that the timing gets all screwed up. I add the line "call setFrameRate(120)" to the beginning of the code, and the framerate indeed stays at 120, (and the frameRate variable depends on the getFrameRate() call later so that's all fine) and yet the game runs super sluggish. I'm not sure what is calculating the timing that is causing this but I will continue to investigate this a bit later.

Anyways, I'm almost positive the frame rate barrier is not a hardware issue but just a bug as stated above. I believe this because I can stop what's running, create a simple text sprite, and adjust the frame rate as high or low as I please without problems.
#30
v1.14
Boot Vectrex32, hit ^C to enter live shell
I noted that if I'm in the middle of creating a while loop in the live shell, such as:
move = 122
while 1
call MoveSprite(-50,0)
call TextSprite(move

And then I realize I forgot something so I break to get out of it:
move = 122
while 1
call MoveSprite(-50,0)
call TextSprite(move^C

I usually have to hit enter for the break to register.
Then the very next command I enter soft crashes the Vectrex 32.
(The two I've tried are print(move), print(), and call MoveSprite(50,0), all of which crash the Vectrex32.
It then reboots to the standard menu (no errors output on terminal)
Then I once had it crash again and reboot without even connecting to the shell.

From the testing I've done, this happens in these circumstances but it's hard to make happen using any general commands. It might involve function calls as this also works:
while 1
call MoveSprite(0,50)
call MoveSprite(1,50)^C