Moved some screen constants to a better place

This commit is contained in:
Will Angenent 2018-05-14 22:49:14 +01:00
parent 95eb6fb575
commit 0f17ecfd21
2 changed files with 6 additions and 12 deletions

View File

@ -15,12 +15,6 @@ import (
"mos6502go/video"
)
const (
screenSizeFactor = 1 // Factor by which the whole screen is resized
textVideoMemory = 0x400 // Base location of page 1 text video memory
flashFrames = 8 // Number of frames when FLASH mode is toggled
)
var showInstructions *bool
var disableFirmwareWait *bool
var resetKeysDown bool
@ -105,5 +99,5 @@ func main() {
reset()
ebiten.Run(update, 280*screenSizeFactor, 192*screenSizeFactor, 2, "Apple //e")
ebiten.Run(update, 280*video.ScreenSizeFactor, 192*video.ScreenSizeFactor, 2, "Apple //e")
}

View File

@ -11,7 +11,7 @@ import (
)
const (
screenSizeFactor = 1 // Factor by which the whole screen is resized
ScreenSizeFactor = 1 // Factor by which the whole screen is resized
textVideoMemory = 0x400 // Base location of page 1 text video memory
flashFrames = 11 // Number of frames when FLASH mode is toggled
)
@ -82,8 +82,8 @@ func drawText(screen *ebiten.Image, x int, y int, value uint8, flashOn bool) err
}
op := &ebiten.DrawImageOptions{}
op.GeoM.Scale(screenSizeFactor, screenSizeFactor)
op.GeoM.Translate(screenSizeFactor*7*float64(x), screenSizeFactor*8*float64(y))
op.GeoM.Scale(ScreenSizeFactor, ScreenSizeFactor)
op.GeoM.Translate(ScreenSizeFactor*7*float64(x), ScreenSizeFactor*8*float64(y))
fontRow := value % 16
fontCol := value / 16
@ -107,8 +107,8 @@ func drawLores(screen *ebiten.Image, x int, y int, value uint8) error {
for i := 0; i < 2; i++ {
op := &ebiten.DrawImageOptions{}
op.GeoM.Scale(screenSizeFactor, screenSizeFactor)
op.GeoM.Translate(screenSizeFactor*7*float64(x), screenSizeFactor*8*float64(y)+float64(i)*4)
op.GeoM.Scale(ScreenSizeFactor, ScreenSizeFactor)
op.GeoM.Translate(ScreenSizeFactor*7*float64(x), ScreenSizeFactor*8*float64(y)+float64(i)*4)
if err := screen.DrawImage(loresSquares[values[i]], op); err != nil {
return err
}