dMZX Forums: Loading Chars - dMZX Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Loading Chars Dumb Question?

#1 User is offline   T-Bone 

  • Wastelander
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,487
  • Joined: 16-August 02
  • Gender:Male
  • Location:Canada

Posted 21 December 2006 - 05:50 AM

This may be an easy question to answer but I certainly haven't figured it out. How do I load in CHARS from a .CHR file?

Load Char Set "@###NAME.CHR" seems to just paste from the char set to the current one all the way till it gets to 255. How do i set where it ends?

EDIT:

Wow..... I just found out how by exporting. EEP MY BAD! Sorry for the post! :p

This post has been edited by T-bone6: 21 December 2006 - 06:06 AM

0

#2 User is offline   zombieguy 

  • Veteran Member
  • Group: Banned
  • Posts: 1,939
  • Joined: 29-June 02
  • Gender:Male
  • Location:Australia, Queensland.

Posted 21 December 2006 - 06:06 AM

Partial charsets.
269c_info.txt

Hrm... I don't see why those text files aren't being included in the port zip files. They could easily be thrown into the docs folder.

edit: lolz, posted at the same time you edited your post. (also before I posted he only had the first line there, his EDIT: should be just below his first line :P)

This post has been edited by zombieguy: 21 December 2006 - 06:13 AM

0

#3 User is offline   T-Bone 

  • Wastelander
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,487
  • Joined: 16-August 02
  • Gender:Male
  • Location:Canada

Posted 21 December 2006 - 06:07 AM

Agreed, that would be extremely helpful since i've forgotten the majority of what i read in those ancient .txt files.
0

#4 User is offline   T-Bone 

  • Wastelander
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,487
  • Joined: 16-August 02
  • Gender:Male
  • Location:Canada

Posted 21 December 2006 - 06:20 AM

In Robotics:
Actually... with partial chars it doesn't explain how to import a partial char set for a set amount of chars. Say I wish to cap off a partial char set to even smaller than its source, I can't seem to find any code for that or any counter.

In the Editor:
I noticed that when you try to import a partial char set it also doesn't allow you to limit how much chars are loaded in from that partial charset.

Am I missing something or is this something that could potentially be a new feature request?

Quote

edit: lolz, posted at the same time you edited your post. (also before I posted he only had the first line there, his EDIT: should be just below his first line :D)


This is true! :p

EDIT:
Thanks Z, I found the answer! But sadly... this doesn't work in robots... at least.. i can't make it work :(

Quote

+X#W gives both. Example: +10#20blah.chr will read a 20 char set into blah.chr starting at the 10th char.

This post has been edited by T-bone6: 21 December 2006 - 06:42 AM

0

#5 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,936
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 21 December 2006 - 06:50 AM

T-bone6, on Dec 21 2006, 04:20 PM, said:

EDIT:
Thanks Z, I found the answer! But sadly... this doesn't work in robots... at least.. i can't make it work :p

Quote

+X#W gives both. Example: +10#20blah.chr will read a 20 char set into blah.chr starting at the 10th char.

That functionality does not exist within MZX at the moment. Either export your charset with the correct number of chars, or do this:

(this example will read 20 chars from the charset given into the current charset, starting at the 10th char, so chars 10-29 will be written over)

set "commands" "(-1>>1)"
set "charset.chr" "fread_open"
set "NumberOfChars" 20
set "OffsetPosition" 10
loop start
char edit "('OffsetPosition'+'loopcount')" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread"
loop "('NumberOfChars'-1)"
set "" "fread_open"
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#6 User is offline   T-Bone 

  • Wastelander
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,487
  • Joined: 16-August 02
  • Gender:Male
  • Location:Canada

Posted 21 December 2006 - 06:52 AM

Cool thanks! Hopefully in the next MZX version we won't have to work around all this.

EDIT:
hmmm seems to freeze when i attempt those lines of code. Could be my system, since at the moment my system is extremely buggy.

This post has been edited by T-bone6: 21 December 2006 - 07:00 AM

0

#7 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,936
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 21 December 2006 - 08:34 AM

Are you injecting this code directly into your game? If so, you probably have a busyloop somewhere (since this sets commands to INT_MAX). Just remove the 'set commands' line and see if it works now.

EDIT:

Quote

Hopefully in the next MZX version we won't have to work around all this.


Unlikely.

1) You're the only person who wants this feature. Everyone else is happy to export their charsets to the correct size.

2) Features are not added if they are only wanted by one person, unless that person is Exophase or myself.

3) It's easy enough to work around.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#8 User is offline   T-Bone 

  • Wastelander
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,487
  • Joined: 16-August 02
  • Gender:Male
  • Location:Canada

Posted 21 December 2006 - 09:37 AM

Oh La La! It doesn't crash now. This works nicely. Now what if i want to start copying from a section within an external charset?

EDIT:
To clarify, wish to copy Characters 10 to 30 from Blocks.chr to the current charset during gameplay to Characters 50 to 70? Would this mean I'd have to change the fread_pos counter? I'm terrible at file read coding... even in MegaZeux.

I'll play around with it -- thanks for the original code there Lancer.

EDIT2:

I've been using the combination of the counters CHAR, BYTE and CHAR_BYTE with FREAD_POS and I still can't seem to get this working hmmm

