Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 20, 2012 9:22:27 GMT -5
The ideal end result would be to ditch the BEX IDE altogether Nobody is preventing you from writing a BEX alternative. There are a bunch of open-source BASIC to 68K compilers available, so you won't even have to do the hardest part yourself.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 20, 2012 9:43:16 GMT -5
Links and names pretty please? I assume you have some in mind that would work well? 68k is just the processor. I don't think I've seen anything that specifically targets the Genesis as a platform.
Also, I'd rather not reinvent the wheel all by my lonesome. I'd rather improve what already works with a community. Why build a new IDE and assembly library from scratch when we can just configure a lexer and improve Devsters existing code?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 20, 2012 10:17:30 GMT -5
Links and names pretty please? ETP-Basic for example. I don't think I've seen anything that specifically targets the Genesis as a platform. That's not how it works. A 68K compiler can be used for the Megadrive, Neo Geo, CPS-2 etc. It simply depends what code you feed it. Also, I'd rather not reinvent the wheel all by my lonesome. I'd rather improve what already works with a community. Why build a new IDE and assembly library from scratch when we can just configure a lexer and improve Devsters existing code? Agreed .. but Code::Blocks is a IDE that comes with MinGW which is a C / C++ compiler, not BASIC.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 20, 2012 10:30:26 GMT -5
Code::Blocks is an IDE that is configurable for many languages. Support for each language is stored in an XML file that is considered a "lexer" configuration file. Eclipse and SciTE also support configuration for different languages.
Here is a quote from some Scintilla documentation to better understand what a lexer is:
We already know what files BEX uses to compile code, right? basicasm.cni basicstr.s and basicdat.s
We already know what it passes to ASMX at compile time: ASMX.EXE -e -b -d SegaCart -d REGSPACE=16711680 -d TILE_UNSET=0 -d TILE_SET=1 basic.s -x basic.bin
Really, to use Code::Blocks, Eclipse or SciTE is just a matter of configuration. We already know what libraries to use and what compiler to call.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 20, 2012 11:29:37 GMT -5
Code::Blocks is an IDE that is configurable for many languages. Support for each language is stored in an XML file that is considered a "lexer" configuration file. Eclipse and SciTE also support configuration for different languages. You're talking about syntax highlighting .. just because you can configure Code::Blocks to highlight BASIC syntax nicely, doesn't mean it ( MinGW / GCC ) can suddenly compile it. We already know what files BEX uses to compile code, right? What you're referring to assembling 68K code into a binary. Compilation of BASIC into 68K happens internally in BEX.
|
|
|
Post by Tom Maneiro on Jun 20, 2012 17:38:23 GMT -5
I want NetBeans support, kthxbai.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 20, 2012 18:18:21 GMT -5
I'm pretty sure you can change what compiler is used. Nevertheless, I think you're right about parsing BEX into assembly. I totally missed that for some reason. The BEX license doesn't allow for decompilation so I can't see how it puts down blocks of BEX assembly. Tom, yes, it can be done: wiki.netbeans.org/How_to_create_support_for_a_new_languageJust that we'd have to clean room reverse engineer the BEX parser. I don't know if I'm up to that
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 20, 2012 19:06:30 GMT -5
I'm pretty sure you can change what compiler is used. Certainly, most IDE's work with a external compiler. Nevertheless, I think you're right about parsing BEX into assembly. That process ( from BASIC to 68K ) is called compiling .. not parsing Just that we'd have to clean room reverse engineer the BEX parser. I don't know if I'm up to that Not really, use ( for example ) ETP-Basic instead.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 21, 2012 8:52:58 GMT -5
Doesn't the process go BEX -> ASMX -> 68k binary? In that case, isn't BEX just parsing the BASIC statements and spitting out ASM source (copied from BEX assembly libraries) to be compiled by a, er, compiler (ASMX)? Not arguing: just making sure I understand your explanation.
As for using ETP-Basic, are you saying use that and the BEX libraries as inline assembly? Just because a compiler supports, say, a z80 doesn't mean it has libraries to support a Gameboy..
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 21, 2012 10:46:19 GMT -5
Doesn't the process go BEX -> ASMX -> 68k binary? Correct, the first part of the process ( BASIC -> 68K assembly ) is done by the compiler ( BEX ) and is called "compiling". The second part of the process ( 68K assembly -> binary ) is done by the assembler ( ASMX ) and is called "assembling". As for using ETP-Basic, are you saying use that and the BEX libraries as inline assembly? Not as inline assembly, but as a function library ( just like in BEX ). Anyway, no offence .. but judging from the replies in this thread I doubt you have the skill-set to develop a BEX replacement. Neither do I by the way .. even though I've got experience coding emulators & assemblers.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 21, 2012 11:52:28 GMT -5
None taken. I'm just starting to puzzle out how to make my own programming language using a brutally simple syntax.
I guess it's back to a common BEX user function/routine library. One document with attribution with all the useful code we've been spreading across this forum. Sega16s Robotniik code needs to be combed over for useful functions.
|
|
|
Post by sega16 on Jun 22, 2012 8:26:26 GMT -5
In robotnik there are a few useful function the menu system hightlight related stuff is in my opinion innovative because it does not use an excessive amount of if statements here is how it works first we have the joypad reading function I have added a few comments
while 1 a=0: while a=0: a=joypad(): wend if a.0 Then if menu_branch = 0 then 'this should be improved menu_branch=0 else menu_branch-- endif gosub calulatemenu waitpadup endif if a.1 Then menu_branch++ gosub calulatemenu waitpadup endif if a.7 Then waitpadup goto menu_branch 'exit out of loop endif sleep 1 wend
so now for the calculate menu function that handles all the drawing
calulatemenu: theink=0 set_ink theink Locate 5,12 : print "play the game" theink++ set_ink theink Locate 7,12 : print "snd test" theink++ set_ink theink Locate 9,12 : print "Help" ink 0 return Declare Sub set_ink(current_ink as integer) 'This function helps reduce repetitive code if menu_branch = current_ink then ink 2 else ink 0 endif end sub
and finally we have the code that determinants which
menu_branch: 'randomize I don't know why I had that there because there is nothing that uses the random function if menu_branch=1 then goto sndtest endif if menu_branch = 2 then goto read_game endif if menu_branch=0 then goto intro endif if menu_branch = 3 then gosub special_stage endif
Also about the compression I did not write any of the compression code and LoadtilesAsm is not mine either. Also if I remember right the LZSS decompression does not work and also when looking though the code there is some unused stuff so be aware of that but it can still be useful.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 22, 2012 10:05:01 GMT -5
The DrawTiles16 was originally Mairtrus but Sega16 modified it to work (better)? Just making sure I know the people who contributed so I can put that in the header.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jun 22, 2012 10:14:02 GMT -5
The only thing sega16 "changed" was that he removed the comments on how to use the function.
' d0=X, d1=Y, d2=Largo, d3=Alto, d4=Opcional Apart from that it's identical to what Mairtrus posted back in 2010.
|
|
|
Post by sega16 on Jun 22, 2012 12:25:32 GMT -5
I don't think I removed the comment on how to use it on purpose but anyways this was made over a year ago and I am already forgetting stuff about it and NO I did not modify the drawtiles16 at all NemDec and Kosdec are from the sonic 1 assembly Aplib compression is from sixpack which is a tile converter the Lszz is also from sixpack but I could not get it to work for some reason but I accidentally left it in there. Here is sixpack jiggawatt.org/badc0de/sixpack/
|
|