Hello Guys,
This time I'm writing because I need a new routine in assembler for MSX1 to save and load the video pages on the TXT videoram of MSX1, for screen1.
below is a source assembler that works for the MSX2, but this routine must be modified to run only 16K videoram for MSX1.
See you to soon.....
^_^
Andrea.
; ************************************************************ ; MSX Z80 source file. ; ; Prog: SCROLL 64 in VRAM for SCREEN1 and SCREEN4 ; Code: SAVE TXT and LOAD TXT in VRAM + SCROLL ; Code: Horizzontal(X) LEFT and RIGHT ; Date: 1/7/09 ; ************************************************************ ; cmnt: Sjoerd Mastijn (C) 2009 ; ; Coded in TeddyWareZ' Chaos Assembler 3 ; ; (C) 2009 Sjoerd Mastijn ; E-mail: smastijn@gmail.com ; ************************************************************ ; Per usare questo programma caricare BLOAD"SCROLL64.BIN",R ; USR7(n) <n> numero di pagina per SAVE TXT in VRAM ; USR8(n) <n> numero di pagina per LOAD TXT in VRAM ; I valori delle pagine vanno da 0 a 63 sulla VRAM. ; USR9(x) <x> x è la posizione di tutte le 64 pagine txt ; salvate con USR7(n) le pagine possono scrollare a sinistra ; e a destra. Il valore di x va da 0 fino a 2016 ; x posizione=32*pagina. ; The pages can to scroll to LEFT and RIGHT ; ************************************************************ ; E' possibile salvare i dati degli schemi salvati con USR7(n) ; con BSAVE e BLOAD per il caricamento, seguire le istruzioni: ; Per salvare i dati della Video RAM fare: ; POKE&HFCAF,8:BSAVE"TEST.VRM",&H4000,&HFFFF,S:POKE&HFCAF,1 ; Per caricare i dati della Video RAM fare: ; POKE&HFCAF,8:BLOAD"TEST.VRM",S:POKE&HFCAF,1 ; ************************************************************ .org $E000 - 7 .db $fe .dw startProgram,endProgram,startProgram startProgram: ; scroll64.asm ; 64 screens in VRAM .byte 254 .word start .word end .word init .org 0E000h start: init: ld hl,tobuf ld (0f3a8h),hl ld hl,frombuf ld (0f3aah),hl ld hl,frombufx ld (0f3ach),hl ret getpar: ld a,(0f663h) cp 2 jr nz,gpret ld hl,(0f7f8h) ret gpret: pop af ret frombufx: call getpar jr fbhop frombuf: call getpar add hl,hl add hl,hl add hl,hl add hl,hl add hl,hl fbhop: ld de,16384 add hl,de ld (readadr),hl ld hl,6144+64 ld (writeadr),hl copyfrom: ld bc,22*256+152 di floopy: push bc ld hl,(readadr) call setvramread ld de,2048 add hl,de ld (readadr),hl ld hl,buffer ld b,32 finloop: ini jr nz,finloop ld hl,(writeadr) call setvramwrite ld de,32 add hl,de ld (writeadr),hl ld hl,buffer ld b,32 foutloop: outi jr nz,foutloop pop bc djnz floopy ret tobuf: call getpar add hl,hl add hl,hl add hl,hl add hl,hl add hl,hl ld de,16384 add hl,de ld (writeadr),hl ld hl,6144+64 ld (readadr),hl copyto: ld bc,22*256+152 di tloopy: push bc ld hl,(readadr) call setvramread ld de,32 add hl,de ld (readadr),hl ld hl,buffer ld b,32 tinloop: ini jr nz,tinloop ld hl,(writeadr) call setvramwrite ld de,2048 add hl,de ld (writeadr),hl ld hl,buffer ld b,32 toutloop: outi jr nz,toutloop pop bc djnz tloopy ret setvramread: ld a,h rlca rlca and 3 out (99h),a ld a,14+128 out (99h),a ld a,l out (99h),a ld a,h and 63 out (99h),a ret setvramwrite: ld a,h rlca rlca and 3 out (99h),a ld a,14+128 out (99h),a ld a,l out (99h),a ld a,h or 64 and 127 out (99h),a ret readadr: .word 0 writeadr: .word 0 buffer: .ds 32 end: endProgram: .end
Aangemeld of registreer om reacties te plaatsen