Skip to content

Commit 2db8ec5

Browse files
author
none
committed
use latin-1 as an encoding so that we can write 8-bit characters
1 parent ecd5b48 commit 2db8ec5

File tree

7 files changed

+12
-11
lines changed

7 files changed

+12
-11
lines changed

console.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _run(self, win):
7777
self._update()
7878
if len(self._buffered_input) > 0:
7979
if self._connection is not None:
80-
self._connection.send(self._buffered_input.encode('ascii'))
80+
self._connection.send(self._buffered_input.encode('latin-1'))
8181
self._buffered_input = u''
8282

8383
def _accept(self, socket, mask):

device.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,5 +367,5 @@ def __init__(self, args, address, interrupt):
367367
Device.register_console_output_handler(self._send)
368368

369369
def _send(self, output):
370-
sys.stdout.write(output.decode('ascii'))
370+
sys.stdout.write(output.decode('latin-1'))
371371
sys.stdout.flush()

devices/CompactFlash.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ def __init__(self, args, address, interrupt):
118118
16383, # 1
119119
16, # 3
120120
63, # 6
121-
'00000000'.encode('ascii'), # 10-19
121+
'00000000'.encode('latin-1'), # 10-19
122122
0, # 22
123-
'00000000'.encode('ascii'), # 23-26
124-
'py68k emulated CF '.encode('ascii'), # 27-46
123+
'00000000'.encode('latin-1'), # 23-26
124+
'py68k emulated CF '.encode('latin-1'), # 27-46
125125
1, # 47
126126
0, # 49
127127
0, # 51

devices/MC68681.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def write(self, addr, value):
110110
# self._txfifo
111111

112112
elif addr == Channel.REG_TB and self._is_console:
113-
self._parent.console_handle_output(chr(value).encode('ascii'))
113+
self._parent.console_handle_output(chr(value).encode('latin-1'))
114114

115115
self.update_status()
116116

devices/p90ce201.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def write(self, width, offset, value):
333333
if width == Device.WIDTH8:
334334
if offset == REG_SBUF:
335335
if self._is_console:
336-
self.console_handle.output(chr(value).encode('ascii'))
336+
self.console_handle.output(chr(value).encode('latin-1'))
337337
if self._scon & 0x02 == 0:
338338
# XXX should be based on time-since-write
339339
self._scon |= 0x02 # transmit complete status

musashi/m68k.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def disassemble(pc, cpu_type):
247247
n = lib.m68k_disassemble(__dis_buf,
248248
c_uint(pc),
249249
c_uint(cpu_type))
250-
return __dis_buf.value.decode('ascii')
250+
return __dis_buf.value.decode('latin-1')
251251

252252

253253
"""
@@ -303,8 +303,8 @@ def mem_write_memory(address, width, value):
303303
lib.mem_write_memory(c_uint(address), c_ubyte(width), c_uint(value))
304304

305305

306-
def mem_write_bulk(address, bytes):
307-
lib.mem_write_bulk(c_uint(address), bytes, c_uint(len(bytes)))
306+
def mem_write_bulk(address, buffer):
307+
lib.mem_write_bulk(c_uint(address), c_char_p(bytes(buffer)), c_uint(len(buffer)))
308308

309309

310310
# Callback API

py68k.sublime-project

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"settings":
1111
{
1212
"tab_size": 4,
13-
"detect_indentation": false
13+
"detect_indentation": false,
14+
"translate_tabs_to_spaces": true
1415
}
1516
}

0 commit comments

Comments
 (0)