Autor
| how to set up Screen 10,11 and 12.
|
mfrissen msx novice Mensajes: 19 | Publicado: Enero 18 2005, 01:04   |
Hi, i'm working om a little program for msx-dos that have to work in msx2+ screen modes.
I olready figured out how to call the msx2 subrom from dos, but can somebody please give me a hand how to set screen 10,11 and 12 ?
i use the folowing routine to call the sub rom (recomended way by ASCII)
CallSRom: exx
ex af,af'
ld hl,015fh
push hl
ld hl,0C300h
push hl
push ix
ld hl,021DDh
push hl
ld hl,03333h
push hl
ld hl,00h
add hl,sp
ld a,0C3h
ld (0fdd6h),a
ld (0fdd7h),hl
ex af,af'
exx
ld ix,0066h
ld iy,(0fcc0h)
call 001ch
exx
ex af,af'
ld hl,10
add hl,sp
ld sp,hl
ex af,af'
exx
ret
This little routine sets mode 0 - 8.
SetScreen: ld ix,00d1h
Call CallSRom
ret
Thanks !
|
|
Sonic_aka_T
 msx guru Mensajes: 2269 | Publicado: Enero 18 2005, 01:21   |
For screen 11 and 12 (screen 10 only exists in BASIC, it's not really a mode) just set the appropriate bits of VDP register 25. Use the BIOS to switch to SCREEN 8 if you want, and then set bit 3 of register 25 to turn YJK mode on. This would be what BASIC calls SCREEN12. If you also set bit 4 (YAE) you set it to YJK Attribute Enable mode, ie YJK+Palette mode. This BIOS keeps a mirror of register 25 at $FFFA, in case you want to update this neatly...
Good luck  |
|
mfrissen msx novice Mensajes: 19 | Publicado: Enero 18 2005, 01:24   |
I already found one document (at the website of Hans O) but what i'm looking for is a bios method , so that the normal bioscalls for drawing on the screen are useful too.
|
|
mfrissen msx novice Mensajes: 19 | Publicado: Enero 18 2005, 01:30   |
ow hehe , i posted at the same time as you Sonic
So , if i adjust 0fffh to i should be able to use the bios routines for drawing too ..
Wel thats something to figure out...
Thanks! |
|
NYYRIKKI msx master Mensajes: 1533 | Publicado: Enero 19 2005, 08:16   |
Just a guess, but you might need to update also screen mode (#FCAF) to use BIOS drawing routines.
|
|
Sonic_aka_T
 msx guru Mensajes: 2269 | Publicado: Enero 19 2005, 08:46   |
Quote:
| ow hehe , i posted at the same time as you Sonic
So , if i adjust 0fffh to i should be able to use the bios routines for drawing too ..
Wel thats something to figure out...
Thanks!
|
Erm.... the address is FFFA (dec 65530) not 0FFFh.... I preceed my hex numbers with a $, some other ppl do too... I've been told this is a horrible horrible thing tho...
|
|
AuroraMSX
 msx master Mensajes: 1277 | Publicado: Enero 19 2005, 10:10   |
Quote:
| I preceed my hex numbers with a $, some other ppl do too... I've been told this is a horrible horrible thing tho... 
|
Depends on the assembler you're using. IIRC, gen80 uses $DEAD whereas other assemblers use #DEAD, 0DEADh or even 0xDEAD. A lot of assemblers use $ as a placeholder for the Location Counter, which would make $DEAD a bit of a confusing notation...
|
|
NYYRIKKI msx master Mensajes: 1533 | Publicado: Enero 19 2005, 12:39   |
IIRC gen80 accepts at least $****, #**** and 0****h syntax. I have not tested 0x**** format.
|
|
mfrissen msx novice Mensajes: 19 | Publicado: Enero 19 2005, 12:42   |
I got the screen 10/11 and 12 modes nice working in a routine called with in A the mode number --same as in basic to keep it simple--.
Right now i'm coding to conversion routines for yck -> rgb and rgb->yck, formula's arn't that difficult... but i want them to be abl to load/save bmp/pcx files and to convert to screen 8->12 and 12->8 afcourse.
only thing tha remaines after that is to utilize the HBI-V1 rom-subroutines to digitize too  --this is discussed in HBI-V! topic--.
By the way, ik use tniASM cross-assembler for msx-dos and wbass for bloadeble code .
I use BleuMSX tot test my code written with tniASM but it seems to put the directory i insert in a drive in to an internal diskimage like format, so eachtime i want to test the newly written code i have to reset BlueMSX ... thats the only disadvantage.
|
|
sjoerd msx addict Mensajes: 454 | Publicado: Enero 19 2005, 12:46   |
Why don't you use tniASM for bloadable code?
|
|
Sonic_aka_T
 msx guru Mensajes: 2269 | Publicado: Enero 19 2005, 13:08   |
'cause WB is really great for quickly testing something. ASM, GO $C000. When you're reading BMPs btw, keep in mind they're stored upside down... -for your convenience- I could've sworn I did something wrong the first time I tried to rip some RAW data from a BMP!  |
|
mfrissen msx novice Mensajes: 19 | Publicado: Enero 19 2005, 18:42   |
Yes wbasm is just a bit handier than tniasm since it can directly save an bloadable file, and i cn test the code faster --afcourse after saving the source , but thats fast with an harddisk  --
and ehh correct me if i'm wrong , but tniASM cant directly create bloadable files ?? --i'm using this assembler for just a few days now so, before i didn't code for msx-dos because i wanted to code for msx1&2 --
|
|
manuel msx guru Mensajes: 3635 | Publicado: Enero 19 2005, 18:55   |
ehm, MSX1 doesn't have any problems with MSX-DOS, as long as it has 64k RAM.
|
|
[D-Tail]
 msx guru Mensajes: 3026 | Publicado: Enero 19 2005, 20:22   |
I think tniASM can do so as well... just do something like this:
ORG #C000-7
DB 254,START, END, START
START: <your program>
END: NOP
Save it like this, the 7 BLOAD header bytes will be saved as well, the program originates at #C000.
|
|
Vincent van Dam msx addict Mensajes: 384 | Publicado: Enero 19 2005, 21:03   |
For words use dw, also, the org can also be placed after the header (that elimates the -7). The nop at end is not neccesary.
DB 254
DW START,END,START
ORG #C000
START:
<your program>
END:
|
|
|
|
|