Author Topic: How to create an 8xp compiler using VB 2010?  (Read 11477 times)

0 Members and 1 Guest are viewing this topic.

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
How to create an 8xp compiler using VB 2010?
« on: December 04, 2010, 11:14:33 am »
Hey Omnimaga Community,
I'm trying to make a program that compiles data to a Ti83+/84+/SE program with Visual Basic.
There's a list holding the program data. I define the list with Public data As List(Of Byte).
I am looking for a routine that creates a new 8xp file in a directory based on a SavefileDialog.
The program data should be dependent of the content from the data list.
Thanks in advance.
« Last Edit: December 04, 2010, 11:15:55 am by Aichi »

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: How to create an 8xp compiler using VB 2010?
« Reply #1 on: December 04, 2010, 11:28:16 am »
So wait, can you give us a test file to work with or something? I'm not too sure about VB, but I can help with the header for the .8xp and all the stuff you'll need like checksums.

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: How to create an 8xp compiler using VB 2010?
« Reply #2 on: December 04, 2010, 12:01:25 pm »
I don't want to compile executable programs for the TI with my VB program.
It shall help me to create and manage TI programs, that contain data for different things.
But I develope an RPG Maker that compiles RPGs for the TI maybe, if I have success by
making this VB compiler.
That's my current code:
Code: [Select]
Imports System.IO
Public Class Form1
    Dim data As List(Of Byte)
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SaveFileDialog1.ShowDialog()
        Dim Stream As System.IO.StreamWriter = System.IO.File.CreateText(SaveFileDialog1.FileName)
    End Sub
End Class
It creates an 8xp file without content by pressing on Button1, which is the Compile button.
I still have no idea how to put the bytes from the data list into the 8xp data.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: How to create an 8xp compiler using VB 2010?
« Reply #3 on: December 04, 2010, 12:40:08 pm »
well, like this, IIRC:
Code: [Select]
'*** Write whatever bytes you want
Stream.WriteByte(0)
'*** Clear the stream buffer and flush it to file (Only if the stream is buffered.)
Stream.Flush()
'*** Close the stream
Stream.Close()

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: How to create an 8xp compiler using VB 2010?
« Reply #4 on: December 04, 2010, 01:08:17 pm »
Thank you, graphmastur. WriteByte fortunately works.
Code: [Select]
Imports System.IO

Public Class Form1
    Dim data As List(Of Byte)
    Public Shared Counter As Integer

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        SaveFileDialog1.ShowDialog()
        Dim Stream As FileStream = New FileStream(SaveFileDialog1.FileName, FileMode.Create)
        For i As Integer = 0 To data.Count - 1
            Stream.WriteByte(data(i))
        Next
        Stream.Close()

    End Sub

End Class
But I have trouble by using these 8xp's in TIConnect.
TIConnect outputs "incompatible type".
The files need more informations than just the program data,
for example the 8-character name that it has on TI.
Does anyone know something about this structure?

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: How to create an 8xp compiler using VB 2010?
« Reply #5 on: December 04, 2010, 01:09:22 pm »
I'm also trying to do one, but just for learning. C#, though.

Also, this is calc related, and computer, wrong forum?

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: How to create an 8xp compiler using VB 2010?
« Reply #6 on: December 04, 2010, 01:11:27 pm »
I know quite a lot about the structure. And so can you if you look here.  It's more complicated than writing just the data to it, but it is fairly well explained in there. Please ask if you have more questions.

I'm also trying to do one, but just for learning. C#, though.

Also, this is calc related, and computer, wrong forum?
No, it is a computer language, just calc files. It's fine here.
« Last Edit: December 04, 2010, 01:12:21 pm by graphmastur »

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: How to create an 8xp compiler using VB 2010?
« Reply #7 on: December 04, 2010, 01:13:36 pm »
Quote
'Non-Calc-Related Computer Projects and Ideas'...

Hey Omnimaga Community,
I'm trying to make a program that compiles data to a Ti83+/84+/SE program with Visual Basic.
There's a list holding the program data. I define the list with Public data As List(Of Byte).
I am looking for a routine that creates a new 8xp file in a directory based on a SavefileDialog.
The program data should be dependent of the content from the data list.
Thanks in advance.
« Last Edit: December 04, 2010, 01:14:31 pm by ScoutDavid »

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: How to create an 8xp compiler using VB 2010?
« Reply #8 on: December 04, 2010, 01:15:53 pm »
Scout, this is a computer language... regardless of how many times something associated with a calculator is mentioned, it is still VB. and VB is programmed on a computer.
« Last Edit: December 04, 2010, 01:16:06 pm by nemo »


Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: How to create an 8xp compiler using VB 2010?
« Reply #9 on: December 04, 2010, 01:16:03 pm »
I'm also trying to do one, but just for learning. C#, though.
Were you able to let the program output a working 8xp file?

Also, this is calc related, and computer, wrong forum?
I put it in this subforum since I need help for VB programming.

I know quite a lot about the structure. And so can you if you look here.  It's more complicated than writing just the data to it, but it is fairly well explained in there. Please ask if you have more questions.
Thanks, I'm going to read this guide.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: How to create an 8xp compiler using VB 2010?
« Reply #10 on: December 04, 2010, 05:23:14 pm »
Yeah for now it should be in Non-calc dev, IMHO. When it picks up and major updates are posted, it will be moved to the calc projects section and he can create a new topic in non-calc dev if he needs more help on VB.

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: How to create an 8xp compiler using VB 2010?
« Reply #11 on: December 05, 2010, 09:50:35 am »
Um, it is quite complicated.  <_<
How do I convert strings (being just one character) to bytes/integers in Visual Basic?
"A" -> 65 for example.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: How to create an 8xp compiler using VB 2010?
« Reply #12 on: December 05, 2010, 05:55:27 pm »
Not sure. I know in Oasis, we were going to use a table, but decided for those characters with an ASCII value, to use that instead. So guess get the ASCII value of the Char.

SirCmpwn

  • Guest
Re: How to create an 8xp compiler using VB 2010?
« Reply #13 on: December 06, 2010, 08:40:52 am »
If you are using VB.NET, you can use this library I made for just that purpose.  It can convert strings to bytes or hex, and it can create 8xps, among other things.
« Last Edit: December 06, 2010, 08:41:29 am by SirCmpwn »

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: How to create an 8xp compiler using VB 2010?
« Reply #14 on: December 06, 2010, 08:42:31 am »
If you are using VB.NET, you can use this library I made for just that purpose.  It can convert strings to bytes or hex, and it can create 8xps, among other things.

Now I'm wondering if you have anything like that for C#