Author Topic: Entry Door - Where to start?  (Read 7004 times)

0 Members and 1 Guest are viewing this topic.

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Re: Entry Door - Where to start?
Well the consensus seems to be C++, and unlike the others, I've already had some resources posted for it.
It would appear that going from C++ to Java is wise though.

A couple FSO related questions....

Is netcode typically still C, or is that actually handled by something else?

If several people here are saying LUA is inefficient / not really a great language, why aren't we using something else?
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline The E

  • He's Ebeneezer Goode
  • Global Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Entry Door - Where to start?
The netcode (as most of FSO) is coded in C.

And we're using lua because, while it isn't as good as a general-purpose language, it works quite well as an interpreted scripting language, and it has the immense advantage of being relatively easy to integrate into an engine.
Let there be light
Let there be moon
Let there be stars and let there be you
Let there be monsters and let there be pain
Let us begin to feel again
--Devin Townsend, Genesis

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Entry Door - Where to start?
when the scripting system was being implemented it was a toss up between lua and python. i think lua won out for being somewhat faster. i think its one of the faster interpreted languages out there, and also has a tiny, easy to implement c api.
« Last Edit: September 11, 2011, 09:01:10 am by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Re: Entry Door - Where to start?
Well in any case, probably going with C++.  I'll see if I can't pick up that book mentioned earlier when it comes out.
I grabbed VS2010 Express so I suppose that's someplace to start.
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Entry Door - Where to start?
Well in any case, probably going with C++.  I'll see if I can't pick up that book mentioned earlier when it comes out.
I grabbed VS2010 Express so I suppose that's someplace to start.

JG, I had two courses freshman year in C++, and I honestly have to say that I learned very little from it, perhaps only some of the syntax and general form of things.

Fastforward a couple of years later, I learned assembly for the MC9S12 chip, which is not a PC but rather a general purpose microcontroller designed for automobiles. Fastforward a little more to my most recent quadrotor project, I had to re-learn C if I ever wanted to get it to do something useful.

I would suggest going through C first to learn the basic program architecture: data types, arrays, loops, recursion, etc.

Then, pick up a microcontrollers, preferably one that isn't a RISC or a Harvard architecture, and learn to code some basic programs in assembly, so you can get a general idea of how von Neuman/Turing computers operate while having fun with blinking LED's and keypads and such by building your own driver software.

Then, try doing the same programs with C, and then later see what C++ has to offer.


One of the biggest things that put me off with learning C++ the first time was the fact that we really couldn't make a program that actually DID anything physical. I didn't see what was so fun (or interesting) about making programs that sorted numbers in a text file.
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Polpolion

  • The sizzle, it thinks!
  • 211
    • Minecraft
Re: Entry Door - Where to start?
I didn't see what was so fun (or interesting) about making programs that sorted numbers in a text file.

Ahh, to be in high school again...

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Entry Door - Where to start?
I didn't see what was so fun (or interesting) about making programs that sorted numbers in a text file.

Ahh, to be in high school again...

The sad thing is that the C++ course was offered as a freshman level class in my community college. My High School didn't have any programming courses whatsoever.

But I did have some fun with making sprites move around on the TV with a Commodore 128 my dad had scavenged from somewhere.  :yes:
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Entry Door - Where to start?
Well in any case, probably going with C++.  I'll see if I can't pick up that book mentioned earlier when it comes out.
I grabbed VS2010 Express so I suppose that's someplace to start.

JG, I had two courses freshman year in C++, and I honestly have to say that I learned very little from it, perhaps only some of the syntax and general form of things.

Fastforward a couple of years later, I learned assembly for the MC9S12 chip, which is not a PC but rather a general purpose microcontroller designed for automobiles. Fastforward a little more to my most recent quadrotor project, I had to re-learn C if I ever wanted to get it to do something useful.

I would suggest going through C first to learn the basic program architecture: data types, arrays, loops, recursion, etc.

Then, pick up a microcontrollers, preferably one that isn't a RISC or a Harvard architecture, and learn to code some basic programs in assembly, so you can get a general idea of how von Neuman/Turing computers operate while having fun with blinking LED's and keypads and such by building your own driver software.

