From X-Basic to ROM?

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

By Pineapple

Rookie (28)

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

09-08-2021, 01:25

^BUMP!

Hey, I'm working on a new game, but my BASIC listing is over 16K...
Is there a way to make a .rom file using X-Basic that is larger than 32k?
When I try the same old method of hex editing the basic rom and my larger basic listing together and padding it out to 64K, it doesn't seem to run.

Does anyone know a solution or another option?

By gdx

Enlighted (4814)

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

09-08-2021, 01:55

The simplest solution is to put the BASIC-Kun between 4000h~7FFFh and the BASIC program between 8000h~BFFFh with the following method.

https://www.msx.org/forum/msx-talk/development/convert-a-pro...

If the BASIC program exceeds 16kB, use a ROM mapper and put the half of the BASIC-Kun to another segment of the ROM and a program at 6000h to place the portion that exceeds at C000h in the RAM. Once this part has been copied to RAM, you will just have to put back the BASIC-Kun segment and go back to initialization (restore the main Z80 registers before).

By Pineapple

Rookie (28)

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

09-08-2021, 02:37

Umm... that sounds easy and straightforward at first glance, but I don't understand why there are 17 bytes of data on each line of your provided example instead of 16.

00000h: 42 42 30 40 00 00 00 00 00 00 00 00 00 00 00 00 00
00010h: E5 D5 C5 21 40 40 11 00 C0 01 XX XX ED B0 C1 D1 E1
00020h: C9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

By DamnedAngel

Master (233)

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

09-08-2021, 04:05

An alternative is using Amaury's BAS2ROM:

https://launchpad.net/msxbas2rom

He's getting formidable results from BASIC!

https://www.youtube.com/watch?v=0D6riuN3nB8

By PingPong

Prophet (3793)

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

09-08-2021, 09:10

DamnedAngel wrote:

An alternative is using Amaury's BAS2ROM:

https://launchpad.net/msxbas2rom

He's getting formidable results from BASIC!

https://www.youtube.com/watch?v=0D6riuN3nB8

would be interesting to make a performance comparison between BAS2ROM and X-Basic to see how much the difference is in terms of speed.

By gdx

Enlighted (4814)

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

09-08-2021, 09:39

This Bomberman looks nice!

Pineapple wrote:

Umm... that sounds easy and straightforward at first glance, but I don't understand why there are 17 bytes of data on each line of your provided example instead of 16.

00000h: 42 42 30 40 00 00 00 00 00 00 00 00 00 00 00 00 00
00010h: E5 D5 C5 21 40 40 11 00 C0 01 XX XX ED B0 C1 D1 E1
00020h: C9 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

This is the ROM header + the program below.

	push	hl
	push	de
	push	bc
	ld	hl,04040h
	ld	de,0C000h
	ld	bc,0XXXXh	; Program BASIC lenght that exceeds
	ldir
	pop	bc
	pop	de
	pop	hl
	ret

but if you use the Basic-Kun, you have to move this program to another address and execute it with INIT address (at 4002h) that is free. So use a ROM mapper because there is no place in the BASIC-Kun ROM.

By Pineapple

Rookie (28)

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

10-08-2021, 04:00

DamnedAngel wrote:

An alternative is using Amaury's BAS2ROM:

https://launchpad.net/msxbas2rom

He's getting formidable results from BASIC!

https://www.youtube.com/watch?v=0D6riuN3nB8

I've tried Bas2Rom, but always fails to compile a rom for me.

By DamnedAngel

Master (233)

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

10-08-2021, 17:04

Pineapple wrote:

I've tried Bas2Rom, but always fails to compile a rom for me.

I have just let Amaury (BAS2ROM's author) know about this. He is very active and perhaps he can help you. Did you try to reach him?

By gdx

Enlighted (4814)

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

11-08-2021, 09:54

What is the size of your Basic program exactly? I can make a ROM in the you will just have to insert your program with a hexa editor if you want.

By Arjan

Paladin (747)

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

11-08-2021, 10:02

A simple program like this works:

10 DEFINT A-Z
20 TIME=0
30 FOR I=1 TO 100
40 FOR J=1 TO 100
50 FOR K=1 TO 100
60 L=I+J+K
70 NEXT K
80 NEXT J
90 NEXT I
100 PRINT TIME

I used notepad++ as editor, text saved as plain text, windows line endings. I don't know how MSXBAS2ROM handles different character encodings and line endings.

Compile with:

MSXBAS2ROM.EXE TEST.TXT -C

I tested the resulting ROM in Bluemsx (emulating MSX2), it takes about 5051 frames to complete. I also tried with XBASIC, then it takes 3197 frames to finish the program.

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