mirror of
https://github.com/irmen/prog8.git
synced 2025-01-12 19:29:50 +00:00
using progend() to maximize amount of mem available to load image
This commit is contained in:
parent
8dcd49934a
commit
e6220a464c
@ -53,14 +53,14 @@ main {
|
|||||||
ubyte[256] buffer3 ; to store a 256 color palette
|
ubyte[256] buffer3 ; to store a 256 color palette
|
||||||
|
|
||||||
str filename = "trsi256.ci"
|
str filename = "trsi256.ci"
|
||||||
const uword bitmap_load_address = $2000 ; TODO use progend() once it is available
|
|
||||||
const uword max_bitmap_size = $9eff - bitmap_load_address
|
|
||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
buffer[0] = 0
|
buffer[0] = 0
|
||||||
buffer2[0] = 0
|
buffer2[0] = 0
|
||||||
buffer3[0] = 0
|
buffer3[0] = 0
|
||||||
ubyte read_success = false
|
ubyte read_success = false
|
||||||
|
uword bitmap_load_address = progend()
|
||||||
|
uword max_bitmap_size = $9eff - bitmap_load_address
|
||||||
|
|
||||||
txt.print(filename)
|
txt.print(filename)
|
||||||
txt.chrout('\n')
|
txt.chrout('\n')
|
||||||
@ -118,7 +118,7 @@ main {
|
|||||||
txt.print("ok\n")
|
txt.print("ok\n")
|
||||||
; restrict the height to what can be displayed using the graphics functions...
|
; restrict the height to what can be displayed using the graphics functions...
|
||||||
if height > graphics.HEIGHT
|
if height > graphics.HEIGHT
|
||||||
height = graphics.HEIGHT ; TODO use maxv() once it is available
|
height = graphics.HEIGHT
|
||||||
graphics.enable_bitmap_mode()
|
graphics.enable_bitmap_mode()
|
||||||
set_palette(num_colors, palette_format, buffer)
|
set_palette(num_colors, palette_format, buffer)
|
||||||
when bpp {
|
when bpp {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user