Autor
| Bios is called at linesplit?
| norakomi msx professional Mensajes: 861 | Publicado: Diciembre 20 2005, 16:47   | Quote:
| do you mean
out ($fd),a?
|
a yes, sorry
@artrag:
are you using page 0 as RAM in your coding? | | norakomi msx professional Mensajes: 861 | Publicado: Diciembre 20 2005, 17:19   | Quote:
| The diskdrive is accessed, and then the screenmode swithes (to screen 1???), and everything stops ....
|
As soon as I use the B(in)LOAD routine written by BIFI, the system jumps to screen 1......
Storing page 0 into page 1 works.
Setting page 0 to RAM works.
But then loading files dont work anymore.....
something is not right .... | | norakomi msx professional Mensajes: 861 | Publicado: Diciembre 20 2005, 17:44   | RO !!!!
It worked,
RAM is set at page 0 and the game works !!!
The only thing I changed is this:
in stead of:
LD A,(&HF341)
LD H,$00
CALL $24
I use:
Ld a,%0000 11 00 ;primairy slot=3, secundairy slot=0
LD H,$00
CALL $24
| | norakomi msx professional Mensajes: 861 | Publicado: Diciembre 20 2005, 17:45   | there is something on my mind still ....
Why dont i have to switch ROM to RAM for page 1?
(what I do now is simply: ld a,5 out ($fd),a)
| | norakomi msx professional Mensajes: 861 | Publicado: Diciembre 20 2005, 17:48   | LD A,(&HFCC1)
LD H,&H00
CALL &H24
Hey I just read in the document AURORA gave me, that I should use this value for A !!!!!!!!!!
It works !!! (i tried it on msx2, 2+ and TR)
RO !!! THANX MAN !!!
| | ARTRAG online msx master Mensajes: 1802 | Publicado: Diciembre 20 2005, 17:50   | Quote:
| Quote:
| do you mean
out ($fd),a?
|
a yes, sorry
@artrag:
are you using page 0 as RAM in your coding?
|
I use msxdos, usually I swap page 1 & 2 and I (ab)use pagemapping, without caring of MSX
compatibility. | | norakomi msx professional Mensajes: 861 | Publicado: Diciembre 20 2005, 18:08   | AAAAAAAAAAAAAH  I doesnt work
When I try this:
org $c000
;page1 to mapper 5
ld a,5
out ($fd),a
;make a copy of page 0 (ROM) to page 1 (RAM)
ld hl,0 ;start
ld de,$4000 ;destiny
ld bc,$4000 ;lenght
ldir ;copy block
;page0 to mapper 6
ld a,6
ld ($fd),a
;set page 0 to RAM
ld a,(#FCC1) ; get RAM primslot for page 0
ld h,0 (indicates page 0 to be set)
di
call #24 ; change slot
ei
;restore the stored ROM info from page 1 (RAM) to page 0 (NOW ALSO RAM !!)
ld hl,$4000 ;start
ld de,0 ;destiny
ld bc,$4000 ;lenght
ldir ;copy block
;now test if page 0 is writable and executable:
ld hl,test ;copy from
ld de,$3FFF ;write to page 0
ld bc $1 ;length block
ldir
jp $3fff
Test:
ret
the computer hangs...................
ld a,(#FCC1) ; get RAM primslot for page 0
aha, this is wrong, $FCC1 is to switch ROM back...
anyway, back to the initial problem | | ARTRAG online msx master Mensajes: 1802 | Publicado: Diciembre 20 2005, 18:47   | Have you never thought about developing in JAVA?
In any case, if you do not want to use memman
think about passing to msxdos.
Page 0 is always RAM and ready for your programs.
Disk I/O routines are ready to use and you can swap page 1 & 2 using
memmap or whatelse you like.
Actually using msxdos 2 whould be better (for you) but
it reduces the number of potential customers.
| | ro msx guru Mensajes: 2353 | Publicado: Diciembre 20 2005, 20:03   | Quote:
| there is something on my mind still ....
Why dont i have to switch ROM to RAM for page 1?
(what I do now is simply: ld a,5 out ($fd),a)
|
b'coz Wbass2 sets it for ya, so you've gotta do this in your BOOTING routine, together with the page 0 RAM set
ld a, (slotinfo)
ld h,#40 ; page 1
call #24
| | ro msx guru Mensajes: 2353 | Publicado: Diciembre 20 2005, 20:04   | yeah, well we've gotta slap BEEF for mixing up the #f341 and #f343 vars 
no honest, FCC1 is for ROM dude. check below.
I found this (and indeed proves which sysvar to use). It's code from the boot program of the kernel we wrote: (init all slots)
INISLT: LD A,($FCC1) ; PAGE 0,0,0 (Set subslot of slot 0)
LD H,0
CALL $24
LD A,($FFFF) ; Init MAIN-RAM subslot on all pages
CPL
AND $F0
LD B,A
RRCA
RRCA
RRCA
RRCA
OR B
LD ($FFFF),A
LD A,($F343)
LD H,$40
JP $24
First it sets page 0 ROM then it will correct Subslots on page 2&3
and last but not least it sets page 1 to RAM
here are some more things you need:
; Set MSX ROM BIOS
MSXROM: PUSH AF
IN A,($A8) ;get prim.slot status
AND $FC ;set page 0 bits to slot 0
OUT ($A8),A
POP AF
RET
; Set FK RAM BIOS
FK_RAM: PUSH AF
LD A,($F343) ;get RAM slot data
AND $03 ;keep page 0 info
PUSH BC
LD B,A
DI
IN A,($A8) ;get other pages info
AND $FC
OR B
OUT ($A8),A
POP BC
POP AF
RET
Here's another cool one:
; Call to ROM-BIOS in:IY=BIOS address
CALROM: EX AF,AF
DI
IN A,($A8) ; Page 0 subslot MUST be 0 [Done during INIT]
PUSH AF
AND $FC
OUT ($A8),A ; Page 0,0
EX AF,AF
CALL JBRM.1
EX AF,AF
POP AF
OUT ($A8),A
EX AF,AF
RET
JBRM.1: JP (IY)
oh and don't forget: DISK BIOS is in page 1 so you can't directly load/save data in/out page 1
good luck man!
 | | ro msx guru Mensajes: 2353 | Publicado: Diciembre 20 2005, 20:21   | in the last routine you can see why it's important to set subslots correct (see inislt).
Many games fail to do that during booting. Hence the "magic" poke -1,x (to set correct subslots.. I keep on repeating this bcuz it's important!) use rip the INISLT and use it in your bootingprogram and you'll be safe.
| | norakomi msx professional Mensajes: 861 | Publicado: Diciembre 21 2005, 10:15   |
BiFi
msx guru
Posts: 2739 Posted: September 26 2005, 18:25
F342 is the address where the RAMslot is found for page 1 (detected by the diskrom).
Quote:
| good luck man!

|
Thanx Ro, I really apreciate it a lot !!!! | | norakomi msx professional Mensajes: 861 | Publicado: Diciembre 21 2005, 10:16   |
BiFi (@ www.msx.org/forumtopic5006.html)
msx guru
Posts: 2739 Posted: September 26 2005, 18:25
F342 is the address where the RAMslot is found for page 1 (detected by the diskrom).
Quote:
| good luck man!

|
Thanx Ro, I really apreciate it a lot !!!!
It worked, Im happy.
This is what I did:
org $c000
;page1 to mapper 6
ld a,6
out ($fd),a
;make a copy of page 0 (ROM) to page 1 (RAM)
ld hl,0 ;start
ld de,$4000 ;destiny
ld bc,$4000 ;lenght
ldir ;copy block
;page0 to mapper 6 NOW PAGE 0 contains the copied Bios which was in page 0 initially
ld a,6
ld ($fd),a
;set page 0 to RAM
ld a,(#F341) ; get RAM primslot for page 0
ld h,0 (indicates page 0 to be set)
call #24 ; change slot
It works, !!! Now in Wbass2 for my own use i type: page 0,3,0,6
and voila, I can start using page 0 !!!!!!!!!!!!!!!
Thanx again, I have so much extra programming space now !!!
Btw, I have pages 1 and 2 filled completely with routines and data.
(background scroll, sprite tables, movement patterns, collision routines, weapon routines,
etc etc etc....)
What do you think is better:
Use page 0 for additional routines (enbosses, extra in game events/features, extra weapons etc etc)
Or use page 0 for the intro screen, load/save game option, and the intro demo
???
| | norakomi msx professional Mensajes: 861 | Publicado: Diciembre 21 2005, 10:50   | aha,
instead of using mapper 6, I use mapper 3 (because the ROM page 0 was initially in mapper 3, so no extra map is used)
the only thing I didnt use is: Quote:
| INISLT: LD A,($FCC1) ; PAGE 0,0,0 (Set subslot of slot 0)
LD H,0
CALL $24
LD A,($FFFF) ; Init MAIN-RAM subslot on all pages
CPL
AND $F0
LD B,A
RRCA
RRCA
RRCA
RRCA
OR B
LD ($FFFF),A
|
is it very important to use this piece of code? | | norakomi msx professional Mensajes: 861 | Publicado: Diciembre 21 2005, 10:52   | Quote:
| Have you never thought about developing in JAVA?
|
I have no clue what it is, could you tell me some more about it (not too detailed please, I'm  ignorant) Quote:
| Actually using msxdos 2 whould be better (for you) but
it reduces the number of potential customers.
|
why is that? | |
| |
| |