Then, try doing the same programs with C, and then later see what C++ has to offer.


One of the biggest things that put me off with learning C++ the first time was the fact that we really couldn't make a program that actually DID anything physical. I didn't see what was so fun (or interesting) about making programs that sorted numbers in a text file.

i concur. if you want to learn asm, id recommend starting with microcontrollers, the instruction set is so much smaller (i think an atmega has 131 instructions) where a modern x86 cpu has a ****ton of instructions, which makes the job of and asm programmer quite tedious. i got into mcus with arduino but it was either too big for what i wanted, or didnt have enough pins, and the ide while useful doesnt really let you do anything with any degree of performance. you learn to write really tight code when you only have a couple k or less of ram.


im actually working on starting a project, designing an 8 bit "videocard" for an mcu, and im going to need to dip into some asm for timing purposes. using a series of latches, buffers, bus transceivers and a dedicated mcu to handle video output timing and a pair of 32k*8 srams which will act as a double buffer, so that you can draw to one memory with an external processor while the processor on the board works to output the signal using the contents of the other sram. when the external processor is done it will signal the other mcu to swap chips. i figure i can output 8 bit greyscale over composite or 332rgb over vga. im already designing it in eagle cad but im not sure when il have all the parts to actually build it. the real challenge will be in programming.
« Last Edit: September 12, 2011, 09:49:33 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Entry Door - Where to start?
I was trained on the MC9S12, an ol' Motorola chip that was designed as a central MCU for automobiles. As a result, it has an ***ton of pins (112 to be exact) that so far haven't been completely used up.

Although not specifically stated anywhere, the chip's pretty much an intermediate architecture that still allows you to put variables wherever you want, and had up to 256Kb paged flash... which again hasn't been completely used up (yet).

Nuke, I remember coming across a "GameDuo" shield over at Sparkfun.com that allowed an Arduino to hook up to a TV using the old RCA plugs. That sounds like what your working on, but with a couple of improvements. I'm dangerously interested, Lol.

As a side note, JG, and everyone else reading this, I wouldn't recommend learning assembler for an x86 chip because 99.999999....9% programs today made for them are in high level languages. Unless you where looking for a job as a compiler programmer, its just no use to learn a CISC's asm when your just beginning.



P.S.: Out of curiosity, Nuke, is your system going to be mainly parallel data transfers or will there be a few serial lines?
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Entry Door - Where to start?
I was trained on the MC9S12, an ol' Motorola chip that was designed as a central MCU for automobiles. As a result, it has an ***ton of pins (112 to be exact) that so far haven't been completely used up.

Although not specifically stated anywhere, the chip's pretty much an intermediate architecture that still allows you to put variables wherever you want, and had up to 256Kb paged flash... which again hasn't been completely used up (yet).

Nuke, I remember coming across a "GameDuo" shield over at Sparkfun.com that allowed an Arduino to hook up to a TV using the old RCA plugs. That sounds like what your working on, but with a couple of improvements. I'm dangerously interested, Lol.

As a side note, JG, and everyone else reading this, I wouldn't recommend learning assembler for an x86 chip because 99.999999....9% programs today made for them are in high level languages. Unless you where looking for a job as a compiler programmer, its just no use to learn a CISC's asm when your just beginning.



P.S.: Out of curiosity, Nuke, is your system going to be mainly parallel data transfers or will there be a few serial lines?

there are a few ways to get video support on arduino. theres the gameduino which uses an fpga, it has a full set of features, backgrounds, sprites, collision detection, and outputs to vga. theres the tv out library which bitbangs 1 bit video over composite, ive played with it a little, but it uses up so much cpu time that you really cant use it for anything but simple games. there was another video board that implemented the same kind of graphics as the tv out library, had text and graphic primitives. ive seen a few diy methods on hack a day that im loosly basing mine off of. many of those used a single sram, with a latch to multiplex address and data lines and some kind of dac.

