Acmlm's Board - I2 Archive - Programming - VB.NET Loading Level
User | Post |
elixirnova
Posts: 33/177 |
Hey ive got all my load routines but now im trying to have a screen Next routine to add &H80 to the offset i load from because theres &H80 between each screens beginning and in my program the first screen loads all the offsets fine but when i use my screen + or screen - button the adress is right but the data it gets from that offset is pretty bizzare i cant even find it in the rom... i thought maybe my drawing routine might be messed so heres my code if ya can help itd help me alot!!!!! Private Sub Draw_Level() Dim LevelBitmap As Bitmap = New Bitmap(512, 512, Drawing.Imaging.PixelFormat.Format64bppPArgb) Dim text As String Dim TilePen As Pen = New Pen(Color.Black, 1) Dim TileBrush As SolidBrush = New SolidBrush(Color.Red) Dim TileFont As Font = New Font("Arial", 8) Dim screentile As Rectangle = New Rectangle(x, y, 64, 64) Dim g As Graphics = Graphics.FromImage(LevelBitmap) LevelDisplay.Refresh() x = 0 y = 0 j = 0 For y = 0 To 448 Step 64 For x = 0 To 448 Step 64 screentile.X = x screentile.Y = y text = Hex(MegaTiles(j)) g.DrawRectangle(TilePen, screentile) g.DrawString(text, TileFont, TileBrush, x + 1, y + 1) j = j + 1 Next Next LevelDisplay.Image = LevelBitmap End Sub Private Sub Load_Level(ByVal Screen As Integer) ' screen =the offset to read from FileNumber = FreeFile() ' note it returns the correct offset here OffsetText.Text() = "Offset:" & Hex(Screen) FileOpen(FileNumber, FileName, OpenMode.Binary, OpenAccess.Default) For i = 0 To 63 Step 1 FileGet(FileNumber, Byte1, Screen) FileGet(FileNumber, Byte2, Screen + 1) MegaTiles(i) = (Byte2 * &H100) + Byte1 Screen = Screen + &H2 Byte1 = 1 Byte2 = 0 Next FileClose(FileNumber) Call Draw_Level() End Sub |
|