msx1 bios in a cartridge (Development MSX Forum)MSX Resource Center               
              
English Nederlands Espa�ol Portugu�s Russian         
 News
   Frontpage
  News archive
  News topics

 Resources
   MSX Forum
  Articles
  Reviews
  Fair reports
  Photo shoots
  Fairs and meetings
  Polls
  Links
  Search

 Software
   Downloads
  Webshop

 MRC
   Who we are
  Join our team
  Donate
  Policies
  Contact us
  Link to Us
  Statistics

 Search
 
  

  

 Login
 

Username

Password




Don't you have an account yet? Become an MSX-friend and register an account now!.


 Statistics
 

There are 55 guests and 5 MSX friends online

You are an anonymous user.
 

MSX Forum


MSX Forum

Development - msx1 bios in a cartridge

Author

msx1 bios in a cartridge

Vincent van Dam
msx addict
Posts: 382
Posted: December 11 2003, 22:24   
Since I own a few cartridges that only run on a msx1 (due to invalid bios calls) I patched the msx.rom (msx1 bios) file so that it can run in a cartridge and burned this in an eprom which I mounted in an old cartridge. Basic idea is, put this bios-cartridge in slot 1, the game in slot 2, and let's go!

The project seems succesfull; in emulators the rom works perfectly, but in the real thing it only works when I put the bios-cartridge in a slotexpander. I am not sure why exactly, maybe somebody else could have a look at it. Here is the patch code:

<TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="mrc-small">Code:</font><HR></TD></TR><TR><TD><FONT class="mrc-small"><PRE>
ORG &H00

DB "CD"
DW &H02D7

ORG &H02D7

DI
IN A,(&HA8)
AND &B00000011
LD L,A
ADD A,A
ADD A,A
LD C,A
IN A,(&HA8)
AND &B11110011
OR C
OUT (&HA8),A

LD A,(&HFFFF)
CPL
AND &B00000011
ADD A,A
ADD A,A
LD B,A
LD A,(&HFFFF)
CPL
AND &B11110011
OR B
LD (&HFFFF),A

; The diskrom uses the value of FCC1 to
; determine the slot where the BIOS is
; located. The slot this BIOS is in,
; is hacked into that location.

LD A,&H80 ; is this the problem?
OR L
OR B
LD (&HFCC1),A

JP &H2680

HACK:
DI
LD C,0
LD DE,&HFCC1
LD HL,&HFCC9
JP &H7D81

ORG &H7D75
JP HACK
</PRE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE>
BiFi
msx guru
Posts: 3142
Posted: December 12 2003, 09:40   
Quote:


LD A,&H80 ; is this the problem?
OR L
OR B
LD (&HFCC1),A

You did localise the problem correctly and here's how it should be solved. You need to check whether the slot this rom is located is actually expanded:
<TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="mrc-small">Code:</font><HR></TD></TR><TR><TD><FONT class="mrc-small"><PRE>
LD C,L
IN A,(&HA8)
AND 3
LD E,A
LD D,0
LD HL,&HFCC1
ADD HL,DE
LD A,(HL)
OR C ; here's the original part again (C has old contents of L)
OR B
LD (&HFCC1),A
</PRE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE>

should do the trick...
Vincent van Dam
msx addict
Posts: 382
Posted: December 22 2003, 17:35   
Apparently it was a hardware problem (the pragmatic hack I did with FCC1 is not a problem).

The problem was that I totally ignored the slot select signal which resulted that my rom was available in both slot 1 and 2 (overriding the one I put in slot 2). The slot expander apparently is smart enough to fix this. I fixed the problem by connecting the slot select to ce/oe on the rom. (Needless to say I have very little hardware expierence )

 
 







(c) 1994 - 2008 MSX Resource Center Foundation. MSX is a trademark of MSX Licensing Corporation.