i intend to use a brute force mentality and use several chips. everything is parallel. address bus is 15 bits and data bus is 8. the memory also requires 2 control lines. on top of that i will have an additional 2 lines to control/indicate bus switching status. one for input to request a bank flip, and the other indicates to the external processor that the bus flip has occured (transition indicates memory ready, while the level indicates which bank is currently attached). for performance i intend that both sram chips will operate simultaneously. you will be able to draw to one, while the other one is used for signal output, so that you dont have to wait for blanking periods to run code. you will draw, request flip, and when the chip controlling the signal output hits a blanking period (could be each line or each frame, whis may be a configuration setting) it reads the control line, and if its high flips the bus and sets a bit informing the cpu that the memory is ready to be written to again.

i intend to use 4 3-state octal bus transceivers to switch the i/o bus. each sram will connect to a pair of transcievers, one will go to the port for an external cpu, and the other will go to the internal bus. the pairs would be cross connected so that the internal buss can be connected to one sram bank while the other sram bank is routed to the external port. the internal bus connects to the internal mcu, and through a buffer or two, to the dacs (to support both greyscale on composite and 332rgb on vga i will need one for each, though i havent really thought this part out very well).

address bus line are one way, so only buffers are required to switch them. unfortunately at 15 lines apiece it will take about 8 3-state octal buffers to do this. im thinking of using a latch to multiplex the bus and address lines with the data lines to reduce the amount of bus. this would require only 4 transceivers, 4 buffers and 2 latches. i may also need some inverters to reduce the number of onboard control lines. hopefully i can control the bus with one of the atmega328s i have on hand, which has 20 available pins. 15 for io/addres bus, 2 for we/oe pins on the sram, 1 for the latch, and 2 control lines to the external processor, bus switching would probably be done with the bank indicator line. im going to have to scan over the datasheets to make sure i can do this with 20 pins or less, otherwise im gonna need a chip with more pins.

everything would be running at 20 mhz. the ram is asynchonus so i dont think there is any need for the external processor to match clock speed or to be in sync. everything will be in a dip package, since im not setup for surface mount. i have fresh pcbs and a recipe for home made etchant. dont have a laser printer to print toner transfer sheets, so i may just end up drawing the pcb patterns freehand. external processor will be an atmega1284, which by itself has a good amount of memory. 128k flash, 16k ram, 4k eeprom, and can be run at 20mhz. will be a fun little project.

I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Entry Door - Where to start?
Dangerously interested, indeed. One of these days I'll have to look into making one for myself.  :yes:

Your probably going to have a bit of trouble designing the bus traces, get them too close, carrying too much current, etc. and they'll induce a current to their neighboring traces. Hopefully your pcb cad will have a tool to help you out, but I can't really say much more 'cause I haven't made any custom pcb's from scratch yet (really want to though).

I did make some home-brew etchant recently, had a real simple recipe of muriatic acid (pool shock) and copper-clad board as a primer. Just toss the copper-clad into the acid, wait till it turns green, and your good to go. I think a few capfuls of hydrogen peroxide is used to revive the solution when the it starts getting saturated with copper ions (REALLY dark green with clouds that fall to the bottom of the jar).

I haven't used the stuff since I made it though... didn't have time to find a good way of drawing the traces.
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Entry Door - Where to start?
my recipe is hydrogen peroxide, acetic acid, sodium chloride. actually 2 of these can be found in my spice rack. ive been scrounging around thrift stores and garage sales trying to find an old laser printer to do the toner transfer method, though i havent found one yet. i hear if you stick photo paper into a laser printer it works quite well. just iron on the pattern and etch. you can hack an old inkjet for direct to pcb printing, but that is a project unto itself. i did have a highschool electronics class, and we made pcbs from scratch using toner transfer and ferric chloride, with pretty good results. you can also use a sharpie and some stencils, but that can be tedious and error prone. granted you can have professionally made pcbs made to spec for less than 50 bucks. but im poor and not really willing to spend more than a few bucks here and there to build this contraption.

