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

#211
Quote from: crcasey on November 15, 2016, 11:10:41 PM
But there are a lot of line drawing series optimizations you can do on the server side.

I wouldn't want to try that in Vectrex32 code. If the user has two lines in a sprite, they are guaranteed to be joined at an endpoint. If you split those lines apart in an attempt to optimize, that connection will not be perfect. Also, to avoid pen drift, you need to return the pen to the origin periodically.

It's certainly something you can experiment with in BASIC (same for your raster graphics idea) but I wouldn't implement it in firmware.

- Bob
#212
Quote from: crcasey on November 15, 2016, 10:51:47 PM
Is real space time curved?  Yes, it has virtuial particals stored in it.  The larger mass you have the more virtual particles you can store on short time frames.  Thus gravity comes from increased density of virtuial particals creating extra energy in local fields.  But if they don't effect the magnetic field then you can find a splitting.

I don't know how late it is in your part of the world, but I think you're getting a little punchy. Time to log off and go to bed. ;-)

- Bob
#213
There's 2K of shared memory. Subtract a bit for overhead and assume three bytes per vector or pen movement, and you've got maybe 500 lines. You need to refresh at 30 frames per second or better to avoid flicker. So that's 15,000 lines per second. I'm pretty sure the Vectrex analog circuitry is nowhere near fast enough to do that.

I don't think the sort of analysis and optimization you're thinking of is really necessary (and of course, I wouldn't expect typical BASIC programmers to want to get into that sort of stuff).

- Bob
#214
In some frames, you might draw a lot of lines. In other frames, you might draw only a few. And yet it's important that the frame rate be constant (otherwise the apparent brightness of the lines would vary). So even if I could look at a drawing list and figure out how long the 6809 will take to draw it (which would be a very difficult thing to do) it would not be a good idea to adjust the frame rate based on that.

- Bob
#215
Quote from: crcasey on November 15, 2016, 10:09:13 PM
The other section(near the end of the language doc) acts like the basic will be an .EXE on the host system. 

I wrote GSBASIC to be embeddable in any system or to run stand-alone on a PC, so that's why the GSBASIC manual sometimes mentions a host system. Currently, Vectrex32 is the only place I've used GSBASIC.

- Bob
#216
General Discussion / Re: Basic Interpreter
November 15, 2016, 09:59:15 PM
You use AppendArrays to concatenate arrays. Operators can't be overloaded: this is BASIC not C++. Besides, if you overloaded + for an array, would it be concatenation or matrix addition?

- Bob
#217
General Discussion / Re: Basic Interpreter
November 15, 2016, 09:53:11 PM
Argument a will be a string, b will be a number, and when the function executes the plus sign, it will act as a string concatenation, with b being converted to a string.

- Bob
#218
General Discussion / Re: Basic Interpreter
November 15, 2016, 09:45:13 PM
It gives you an error, that the function call has the wrong number of arguments.

- Bob
#219
You mean I don't say what value gets printed? It's an exercise left for the reader. :-)

- Bob
#220
General Discussion / Re: Basic Interpreter
November 15, 2016, 09:33:41 PM
Actually, I think BASIC has always allowed floating point values in FOR statements. I remember doing it in BASIC Plus on a PDP-11 in the late 70s. It requires some care due to the imprecise nature of floating point values.

- Bob
#221
I'm using reference counting so there's no garbage collector and therefore no slowdowns. Freed memory blocks are coalesced with adjacent blocks (as you'd expect from C's malloc and free), but it's conceivable that memory fragmentation could cause a crash. There's no virtual memory or Windows 3.1-like moveable memory, so there's not much I can do if your BASIC program uses arrays in such a way as to cause fragmentation.

- Bob
#222
General Discussion / Re: Basic Interpreter
November 15, 2016, 08:33:17 PM
Quote from: crcasey on November 15, 2016, 08:29:23 PM
Also a quick question on assignment and pointers...

a=10
b=a
b=b+10

is a = 10 or is a=20 now?

How about with more complex types like arrays?

-Cecil

a remains 10. However, if you did:

dim a[1]
a[1] = 10
b = a
b[1] = 20

then a[1] would also be 20. So scalar assignments are copies of the value while array assignments are copies of the references.

- Bob
#223
General Discussion / Re: Basic Interpreter
November 15, 2016, 08:29:58 PM
BASIC has always used = for both assignment and comparison, so I'm just keeping with that tradition.

- Bob
#224
Arrays that are no longer referenced by any variable or sprite are deallocated - the memory is freed.

- Bob
#225
Yup, that's a mistake. Thanks for catching it.

- Bob