TailChao Posted November 24, 2003 Share Posted November 24, 2003 My demo has nearly exceeded the limits of ram, and I need to add a point where it loads from the cartridge, how should I set this up in BLL? Edit: I'm coding in Assembler. Quote Link to comment Share on other sites More sharing options...
+karri Posted November 25, 2003 Share Posted November 25, 2003 You need to read the file entry from the cart and then read the block somewhere. I don't know if the code is in BLL. I use the file.m65 from the C compiler (newcc65/libsrc/lynx/file.m65). struct fileentry { uchar StartBlock; uint BlockOffset; uchar ExecFlag; char *DestAddr; uint FileLen; }; extern struct fileentry FileEntry; uchar buffer[256]; -- Cheers, Karri Quote Link to comment Share on other sites More sharing options...
sage Posted November 25, 2003 Share Posted November 25, 2003 My demo has nearly exceeded the limits of ram, and I need to add a point where it loads from the cartridge, how should I set this up in BLL?Edit: I'm coding in Assembler. Use the macros given in "file.mac". Tschau, Sage Quote Link to comment Share on other sites More sharing options...
Matthias Posted November 25, 2003 Share Posted November 25, 2003 Hi! My demo has nearly exceeded the limits of ram, and I need to add a point where it loads from the cartridge, how should I set this up in BLL?Edit: I'm coding in Assembler. Use the macros given in "file.mac". Tschau, Sage But do we have a good description of the usage of the Lynxer-tool meanwhile? For those who don't know what i mean: The Lynx uses a kind of file-system for accessing the content of the cartridge, and the Lynxer helps to compile the several necessary "files" for the cartridge. Regards Matthias Quote Link to comment Share on other sites More sharing options...
TailChao Posted November 25, 2003 Author Share Posted November 25, 2003 So, would it be feasable to make seperate programs for each section of the game, and have the lynx load them, but keep the values of the variables set by earlier programs by using the file macro? and if that is true, what is the syntax for the loadprg command? Quote Link to comment Share on other sites More sharing options...
sage Posted November 26, 2003 Share Posted November 26, 2003 So, would it be feasable to make seperate programs for each section of the game, and have the lynx load them, but keep the values of the variables set by earlier programs by using the file macro? and if that is true, what is the syntax for the loadprg command? without looking into the source i guess its LOADPRG Quote Link to comment Share on other sites More sharing options...
TailChao Posted November 28, 2003 Author Share Posted November 28, 2003 Sorry, but i'm still having problems. what exactly do I have to do for the lynx to load from the cart, I've originally tried to set it up with two .o files linked together, but the assembler didn't like that, so what should I do? clear the ram from x to y and then load whatever. I'm kinda stuck here. Edit: also, whenever the demo itself reaches a certain size, handy gives me the error "CMikie::Poke() - Write to MTEST2". is that bad? Quote Link to comment Share on other sites More sharing options...
TailChao Posted November 29, 2003 Author Share Posted November 29, 2003 also, here is a link to the current build if anyone cares to debug- http://www.webpost.net/tc/tcPicgallery/ZONIK.rar Quote Link to comment Share on other sites More sharing options...
+karri Posted November 29, 2003 Share Posted November 29, 2003 You have to create the cart image first. Create an ASCII file ROM.MAK with content like INSERT.O #ALIGN myprog.o #ALIGN myprog2.o Then you run Lynxer on this to crate a *.LYX file The resulting LYX-file is then burnable on a chip. Now your programs should be able to load each other from the cart. -- Karri Quote Link to comment Share on other sites More sharing options...
D-lag Posted November 29, 2003 Share Posted November 29, 2003 Well, Karri already told you everything, but I wanted to tell you that your demo looks quite good! Keep up with the good work Quote Link to comment Share on other sites More sharing options...
TailChao Posted November 29, 2003 Author Share Posted November 29, 2003 Alright, the cart fits together alright (thanks karri), but I still cant get one program to load the other, whenever I try to use the LOADPRG command from the file.mac like this- LOADPRG 2 or LOADPRG LTOXY (ltoxy is the name of the seccond program) I get an undefined variable error message when assembling the pieces of my game (each .o file) so what is the proper way to use the command? (If you tell me, i'll shut up and leave you all alone ) and, thanks, D@md@m for the compliment. Quote Link to comment Share on other sites More sharing options...
sage Posted November 30, 2003 Share Posted November 30, 2003 Edit: also, whenever the demo itself reaches a certain size, handy gives me the error "CMikie::Poke() - Write to MTEST2". is that bad? Then your demo reach the hardware adresses of teh memory. Putting the screen memory at that position saves a lot of memory. Tschau, Sage Quote Link to comment Share on other sites More sharing options...
sage Posted November 30, 2003 Share Posted November 30, 2003 Alright, the cart fits together alright (thanks karri), but I still cant get one program to load the other, whenever I try to use the LOADPRG command from the file.mac like this- LOADPRG 2 or LOADPRG LTOXY (ltoxy is the name of the seccond program) I get an undefined variable error message when assembling the pieces of my game (each .o file) so what is the proper way to use the command? (If you tell me, i'll shut up and leave you all alone maybe LOADPRG #2 (or even #3, because there is the title picture before the first program, i am not sure if title picture is #0 or #1) Also, the part should be loaded to differentz memory positions. at least the part where the loading code sits, should not be overwritten by the loading program!!! Overloading the code while executing gives nice effects I have some pieces of demo code here, how it can be done... Tschau, Sage Quote Link to comment Share on other sites More sharing options...
TailChao Posted November 30, 2003 Author Share Posted November 30, 2003 Hmm, I got the assembler to let the programs go through, and stuck them together with lynxer, but now handy is giving me illegal opcode errors, and I think I have to clear the ram before loading, but I dont know how to do so properly, if anyone can help, I'd appreciate it, here is a link to the demo and source code- http://www.webpost.net/tc/tcPicgallery/Zonik.rar Quote Link to comment Share on other sites More sharing options...
sage Posted December 1, 2003 Share Posted December 1, 2003 Hmm, I got the assembler to let the programs go through, and stuck them together with lynxer, but now handy is giving me illegal opcode errors, and I think I have to clear the ram before loading, but I dont know how to do so properly, if anyone can help, I'd appreciate it, here is a link to the demo and source code-http://www.webpost.net/tc/tcPicgallery/Zonik.rar Besides the mistake, that you run through data in LOXY.asm because the loop is not closed, i think your problem is that you use the same memory regions. you should check that the loader is not overwritten by the programm which is loaded!! Moreover, you should define in the ASM file, that you are using NEWHEAD (arent you?). I put some example sourcecodes on my site... lynxdev.atari.org -> development Quote Link to comment Share on other sites More sharing options...
sage Posted December 1, 2003 Share Posted December 1, 2003 PS: It look like you are really doing some work. But I would first finish the game before thinking about the cover design *g* PSS: Nice handheld devkit Quote Link to comment Share on other sites More sharing options...
TailChao Posted December 2, 2003 Author Share Posted December 2, 2003 Hmm, apparently the data I was trying to load was overwriting the code in ram, you were right... now to just figure out how to get such a huge file loaded not to do so . And also, the TExpress to lynx connection was a multiplayer idea, not a dev station *shot* Also, Is there any way to have lynxer create 512k images, because I have no idea how to use lynxer4.ttp. thanks. Quote Link to comment Share on other sites More sharing options...
+karri Posted December 3, 2003 Share Posted December 3, 2003 42Bastian invented a very nice way of using Audio I/O pin as an external block-select line. Then you can use 512k with no problems using the BLL-kit. Just create two seperate 256k images with Lynxer and burn them on the same 512k cart. If you rewrite the libraries for 2048 byte block access you can even get 1024k images to run. So space is not a big problem -- Cheers, Karri Quote Link to comment Share on other sites More sharing options...
TailChao Posted December 9, 2003 Author Share Posted December 9, 2003 Edit: also, whenever the demo itself reaches a certain size, handy gives me the error "CMikie::Poke() - Write to MTEST2". is that bad? Then your demo reach the hardware adresses of teh memory. Putting the screen memory at that position saves a lot of memory. Tschau, Sage How would I move the screen buffers and collision buffers right before that point? Note- I have two screen buffers and one collision buffer. Quote Link to comment Share on other sites More sharing options...
sage Posted December 9, 2003 Share Posted December 9, 2003 How would I move the screen buffers and collision buffers right before that point? Note- I have two screen buffers and one collision buffer. SCRBASE $A000, $C000,$E000 Hint: Try to look in the .mac files, some things are explained there. PS: If you use collision buffer, make sure the offset for the collision flag is set correctly!!! Tschau, Sage Quote Link to comment Share on other sites More sharing options...
vince Posted August 24, 2012 Share Posted August 24, 2012 (edited) Sorry for the up but I was wondering how to do it, in C. (with or without BLL) Have any idea ? Edited August 24, 2012 by vince Quote Link to comment Share on other sites More sharing options...
+karri Posted August 27, 2012 Share Posted August 27, 2012 This thread was _really_old_. If you use cc65 it is all taken care of. You can choose from two pre-designed configuration files. -C lynx.cfg has dual screen buffers (or if you don't use the tgi_updatedisplay you can use a single screen also) -C lynx-coll.cfg has dual screen buffers + collision detection For using collision detection you also have to initialize collision detection in the driver. tgi_setcollisiondetection(1); // this activates it tgi_setcollisiondetection(0); // this de-activates it -- Karri Quote Link to comment Share on other sites More sharing options...
vince Posted August 27, 2012 Share Posted August 27, 2012 I'm sorry, I didn't specify that's the original post that interest me. How can I do in C if I want to load a program from cartridge (for example a .o file) and run it ? Quote Link to comment Share on other sites More sharing options...
sage Posted August 27, 2012 Share Posted August 27, 2012 (edited) I'm sorry, I didn't specify that's the original post that interest me. How can I do in C if I want to load a program from cartridge (for example a .o file) and run it ? Sorry, my first answer was eaten up by a wifi disconnect. I think the function name in c was LoadFile(nr); Add: check the example sources on my website. I mostly use a function names LaodFileTo(nr, addr), but this works only for data files as executeables always have afixed address. Edited August 27, 2012 by sage Quote Link to comment Share on other sites More sharing options...
+karri Posted August 28, 2012 Share Posted August 28, 2012 In MegaPak most minigames are written with the BLL-kit. I used a simple unix command to turn the *.o files into asm-files that can be compiled by cc65 and included on a compilation cart. From the cc65 you can load and execute the BLL games with lynx_exec(filenr); The conversion program looks like this: tail --bytes=`ls -l yahtzee.o | cut -b 37-41 | bc calc` yahtzee.o | od -i -v -w2 | gawk -f dicee.awk > dicee.s The calc help file looks like this: a=read() a-10 And the formattin file dicee.awk like this: BEGIN { FS=" " printf(" .global _dicee_start\n"); printf(" .global _dicee_end\n"); printf(" .segment \"DICEE_RODATA\"\n"); printf("_dicee_start: \n"); } ($2 != "") { printf(" .word %d\n",$2); } END { printf("_dicee_end: \n"); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.