Over the last few weeks, I've been working on a new Genesis/Mega Drive compiler. I know most of you here prefer C or ASM, so this may disappoint you a little bit, but it's a BASIC compiler called Second Basic.
*dodges a tomato or 12*
Don't get me wrong, I know C is generally a better compiler, but I have this special place in my heart for BASIC.
Onto some details:
It's using BEX's ASM library, for the most part. I've asked Devster about it previously, even posted on his forums about it, so while I haven't heard anything back, I'm going to assume for the time being that it's okay to use his ASM library (if he does object, I'll respect his wishes, of course).
I know BEX gets a lot of flack, and while the ASM library isn't the best that it could be, it's just a starting point until I get a better grasp on ASM (which this project has definitely helped that process quite a bit!) and can do what I can to improve the behind-the-scenes stuff.
Anyway, it's still early in the builds and only supports a handful of commands at the moment, but I did hit a big milestone in that it's actually functional with math operations, variables (including arrays as of last night), and a lot of fixed functionality that was either broken in BEX, or just wasn't there.
Here's a quick video of an earlier build from last week: https://www.youtube.com/watch?v=XjMke6H ... e=youtu.be
Here's the code used in the video:
Code: Select all
players = 1
IF players < 2 THEN
pal& = LBLPTR&(sdpal)
END IF
PALETTES pal&,0,0,16,224 ' set the palette to black
PRINT "Fading Test"
FOR i = 7 TO 0 STEP -1
PALETTES pal&,0,0,16,i<<5
SLEEP 3
NEXT
sdpal:
DATAINT $0EEE,$0EC4,$0EA2,$0CA4,$0C60,$06CE,$008E,$006E ' Palette: 0
DATAINT $000E,$0802,$0A82,$0000,$0CCC,$048E,$0ECE,$0ECE
DATAINT $0CCC,$0CA2,$0C80,$0A82,$0A40,$04AC,$006C,$004C ' Palette: 0
DATAINT $000C,$0600,$0860,$0000,$0AAA,$024C,$0CAC,$0CAC
DATAINT $0AAA,$0A82,$0A60,$0860,$0820,$028A,$004A,$002A ' Palette: 0
DATAINT $000A,$0400,$0640,$0000,$0888,$002A,$0A8A,$0A8A
DATAINT $0888,$0860,$0840,$0640,$0600,$0068,$0028,$0008 ' Palette: 0
DATAINT $0008,$0200,$0420,$0000,$0666,$0008,$0868,$0868
DATAINT $0666,$0640,$0620,$0420,$0400,$0046,$0006,$0006 ' Palette: 0
DATAINT $0006,$0000,$0200,$0000,$0444,$0006,$0646,$0646
DATAINT $0444,$0420,$0400,$0200,$0200,$0024,$0004,$0004 ' Palette: 0
DATAINT $0004,$0000,$0000,$0000,$0222,$0004,$0424,$0424
DATAINT $0222,$0200,$0200,$0000,$0000,$0002,$0002,$0002 ' Palette: 0
DATAINT $0002,$0000,$0000,$0000,$0000,$0002,$0202,$0202
DATAINT $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000 ' Palette: 0
DATAINT $0000,$0000,$0000,$0000,$0000,$0000,$0000,$0000
The reason why I decided to start this project is because I've started running into a lot of annoyances with BEX (such as if you accidentally double tap F5, the IDE will crash and all unsaved work will be lost), and more annoying than that is the compiler error that occurs after the code reaches a certain length, or too many user functions are created. I wrote a program to fix the compiler issue (change BSR to JSR) so that this wasn't an issue anymore, but instead of writing little add on applications to keep a presumed project as dead (no updates in almost 5 or 6 years, Devster rarely posts these days), I figured it would just be better to rebuild the compiler and use the existing ASM framework for compatibility and to save time (aside from learning ASM or C)
Anywho, I can hardly wait until it's ready for an actual release!
Cheers!