mirror of
https://github.com/fadden/6502bench.git
synced 2025-02-20 06:29:04 +00:00
PETSCII does DCI
I didn't think it made sense, but I found something that used it, so apparently it's a thing. This updates the operand editor to let you choose PETSCII+DCI, and updates the assemblers to handle it correctly (really just 64tass, since the others either don't have a DCI directive or don't deal with PETSCII at all). Changed the char-encoding sample from "bad dcI" to "pet dcI", and updated the documentation.
This commit is contained in:
parent
57deccca27
commit
38d3adbb08
@ -217,6 +217,15 @@ namespace Asm65 {
|
|||||||
public static char ConvertC64Petscii(byte val) {
|
public static char ConvertC64Petscii(byte val) {
|
||||||
return sPetsciiToUnicode[val];
|
return sPetsciiToUnicode[val];
|
||||||
}
|
}
|
||||||
|
public static char ConvertLowAndHighC64Petscii(byte val) {
|
||||||
|
// This is an odd one. Some programs use DCI with PETSCII, which means the
|
||||||
|
// string is allow lower case except for the last letteR.
|
||||||
|
//
|
||||||
|
// There's no such thing as "high PETSCII", in the same sense that ASCII or
|
||||||
|
// C64 screen codes have it, but I'm giving the method a similar name for
|
||||||
|
// the sake of consistency.
|
||||||
|
return ConvertC64Petscii((byte)(val & 0x7f));
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// C64 Screen Codes
|
// C64 Screen Codes
|
||||||
|
@ -573,7 +573,7 @@ namespace SourceGen.AsmGen {
|
|||||||
case FormatDescriptor.Type.StringReverse:
|
case FormatDescriptor.Type.StringReverse:
|
||||||
case FormatDescriptor.Type.StringNullTerm:
|
case FormatDescriptor.Type.StringNullTerm:
|
||||||
case FormatDescriptor.Type.StringDci:
|
case FormatDescriptor.Type.StringDci:
|
||||||
// Last byte will be output as hex.
|
// Last byte may be output as hex.
|
||||||
break;
|
break;
|
||||||
case FormatDescriptor.Type.StringL8:
|
case FormatDescriptor.Type.StringL8:
|
||||||
// Length byte will be output as hex.
|
// Length byte will be output as hex.
|
||||||
|
@ -601,10 +601,7 @@ namespace SourceGen.AsmGen {
|
|||||||
case FormatDescriptor.SubType.C64Petscii:
|
case FormatDescriptor.SubType.C64Petscii:
|
||||||
if (textMode == TextScanMode.C64Petscii) {
|
if (textMode == TextScanMode.C64Petscii) {
|
||||||
charConv = CharEncoding.ConvertC64Petscii;
|
charConv = CharEncoding.ConvertC64Petscii;
|
||||||
// DCI not supported for PETSCII; make sure it doesn't get tried
|
dciConv = CharEncoding.ConvertLowAndHighC64Petscii;
|
||||||
if (dfd.FormatType == FormatDescriptor.Type.StringDci) {
|
|
||||||
charConv = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FormatDescriptor.SubType.C64Screen:
|
case FormatDescriptor.SubType.C64Screen:
|
||||||
|
@ -1044,7 +1044,8 @@ namespace SourceGen {
|
|||||||
/// that all strings have the same hi/lo pattern.
|
/// that all strings have the same hi/lo pattern.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Not useful for C64Petscii, which mixes high/low characters.
|
/// For C64Petscii, this will identify strings that are entirely in lower case except
|
||||||
|
/// for the last letteR, or vice-versa.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="fileData">Raw data.</param>
|
/// <param name="fileData">Raw data.</param>
|
||||||
/// <param name="start">Offset of first byte in range.</param>
|
/// <param name="start">Offset of first byte in range.</param>
|
||||||
|
@ -410,7 +410,11 @@ namespace SourceGen {
|
|||||||
delDef = delSet.Get(CharEncoding.Encoding.HighAscii);
|
delDef = delSet.Get(CharEncoding.Encoding.HighAscii);
|
||||||
break;
|
break;
|
||||||
case FormatDescriptor.SubType.C64Petscii:
|
case FormatDescriptor.SubType.C64Petscii:
|
||||||
charConv = CharEncoding.ConvertC64Petscii;
|
if (dfd.FormatType == FormatDescriptor.Type.StringDci) {
|
||||||
|
charConv = CharEncoding.ConvertLowAndHighC64Petscii;
|
||||||
|
} else {
|
||||||
|
charConv = CharEncoding.ConvertC64Petscii;
|
||||||
|
}
|
||||||
delDef = delSet.Get(CharEncoding.Encoding.C64Petscii);
|
delDef = delSet.Get(CharEncoding.Encoding.C64Petscii);
|
||||||
break;
|
break;
|
||||||
case FormatDescriptor.SubType.C64Screen:
|
case FormatDescriptor.SubType.C64Screen:
|
||||||
|
@ -136,9 +136,8 @@ you change the encoding, your available options may change. The
|
|||||||
low + high ASCII setting will accept both, configuring the appropriate
|
low + high ASCII setting will accept both, configuring the appropriate
|
||||||
encoding based on the data values, but when identifying multiple strings
|
encoding based on the data values, but when identifying multiple strings
|
||||||
it requires that each individual string be entirely one or the other.</p>
|
it requires that each individual string be entirely one or the other.</p>
|
||||||
<p>Due to fundamental limitations of the character sets, C64 PETSCII
|
<p>Due to fundamental limitations of the character set, C64 screen code
|
||||||
does not support DCI, and C64 screen code strings cannot be null
|
strings cannot be null terminated.</p>
|
||||||
terminated.</p>
|
|
||||||
|
|
||||||
<p>To avoid burying a label in the middle of a data item, contiguous areas
|
<p>To avoid burying a label in the middle of a data item, contiguous areas
|
||||||
are split at labels. This can sometimes have unexpected effects. For
|
are split at labels. This can sometimes have unexpected effects. For
|
||||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
### 6502bench SourceGen dis65 v1.0 ###
|
### 6502bench SourceGen dis65 v1.0 ###
|
||||||
{
|
{
|
||||||
"_ContentVersion":2,"FileDataLength":1093,"FileDataCrc32":589095233,"ProjectProps":{
|
"_ContentVersion":2,"FileDataLength":1093,"FileDataCrc32":-1027700879,"ProjectProps":{
|
||||||
"CpuName":"65816","IncludeUndocumentedInstr":false,"EntryFlags":32702671,"AutoLabelStyle":"Simple","AnalysisParams":{
|
"CpuName":"65816","IncludeUndocumentedInstr":false,"EntryFlags":32702671,"AutoLabelStyle":"Simple","AnalysisParams":{
|
||||||
"AnalyzeUncategorizedData":true,"DefaultTextScanMode":"LowAscii","MinCharsForString":4,"SeekNearbyTargets":true},
|
"AnalyzeUncategorizedData":true,"DefaultTextScanMode":"LowAscii","MinCharsForString":4,"SeekNearbyTargets":true},
|
||||||
"PlatformSymbolFileIdentifiers":[],"ExtensionScriptFileIdentifiers":[],"ProjectSyms":{
|
"PlatformSymbolFileIdentifiers":[],"ExtensionScriptFileIdentifiers":[],"ProjectSyms":{
|
||||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
### 6502bench SourceGen dis65 v1.0 ###
|
### 6502bench SourceGen dis65 v1.0 ###
|
||||||
{
|
{
|
||||||
"_ContentVersion":2,"FileDataLength":1093,"FileDataCrc32":589095233,"ProjectProps":{
|
"_ContentVersion":2,"FileDataLength":1093,"FileDataCrc32":-1027700879,"ProjectProps":{
|
||||||
"CpuName":"65816","IncludeUndocumentedInstr":false,"EntryFlags":32702671,"AutoLabelStyle":"Simple","AnalysisParams":{
|
"CpuName":"65816","IncludeUndocumentedInstr":false,"EntryFlags":32702671,"AutoLabelStyle":"Simple","AnalysisParams":{
|
||||||
"AnalyzeUncategorizedData":true,"DefaultTextScanMode":"C64Petscii","MinCharsForString":4,"SeekNearbyTargets":true},
|
"AnalyzeUncategorizedData":true,"DefaultTextScanMode":"C64Petscii","MinCharsForString":4,"SeekNearbyTargets":true},
|
||||||
"PlatformSymbolFileIdentifiers":[],"ExtensionScriptFileIdentifiers":[],"ProjectSyms":{
|
"PlatformSymbolFileIdentifiers":[],"ExtensionScriptFileIdentifiers":[],"ProjectSyms":{
|
||||||
|
Binary file not shown.
@ -1,6 +1,6 @@
|
|||||||
### 6502bench SourceGen dis65 v1.0 ###
|
### 6502bench SourceGen dis65 v1.0 ###
|
||||||
{
|
{
|
||||||
"_ContentVersion":2,"FileDataLength":1093,"FileDataCrc32":589095233,"ProjectProps":{
|
"_ContentVersion":2,"FileDataLength":1093,"FileDataCrc32":-1027700879,"ProjectProps":{
|
||||||
"CpuName":"65816","IncludeUndocumentedInstr":false,"EntryFlags":32702671,"AutoLabelStyle":"Simple","AnalysisParams":{
|
"CpuName":"65816","IncludeUndocumentedInstr":false,"EntryFlags":32702671,"AutoLabelStyle":"Simple","AnalysisParams":{
|
||||||
"AnalyzeUncategorizedData":true,"DefaultTextScanMode":"C64ScreenCode","MinCharsForString":4,"SeekNearbyTargets":true},
|
"AnalyzeUncategorizedData":true,"DefaultTextScanMode":"C64ScreenCode","MinCharsForString":4,"SeekNearbyTargets":true},
|
||||||
"PlatformSymbolFileIdentifiers":[],"ExtensionScriptFileIdentifiers":[],"ProjectSyms":{
|
"PlatformSymbolFileIdentifiers":[],"ExtensionScriptFileIdentifiers":[],"ProjectSyms":{
|
||||||
|
@ -115,7 +115,7 @@
|
|||||||
.byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c
|
.byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c
|
||||||
.byte $45,$4e,$47,$54,$48,$32
|
.byte $45,$4e,$47,$54,$48,$32
|
||||||
.byte $84
|
.byte $84
|
||||||
.byte $42,$41,$44,$20,$44,$43,$c9
|
.byte $50,$45,$54,$20,$44,$43,$c9
|
||||||
.byte $84
|
.byte $84
|
||||||
.byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05
|
.byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05
|
||||||
.byte $16,$05,$12
|
.byte $16,$05,$12
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
dfb $84
|
dfb $84
|
||||||
hex 1400d0c5d4d3c3c9c92057495448204c454e47544832
|
hex 1400d0c5d4d3c3c9c92057495448204c454e47544832
|
||||||
dfb $84
|
dfb $84
|
||||||
hex 424144204443c9
|
hex 504554204443c9
|
||||||
dfb $84
|
dfb $84
|
||||||
hex 05040f43200e05051203532005131205160512
|
hex 05040f43200e05051203532005131205160512
|
||||||
dfb $84
|
dfb $84
|
||||||
|
@ -97,7 +97,7 @@
|
|||||||
!byte $84
|
!byte $84
|
||||||
!pet $14,$00,"PETSCII with length2"
|
!pet $14,$00,"PETSCII with length2"
|
||||||
!byte $84
|
!byte $84
|
||||||
!pet "bad dcI"
|
!pet "pet dcI"
|
||||||
!byte $84
|
!byte $84
|
||||||
!scr "edoC neercS esrever"
|
!scr "edoC neercS esrever"
|
||||||
!byte $84
|
!byte $84
|
||||||
|
@ -119,7 +119,7 @@
|
|||||||
.byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c
|
.byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c
|
||||||
.byte $45,$4e,$47,$54,$48,$32
|
.byte $45,$4e,$47,$54,$48,$32
|
||||||
.byte $84
|
.byte $84
|
||||||
.byte $42,$41,$44,$20,$44,$43,$c9
|
.byte $50,$45,$54,$20,$44,$43,$c9
|
||||||
.byte $84
|
.byte $84
|
||||||
.byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05
|
.byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05
|
||||||
.byte $16,$05,$12
|
.byte $16,$05,$12
|
||||||
|
@ -113,7 +113,7 @@
|
|||||||
.byte $84
|
.byte $84
|
||||||
.text $14,$00,"PETSCII with length2"
|
.text $14,$00,"PETSCII with length2"
|
||||||
.byte $84
|
.byte $84
|
||||||
.byte $42,$41,$44,$20,$44,$43,$c9
|
.shift "pet dci"
|
||||||
.byte $84
|
.byte $84
|
||||||
.byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05
|
.byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05
|
||||||
.byte $16,$05,$12
|
.byte $16,$05,$12
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
dfb $84
|
dfb $84
|
||||||
hex 1400d0c5d4d3c3c9c92057495448204c454e47544832
|
hex 1400d0c5d4d3c3c9c92057495448204c454e47544832
|
||||||
dfb $84
|
dfb $84
|
||||||
hex 424144204443c9
|
hex 504554204443c9
|
||||||
dfb $84
|
dfb $84
|
||||||
hex 05040f43200e05051203532005131205160512
|
hex 05040f43200e05051203532005131205160512
|
||||||
dfb $84
|
dfb $84
|
||||||
|
@ -103,7 +103,7 @@
|
|||||||
!byte $84
|
!byte $84
|
||||||
!pet $14,$00,"PETSCII with length2"
|
!pet $14,$00,"PETSCII with length2"
|
||||||
!byte $84
|
!byte $84
|
||||||
!pet "bad dcI"
|
!pet "pet dcI"
|
||||||
!byte $84
|
!byte $84
|
||||||
!scr "edoC neercS esrever"
|
!scr "edoC neercS esrever"
|
||||||
!byte $84
|
!byte $84
|
||||||
|
@ -125,7 +125,7 @@
|
|||||||
.byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c
|
.byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c
|
||||||
.byte $45,$4e,$47,$54,$48,$32
|
.byte $45,$4e,$47,$54,$48,$32
|
||||||
.byte $84
|
.byte $84
|
||||||
.byte $42,$41,$44,$20,$44,$43,$c9
|
.byte $50,$45,$54,$20,$44,$43,$c9
|
||||||
.byte $84
|
.byte $84
|
||||||
.byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05
|
.byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05
|
||||||
.byte $16,$05,$12
|
.byte $16,$05,$12
|
||||||
|
@ -122,7 +122,7 @@
|
|||||||
.byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c
|
.byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c
|
||||||
.byte $45,$4e,$47,$54,$48,$32
|
.byte $45,$4e,$47,$54,$48,$32
|
||||||
.byte $84
|
.byte $84
|
||||||
.byte $42,$41,$44,$20,$44,$43,$c9
|
.byte $50,$45,$54,$20,$44,$43,$c9
|
||||||
.byte $84
|
.byte $84
|
||||||
.text "edoC neercS esrever"
|
.text "edoC neercS esrever"
|
||||||
.byte $84
|
.byte $84
|
||||||
|
@ -96,7 +96,7 @@
|
|||||||
dfb $84
|
dfb $84
|
||||||
hex 1400d0c5d4d3c3c9c92057495448204c454e47544832
|
hex 1400d0c5d4d3c3c9c92057495448204c454e47544832
|
||||||
dfb $84
|
dfb $84
|
||||||
hex 424144204443c9
|
hex 504554204443c9
|
||||||
dfb $84
|
dfb $84
|
||||||
hex 05040f43200e05051203532005131205160512
|
hex 05040f43200e05051203532005131205160512
|
||||||
dfb $84
|
dfb $84
|
||||||
|
@ -103,7 +103,7 @@
|
|||||||
!byte $84
|
!byte $84
|
||||||
!pet $14,$00,"PETSCII with length2"
|
!pet $14,$00,"PETSCII with length2"
|
||||||
!byte $84
|
!byte $84
|
||||||
!pet "bad dcI"
|
!pet "pet dcI"
|
||||||
!byte $84
|
!byte $84
|
||||||
!scr "edoC neercS esrever"
|
!scr "edoC neercS esrever"
|
||||||
!byte $84
|
!byte $84
|
||||||
|
@ -125,7 +125,7 @@
|
|||||||
.byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c
|
.byte $14,$00,$d0,$c5,$d4,$d3,$c3,$c9,$c9,$20,$57,$49,$54,$48,$20,$4c
|
||||||
.byte $45,$4e,$47,$54,$48,$32
|
.byte $45,$4e,$47,$54,$48,$32
|
||||||
.byte $84
|
.byte $84
|
||||||
.byte $42,$41,$44,$20,$44,$43,$c9
|
.byte $50,$45,$54,$20,$44,$43,$c9
|
||||||
.byte $84
|
.byte $84
|
||||||
.byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05
|
.byte $05,$04,$0f,$43,$20,$0e,$05,$05,$12,$03,$53,$20,$05,$13,$12,$05
|
||||||
.byte $16,$05,$12
|
.byte $16,$05,$12
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
; The 2005 test exercises low/high ASCII strings, so no need to do that here.
|
; The 2005 test exercises low/high ASCII strings, so no need to do that here.
|
||||||
; Do a quick test with C64 characters. Note Screen Code can't be null-terminated
|
; Do a quick test with C64 characters. Note Screen Code can't be null-terminated
|
||||||
; by definition, and PETSCII can't effectively be DCI.
|
; by definition.
|
||||||
!byte $84
|
!byte $84
|
||||||
!pet "IICSTEP esrever" ;format as StringReverse
|
!pet "IICSTEP esrever" ;format as StringReverse
|
||||||
!byte $84
|
!byte $84
|
||||||
@ -119,7 +119,7 @@
|
|||||||
!byte $84
|
!byte $84
|
||||||
!pet 20,0,"PETSCII with length2" ;format as StringL16
|
!pet 20,0,"PETSCII with length2" ;format as StringL16
|
||||||
!byte $84
|
!byte $84
|
||||||
!pet "bad dcI" ;EDIT: format as StringDCI
|
!pet "pet dcI" ;format as StringDCI
|
||||||
|
|
||||||
!byte $84
|
!byte $84
|
||||||
!scr "edoC neercS esrever" ;format as StringReverse
|
!scr "edoC neercS esrever" ;format as StringReverse
|
||||||
|
@ -405,7 +405,7 @@ namespace SourceGen.WpfGui {
|
|||||||
radioStringNullTerm.IsEnabled = (scanMode != TextScanMode.C64ScreenCode);
|
radioStringNullTerm.IsEnabled = (scanMode != TextScanMode.C64ScreenCode);
|
||||||
radioStringLen8.IsEnabled = true;
|
radioStringLen8.IsEnabled = true;
|
||||||
radioStringLen16.IsEnabled = true;
|
radioStringLen16.IsEnabled = true;
|
||||||
radioStringDci.IsEnabled = (scanMode != TextScanMode.C64Petscii);
|
radioStringDci.IsEnabled = true;
|
||||||
|
|
||||||
IEnumerator<TypedRangeSet.TypedRange> iter = mSelection.RangeListIterator;
|
IEnumerator<TypedRangeSet.TypedRange> iter = mSelection.RangeListIterator;
|
||||||
while (iter.MoveNext()) {
|
while (iter.MoveNext()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user