mirror of
https://github.com/freewilll/apple2-go.git
synced 2025-01-04 12:30:20 +00:00
Renamed vid and moved some more vid stuff to it
This commit is contained in:
parent
4bc2403e25
commit
ef0000b67b
@ -2,15 +2,13 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
"github.com/hajimehoshi/ebiten/ebitenutil"
|
||||
|
||||
"mos6502go/cpu"
|
||||
"mos6502go/keyboard"
|
||||
"mos6502go/mmu"
|
||||
"mos6502go/vid"
|
||||
"mos6502go/video"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -19,12 +17,6 @@ const (
|
||||
flashFrames = 8 // Number of frames when FLASH mode is toggled
|
||||
)
|
||||
|
||||
var (
|
||||
charMap *ebiten.Image
|
||||
flashCounter int
|
||||
flashOn bool
|
||||
)
|
||||
|
||||
var cpuState cpu.State
|
||||
var showInstructions *bool
|
||||
var disableBell *bool
|
||||
@ -54,7 +46,7 @@ func update(screen *ebiten.Image) error {
|
||||
checkResetKeys()
|
||||
|
||||
cpu.Run(&cpuState, *showInstructions, nil, *disableBell, 1024000/60)
|
||||
return vid.DrawTextScreen(cpuState.PageTable, screen, charMap)
|
||||
return video.DrawTextScreen(cpuState.PageTable, screen)
|
||||
}
|
||||
|
||||
func main() {
|
||||
@ -71,14 +63,9 @@ func main() {
|
||||
cpuState.Init()
|
||||
|
||||
keyboard.Init()
|
||||
video.Init()
|
||||
|
||||
reset()
|
||||
|
||||
var err error
|
||||
charMap, _, err = ebitenutil.NewImageFromFile("./pr-latin1.png", ebiten.FilterNearest)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
ebiten.Run(update, 280*screenSizeFactor, 192*screenSizeFactor, 2, "Apple //e")
|
||||
}
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
@ -1,4 +1,4 @@
|
||||
package vid
|
||||
package video
|
||||
|
||||
import (
|
||||
"image"
|
||||
@ -6,6 +6,7 @@ import (
|
||||
"mos6502go/mmu"
|
||||
|
||||
"github.com/hajimehoshi/ebiten"
|
||||
"github.com/hajimehoshi/ebiten/ebitenutil"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -15,11 +16,21 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
charMap *ebiten.Image
|
||||
flashCounter int
|
||||
flashOn bool
|
||||
)
|
||||
|
||||
func DrawTextScreen(pageTable *mmu.PageTable, screen *ebiten.Image, charMap *ebiten.Image) error {
|
||||
func Init() {
|
||||
var err error
|
||||
charMap, _, err = ebitenutil.NewImageFromFile("video/pr-latin1.png", ebiten.FilterNearest)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func DrawTextScreen(pageTable *mmu.PageTable, screen *ebiten.Image) error {
|
||||
flashCounter--
|
||||
if flashCounter < 0 {
|
||||
flashCounter = flashFrames
|
Loading…
Reference in New Issue
Block a user