For creating MSX ROMs you can check asMSX v.0.10.
Get it at http://www.robsy.net/asmsx.htm
For creating a ROM file using asMSX v.0.10 you only need to include the following header to your source code:
.bios ; this defines all MSX1 subroutine names: ENASCR, LDIRVM, GTSTCK, etc.
.page 1 ; set at 4000h. Use .page 2 to start at 8000h
.rom ; defines the output file as a ROM
.start MY_PROGRAM ; defines the boot address for the ROM file
MY_PROGRAM:
; Include here your code
After assembling you will get a corretly sized (8, 16 o 32 KB) ROM file.
The package has got some simple examples. You can also download a full commented opensource game at http://www.robsy.net/progs.htm
At the moment all the documentation and comments are in spanish, but that shouldn't be a problem for you, being brazilian. Anyway, an updated v.0.11 version will be published by the end of this month, with a translated documentation and several other examples and tiny helpful tools (file converters, compressors, examples, etc.)
Another full-source MSX game is coming. And an updated version of the crappy PONG CLASSIC v.0.10 aswell.
Give it a try, Leandro.
Sure I will try it!
Just in case, what do I have in mind...
One or two players game running and shooting just like Son Son, Risky Woods or Metal Slug. Scenery composed by graphic blocks, simple background tune. 10 stages, and graphics would change at each two stages. Scroll would be 8x8 pixels, of course, but enemies would move smoothly (just like in Magical KidWiz). Five bosses that would be just 32x32 pixel sprites. It can be done in 32 Kbytes, I guess.
I wonder if your compiler could be adapted to generate 64, 128, 256 and 512 Kbytes ROMs as well.
I rewrote a hello world that was lying around here somewhere:
; hoi.asm ; bios routine addresses Init32 equ 7bh SetWrt equ 53h ChGet equ 9fh ChPut equ 0a2h ; rom header size 8000h ; 32KB ROM org 4000h ; ROM starts on address 4000h db "AB" dw Start ; init address dw 0,0,0 dw 0,0,0 Start call Init32 ; bios routine to init screen 1 ld hl,6144 ; put writeaddress in registerpair HL call SetWrt ; set vdp for writing from address in HL ld hl,HelloWorldTxt ; put adress of our string in registerpair HL call Print ; subroutine that prints string to screen call ChGet ; bios routine to read a character from the keyboard ret ; return to BASIC ROM Print ld a,(hl) ; put char that HL points to in register A or a ; A=A OR A, and set flags, like the zeroflag when A=0 ret z ; return if the zeroflag is set call ChPut ; bios routine to output char in A to the screen inc hl ; increase the stringpointer jr Print ; jump to start of the routine to print next char HelloWorldTxt ; Label for our string db "Hello World!",0 ; an array so to say :)
Of course I am using SjASM (like "sjasm -l hoi.asm hoi.rom").
To create ROM files, you could use asMSX, that has even a ROM directive.
Of course that it can be adapted for that. All that you need is to import the symbols table, create different files for every ROM page and then just link them alltogether.
Anyway, I would suggest you to start with an easier project. Assembler is tricky, try some basic concepts before starting with a BIG project. And look at ADVENTURE ISLAND, MAGICAL KID WIZ and several others: they are only 32 KB long.
Regards,
Edward Robsy
By the way,
Can I use C and Assembly in MSX together?
If I started a big project...
I'd rather program it in a high level language (Blitz Basic for PC, for instance), but adapting some features to behave like a real MSX. After that I'd start to convert it into Assembly.
My first compiling error in Assembly...
.bios .page 1 .rom .start MY_PROGRAM MY PROGRAM: call Init32
At AsMSX, it returns: Sintax error at line 6...
Your compiler doesn't support spaces in LABELS?
Mea culpa! Now it returns an "undefined identifier" at the "Call Init 32".
.bios .page 1 .rom .start MY_PROGRAM MY_PROGRAM: call Init 32
By the way,
Can I use C and Assembly in MSX together?
You can but beleive me you don't want to