This post has been edited by T-bone6: 21 December 2006 - 10:12 AM

0

#9 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,936
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 21 December 2006 - 10:56 AM

Okay, to do what you mentioned..

set "commands" "(-1>>1)"
set "charset.chr" "fread_open"
set "NumberOfChars" 21
set "OffsetPosition" 50
set "ReadOffsetPosition" 10

set "fread_pos" "('ReadOffsetPosition'*14)"
loop start
char edit "('OffsetPosition'+'loopcount')" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread"
loop "('NumberOfChars'-1)"
set "" "fread_open"

Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#10 User is offline   T-Bone 

  • Wastelander
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,487
  • Joined: 16-August 02
  • Gender:Male
  • Location:Canada

Posted 22 December 2006 - 04:43 AM

Wow.... your amazing :p
0

#11 User is offline   Frobozz 

  • Ryiah
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,808
  • Joined: 07-March 01
  • Gender:Not Telling

Posted 22 December 2006 - 03:37 PM

No need to have the feature added to MegaZeux. Just plop the code into the global robot and allow for some counters to control how to works.

:"loadchars"
set "oldcommands" "commands"
set "commands" "(-1>>1)"
set "charset.chr" "fread_open"
set "NumberOfChars" 21
set "OffsetPosition" 50
set "ReadOffsetPosition" 10

set "fread_pos" "('ReadOffsetPosition'*14)"
loop start
char edit "('OffsetPosition'+'loopcount')" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread"
loop "('NumberOfChars'-1)"
set "" "fread_open"
set "commands" "oldcommands"
end

0

#12 User is offline   T-Bone 

  • Wastelander
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,487
  • Joined: 16-August 02
  • Gender:Male
  • Location:Canada

Posted 23 December 2006 - 05:42 AM

Fantastic! I can even now use something like:

Quote

:"#loadchars"
set "oldcommands" "commands"
set "commands" "(-1>>1)"
set "&$string1&.CHR" "fread_open"

set "fread_pos" "('ReadOffsetPosition'*14)"
loop start
char edit "('OffsetPosition'+'loopcount')" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread"
loop "('NumberOfChars'-1)"
set "" "fread_open"
set "commands" "oldcommands"
goto "#return"


And just have robots on different boards control the other stuff like:

Quote

set "$string1" "Whatever charset"
set "NumberOfChars" #
set "OffsetPosition" #
set "ReadOffsetPosition" #
send "Global" "#loadchars"


This will help a lot with many of my games that use a lot of characters. Especially Super Mario which I'll be using this method for defiantly. Thanks a ton guys :p

EDIT:
The reason why im using subroutines here is because i generally always have stuff in the Global robot already looping.

This post has been edited by T-bone6: 23 December 2006 - 05:49 AM

0

#13 User is offline   Koji 

  • End
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 6,644
  • Joined: 15-November 01
  • Gender:Not Telling
  • Location:US, NC

Posted 25 December 2006 - 06:14 AM

just remember not to have multiple robots sending global to "#loadchars" at the same time.

a better option would be to have a way to distinguish between values.

"#loadchars"
set "oldcommands" "commands"
set "commands" "(-1>>1)"
:"loop"
if "$string('loop')&.char" != "" "#go"
inc "loop" 1
if "loop" < 10 "loop"
goto "#return"

:"#go"
set "&$string('loop')&.CHR" "fread_open"
set "fread_pos" "('ReadOffsetPosition_('loop')'*14)"
loop start
char edit "('OffsetPosition_('loop')'+'loopcount')" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread" "fread"
loop "('NumberOfChars_('loop')'-1)"
set "" "fread_open"
set "commands" "oldcommands"
set "$string('loop')" to ""
goto "#return"

That way, several robots could all get their work done, so long as they all appended a unique value from 0 to 10 at the end of their counters. :p

EDIT: ACTUALLY, not that I think about it, sending the global robot to a subroutine lable doesn't make the global robot actually spawn a subroutine, it'll just jump to that position, if you get to a "#return" lable it'll just return it not to the section it was taken from on the send... but to wherever a "#return" would have taken it BEFORE the global robot was sent to the subroutine lable...

I'm pretty sure this wouldn't work... :D

This post has been edited by Koji: 25 December 2006 - 06:20 AM

0

#14 User is offline   T-Bone 

  • Wastelander
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,487
  • Joined: 16-August 02
  • Gender:Male
  • Location:Canada

Posted 25 December 2006 - 09:58 AM

Thanks regardless though Koji! Oy... its 5am Christmas Morning :p

This post has been edited by T-bone6: 25 December 2006 - 09:58 AM

0

#15 User is offline   T-Bone 

  • Wastelander
  • PipPipPipPipPip
  • Group: Members
  • Posts: 2,487
  • Joined: 16-August 02
  • Gender:Male
  • Location:Canada

Posted 26 December 2006 - 12:11 PM

I just noticed something (or im missing something) but in the editor when you press CONTROL + C to get to the Char Edit Mode press ALT+I - I noticed that no matter what i set the offset, first and count values to the table is still imported from 0 - 255.

I may be doing something wrong...
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

11 User(s) are reading this topic
0 members, 11 guests, 0 anonymous users