Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - VB.NET Loading Level | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
elixirnova

Red Paratroopa
Level: 22

Posts: 33/177
EXP: 56507
For next: 1843

Since: 04-05-04
From: Midgar

Since last post: 1 day
Last activity: 1 day
Posted on 09-02-04 01:38 AM Link | Quote
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
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Programming - VB.NET Loading Level | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.012 seconds.