How to create a ROM file?

Страница 3/4
1 | 2 | | 4

By NYYRIKKI

Enlighted (6033)

Аватар пользователя NYYRIKKI

26-01-2019, 11:00

thegeps wrote:

So I simply asked (I think it's a clear question) if a rom file is a bin file with simply changed extension (with the right header of course). Is it so difficult to have a clear answer about a clear question? yes or no.

No

bin-file is a standard way to store binary data on cassette, disk or HDD. ROM-file is not a file standard at all. It may or may not include header (ie. MSX-BIOS ROM does not) and you can't even think it has file header as sometimes the "header" is not at beginning of file. ROM-file is just a dump of content of ROM-chip put in to a file as is. It does not even store information how the ROM is connected to MSX. Usually emulators use either heuristic approach or checksum to know/guess how the ROM should be connected.

When you develop MSX cartridge instead of file to be loaded the biggest difference is that the program is really stored in ROM instead of RAM. This means, you can't use self modifying code or place variables between code blocks. When BIN-filed is loaded the situation is very clear: Bottom half of memory contain MSX-BIOS & BASIC and upper half of memory contains RAM. When ROM is started the situation depends of many things... Usually program is started with interslot call to address in header and that alone gives quite a few options how the memory may end up looking from program perspective.

By thegeps

Paragon (1174)

Аватар пользователя thegeps

26-01-2019, 11:49

Thank you Smile I have another question: I have created a 32k ROM, in slot 1 and 2. Can I use slot3 RAM? I'm trying to unpack in RAM from C000h the tilemap but it seems not to work. Then I've copied only first screen (704 byte, that is already unpacked in ROM from C000H with a LDIR) but it shows only the first 3 tiles on screen! oO Is there someone else I have to know?

By Manuel

Ascended (19298)

Аватар пользователя Manuel

26-01-2019, 12:11

Do you mean page, where you said slot?

By thegeps

Paragon (1174)

Аватар пользователя thegeps

26-01-2019, 12:40

yep, my fault. Pages. I have a 32k ROM in pages 1 and 2 from 4000h to BFFFh

By Parn

Paladin (833)

Аватар пользователя Parn

26-01-2019, 12:48

Yes, you can use RAM in page 3. Just try to stay clear of the system variables, which on a disk system start around $F300. Better avoid using the area above $F000. More experienced coders may give better advice. Tongue

By thegeps

Paragon (1174)

Аватар пользователя thegeps

26-01-2019, 12:51

yep, I've just attempted in another way to see where's the problem and saw that RAM is still there (I filled first 704 bytes with 0 and my draw routine copy exactly them in nametable)

By Grauw

Ascended (10706)

Аватар пользователя Grauw

26-01-2019, 12:52

Parn wrote:

Yes, you can use RAM in page 3. Just try to stay clear of the system variables, which on a disk system start around $F300. Better avoid using the area above $F000. More experienced coders may give better advice. Tongue

Isn’t it way lower? Somewhere around D400H? You can know where the top of the usable memory is by inspecting the stack pointer.

By Parn

Paladin (833)

Аватар пользователя Parn

26-01-2019, 13:07

Grauw wrote:

Isn’t it way lower? Somewhere around D400H? You can know where the top of the usable memory is by inspecting the stack pointer.

Eek!

I'm sorry, I don't know where in my mind I was when I wrote that. Maybe I was thinking of the interslot calls, I don't know. Very embarrassing.

Maybe $E400? That's a bit less than the top of free memory when you just boot a turboR.

By thegeps

Paragon (1174)

Аватар пользователя thegeps

26-01-2019, 13:09

So I have another bug XD. Have I do something particular for read data in page 2? I have stored my map there and first 704 bytes are start screen uncompressed. I did this:
LD HL,LEVEL1MAP
LD DE,(NAMETABLE)
LD BC,704
LDIR
but it seems not to work. attempted also without ldir in this way:
ld hl,LEVEL1MAP
ld de,(NAMETABLE)
ld c,3
ld b,192
looppr:
ld a,(hl)
ld (de),a
inc hl
inc de
djnz looppr
dec c
jp nz,looppr

but did'nt work. Seems I can't access page 2 oO

By Manuel

Ascended (19298)

Аватар пользователя Manuel

26-01-2019, 13:08

Did you try to debug it with a debugger?

Страница 3/4
1 | 2 | | 4