Package smsqmulator
Class SmsqeString
java.lang.Object
smsqmulator.SmsqeString
Methods to get string from smsqe to java and vice-versa.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final String
convertToJava
(byte c) Converts from SMSQE byte to Java string.static final byte
convertToSMSQE
(char c) Converts from java char to smsqe char/byte.static final byte
Converts from java string to smsqe char/byte.static final String
readSmsqeString
(int address, MC68000Cpu cpu) Returns a java String from an SMSQE string at a certain address MAKING accented chars conversion.static final void
writeSmsqeString
(int address, String s, boolean writeLength, int maxLength, MC68000Cpu cpu) Writes a java String as an SMSQE string to a certain address MAKING accented chars conversion.static final void
writeSmsqeString
(int address, String s, int maxLength, MC68000Cpu cpu) Writes a java String as an SMSQE string to a certain address MAKING accented chars conversion.
-
Constructor Details
-
SmsqeString
public SmsqeString()
-
-
Method Details
-
readSmsqeString
Returns a java String from an SMSQE string at a certain address MAKING accented chars conversion.- Parameters:
address
- where the string lies in memory. This is presumed to be even (after all, the string is preceded by a length word).cpu
- the cpu with the momory- Returns:
- the String read, this may be "" but will not be
null
.This makes character conversion from SMSQQE charset to Java charset.
-
writeSmsqeString
Writes a java String as an SMSQE string to a certain address MAKING accented chars conversion.- Parameters:
address
- - where to start writing.s
- theString
to write.maxLength
- the max length of the string to write NOT INCLUDING THE LENGTH WORD, -1 if no max length.cpu
- the cpu with the momory
-
writeSmsqeString
public static final void writeSmsqeString(int address, String s, boolean writeLength, int maxLength, MC68000Cpu cpu) Writes a java String as an SMSQE string to a certain address MAKING accented chars conversion.- Parameters:
address
- - where to start writing.s
- theString
to write.writeLength
-true
if the length of the string should be prepended to the string (as would be usual in SMSQE)maxLength
- the max length of the string to write NOT INCLUDING THE LENGTH WORD, -1 if no max length.cpu
- the cpu with the momory
-
convertToSMSQE
Converts from java string to smsqe char/byte.- Parameters:
c
- the char to convert- Returns:
- the converted char
-
convertToSMSQE
public static final byte convertToSMSQE(char c) Converts from java char to smsqe char/byte.- Parameters:
c
- the char to convert- Returns:
- the converted char
-
convertToJava
Converts from SMSQE byte to Java string.- Parameters:
c
- the byte ti convert- Returns:
- the byte as a java unicode string.
-