I was trying to call the COLOR RESTORE subroutine from msxdos
I have adapted to my purpose this code from tni-map
RSTPLT EQU 0x0145 ; Restores palette from VRAM
global _restore
_restore:
push ix
push iy
ld ix,RSTPLT
call CALSUB
pop iy
pop ix
ret
; CALSUB
;
; In: IX = address of routine in MSX2 SUBROM
; AF, HL, DE, BC = parameters for the routine
;
; Out: AF, HL, DE, BC = depending on the routine
;
; Changes: IX, IY, AF', BC', DE', HL'
;
; Call MSX2 subrom from MSXDOS. Should work with all versions of MSXDOS.
;
; Notice: NMI hook will be changed. This should pose no problem as NMI is
; not supported on the MSX at all.
;
CALSLT EQU 0x001C
NMI EQU 0x0066
EXTROM EQU 0x015f
EXPTBL EQU 0xfcc1
H_NMI EQU 0xfdd6
CALSUB:
exx
ex af,af' ; store all registers
ld hl,EXTROM
push hl
ld hl,0xC300
push hl ; push NOP ; JP EXTROM
push ix
ld hl,0x21DD
push hl ; push LD IX,<entry>
ld hl,0x3333
push hl ; push INC SP; INC SP
ld hl,0
add hl,sp ; HL = offset of routine
ld a,0xC3
ld (H_NMI),a
ld (H_NMI+1),hl ; JP <routine> in NMI hook
ex af,af'
exx ; restore all registers
ld ix,NMI
ld iy,(EXPTBL-1)
call CALSLT ; call NMI-hook via NMI entry in ROMBIOS
; NMI-hook will call SUBROM
exx
ex af,af' ; store all returned registers
ld hl,10
add hl,sp
ld sp,hl ; remove routine from stack
ex af,af'
exx ; restore all returned registers
ret
But sadly it seems that CALSUB has no effect.
I changed CALLSLT to CALSLT assuming it was a type in the source
as CALLSLT was undefined. Nevertheless it coninues to hang...
Any idea or workaround?
I just need to restore palette from a screen 5 image.
!login ou Inscrivez-vous pour poster

Why not call MSX2 subROM directly?