anyway i think my resolution will be 240*136, this will also allow my an extra 128 bytes for configuration data. the vid board will start up and wait for a bank flip request as soon as it gets one it will read the first 128 bytes (really i cant imagine needing more than a few bytes for this) and if there is data there, use that data to configure the video mode, the remaining data will be frame buffer. i also re-examined my design and found that i will need an mcu with more pins on the board, because i forgot that it would need a couple more lines to control sync signals, especially on vga where you need independent horizontal and vertical sync lines, with composite you only need one which is added to the dac output. so i will need 22 pins if i use bus multiplexing, or 29 pins if i dont (not 30 cause i dont need to drive a latch line). bus management is going to be tricky, but im using dual side pcbs, i could put address lines on one side and data lines on the other. there arent gonna be many support components, voltage regulator and caps, crystal and caps, and a few pulldown resistors here and there, and i think the srams need a cap each for power stability. probably wont need inverters if i have more pins on the onboard mcu to work with.
« Last Edit: September 13, 2011, 12:11:01 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Entry Door - Where to start?
For anyone that was following this thread before the off-topic derailleur (it was refreshing I think...):

I found a cool C++ reference website: http://www.cplusplus.com/doc/tutorial/

So far the only bias I've found is against Fortran and the like. Seems not many people these days like GOTO statements. :shaking:
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Entry Door - Where to start?
well, if you look at the instruction set of a cpu. you wont find a for, you wont find a while, but you will find a jump. the control structures we use are not really representative of the way a cpu works. a goto on the other hand is. its just bad programming practice because they are hard to read in code.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Minecraft
    • Steam
Re: Entry Door - Where to start?
well, if you look at the instruction set of a CPU. you wont find a for, you wont find a while, but you will find a jump. the control structures we use are not really representative of the way a CPU works. a goto on the other hand is. its just bad programming practice because they are hard to read in code.

Right, because many of the control structures (for, while, case) can be easily made by a combination of jumps and compare statements. It's a bit difficult (and costly) to make an opcode for everything. The general consensus with CPU manufacturers is to make the chip as multipurpose as possible, so that you sell your chip in more than one market.

In high-level languages, mechanisms such as the GOTO statement should be reserved for cases where it would be too roundabout if you did it with other structures. Spaghetti is for food, not programs!  :)
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Flipside

  • əp!sd!l£
  • 212
Re: Entry Door - Where to start?
Go for Fortran, it's great for impressing the ladies ;)

Seriously though, I started on BASIC (Because that was pretty much the only option when Spectrums, BBC Micros and C64's were all that was available). I then got a BBC Micro and discovered the [] tags, which actually allowed you to code in 6502 machine code in the middle of your programs.

I then moved to learning Z80 machine code on an Amstrad, and Turbo Pascal on something like a 286. Tried to learn Fortran, failed to epic levels.

More recently, I learned Java, it's not as bad as some make out, but is memory hungry and the supposed 'hiding' of the complexities of things like references actually makes it feel a little ambiguous at times. Sometimes you aren't certain whether you are assigning a value to a variable or a reference to a value, and that can cause problems.

I will say this for Java, though you can do it in C++, but it isn't often done, and that is Java is very good if you want to learn how to divide your code up into managable sized pieces, and because it has high- and low- level interpretation, a lot of the code can be error-checked before running. On the down side, in my opinion, there's far too much recasting, which never makes me feel comfortable.
« Last Edit: October 28, 2011, 12:08:32 am by Flipside »

 

Offline JGZinv

  • 211
  • The Last Dual! Guardian
    • The FringeSpace Conversion Mod
Re: Entry Door - Where to start?
Since I didn't directly reference what I was doing....

I took a introduction to C class (5 hour thing) and got a basic book to start with on that. Haven't been able to spend
a lot of time on it honestly.

After I get some sort of grasp on C I'll look into C++.
True power comes not from strength, but from the soul and imagination.
Max to PCS2 to FS2 SCP Guide
The FringeSpace Conversion Mod

 

Offline Davros

  • 29
Re: Entry Door - Where to start?
C++ should only take you 3 weeks

 

Offline Polpolion

  • The sizzle, it thinks!
  • 211
    • Minecraft
Re: Entry Door - Where to start?
Other computer languages you should be able to pick up quicker.

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: Entry Door - Where to start?
C++ should only take you 3 weeks
*imgsnip*

Not sure if serious. I'd say it takes more like several years.

Also, impressive bump.