Automatic Screen 2 to Screen 4 rom loader

Page 1/2
| 2

By retrocanada76

Champion (460)

retrocanada76's picture

25-11-2011, 05:39

Hi all,

Investigating the sprites 2 for my game came up an ideia for this new tool.

It's in my page:

http://sites.google.com/site/msxengine/sc4-rom-loader

enjoy

Login or register to post comments

By Vampier

Prophet (2297)

Vampier's picture

25-11-2011, 06:57

Nice tool; will you be implementing a way to load new sprites? (I guess it'll take more memory too now)

By PingPong

Prophet (3447)

PingPong's picture

25-11-2011, 08:23

Hi all,

Investigating the sprites 2 for my game came up an ideia for this new tool.

It's in my page:

http://sites.google.com/site/msxengine/sc4-rom-loader

enjoy
can you explain in detail the trick?
(do you replace some bios calls ?)

By Vampier

Prophet (2297)

Vampier's picture

25-11-2011, 09:21

Hi all,

Investigating the sprites 2 for my game came up an ideia for this new tool.

It's in my page:

http://sites.google.com/site/msxengine/sc4-rom-loader

enjoy
can you explain in detail the trick?
(do you replace some bios calls ?)

check the included asm file

By ARTRAG

Enlighted (6243)

ARTRAG's picture

25-11-2011, 10:01

IIRC Thexder uses sprites for main laser. Have you tested the rom disabling sprites?

By norakomi

Paladin (992)

norakomi's picture

25-11-2011, 10:01

You said stuff slows down alot...
You can speed up the stack watcher:

STACK_WATCHER:
LD HL,0
ADD HL,SP ; this resets carry
EX DE,HL
LD HL,RELOC_ADDR
SBC HL,DE ; no need for AND A
RET NC
.BAD_STACK:
LD HL,-40
ADD HL,DE
LD DE,RELOC_ADDR - 42
LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI LDI
LD HL,RELOC_ADDR - 42
LD SP,HL
RET

And when you copy the sat you can
ld b,16
ld a,[SPR_ATR+3]
.COLOR_LOOP:
out (0x98),a
inc de
djnz .COLOR_LOOP

completely write out the loop:
out (0x98),a
inc de
out (0x98),a
inc de
out (0x98),a
inc de
16x in total.
that saves time, and you save your b register.
you have the ram space so that wont be a problem either.

also can't you combine the sat and the stack watcher routine ? so you dont have to double use the push af push bc push de push hl pop hl pop de pop bc pop af ?

By slowerisbetter

Master (194)

slowerisbetter's picture

25-11-2011, 12:11

Very cool work; I had something like that on my todo list Smile

By retrocanada76

Champion (460)

retrocanada76's picture

25-11-2011, 15:08

In fact the code must be as compact as possible to avoid being overwritten by the game.

There is an optimization to do, once I find a sprite at line 206 I update its Y as 216 value and exit. Also the stacker watcher seems to be useless.

I can add more color to the sprites, creating a stripe pattern: for example a blue sprite would be drawn as dark blue/blue pattern. Dunno if it will improve or make it worse Tongue

By retrocanada76

Champion (460)

retrocanada76's picture

25-11-2011, 18:17

updated to v0.2: Better perfomance and stack watcher removed.

By Vampier

Prophet (2297)

Vampier's picture

25-11-2011, 19:01

lol Smile I clicked download just as you uploaded a new version Smile (v3 is out!)

ps will the tool work with dos2?

By retrocanada76

Champion (460)

retrocanada76's picture

25-11-2011, 19:02

Better stability. The new version was crashing with Twinbee before the first boss.

Page 1/2
| 2