From 5ccac6e48aeb1226893b451a3375b5da2def7575 Mon Sep 17 00:00:00 2001 From: alpine9000 Date: Wed, 1 Jun 2016 14:37:42 +1000 Subject: [PATCH] Fail safe quit for wb --- 028.bs/game1.s | 8 ++++---- 028.bs/os.i | 26 +++++++++++++++----------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/028.bs/game1.s b/028.bs/game1.s index 762eaad..7b4a0b5 100644 --- a/028.bs/game1.s +++ b/028.bs/game1.s @@ -272,7 +272,7 @@ QuitGame: movem.l d0-a6,-(sp) jsr P61_End movem.l (sp)+,d0-a6 - rts + jmp LongJump Update: jsr UpdatePlayer @@ -893,16 +893,16 @@ BlitCountdown: ;; \c sprite Level 91,"STAY ON THE PATHWAYS!",100,2*2,12,10,"WELL DONE!",A,21,0,1,pig Level 92,"COLLECT COINS!",100,2*2,12,10,"NEXT COLLECT AN ARROW...",A,21,0,1,pig - Level 93,"PRESS FIRE TO ACTIVATE THE ARROW",100,2*2,12,10,"WHOOHOO",A,21,0,1,pig + Level 93,"PRESS FIRE TO ACTIVATE THE ARROW",100,2*2,12,10,"WHOO HOO!",A,21,0,1,pig Level 94,"WATCH OUT FOR BEES!",100,2*2,12,10,"LOL - BEES :-)",A,21,0,1,pig Level 95,"REMEMBER THE PATHWAYS BEFORE THEY FADE!",75,2*2,12,10,"CLOCKS WILL STOP THE BOARD MOVING",A,21,0,1,pig Level 96,"PRESS FIRE TO ACTIVATE THE CLOCK",200,2*2,12,10,"EYES WILL UNHIDE THE BOARD",A,21,0,1,pig - Level 97,"PRESS FIRE TO ACTIVATE THE EYE",100,2*2,12,10,"LEVEL 7",A,21,0,1,pig + Level 97,"PRESS FIRE TO ACTIVATE THE EYE",100,2*2,12,10,"YOU DID IT!",A,21,0,1,pig Level 1,"WELCOME TO BLOCKY SKIES!",75,2*2,12,10,"PHEW!, LEVEL 1 COMPLETE!",A,99,0,1,pig Level 2,"HAVING FUN YET?",70,2*2,12,10,"LEVEL 2",B,98,2,0,robot Level 3,"GIDDY UP!",50,4*2,8,6,"GETTING FASTER!, LEVEL 3 COMPLETE!",C,98,2,0,pig - Level 4,"LETS GO?",200,4*2,8,6,"LEVEL 4 COMPLETE",E,99,2,0,cow + Level 4,"MOOOOOOOO!",200,4*2,8,6,"LEVEL 4 COMPLETE",E,99,2,0,cow Level 5,"KABOOM?!",200,4*2,8,6,"PHEW!!! LEVEL 5 COMPLETE!",D,99,1,0,tank Level 6,"WHAT? WHAT?!",50,4*2,8,6,"NICE! LEVEL 6 COMPLETE!",A,98,1,0,cow diff --git a/028.bs/os.i b/028.bs/os.i index b4fca08..a69e424 100644 --- a/028.bs/os.i +++ b/028.bs/os.i @@ -6,16 +6,16 @@ StartupFromOS: sub.l a4,a4 btst #0,297(a6) ;68000 CPU? beq.s .yes68k - lea .GetVBR(PC),a5 ;else fetch vector base address to a4: + lea GetVBR(PC),a5 ;else fetch vector base address to a4: jsr -30(a6) ;enter Supervisor mode *--- save view+coppers ---* .yes68k: - lea .GfxLib(PC),a1 ;either way return to here and open + lea GfxLib(PC),a1 ;either way return to here and open jsr -408(a6) ;graphics library tst.l d0 ;if not OK, - beq.s .quit ;exit program. + beq.s quit ;exit program. move.l d0,a5 ;a5=gfxbase move.l a5,a6 @@ -26,22 +26,25 @@ StartupFromOS: *--- save int+dma ---* lea $dff000,a6 - bsr.s WaitEOF ;wait out the current frame + bsr WaitEOF ;wait out the current frame move.l $1c(a6),-(sp) ;save intena+intreq move.w 2(a6),-(sp) ;and dma move.l $6c(a4),-(sp) ;and also the VB int vector for sport. - bsr.s AllOff ;turn off all interrupts+DMA + bsr AllOff ;turn off all interrupts+DMA *--- call demo ---* movem.l a4-a6,-(sp) + move.l a7,longJump jsr Entry2 +LongJump: + move.l longJump,a7 movem.l (sp)+,a4-a6 *--- restore all ---* - bsr.s WaitEOF ;wait out the demo's last frame - bsr.s AllOff ;turn off all interrupts+DMA + bsr WaitEOF ;wait out the demo's last frame + bsr AllOff ;turn off all interrupts+DMA move.l (sp)+,$6c(a4) ;restore VB vector move.l 38(a5),$80(a6) ;and copper pointers move.l 50(a5),$84(a6) @@ -62,15 +65,17 @@ StartupFromOS: move.l a6,a1 ;close graphics library move.l 4.w,a6 jsr -414(a6) -.quit: +quit: moveq #0,d0 ;clear error return code to OS rts ;back to AmigaDOS/Workbench. -.GetVBR: +GetVBR: dc.w $4e7a,$c801 ;hex for "movec VBR,a4" rte ;return from Supervisor mode -.GfxLib: +longJump: + dc.l 0 +GfxLib: dc.b "graphics.library",0,0 WaitEOF: ;wait for end of frame @@ -83,7 +88,6 @@ WaitRaster: ;Wait for scanline d0. Trashes d1. cmp.w d0,d1 bne.s .l ;wait until it matches (eq) rts - AllOff: move.w #$7fff,d2 ;clear all bits move.w d2,$96(a6) ;in DMACON,