Schrijver
| page flipping in basic
|
norakomi msx professional Berichten: 861 | Geplaatst: 02 Juni 2005, 13:59   |
in wbass2 page 2,3,0,3 sets page 2, slot 3, subslot 0, bank 3
how do i do this in basic??? (and especially the bank switching is what interests me)???
|
|
Sonic_aka_T
 msx guru Berichten: 2260 | Geplaatst: 02 Juni 2005, 16:08   |
You don't, really... Since your BASIC 'code' is at $8000, a bank switch on $8000 would fase-out your BASIC listing. You can of course move your BASIC listing to $C000, but then there wouldn't be any place left to have any machine code routines, plus your BASIC listing would have to be a lot shorter. Anyhoo, you can change banks with OUT (&HFE),page (for $8000), same like in asm. Due to the problems I mentioned, it's really not worth the hassle. Besides, if you really want to make a Space Manbow 2, you're going to have to do it in ASM, if possible even without having the BIOS enabled... But whatever, point being: bank switching in BASIC is not very useful if you are going to need machine code as well or a large listing. It's more trouble than it's worth...
|
|
pooogramer msx friend Berichten: 3 | Geplaatst: 02 Juni 2005, 17:34   |
in msx1, only way i know (sorry my english
copy page 1 slot 0 to page 1 in another slot (with ram, of course). then change the memory map to all ram, for example. this way you can translate to another language -with limits, of course- the error messages of msxbasic, for example (i did it)
in msx2 i think msxbasic page can´t work in subslot... but i have no real idea...
|
|
ro msx guru Berichten: 2296 | Geplaatst: 02 Juni 2005, 21:06   |
crap. basic and slotswitching? crap!
just read t00b's (sonic) post again and be cool with ASM.
(switching page's (aka setting slots) is not done in Basic and ya just don't 'ave 2. only for ASM coders it is of any importance)
|
|
NYYRIKKI msx master Berichten: 1494 | Geplaatst: 02 Juni 2005, 22:02   |
Don't be so negative...
There is no way to make SpaceManbow or anything close to it with BASIC, but you can do surpricingly big BASIC program even if you move BASIC to #C000. Many people think, that BASIC is bad and ugly glue, but somehow I'm used to use it and BASIC is one of the reasons, why I like MSX so much. For example in Diary-demo (member of MRC bounce challenge) I used this method. MI-CHI was another guy, who used to use same technics with me. (Or to be honest I loaned my style from him)
Normally you have parts that need ultimate speed and parts that just need to be there, so it is not 100% must to do everything in assembler. I'm used to use BASIC as glue and some other use Pascal or C.
Switching of primary slot is easy with BASIC, but you can't switch sub-slot without assembler exept the slot where RAM of page 3 is located. Method is just same as in assembler...
For primary slot, use I/O #A8, for secondary slot, use address -1 and for memory mapper page switching, use I/O #FC-#FF For more info, look for example "Portar" documentation. (google is your friend)
|
|
norakomi msx professional Berichten: 861 | Geplaatst: 03 Juni 2005, 15:29   |
Im making my game completely in assembly,
however when I boot my msx and WBASS2 starts,
I load all my files (sprite patterns, sprite colors, movement
patterns etc etc etc.) in RAM.
Before I load all those files in RAM I type:
page 1,3,0,4
page 2,3,0,4
to make sure I can use page 1 and 2......
but how do I make a basic loader that loads this game????
because if in basic I load all my files (sprite patterns, sprite colors, movement patterns etc etc etc.) in RAM I want to be
able to use address $4000-$BFFF as well !!
so game: assembly
loader: basic
|
|
NYYRIKKI msx master Berichten: 1494 | Geplaatst: 03 Juni 2005, 15:40   |
Sorry, you need to load the data to for example #9000-#CFFF area and then write a small assembly routine like this to #D000:
LD A,(#F342)
LD H,#40
CALL #24
LD HL,#9000
LD DE,#4000
LD BC,#4000
LDIR
LD A,#80
LD H,#40
JP #24
... and save this like this:
BSAVE"DATA1.BIN",&H9000,&HD01A,&HD000
Now you can load the data from basic to #4000-#7FFF by typing:
BLOAD"DATA1.BIN",R
|
|
ro msx guru Berichten: 2296 | Geplaatst: 03 Juni 2005, 16:32   |
make a loader in ASM that's, say, in page 3 (somewhere between #c000-#de00 for example)
There start using the slotswitching (like nyyrikki mentioned above) and load routines.. it's really simple
|
|
pitpan msx master Berichten: 1367 | Geplaatst: 03 Juni 2005, 18:42   |
When in doubt, always execute the following useful BASIC code:
DEFUSR=0:?USR(0)
 |
|
pitpan msx master Berichten: 1367 | Geplaatst: 03 Juni 2005, 18:53   |
And if you are a die-hard assembler programmer, do not hesitate to use the fantastic RST 00h - it is faster and more reliable than the BASIC solution  |
|
|
|
|