How to do a MegaROM?

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

By thegeps

Master (254)

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

05-09-2019, 20:24

Hi all! I know how to do a ROM, but the space is about to end... So I need to do a MegaROM but I don't know how...
Can someone teach me? I'd like to view the assembly code (I don't get this subslot system oO ) and how to use subslots, where I have to put them etc, etc. Extra space will be only for data (graphics, music, eventlists and enemy patterns) so I won't use interslot calls. Waiting for your knowledge guys!

Для того, чтобы оставить комментарий, необходимо регистрация или !login

By Manuel

Ascended (15686)

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

05-09-2019, 21:11

I'm not sure why you need subslots and stuff. A MegaROM is the same as a ROM, but you can change different parts of the ROM area by writing to certain memory locations. The slot remains the same as before, where your ROM is in.

By Thom

Hero (576)

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

05-09-2019, 21:38

By thegeps

Master (254)

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

05-09-2019, 23:55

Thank you all. Manuel I, I read about creating ROM files long time ago, and I don't rember a lot (I just use the same starting code to create them). I asked just because I want to know about those memory locations and how to "set" those different parts of ROM: Have I to write them after the parts I yet have? For this reason I asked a assembly code, just to have a clear example to "how to do"

By gdx

Prophet (2977)

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

06-09-2019, 01:17

You can use the instruction .PHASE in your program in assember, or create a separate program to merge the assembled segments with concat, or use the instruction INCBIN in an extra program in assember to create the MegaRom file with the assembled segments.

By Manel46

Champion (428)

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

06-09-2019, 20:24

This is an example rom, with ascii16 mapper.
I can explain the details.
It is for the cross assembler sjasm.
It is about connecting momentarily, the necessary pages in "_bank2" (# 8000 / # bfff), to make use of the graphics, etc.
I clarify that to connect a page is done:
LD A, 5
LD (_bank2), A
This connects page 5
LD A,: LABEL1
Type in A the page number that contains LABEL1.

https://drive.google.com/open?id=1NyKgUosodk-n9F1bNK_DZl2YJG...

By Grauw

Ascended (8382)

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

06-09-2019, 21:00

ROM banks just follow each other sequentially in a ROM file. For a 16K mapper the first 4000H bytes are the first bank, the second 4000H bytes the second, the third 4000H bytes the third, etc. Selecting a bank is done by writing the bank number to a mapper-specific memory address. I recommend ASCII8 to start with.

The easiest way to start a new ROM bank in code is to first pad until the end of the current bank:

ds -$ & 1FFFH  ; for 8k mappers
ds -$ & 3FFFH  ; for 16k mappers

And then reset the org address to match the page where the code that follows will be accessed:

org 8000H

Some assemblers like Pasmo handle org strangely so they are not suited for making megaroms.

By Manel46

Champion (428)

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

06-09-2019, 20:51

Look at the list, friend.
Sjasm, calls each part of 16kbs a page that we connect in bank 2. Or 1, for ascii16, of course.
Okay, the definition of pages is what you say.

By Grauw

Ascended (8382)

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

06-09-2019, 20:54

What?

By Manel46

Champion (428)

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

06-09-2019, 22:10

Excuse me. What what? Smile
Explaining the list, I mean pages, as they appear named in it. Which are actually segments to be placed on page 2. I am interested in ascii16, because of the large volume of the graphics I use.

By Grauw

Ascended (8382)

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

06-09-2019, 22:31

Oh I see by list you were referring to BiFi’s Megabit ROM documentation.

Terminology of pages/banks/segments is often mixed up so it’s best to just read the underlying intention. (If you are interested in my thoughts on what is the correct terminology, there’s a thorough discussion in the wiki discussion thread from a few months ago Smile.) But anyway it doesn’t really matter in the end, as long as we understand each other.

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