xahmol Posted March 17, 2021 Share Posted March 17, 2021 (edited) Small update: took the Makefile from the Turmoil project and adapted for my use to convert CC, CH an MP lines directly from the .mag file I made. I like his idea of using the sourcefile directly to generate a C header file more than doing a feature request for a C header file as export as I now do not need to export again on changes made in my screen, just a save of the main .mag file is sufficient Please improve/comment where needed, else maybe usefull for others. Next step is actually using that in a first C program to show that screen (but out of time now). SCREENNAME=ludo_mainscreen.mag GRAPHICS=graphics.h $(GRAPHICS): $(SCREENNAME) Makefile ( echo "static const u8 colorset[] = {" ;\ gawk -F: -e '$$1=="CC" { if (i>=0 && i<25) { split($$2, a, "|"); printf("0x%x%x,\n", a[1], a[2]) } i++ }' $(SCREENNAME) ;\ echo "};" ;\ echo "static const u8 charset[] = {" ;\ gawk -F: -e '$$1=="CH" { if (i>=0 && i<200) { print gensub(/(..)/,"0x\\1,","g",$$2) } i++ }' $(SCREENNAME) ;\ echo "};" ;\ echo "static const u8 mainscreen[] = {" ;\ gawk -F: -e '$$1=="MP" { split($$2, a, "|"); for( b in a ) { printf("0x%02x,", a[b]); } print "" }' $(SCREENNAME) ;\ echo "};" ) > $@ Edited March 17, 2021 by xahmol 3 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted March 19, 2021 Share Posted March 19, 2021 On 3/17/2021 at 4:02 PM, xahmol said: Small update: took the Makefile from the Turmoil project and adapted for my use to convert CC, CH an MP lines directly from the .mag file I made. I like his idea of using the sourcefile directly to generate a C header file more than doing a feature request for a C header file as export as I now do not need to export again on changes made in my screen, just a save of the main .mag file is sufficient Please improve/comment where needed, else maybe usefull for others. Next step is actually using that in a first C program to show that screen (but out of time now). SCREENNAME=ludo_mainscreen.mag GRAPHICS=graphics.h $(GRAPHICS): $(SCREENNAME) Makefile ( echo "static const u8 colorset[] = {" ;\ gawk -F: -e '$$1=="CC" { if (i>=0 && i<25) { split($$2, a, "|"); printf("0x%x%x,\n", a[1], a[2]) } i++ }' $(SCREENNAME) ;\ echo "};" ;\ echo "static const u8 charset[] = {" ;\ gawk -F: -e '$$1=="CH" { if (i>=0 && i<200) { print gensub(/(..)/,"0x\\1,","g",$$2) } i++ }' $(SCREENNAME) ;\ echo "};" ;\ echo "static const u8 mainscreen[] = {" ;\ gawk -F: -e '$$1=="MP" { split($$2, a, "|"); for( b in a ) { printf("0x%02x,", a[b]); } print "" }' $(SCREENNAME) ;\ echo "};" ) > $@ I could relatively easy add a C export option if you're interested - especially if a had an example of the desired output. It would follow the assembly output closely but with C syntax. 1 Quote Link to comment Share on other sites More sharing options...
xahmol Posted March 19, 2021 Share Posted March 19, 2021 7 minutes ago, Asmusr said: I could relatively easy add a C export option if you're interested - especially if a had an example of the desired output. It would follow the assembly output closely but with C syntax. Thanks. Will come back on that if I get a first program working, as then I also would know what format I need ? But advantage of such a Make script is that there is not even a need to use an export, and to be more flexible in how it is converted in different projects. 1 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted July 2, 2021 Share Posted July 2, 2021 I have Magellan 3.1, and when I click on Export Assembler Data, nothing happens. Exporting to XB works fine. Am I missing something here? Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted July 2, 2021 Share Posted July 2, 2021 30 minutes ago, Vorticon said: I have Magellan 3.1, and when I click on Export Assembler Data, nothing happens. Exporting to XB works fine. Am I missing something here? Why not download Magellan 4.1.1? ...lee 1 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted July 2, 2021 Share Posted July 2, 2021 7 hours ago, Lee Stewart said: Why not download Magellan 4.1.1? ...lee There is no binary for that version. Not sure how to compile it. Quote Link to comment Share on other sites More sharing options...
Asmusr Posted July 2, 2021 Share Posted July 2, 2021 1 minute ago, Vorticon said: There is no binary for that version. Not sure how to compile it. https://magellan.js99er.net Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted July 2, 2021 Share Posted July 2, 2021 49 minutes ago, Asmusr said: https://magellan.js99er.net Thank you! That one worked. Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted July 2, 2021 Share Posted July 2, 2021 Perhaps a feature request for a future update: Could there be an assembly export option with the XB screen offset by any chance? Quote Link to comment Share on other sites More sharing options...
Asmusr Posted July 2, 2021 Share Posted July 2, 2021 (edited) 5 hours ago, Vorticon said: Perhaps a feature request for a future update: Could there be an assembly export option with the XB screen offset by any chance? As I understand your request, you would like an option to add 96 to all values in the map, wrapping around to 0 when greater than 255. It sounds to me like a feature few people would use, but yell if anybody want it. Isn't it possible to account for the offset when you create the Magellan file (use character 128 for space)? Or account for the offset in the assembly code instead? Edited July 2, 2021 by Asmusr Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted July 2, 2021 Share Posted July 2, 2021 2 hours ago, Asmusr said: As I understand your request, you would like an option to add 96 to all values in the map, wrapping around to 0 when greater than 255. It sounds to me like a feature few people would use, but yell if anybody want it. Isn't it possible to account for the offset when you create the Magellan file (use character 128 for space)? Or account for the offset in the assembly code instead? Yes I could easily add the offset in my code, but it would a slower process if I plan on dumping a character map straight into VDP RAM in one shot using VMBW. No harm in asking Quote Link to comment Share on other sites More sharing options...
Asmusr Posted July 2, 2021 Share Posted July 2, 2021 38 minutes ago, Vorticon said: Yes I could easily add the offset in my code, but it would a slower process if I plan on dumping a character map straight into VDP RAM in one shot using VMBW. So how about the other option, placing the characters in Magellan at the positions where they should end up? Magellan is open source. If anyone would like to contribute to Magellan, just send me a note and I will add you as a collaborator in github. To be honest the code is a bit messy, but I have spent a lot of time recently making the import/export code more accessible to developers. https://github.com/Rasmus-M/magellan 2 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted July 2, 2021 Share Posted July 2, 2021 25 minutes ago, Asmusr said: So how about the other option, placing the characters in Magellan at the positions where they should end up? Magellan is open source. If anyone would like to contribute to Magellan, just send me a note and I will add you as a collaborator in github. To be honest the code is a bit messy, but I have spent a lot of time recently making the import/export code more accessible to developers. https://github.com/Rasmus-M/magellan Yes, I suppose I could start my character sets at 128 instead of 32, but it would create difficulties with plain XB if I want to do anything with them from within XB proper due to the set limitation unless I use XB256. I would have loved to contribute to Magellan, but this is likely above my pay grade... Quote Link to comment Share on other sites More sharing options...
Sinphaltimus Posted October 10, 2021 Share Posted October 10, 2021 Why can't I figure out how to draw on the map screen? Just installed the latest version "over" the previous one (upgraded). Mouse buttons do nothing. I know its me. I've looked for instructions or tutorial on-line. Feeling like a dunce. EDIT: I still haven't figured it out but I did get my image imported in such a way that I can hand place the character sets. I recall being able to "paint" on the map screen at the pixel level and not the full CHAR set. Am I wrong? Quote Link to comment Share on other sites More sharing options...
Asmusr Posted October 10, 2021 Share Posted October 10, 2021 1 hour ago, Sinphaltimus said: Am I wrong? Yes, you are wrong. It has never been possible to paint directly to the map screen at the pixel level. Quote Link to comment Share on other sites More sharing options...
Sinphaltimus Posted October 10, 2021 Share Posted October 10, 2021 2 minutes ago, Asmusr said: Yes, you are wrong. It has never been possible to paint directly to the map screen at the pixel level. Thanks. Could it have been a different screen or mode I'm thinking about by mistake? Quote Link to comment Share on other sites More sharing options...
Asmusr Posted October 10, 2021 Share Posted October 10, 2021 5 minutes ago, Sinphaltimus said: Thanks. Could it have been a different screen or mode I'm thinking about by mistake? Not within Magellan. Perhaps you're thinking of another program? Quote Link to comment Share on other sites More sharing options...
Sinphaltimus Posted October 10, 2021 Share Posted October 10, 2021 12 minutes ago, Asmusr said: Not within Magellan. Perhaps you're thinking of another program? Has to be. Thanks again. Quote Link to comment Share on other sites More sharing options...
pixelpedant Posted October 10, 2021 Share Posted October 10, 2021 There's Rasmus's Raphael for drawing individual multi-tile graphics, which could then be imported to Magellan as PNG. Though I tend to just use GIMP with a TMS9918 palette and 8x8 gridlines, myself. 4 Quote Link to comment Share on other sites More sharing options...
Sinphaltimus Posted October 16, 2021 Share Posted October 16, 2021 I maybe doing something wrong but I can't figure out how to change it. The usable character set for basic starts at 32. but when import a ng file, Magellan seems to start at 0. So the top of my images get cut off. I end up having to padd my png files by 32 pixels on top i order to force the rest of my wanted image to start at Char Code 32 instead of 0. Is there a way to force Magellan to start at 32? Quote Link to comment Share on other sites More sharing options...
Asmusr Posted October 16, 2021 Share Posted October 16, 2021 1 hour ago, Sinphaltimus said: I maybe doing something wrong but I can't figure out how to change it. The usable character set for basic starts at 32. but when import a ng file, Magellan seems to start at 0. So the top of my images get cut off. I end up having to padd my png files by 32 pixels on top i order to force the rest of my wanted image to start at Char Code 32 instead of 0. Is there a way to force Magellan to start at 32? If you're talking about importing a character image it always starts at 0, so you have to pad it. It would make sense that it depended on which character set you had chosen, but it doesn't. You can also try to import it as a map image where you have more choices. Quote Link to comment Share on other sites More sharing options...
Sinphaltimus Posted October 16, 2021 Share Posted October 16, 2021 2 hours ago, Asmusr said: If you're talking about importing a character image it always starts at 0, so you have to pad it. It would make sense that it depended on which character set you had chosen, but it doesn't. You can also try to import it as a map image where you have more choices. Cool, thanks. I wasn't aware padding was necessary. Took me a bit to figure out what was going on. Also, another thing that maybe importing as map might do better. The character sets. Seems I can only import an image that is exactly one character set wide (8 characters) . Perhaps th map image allows for wider graphics to be imported. Not sure. i'll check that out now. I've searched around and don't see any comprehensive documentation for Magellan, like a complete user guide. Is there one? I understand if not, but I did search around which is why I posted here about the padding thing I noticed. Quote Link to comment Share on other sites More sharing options...
Asmusr Posted October 16, 2021 Share Posted October 16, 2021 27 minutes ago, Sinphaltimus said: Cool, thanks. I wasn't aware padding was necessary. Took me a bit to figure out what was going on. Also, another thing that maybe importing as map might do better. The character sets. Seems I can only import an image that is exactly one character set wide (8 characters) . Perhaps th map image allows for wider graphics to be imported. Not sure. i'll check that out now. I've searched around and don't see any comprehensive documentation for Magellan, like a complete user guide. Is there one? I understand if not, but I did search around which is why I posted here about the padding thing I noticed. Yes the image when you import for a character set must be the same dimensions as the one produced when you export a character set. The 'import map image' function can import images of any size, but note that it will eliminate duplicates. Actually there is a bit of documentation in Magellan.txt that was written by the original author: Character Image - Load an image that contains character graphics you'd like to use in the Character Dock. This image should be pure black-and-white, with black pixels representing "drawn" data and white pixels representing "clear" data. The imported image should have the same dimensions and layout as the image that is created using the "Export -> Character Image (Mono)" function described below. You can export one of these images to get a starting image that you can then edit with your own character graphics. I'm not interested in writing documentation for Magellan, but if anyone else wants to do it, I would be happy to check it for errors. 1 Quote Link to comment Share on other sites More sharing options...
1980gamer Posted October 16, 2021 Share Posted October 16, 2021 40 minutes ago, Asmusr said: I'm not interested in writing documentation for Magellan, but if anyone else wants to do it, I would be happy to check it for errors. I wish someone would. I need the manual, so it will not be me! I would also love to see an example of large maps and GEM examples scrolling around that map. I have seen completed TI games and TI Demos. But not HOW to do this? Or is this pure ASM and not something compiled XB can do? Quote Link to comment Share on other sites More sharing options...
Sinphaltimus Posted October 17, 2021 Share Posted October 17, 2021 (edited) OK, one more issue I am having. This is only happening on this particular project. When I export to basic program, I cannot open it in classic 99. I also cannot open it in a text editor and when I use TI99DIR to copy to dsk, I convert to PROGRAM and it gets errors loading. I also cannot paste the text into Classic 99 as it throws errors on the same print statements. There are pretty wierd characters in some of the print statements. The Quotes go missing etc... Example: 1140 PRINT 1150 1160 1170 1180 1190 PRINT "BCDEFG@ABCDEFG@ABCDEFG@ABCDE IJKLMNHIJKLMNHIJKLMNHIJKL" 1200 PRINT " #$%&! #$%&! #$%&! #$%QRSTUOPQRSTUOPQRSTUOPQRST)*+,'()*+,'()*+,'()*+," I'll attach the txt that comes out of Magellan as well as the map project. Any ideas why this is happening to this project? BOBLM.TXT bOb_Largest_multi.mag Edited October 17, 2021 by Sinphaltimus Thought it was fixed, it's not. 1 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.