Project Universal Vector Graphics Computer for Orbiter

cinder1992

Random failhurricane.
Addon Developer
Tutorial Publisher
Joined
Jul 5, 2009
Messages
350
Reaction score
1
Points
0
Website
cinder1992.blogspot.com
Because if he can't be arsed to copy/paste the compile error, I can't be arsed to go try to compile it myself.


Instead of talking, why don't you just tell him the three characters he needs to add to fix it at this point?
Code:
  switch (argv[nArg][COLOR=red][0][/COLOR])
  {
   case 'r':                   //the RUN flag
    run = 1;
    break;
   case 'c':                   //the COMPILE flag
    compile = 1;
    break;
   case 'd':                   //the debug flag
    debug = 1;
    break;
   default:
    cout << "ERROR: UNKNOWN ARGUMENT. TERMINATING" << endl;       //this is going to pop up an error when an unidetified flag is set
    return 0;
    break;
  }
You'll probably also want to have the flags-handling loop start at 3 instead of 0 (0 is the program name, 1 is the input file, and 2 is the output file), and you'll need to do something about the input file and output file.

that would complicate things, as the output file is optional. but, I can work around it, like completely removing the output file argument. the compiler would just name the file according to the input file. E.G. Intel.ZASM would compile to Intel.BIN

also, I should probably mention that the programming reference I have is almost as old as me.... time for a trip to the bookstore.

OH yes, nearly forgot:
Code:
Build started 29/08/2010 11:34:12 AM.
     1>Project "C:\Users\Cinder1992\Documents\UVGCO_Z80\UVGCO Z80 Compiler\UVGCO Z80 Compiler\UVGCO Z80 Compiler.vcxproj" on node 2 (build target(s)).
     1>PrepareForBuild:
         Creating directory "C:\Users\Cinder1992\Documents\UVGCO_Z80\UVGCO Z80 Compiler\Release\".
       InitializeBuildStatus:
         Creating "Release\compile.unsuccessfulbuild" because "AlwaysCreate" was specified.
       ClCompile:
         C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /O2 /Oi /Oy- /GL /D _MBCS /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Release\\" /Fd"Release\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt EMU.cpp main.cpp OPCODE.cpp
         EMU.cpp
         main.cpp
     1>main.cpp(19): error C2061: syntax error : identifier 'argv'
     1>main.cpp(20): error C2143: syntax error : missing ';' before '{'
     1>main.cpp(21): error C2046: illegal case
     1>main.cpp(22): error C2065: 'run' : undeclared identifier
     1>main.cpp(24): error C2046: illegal case
     1>main.cpp(25): error C2065: 'compile' : undeclared identifier
     1>main.cpp(27): error C2046: illegal case
     1>main.cpp(28): error C2065: 'debug' : undeclared identifier
     1>main.cpp(30): error C2047: illegal default
         OPCODE.cpp
     1>Done Building Project "C:\Users\Cinder1992\Documents\UVGCO_Z80\UVGCO Z80 Compiler\UVGCO Z80 Compiler\UVGCO Z80 Compiler.vcxproj" (build target(s)) -- FAILED.

Build FAILED.

Time Elapsed 00:00:01.47

oh, and my brother is a troll. he was the one who told me that I didn't need to link main.h and main.cpp

---------- Post added at 10:41 AM ---------- Previous post was at 10:30 AM ----------

ok, I linked the .H fiel and the .CPP file, and now there appears to be a new problem: it's complaining about the CASE commands, claiming their not constants.
new log:
Code:
Build started 30/08/2010 10:39:50 AM.
     1>Project "C:\Users\Cinder1992\Documents\UVGCO_Z80\UVGCO Z80 Compiler\UVGCO Z80 Compiler\UVGCO Z80 Compiler.vcxproj" on node 2 (build target(s)).
     1>InitializeBuildStatus:
         Touching "Release\compile.unsuccessfulbuild".
       ClCompile:
         C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /O2 /Oi /Oy- /GL /D _MBCS /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Release\\" /Fd"Release\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt main.cpp
         main.cpp
     1>main.cpp(21): error C2051: case expression not constant
     1>main.cpp(24): error C2051: case expression not constant
     1>main.cpp(27): error C2051: case expression not constant
     1>main.cpp(34): warning C4065: switch statement contains 'default' but no 'case' labels
     1>Done Building Project "C:\Users\Cinder1992\Documents\UVGCO_Z80\UVGCO Z80 Compiler\UVGCO Z80 Compiler\UVGCO Z80 Compiler.vcxproj" (build target(s)) -- FAILED.

Build FAILED.

Time Elapsed 00:00:00.46

I've modified the .cpp file as helior reccomended.
 
