Vertical scrolling routine (MSX1)

Page 9/12
2 | 3 | 4 | 5 | 6 | 7 | 8 | | 10 | 11 | 12

By hit9918

Prophet (2868)

hit9918's picture

15-01-2019, 01:28

Quote:

Instead of:
LD A,(HL) ;8
ADD A,128 ;8
LD (HL),A ;8

I use
SET 7,(HL); 17
To subtract 128 I use RES 7,(HL)

you could save all the toggeling forth and back of the RAM nametable when you simply set bit 7 in every second copy to the vram nametable!

By santiontanon

Paladin (834)

santiontanon's picture

15-01-2019, 02:20

ah, good optimization! I always forget when optimizing that most operations can be done directly with (hl), without having to bring the data to a register Smile

By thegeps

Champion (273)

thegeps's picture

16-01-2019, 19:45

I think the best optimization would be reading uncompressed map directly from memory with an offset, so there will be no LDDR of "in RAM nametable" on 8th frame...
But a map of 256x32 tiles is 8Kb long. The map you all saw in video was 280x32. I think a good map would be 512 rows. So i need 16kb for every level of a hypothetical game. About 10 levels? so I need 160kbytes only for store maps.
A megarom? I think so. Someone can explain me how can I do it? Or link me somewhere Wink

By TomH

Champion (327)

TomH's picture

17-01-2019, 16:29

In that scenario you can keep the levels compressed as their permanent storage, but decompress them into a 16kb buffer before a level begins.

By thegeps

Champion (273)

thegeps's picture

17-01-2019, 16:45

Yep, but still I don't know how create a ROM nor the best mem configuration. Someone will teach me, please?

By Grauw

Ascended (8457)

Grauw's picture

17-01-2019, 17:35

thegeps wrote:

A megarom? I think so. Someone can explain me how can I do it? Or link me somewhere Wink

Here is a page that describes the different ROM mappers.

I’d suggest ASCII8 as a first choice.

The ROM binary you create is just cut into 8K chunks, and the chunk with the index you write to the bank registers of the mapper is visible in the corresponding memory region.

By thegeps

Champion (273)

thegeps's picture

17-01-2019, 18:25

Thank you!

By thegeps

Champion (273)

thegeps's picture

17-01-2019, 19:12

I feel as I am a donkey... is there any tutorial about creating a ROM file, how configure and manage it? A guide from A to Z, possibly with some code examples?

By Grauw

Ascended (8457)

Grauw's picture

17-01-2019, 19:31

Here’s “Hello World” as a 16K ROM:

https://bitbucket.org/grauw/glass/src/@/examples/hellorom.asm

Here’s some official documentation:

MSX2 Technical Handbook: Developing cartridge software

In short: the signature starting with “AB” at the beginning provides the initialisation address. When you want to make a 32K ROM, only the first half is automatically paged in to page 1 (4000H-7FFFH). To page in the second half, determine the slot ID of page 1 with a GetSlot routine, and use ENASLT to also enable it in page 2. Then, if you want to use more than 32K by using a MegaROM mapper, write the segment number to the mapper’s corresponding memory address to select a bank.

By thegeps

Champion (273)

thegeps's picture

17-01-2019, 23:40

That's the answer I was looking for! So I can start studying ROM stuff Big smile
Thank you VERY much Grauw! You are always a great help (in a lot of posts. yes, I'm reading them all, a bit every day. I'm at page 42 of development forum). I'll return ASAP with a ROM file (no more CAS for me XD)

Page 9/12
2 | 3 | 4 | 5 | 6 | 7 | 8 | | 10 | 11 | 12