poll_in.register(fd_in, select.POLLIN)
mem = {
ZP_CH: 0,
- ZP_CV: 0
+ ZP_CV: 0,
+ 0x300: 0, # tone freq
+ 0x301: 0, # tone dur
}
def init():
atexit.unregister(deinit)
attr = None
+def pr_hash(n):
+ pass
+
+def in_hash(n):
+ pass
+
def read_ready():
return len(poll_in.poll(1)) != 0
return line
if ch == '\b':
if len(line):
- _prnt(' \b')
+ _print(' \b')
line = line[:-1]
else:
# strictly, apple only does this if cursor not at left, maybe
# doesn't seem to work on any linux console on my laptop
write(f'\x1b7\x1b[10;{freq:d}]\x1b[11;{dur:d}]\x07\x1b8')
+def himem(addr):
+ pass
+
+def lomem(addr):
+ pass
+
def peek(addr):
return mem.get(addr & 0xffff, 0)
def call(addr):
addr &= 0xffff
- raise Exception(f'call {addr:04x}')
+ if addr == 0x302:
+ tone(mem[0x300], mem[0x301])
+ elif addr == 0x3600:
+ # lighting (setup)
+ pass
+ elif addr == 0x3603:
+ # lightning (execute)
+ pass
+ elif addr == ROM_CLREOP:
+ clreop()
+ else:
+ raise Exception(f'call {addr:04x}')
def text():
pass
}
}
<INITIAL>{
- \>\ *=|=\ *\> {
+ \xcf\ *\xd0|\xd0\ *\xcf {
return y_tab.OPERATOR_GE
}
- \<\ *=|=\ *\< {
+ \xd1\ *\xd0|\xd0\ *\xd1 {
return y_tab.OPERATOR_LE
}
- \<\ *\>|\>\ *\< {
+ \xd1\ *\xcf|\xcf\ *\xd1 {
return y_tab.OPERATOR_NE
}
}
apple_io.text()
@method(StatementPrHash)
def execute(self, context):
- assert False
+ value = self.children[0].get_int(context)
+ apple_io.pr_hash(value)
@method(StatementInHash)
def execute(self, context):
- assert False
+ value = self.children[0].get_int(context)
+ apple_io.in_hash(value)
@method(StatementCall)
def execute(self, context):
value = self.children[0].get_int(context)
apple_io.vtab(value)
@method(StatementHimemColon)
def execute(self, context):
- assert False
+ value = self.children[0].get_int(context)
+ apple_io.himem(value)
@method(StatementLomemColon)
def execute(self, context):
- assert False
+ value = self.children[0].get_int(context)
+ apple_io.lomem(value)
@method(StatementOnErr)
def execute(self, context):
assert False
| %space (?E{t_def.StatementRead}TOKEN_READ lvalue_list)
| %space (?E{t_def.StatementGr}TOKEN_GR)
| %space (?E{t_def.StatementText}TOKEN_TEXT)
- | %space (?E{t_def.StatementPrHash}TOKEN_PR_HASH)
- | %space (?E{t_def.StatementInHash}TOKEN_IN_HASH)
+ | %space (?E{t_def.StatementPrHash}TOKEN_PR_HASH rvalue)
+ | %space (?E{t_def.StatementInHash}TOKEN_IN_HASH rvalue)
| %space (?E{t_def.StatementCall}TOKEN_CALL rvalue)
| %space (?E{t_def.StatementPlot}TOKEN_PLOT rvalue ',' rvalue)
| %space (?E{t_def.StatementHLin}TOKEN_HLIN rvalue ',' rvalue TOKEN_AT rvalue)
| %space (?E{t_def.StatementColorEqual}TOKEN_COLOR_EQUAL rvalue)
| %space (?E{t_def.StatementPop}TOKEN_POP)
| %space (?E{t_def.StatementVTab}TOKEN_VTAB rvalue)
- | %space (?E{t_def.StatementHimemColon}TOKEN_HIMEM_COLON)
- | %space (?E{t_def.StatementLomemColon}TOKEN_LOMEM_COLON)
+ | %space (?E{t_def.StatementHimemColon}TOKEN_HIMEM_COLON rvalue)
+ | %space (?E{t_def.StatementLomemColon}TOKEN_LOMEM_COLON rvalue)
| %space (?E{t_def.StatementOnErr}TOKEN_ONERR)
| %space (?E{t_def.StatementResume}TOKEN_RESUME)
| %space (?E{t_def.StatementRecall}TOKEN_RECALL)