I wrote a program/hack in Processing to save an images compressed data in text for asm. I also created a dll for asmstudio8x to create an appvar. I created a viewer assembly program and it will display an image unless the appvar spans across pages. If the appvar is stored on one page it will display an image without problems. However, if it's drawing an image and it needs to change pages, the data is not on the next page. Here's some code without using compression. I think the problem is at IncMemPort. It would help if I could find the FlashToRam routine in the ROM to verify.
Code:
Code:
di
xor a
out ($10),a
ld a,$22 ;set GRAM register
out ($10),a
ld hl,PicName
bcall(_Mov9ToOP1)
bcall(_ChkFindSym) ;b=$0e (rom) de=$6ef6
ex de,hl
ld de,20 ;will point it to the data
add hl,de
bit 7,h
jp z,PageGood
inc b ;next page
ld a,h
sub $40
ld h,a ;if hl happened to point past $7fff
PageGood:
ld a,b
call SetMemPage ;sets the rom page to $0e initially
ld bc,$8000
CopyData:
bit 7,h
jp z,KeepPage
call IncMemPort ;draws image until it has to change
ld hl,$4000 ;pages. just starts displaying garbage.
KeepPage:
ld a,(hl)
out ($11),a
ld a,b
or c
jp nz,CopyData
ei
ret
IncMemPort:
ld a,($06)
inc a
SetMemPage:
bit 7,a
jp z, Low
xor a
out ($06),a
ld a,($0e)
inc a
out ($0e),a
ret
Low:
out ($06),a
ret
Pic:
.db 0,0,0
PicName:
.db $15,"TESTAPPV", $00 ;appvar that stores image data