mirror of
https://github.com/irmen/prog8.git
synced 2024-08-11 05:29:18 +00:00
added gfx2.init_mode()
This commit is contained in:
parent
72f1a779f2
commit
d5f35bb3fb
@ -40,9 +40,6 @@ gfx2 {
|
|||||||
cx16.VERA_L1_CONFIG = %00000111
|
cx16.VERA_L1_CONFIG = %00000111
|
||||||
cx16.VERA_L1_MAPBASE = 0
|
cx16.VERA_L1_MAPBASE = 0
|
||||||
cx16.VERA_L1_TILEBASE = 0
|
cx16.VERA_L1_TILEBASE = 0
|
||||||
width = 320
|
|
||||||
height = 240
|
|
||||||
bpp = 8
|
|
||||||
}
|
}
|
||||||
2 -> {
|
2 -> {
|
||||||
; highres 4c
|
; highres 4c
|
||||||
@ -52,27 +49,44 @@ gfx2 {
|
|||||||
cx16.VERA_L1_CONFIG = %00000101
|
cx16.VERA_L1_CONFIG = %00000101
|
||||||
cx16.VERA_L1_MAPBASE = 0
|
cx16.VERA_L1_MAPBASE = 0
|
||||||
cx16.VERA_L1_TILEBASE = %00000001
|
cx16.VERA_L1_TILEBASE = %00000001
|
||||||
width = 640
|
|
||||||
height = 480
|
|
||||||
bpp = 2
|
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
; back to default text mode
|
; back to default text mode
|
||||||
cx16.r15L = cx16.VERA_DC_VIDEO & %00000111 ; retain chroma + output mode
|
cx16.r15L = cx16.VERA_DC_VIDEO & %00000111 ; retain chroma + output mode
|
||||||
cbm.CINT()
|
cbm.CINT()
|
||||||
cx16.VERA_DC_VIDEO = (cx16.VERA_DC_VIDEO & %11111000) | cx16.r15L
|
cx16.VERA_DC_VIDEO = (cx16.VERA_DC_VIDEO & %11111000) | cx16.r15L
|
||||||
width = 0
|
|
||||||
height = 0
|
|
||||||
bpp = 0
|
|
||||||
mode = 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
active_mode = mode
|
init_mode(mode)
|
||||||
if bpp
|
if active_mode
|
||||||
clear_screen(0)
|
clear_screen(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub init_mode(ubyte mode) {
|
||||||
|
; set the internal configuration variables corresponding to the given screenmode
|
||||||
|
; doesn't manipulate Vera / the actual display mode
|
||||||
|
active_mode = mode
|
||||||
|
when mode {
|
||||||
|
1 -> {
|
||||||
|
width = 320
|
||||||
|
height = 240
|
||||||
|
bpp = 8
|
||||||
|
}
|
||||||
|
2 -> {
|
||||||
|
width = 640
|
||||||
|
height = 480
|
||||||
|
bpp = 2
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
|
width = 0
|
||||||
|
height = 0
|
||||||
|
bpp = 0
|
||||||
|
active_mode = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub clear_screen(ubyte color) {
|
sub clear_screen(ubyte color) {
|
||||||
position(0, 0)
|
position(0, 0)
|
||||||
when active_mode {
|
when active_mode {
|
||||||
|
Loading…
Reference in New Issue
Block a user