Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub simplegraphics
- 'Simple graphics renderer. As with keycheck, this is only useful for the "simple" 6502 machine. The graphics are memory mapped.
- Dim As integer memcount = -1, sf
- If monitor = 0 Then sf = (screeny/256) Else sf = 8
- Dim As fb.image Ptr simplebuff
- simplebuff = ImageCreate(32*sf,32*sf,RGB(0,0,0))
- For dy As Integer = 1 To 32
- For dx As Integer = 1 To 32
- memcount+=1
- If memcount + &h200 > 1535 Then
- Exit for
- EndIf
- For z As Integer = sf To 1 Step -1
- ' Draw a line z number of times to make a giant pixel. This is how we are scaling
- Line simplebuff, (dx*sf-sf,dy*sf-z)-(dx*sf,dy*sf-z), clr(cpu.memory(&h200 + memcount) )
- Next
- Next
- next
- Line simplebuff, (0, 0)-(32*sf-1, 32*sf-1), RGB(255,255,255), b ' draw the box around the graphic area
- If monitor = 1 Then Put (screenx-(32*sf)-25,screeny-(32*sf)-25), simplebuff, _ 'long line break
- PSet Else Put ((screenx/2)-((sf*32)/2),0),simplebuff,PSet ' put the image buffer to screen
- ImageDestroy(simplebuff) ' Get rid of the buffer, or else memory leaks!
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement