Jump to content
IGNORED

Magellan


The Codex

Recommended Posts

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 by xahmol
  • Like 3
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

  • 3 months later...
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 by Asmusr
Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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 

  • Like 2
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

  • 3 months later...

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?

 

Link to comment
Share on other sites

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?


 

 

 

 

 

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

 

  • Like 1
Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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 by Sinphaltimus
Thought it was fixed, it's not.
  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...