Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Munchor on November 12, 2010, 04:13:49 pm

Title: 8xp to txt Converter
Post by: Munchor on November 12, 2010, 04:13:49 pm
Hey,

So, I'm trying to make a 8xp to txt, just like Tokens or SourceCoder, to learn, though, not to use it, to learn more :D


So, i'm gonna need tokens:

http://omnimaga.pastebin.com/3KQ3PRFe (http://omnimaga.pastebin.com/3KQ3PRFe)

I'll use this ones.

However, I have no idea what kind of knowledge I need to use the things in front of the tokens:

Code: [Select]
tDisp           EQU       PROGTOK+16  ; DEh   'Disp_'
How could I implement this in a program, for example?

I'll probably give up after making the Disp one, so I have to make sure I can do it.


I'm gonna be using Python, but I don't need help with Python, I need help on what I should use in the program from that line tDisp above?
Title: Re: 8xp to txt Converter
Post by: thepenguin77 on November 12, 2010, 04:16:51 pm
Scoutdavid, I actually made one of these 4 days ago in c++. I could give you the source if you wanted.
Title: Re: 8xp to txt Converter
Post by: Munchor on November 12, 2010, 04:21:00 pm
Scoutdavid, I actually made one of these 4 days ago in c++. I could give you the source if you wanted.
Yes please, since I'm programming a C or Python one, that would be useful. Thanks much
Title: Re: 8xp to txt Converter
Post by: thepenguin77 on November 12, 2010, 04:31:29 pm
Here (http://pastebin.com/pe8Up9HJ) it is. I'm sure there is a better way to list the tokens. I basically write in ASM based c++. So as you can see, I just wanted to define data ;)
Title: Re: 8xp to txt Converter
Post by: Munchor on November 12, 2010, 04:46:02 pm
Here (http://pastebin.com/pe8Up9HJ) it is. I'm sure there is a better way to list the tokens. I basically write in ASM based c++. So as you can see, I just wanted to define data ;)

Thanks, I will study deep into later and post doubts here. Thanks

The first thing I tried to do was to compile it and run it, but got error on this line:

Code: [Select]
ifstream fSongFile (argv[1], ios::_Nocreate | ios::binary | ios::ate | ios::out);
C stdafx.h: No such file or directory.

I need a header that I don't have :S

_Nocreate' is not a member of `std::ios'

What the hell?


Does it work okay in your PC? Thanks

Title: Re: 8xp to txt Converter
Post by: thepenguin77 on November 12, 2010, 05:51:15 pm
The problem might be that I did it in C++ and you are doing it in C. Just do a whatever it takes to open a file in C, you don't have to specifically open it the way I do. All that's important is that you open it in binary mode and that you can figure out the size.
Title: Re: 8xp to txt Converter
Post by: Munchor on November 12, 2010, 05:52:12 pm
The problem might be that I did it in C++ and you are doing it in C. Just do a whatever it takes to open a file in C, you don't have to specifically open it the way I do. All that's important is that you open it in binary mode and that you can figure out the size.

I'm opening C Plus Plus and using C Plus plus Converter, though
Title: Re: 8xp to txt Converter
Post by: thepenguin77 on November 12, 2010, 05:55:13 pm
That's strange... What are you using to compile the program? I used visual studio 2010. The year probably doesn't matter since this is a simple program, but perhaps if you don't have visual studio, you won't have exactly the same libraries.
Title: Re: 8xp to txt Converter
Post by: Munchor on November 12, 2010, 05:56:17 pm
That's strange... What are you using to compile the program? I used visual studio 2010. The year probably doesn't matter since this is a simple program, but perhaps if you don't have visual studio, you won't have exactly the same libraries.

I will install Visual Studio, since I need it for GUI C++ and this.

I was using Dev C++
Title: Re: 8xp to txt Converter
Post by: thepenguin77 on November 12, 2010, 05:57:13 pm
Visual studio is so nice. I've never used anything else, but it kicks the crap out of notepad.
Title: Re: 8xp to txt Converter
Post by: Munchor on November 12, 2010, 06:28:27 pm
I don't understand Visual Studi c++, first time using?

Console Application? Not a WF for sure, so which one?
Title: Re: 8xp to txt Converter
Post by: Munchor on November 13, 2010, 10:28:28 am
Sorry for double post, but thanks to Kermm I am having some succes and managing to make a few tokens.

About 677 tokens left and the checksum and the header.

The hardest part will be to create the .8xp final :s
Title: Re: 8xp to txt Converter
Post by: aeTIos on November 13, 2010, 10:29:38 am
you can use the "quick modify" button in your post :)
The Game is angry with you ;D

nice project, though
Title: Re: 8xp to txt Converter
Post by: Munchor on November 13, 2010, 10:30:59 am
I know I can modify, but it doesn't warn people about editing, and I will be needing help :S

So far, I have this:

http://codepad.org/ChPpTG3f (http://codepad.org/ChPpTG3f)
Fix:
*Space after Disp
*Instead of typing the text, importing a file
*Add checksum and header to .8xp files (whatever that is)
Title: Re: 8xp to txt Converter
Post by: meishe91 on November 13, 2010, 11:30:53 am
Rule three states that you can double post as long as it's been at least six hours after your last post. So you're fine.

Good luck on the program.
Title: Re: 8xp to txt Converter
Post by: Munchor on November 13, 2010, 12:23:40 pm
Yes Meishe, then it was OKAY, I've got a big update now

"Disp Prompt Disp Disp"

Counts 2 Disp's and 1 Prompt, since Disp needs a space after it, so as Prompt.

I may stop posting the code or posting only parts of it to avoid my program being stolen.

Sorry :s
Title: Re: 8xp to txt Converter
Post by: DJ Omnimaga on November 14, 2010, 12:19:41 am
I think you should be fine, because I am sure if it comes out on ticalc.org people here will recognize the code if they saw it here before. See Hyped, for example, on Cemetech. The community easily spotted the program that were stolen, even if they never used them before. That said, there's a lot of traffic over here, though, so if you ever put your code on pastebin.com, make sure to mention here that you did post it.
Title: Re: 8xp to txt Converter
Post by: Munchor on November 14, 2010, 03:33:06 pm
:O Ok, great then, I'm also at Cemetech with this program since this is gonna be tough:

http://cemetech.net/forum/viewtopic.php?p=122830#122830 (http://cemetech.net/forum/viewtopic.php?p=122830#122830)

I have managed to make "Disp " with the space being recognized now, GREAT!

I could make my first Tokens program working with a few tokens (something like 10 just to say I could do it), but, once again, checksum and header is something that I have no idea of what is, though.

Title: Re: 8xp to txt Converter
Post by: DJ Omnimaga on November 15, 2010, 12:20:39 am
Ah cool, you might find some additional help there too. :)

Nice to see this progressing. Hope you figure everything out soon :)
Title: Re: 8xp to txt Converter
Post by: Munchor on November 15, 2010, 07:46:39 am
Ah cool, you might find some additional help there too. :)

Nice to see this progressing. Hope you figure everything out soon :)

Yeah, I will succeed I'm sure, and by posting the code it is easier, and sure nobody steals it from me :D
Title: Re: 8xp to txt Converter
Post by: Binder News on November 15, 2010, 09:35:31 am
I have been working on something like this in java. The checksum is the lsb of the sum of all the bytes in the data section of the file. (I'll use "c" at the end of a num to represent that it must be converted to a char) The header of the whole file is **TI83F* 16c 10c 0c (42 nulls) (2-byte length of data section). I got this from the tixx_something guide on ticalc. Search tixx.