aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/crt0.s5
-rw-r--r--src/edbox.c9
-rw-r--r--src/edbox.h5
-rw-r--r--src/main.c2
4 files changed, 7 insertions, 14 deletions
diff --git a/src/crt0.s b/src/crt0.s
index 399f391..44a1c93 100644
--- a/src/crt0.s
+++ b/src/crt0.s
@@ -43,11 +43,12 @@ start:
lda MEMTOP+1
sta sp+1
-; Set the keyboard to upper-/lower-case mode.
+; Set various OS variables.
ldy #$ff
sty CH ; remove keypress which might be in the input buffer
iny ; Set Y to 0
- sty SHFLOK
+ sty SHFLOK ; Turn off Caps Lock
+ sty SOUNDR ; Turn off SIO beep/click
; Go directly to main(). No support for CLI arguments, no saving
; any machine state for a clean exit, because we don't exit.
diff --git a/src/edbox.c b/src/edbox.c
index 7f232fd..eca60f8 100644
--- a/src/edbox.c
+++ b/src/edbox.c
@@ -25,8 +25,6 @@ char edbox_visible = 0;
char edbox_pos; /* range 0 to EDBOX_SIZE - 1 */
char edbox_len; /* idem */
-void (*edbox_callback)(void);
-
void edbox_show(void) {
u16 addr;
@@ -55,8 +53,8 @@ void move_right(void) {
/* note: c will never be an EOL.
idea: when the edbox is completely full (240 chars), go
- ahead and pretend the user pressed Return (call edbox_callback,
- etc). not sure if this is more or less annoying than just
+ ahead and pretend the user pressed Return.
+ Not sure if this is more or less annoying than just
refusing to accept more input until Return is pressed. */
void edbox_putc(char c) {
if(!c)
@@ -168,8 +166,7 @@ void edbox_keystroke(char c) {
case CH_EOL:
copy_to_old();
edbox_hide();
- if(edbox_callback)
- (*edbox_callback)();
+ cmd_execute();
edbox_clear();
break;
case XCH_TAB:
diff --git a/src/edbox.h b/src/edbox.h
index e4069a0..99e64da 100644
--- a/src/edbox.h
+++ b/src/edbox.h
@@ -24,12 +24,9 @@ void edbox_hide(void);
void edbox_putc(char c);
/* pass a keystroke, insert its character into the edit box. if Return
- is pressed, edbox_callback gets called (if it's set!) */
+ is pressed, cmd_execute() gets called. */
void edbox_keystroke(char c);
-/* called when the user presses Return */
-extern void (*edbox_callback)(void);
-
/* set edit box contents (clears out whatever was there) */
void __fastcall__ edbox_set(char *contents);
diff --git a/src/main.c b/src/main.c
index 536923d..4d80a78 100644
--- a/src/main.c
+++ b/src/main.c
@@ -132,14 +132,12 @@ void reconnect(void) {
void main(void) {
bell_type = config.alert_type; /* TODO: have bell.s read staight from the struct */
- OS.soundr = 0; // Turn off SIO beeping sound
edbox_clear();
scr_init();
init_channels();
while(1) {
- edbox_callback = cmd_execute;
if(fn_connect()) {
ind_net_idle();
irc_register();