I'm wondering if there's any way to "set" the flash page to read from, so you can do
Code:
and other commands like that.
Code:
ld a,(5437h)
and other commands like that.
ld a,(5437h)
ldirROMRAM:
ld a,(CurROMPage)
or a
jr z,ldirRAM
ldirROM:
call GetArcProgByte
ld (de),a
inc hl
inc de
dec bc
ld a,b
or c
jr nz,ldirROM
ret
ldirRAM:
ldir
ret
GetArcProgByte:
push bc
push hl
ld a,(CurROMPage)
or a
jr z,GetArcProgByteReg
ld b,a
call AutoArcPtrUpdate
bcall(_LoadCIndPaged)
ld a,c
pop hl
pop bc
ret
GetArcProgByteReg:
pop hl
pop bc
ld a,(hl)
ret
GetArcProgByteDE:
push bc
push hl
push de
ld a,(CurROMPage)
or a
jr z,GetArcProgByteRegDE
ld b,a
ex de,hl
call AutoArcPtrUpdate
bcall(_LoadCIndPaged)
ld a,c
pop de
pop hl
pop bc
ret
GetArcProgByteRegDE:
pop de
pop hl
pop bc
ld a,(de)
ret
GetArcProgWord:
push de
push bc
ld a,(CurROMPage)
or a
jr z,GetArcProgWordReg
ld b,a
call AutoArcPtrUpdate
bcall(_LoadDEIndPaged)
ex de,hl
pop bc
pop de
ret
GetArcProgWordReg:
pop bc
pop de
bcall(_ldhlind)
ret
AutoArcPtrUpdate:
bit 7,h
ret z
inc b
res 7,h
set 6,h
ret
SetUpROM:
ld a,(CurROMPage)
or a
ret z
push de
ld de,9
add hl,de
call GetArcProgByte
ld d,0
inc a
ld e,a
add hl,de
pop de
ret
push af
in a,(6)
push af
ld a,(9874h) ;the current page to browse
out (6),a
ld a,d
ld bc,0
cpir ;find first occurence of d
dec hl
pop af
in (6),a
pop af
ret
bcall _chkfindsym ;find the program
jr c,notfound
ex de,hl ;put data pointer into hl
xor a
cp b ;see if b is 0
jr z,unarched ;if so, jump to unarched
push bc ;save page
ld b,0 ;after chkfindsym, c=length of name
add hl,bc ;so add that to hl
ld c,10 ;bc=10
add hl,bc ;add 10 to hl
pop bc ;restore page
SetUpROM:
ld a,(CurROMPage)
or a
ret z
push de
ld de,9
add hl,de
call GetArcProgByte
ld d,0
inc a
ld e,a
add hl,de
pop de
ret
Advertisement