Choice4genesis - a ChoiceScript clone for the Sega Genesis

This is a ChoiceScript clone that generates Sega Genesis ROMs. If can be used for visual novels or simple multimedia presentations.

It takes a bunch of scripts and images and, from that, it generates SGDK-compatible .c and .res files. Those are then compiled into a Sega Genesis compatible ROM, which can be run on an emulator or even on real hardware.

The syntax of the scripts is somewhat based on ChoiceScript, but it is not exactly the same.

Please note that this is an early work and progress, and it is not as stable or user-friendly as it is planned to become.

Version 0.0.1 of the tool: https://github.com/haroldo-ok/choice4ge … nspiler.7z
Video for version 0.0.1: choice4genesis version 0.0.1 - YouTube

Page on itch.io: choice4genesis - a ChoiceScript clone for the Sega Genesis by haroldo-ok
Github repo: GitHub - haroldo-ok/choice4genesis: A ChoiceScript clone that generates SGDK-compatible C source for the Sega Genesis

Example script:

* font "damieng.com - Hourglass font.png"
* background "Blue Hedgehog.png"
* choice
	# Play some music
		* music "Actraiser - Fillmore.vgm"
		OK, playing Fillmore, from Actraiser.
	# Show a smiley
		* image "Smiley.png", at(30, 3)
		OK... showing a smiley!
	# Third choice
		You chose the third one
		* choice
			# Yet another choice
				You chose this.
			# One more choice
				You chose that.
This is a test.
Second line.
Third line.
11 Likes

Interesting?

Hi @Haroldo_Pinheiro very interesting approach. Unfortunately I don’t own a Sega Genesis and I can’t play with it. I am just curious about what motivated you to do this. By the way, I would love a Commodore 64 port, so we could play CS games there!

2 Likes

I’m implementing this partially because:

  • I like creating tools;
  • I wanted to create something for the Sega Genesis;
  • And I wanted to create a more powerful version of GINCS.

Of course, since it generates C code, it should be relatively easy to make it generate code for other platforms.

As for the C64, well, there is another project by me called BlocklyVN8bit, thouh this one is not based on Choicescript :GitHub - haroldo-ok/BlocklyVN8bit: This is a mashup between BlocklyVN32X and 8Bit-Unity. It allows you to make Visual Novels for classic 8bit computers and consoles, using a visual scripting language.

Now that I think about it, both tools ended up generating very similar C source…

2 Likes

Haroldo_Pinheiro

Hello, again;
Version 0.3.0 has been released!

Commands implemented between 0.0.1 and 0.3.0 are:

  • sound for playing digitized sounds and voices;
  • stop: to stop sound and/or music;
  • create, temp, set for variable creation and manipulation;
  • if, elseif and else for conditional execution
  • goto_scene to jump to another scene script.

I would link to the transpiler and sample ROM, but the forum is not allowing it… :sweat_smile:

2 Likes

Hello, again;

Version 0.6.0 is now available!

Implemented between 0.3.0 and 0.6.0:

  • Added a few improvements on the command line tool:
    • It is now possible to choose which project to compile;
    • The command line tool can now invoke the SGDK compiler to convert the generated .c and .res files into ROMs;
    • The command line tool can now call the emulator after compiling;
    • It is now possible to call a command line menu to compile the projects interactively.
  • Added language features:
    • Now it is possible to use print a numeric variable in the middle of a text line by using ${expression};
    • window: allows to change the location of the text window;
    • flush: immediately displays the contents of the text buffer on the text window; it may or may not wait for a button press;
    • clear: clears a layer/region of the screen.
2 Likes

Hello, again!

Version 0.12.0 has been released.

Implemented between 0.6.0 and 0.12.0:

  • 0.7.0: Implement title, author and while commands;
  • 0.8.0: Customize cursor and allow to select image layer;
  • 0.9.0: Implement automatic word wrapping for the text boxes;
  • 0.9.1: Fix image and sound related code to check if the referenced file exists;
  • 0.10.0: Allow the use of native C functions;
  • 0.11.0: Automatically convert images to 16 colors, if necessary;
  • 0.11.1: Fix background palette bug;
  • 0.11.2: When clearing the foreground, deallocate the tiles used by the *image command;
  • 0.12.0: Implement support for ADPCM for both music and sound.
1 Like

Also, Ren Py’s “The Question” has been ported to Sega Genesis through the “choice4genesis” engine.

Itch.io page: The Question - ported to Sega Genesis / Mega Drive by haroldo-ok