Sign in to follow this  

[.net] overflow

Recommended Posts

I'm working on a chip 8 emulator and right now I'm trying to read a rom into an array of bytes but I keep getting an overflow. I don't know why this is?
Public Class Form1
    Dim ram(&HFFF) As Byte
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Sub ReadFile()
        Dim ofile As IO.File
        Dim oRead As IO.StreamReader
        Dim i As Integer
        i = 0

        oRead = ofile.OpenText("c:\roms/c8games/UFO")
        While Not oRead.EndOfStream

            ram(i) = oRead.Read()

            i += 1
        End While
     End Sub
End Class

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.
Sign in to follow this