Skip to main content
gamedev.net
🔒 Locked

[.net] overflow

Started by ed209 Mar 3, 2008 at 9:39 AM 0 replies 750+ views
Original Post
ed209
ed209
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
        ReadFile()

    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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.