lisper / emulator-sun-2

Emulator for Sun-2 workstation
GNU General Public License v2.0
141 stars 13 forks source link

Abort at 0048D0 when running vi on sunos 3.2 #8

Open jrmuizel opened 2 years ago

jrmuizel commented 2 years ago

Steps to reproduce:

sim/sim --prom=media/rom/sun2-multi-rev-R.bin --disk=media/disk/my-sun2-s3.2-disk.img --tape=media/tape/tape
nomame# vi
[press esc]
[press esc]
Abort at 0048D0
>
jrmuizel commented 2 years ago

The emulator log contains:

68k: vector 0x20, old pc 0x1ebbc (prev pc 0x1ebba), fetch 0x20 (80), new pc 0x43a6
fault: bus error! write, pc 11f74 sr 0000 isn_count 83082641
cpu_write: va ffbea0 pa 6a0 fc 1 size 4 mtype 7 fault 1, pte 7fe00000
m68k_set_buserr
PC 011f74 sr 0000 usp ffc240 isp 0037fc msp 000000 sp ffbea4 vbr 000000 (isn 83082642)
sigurbjornl commented 2 years ago

It's probably because of the display beep, I fixed this a bit back in my development branch

Locate this code

void sun2_kb_write(int value, int size) { switch (value) { case 0x01: / reset / scc_in_push(3, 0xff); scc_in_push(3, 0x02); scc_in_push(3, 0x7f); break; case 0x02: / bell on, print bell on screen / // This sends ctrl-g to the terminal, which should blink your terminal or do whatever it is that you've set your terminal to // do on a beep event printf( "\7" ); // If on windows, use the system function to generate a short beep

ifdef _WIN32

  Beep(523, 500);

endif

  break;
case 0x03: /* bell off */
  /* Sigurbjornl, disabled this abort sending code, we can't send an abort everytime an application beeps
     This fixes the beep on startup causing abort (now boots at startup) and applications like vi bombing out when there's a
     bell event (like pressing up arrow at the top of the display, pressing esc when not in insert mode and so on)
  scc_in_push(3, 0x00+1);
  scc_in_push(3, 0x00+77);
  scc_in_push(3, 0x80+77);
  scc_in_push(3, 0x80+1);

  scc_in_push(3, 0x7f); */
  break;
}

}

And fix the case 0x03 by commenting it out

Kind regards, Sibbi

On 4 Apr 2022, at 17:24, Jeff Muizelaar @.***> wrote:

The emulator log contains:

68k: vector 0x20, old pc 0x1ebbc (prev pc 0x1ebba), fetch 0x20 (80), new pc 0x43a6 fault: bus error! write, pc 11f74 sr 0000 isn_count 83082641 cpu_write: va ffbea0 pa 6a0 fc 1 size 4 mtype 7 fault 1, pte 7fe00000 m68k_set_buserr PC 011f74 sr 0000 usp ffc240 isp 0037fc msp 000000 sp ffbea4 vbr 000000 (isn 83082642) — Reply to this email directly, view it on GitHub https://github.com/lisper/emulator-sun-2/issues/8#issuecomment-1087819048, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBSMVECVR36T43Y5PYTA2DVDMQWRANCNFSM5SQGXIUQ. You are receiving this because you are subscribed to this thread.