Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Meka Ram to BASIC Program list - txt format

Reply to topic
Author Message
  • Joined: 08 Aug 2005
  • Posts: 203
  • Location: Italy
Reply with quote
Meka Ram to BASIC Program list - txt format
Post Posted: Thu Feb 09, 2006 8:59 am
Hi to all,
Thanks to the help of the Tape format documents, available in this site, and thanks to kerrjnr for the list of Basic command codes, and also the Bock's suggestion, I worked to the RAM dump of MEKA.
I was able to write a very simple Basic program to test this possibility.
This program needs some debug and some more features but the result is not bad...

here it is the "DEMO #1 .bas" extracted from the system disk "Sega Disk Basic v1.0p (SF-7000).sf7". Just typed "FILES", loaded "DEMO #2 .BAS" and dumped RAM.

The program starts from &HB70F with the first byte, which describes the length of the basic line. Just ignore it ( not useful to the conversion ) and start with the line number bytes. Basically the byte sequence is the same of the tape format... so:
length byte, line number, commands and text, [CR] and so on...

My program extracts all lines checked by a minimal interpreter, which handle PRINT instruction with quotes, and DATA.

Here is the example...

The RAM Dump:

http://us.f1.yahoofs.com/bc/5bfe47d_m418a4d1f/bc/I+miei+documenti/RAM?bfCIw6DBe_Rvx2mP

The Text file produced:

http://us.f1.yahoofs.com/bc/5bfe47d_m418a4d1f/bc/I+miei+documenti/list.txt?bfCIw6DBXjXPT_yG

I think this utility is useful to those who still like program the SC3000, and need the full program printed for the debug. They will be able to convert the memory and have the full program list to print.
But, there is a problem... the character set is different from the char set of the windows fonts... so i wrote a SC3000 raster font for windows.

If you open text files produced with my utility in notepad and choose SC3000 font you will see all the characters of the SC 3000, including special graphic characters.

I don't know if this fonts already exists in the web but here it is for you:

http://us.f1.yahoofs.com/bc/5bfe47d_m418a4d1f/bc/I+miei+documenti/SC3000x2.FON?bfCIw6DBMWsjc143

Just load into fonts directory of windows.

Now I will clean the code and fix some bugs. Then i will publish it to you all.
I will leave it in BASIC so that everyone can read it with simple language programming knowledge.
Maybe it can be helpful for somebody.
Bye, bye.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Thu Feb 09, 2006 9:23 am
None of your Yahoo links work for me. If you email the files to me I can put them online, or you can use a free file-sharing host.

For the font, I'd be surprised if there are many characters that don't have a Unicode representation - so you could get it working without requiring a custom font.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Aug 2005
  • Posts: 203
  • Location: Italy
Reply with quote
Just have done :-)
Post Posted: Thu Feb 09, 2006 10:04 am
I've sent you the files...
For the font, i didn't exactly undersand what do you mean, but, the font is a raster font, created from a bitmap.
The main use of this font is with notepad to see all the SC3000 character set.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Thu Feb 09, 2006 11:02 am
Regular ASCII text uses characters 0 to 255, but Unicode uses characters 0 to 4294967295 (UTF-32). You can use the 16-bit version in most cases, however, and Notepad will open the file with no problems.

Some of the characters are hard to match - I can't find a Unicode "Skull" but there is a "Skull and crossbones", but there are plenty of smiley faces, playing card symbols and box/line drawing characters. Here's a demo, from the files you just sent me:

1200 PRINT"☠";
1240 PRINT"█";
2090 PRINT"▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒";
4320 DATA┌──┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
4330 DATA│  │2│3│4│5│6│7│8│9│A│B│C│D│E│F│
4340 DATA├──┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┤
4350 DATA│  │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
4360 DATA└──┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘

Unfortunately, it's somewhat dependent on having a fixed width font with all the characters in it and having the same width; Courier New does OK with the boxes but the skull is too wide, Lucida Console seems best in my limited test.

However, I can see the advantage of using the SC-3000 font in these cases.

I've put your files in a 111KB ZIP here:

http://www.smspower.org/misc/SC-3000_basic_ram_to_text_example.zip

Did you notice that you can dump Meka's RAM as a binary file (64KB in the case of the SF-7000) ? It'd save a little space and probably make parsing it a great deal easier.

I had some problems with the @ symbol in your SC3000x2 font, by the way.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Aug 2005
  • Posts: 203
  • Location: Italy
Reply with quote
Post Posted: Thu Feb 09, 2006 11:17 am
Ah, OK.... Now i understand...
I decided to make a custom font to avoid those problems... Uhm what kind of keyboard layout do you have ? To have a "@" with italian layout, i need to press Alt gr and the key next to "L" (ò), in english i suppose you press SHIFT and "2"... anyway if you compare the char table of an Arial to the SC3000x2 the keycode is the same H40... I don't know what kind of problems they might be...

Yes i saw it can be possible, i used the txt one to have some more readable info to study the file. :-)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Thu Feb 09, 2006 11:33 am

Any line with an @ gets rendered in a different font, but seems OK with the non-zoomed font (maybe, it seems to be blurry). I can easily type @ on my UK and US keyboards :)
  View user's profile Send private message Visit poster's website
  • Joined: 08 Aug 2005
  • Posts: 203
  • Location: Italy
Reply with quote
Post Posted: Thu Feb 09, 2006 11:57 am
Uhm, strange... i don't have problem... and it doesn't blur...

at normal size



doubled



maybe are problems with font rendering of Windows...
do you use Notepad ?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Thu Feb 09, 2006 12:20 pm
That was in Notepad, Windows XP as-up-to-date-as-it-can-get, maybe the problem is that I have international font support set up (far-eastern characters) and Windows is wrongly thinking this line needs an alternative font to render correctly. Testing alternative editors, UltraEdit gets it even more wrong, and ConTEXT works perfectly.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Aug 2005
  • Posts: 203
  • Location: Italy
Reply with quote
Post Posted: Thu Feb 09, 2006 12:33 pm
ah, ok....
at least it works someway :-))
  View user's profile Send private message Visit poster's website
  • Joined: 08 Aug 2005
  • Posts: 203
  • Location: Italy
Reply with quote
Post Posted: Thu Feb 09, 2006 4:29 pm
Maxim, i've just sent you some files to check regarding the ram reader... hope they are useful.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!