Last edited:

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Did you actually change the double-quotes to single-quotes for case statements?
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
Did you actually change the double-quotes to single-quotes for case statements?

my thoughts exactly. " " defines the character(s) between as char, while ' ' defines it as const car. So whenever you want to manualy input a const char, you need to put it in ' ' quotes.

And as far as programming references go, no need for the bookstore. The reference of visual studio is sufficient in most cases, and if not there's still MSDN (I still have a printed Visual Basic 6 reference around. A ton of books that cost a fortune, and some months after buying them I finally got internet connection, never using them as a result, but very reluctant to throw them away because they were so awfully expensive :lol:)
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,659
Reaction score
2,379
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
my thoughts exactly. " " defines the character(s) between as char, while ' ' defines it as const car. So whenever you want to manualy input a const char, you need to put it in ' ' quotes.

Differently.

" " = const pointer to an array of char's : {'\s','\0'}
' ' = single character '\s'.

Also, please remember that C++ is not C. C++ is also not just an extension of C. C++ has strict type-checking, C doesn't complain as long as it can compile it.
 

jedidia

shoemaker without legs
Addon Developer
Joined
Mar 19, 2008
Messages
10,891
Reaction score
2,141
Points
203
Location
between the planets
" " = const pointer to an array of char's : {'\s','\0'}
' ' = single character '\s'.

oh... I understood that wrong the whole time, then :embarrassed:
 

Hielor

Defender of Truth
Donator
Beta Tester
Joined
May 30, 2008
Messages
5,580
Reaction score
2
Points
0
that would complicate things, as the output file is optional. but, I can work around it, like completely removing the output file argument. the compiler would just name the file according to the input file. E.G. Intel.ZASM would compile to Intel.BIN
Probably a better idea would be to have the flags before the input/output file, ie:
<program> <flags> <input file> [<output file>]

That's how most command-line programs work. I'd also recommend having the flags have a dash before them, so you don't end up thinking they're the input files.
 

computerex

Addon Developer
Addon Developer
Joined
Oct 16, 2007
Messages
1,282
Reaction score
17
Points
0
Location
Florida
Instead of talking, why don't you just tell him the three characters he needs to add to fix it at this point?

I wanted to make it clear that the code you posted was erroneous and would not compile. :lol:

I don't like how the flags are handled in cinder's implementation, that is why I did not elaborate on a fix, rather I just pointed out the error.
 

carolyny476

New member
Joined
Sep 4, 2010
Messages
1
Reaction score
0
Points
0
Actually, that was the plan. I was going to take advantage of the fact that the LUA script and the MFD were separate processes in order to have separate CPU emulation and GPU emulation.

currently, the CPU is, in fact, written in python. but I'm confident that I can port it.

Thanks you for the reply.
 

cinder1992

Random failhurricane.
Addon Developer
Tutorial Publisher
Joined
Jul 5, 2009
Messages
350
Reaction score
1
Points
0
Website
cinder1992.blogspot.com
ok, what the hell, two "I AINTNT DEAD" posts in the same thread, that's always a good sign >_>.

anyways, here's whats happening: I've once again scrapped the CPU code and have decided to use a friends code, despite the amount of junk in it (vague variables and several apparently useless pointers). I've also realized that I may only be able to do half of the graphics system. Now, don't get me wrong ,I MIGHT be able to do it, but I'm not making promises. I've also scrapped the SVG idea and have started to think about making some form of compiled vector image system.

news on the compiler: none, other than the fact that I switched around my flags a bit.

only one garuntee at this point: it WILL be out on tuesday! (yes, this is the one project that I'm not going to kill or suspend)
 

cinder1992

Random failhurricane.
Addon Developer
Tutorial Publisher
Joined
Jul 5, 2009
Messages
350
Reaction score
1
Points
0
Website
cinder1992.blogspot.com
sorry for the double post, but I just had a REALLY stupid idea.

Now, the TI-8x family of calculators all have Z80 Processers, right? well, Picture this: Running UVGCO Programs on a TI Calculator!

well, i hope I can get to the stage where I can start porting the graphics engine, also, it would REALLY bog down the TI's Z80, so most of the graphics would be in 1/2 real time.

Just thought I'd share this thought with you.
 

cinder1992

Random failhurricane.
Addon Developer
Tutorial Publisher
Joined
Jul 5, 2009
Messages
350
Reaction score
1
Points
0
Website
cinder1992.blogspot.com
shameless triple bump, but life has begun to kick back into gear... it is definitely not possible for me to do this on my own. I was a fool to think that I would be able to.

also, with the new teaching style they put in at my school, I'm getting enough homework to reach io, so don't count on this being done until about late summer 2012. this is also going to be the same year that they release me from the prison of a school that I have to go to.

I hope this has been enlightening.
 
Top