commanderx16 / x16-demo

73 stars 29 forks source link

png2sprite produces lowercase hex that doesn't copy-paste into BASIC #79

Open Robert-Lloyd3 opened 5 years ago

Robert-Lloyd3 commented 5 years ago

Line 113: if args.f == 'acme' or args.f == 'basic': file.write("$%02x" % best)

Writes to file: 10007 DATA $00,$00,$00,__$bc__,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

Pastes to BASIC: 10007 DATA $00,$00,$00,__$|-__,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

LIST outputs: 10007 DATA $00,$00,$00,__$__,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00

Changing the string formatting to use capital-letter-X HEX formatting will fix output for BASIC, but I don't know if this will fix or break ACME: if args.f == 'acme' or args.f == 'basic': file.write("$%02X" % best)

I don't use ACME. Can someone verify and submit the best fix to keep this DRY?

Thanks.