Skip to content

Commit

Permalink
Fix interrupt mask for non-Atari hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
vinriviere committed Feb 5, 2017
1 parent b77cd83 commit ca11011
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/video/ataricommon/SDL_ikbdinterrupt.S
Expand Up @@ -51,6 +51,7 @@ _SDL_AtariIkbdInstall:

| Disable interrupts

movew sr,d1
movew #0x2700,sr

| Save MFP registers used for keyboard
Expand Down Expand Up @@ -99,7 +100,7 @@ _SDL_AtariIkbdInstall:

| Reenable interrupts

movew #0x2300,sr
movew d1,sr

| Interrupts done

Expand All @@ -123,6 +124,7 @@ _SDL_AtariIkbdUninstall:

| Disable interrupts

movew sr,d1
movew #0x2700,sr

| Restore previous MFP registers
Expand Down Expand Up @@ -160,7 +162,7 @@ ikbd_finbuffer:

| Reenable interrupts

movew #0x2300,sr
movew d1,sr

movel sp@+,a0
rts
Expand Down
14 changes: 8 additions & 6 deletions src/video/ataricommon/SDL_xbiosinterrupt.S
Expand Up @@ -46,6 +46,7 @@ _SDL_AtariXbios_Install:

/* Stop interrupts */

movew sr,d1
movew #0x2700,sr

/* Save old mouse vector, set our routine */
Expand All @@ -54,8 +55,8 @@ _SDL_AtariXbios_Install:
movel sp@(8),d0
beqs no_new_mouse_vector
#if defined(__mcoldfire__)
movel a0@(16),d1
movel d1,oldmousevector
movel a0@(16),a1
movel a1,oldmousevector
#else
movel a0@(16),oldmousevector
#endif
Expand All @@ -68,8 +69,8 @@ no_new_mouse_vector:
movel sp@(12),d0
beqs no_new_joystick_vector
#if defined(__mcoldfire__)
movel a0@(24),d1
movel d1,oldjoystickvector
movel a0@(24),a1
movel a1,oldjoystickvector
#else
movel a0@(24),oldjoystickvector
#endif
Expand All @@ -78,7 +79,7 @@ no_new_joystick_vector:

/* Restart interrupts */

movew #0x2300,sr
movew d1,sr

rts

Expand All @@ -89,6 +90,7 @@ _SDL_AtariXbios_Restore:

/* Stop interrupts */

movew sr,d1
movew #0x2700,sr

/* Restore mouse vector */
Expand All @@ -107,7 +109,7 @@ no_restore_joystick:

/* Restart interrupts */

movew #0x2300,sr
movew d1,sr

rts

Expand Down

0 comments on commit ca11011

Please sign in to comment.