Commit 679f7452 authored by Richard Leggett's avatar Richard Leggett
Browse files

Hourglass shape changed.

parent 5a06b179
......@@ -5,10 +5,10 @@
GBLS CurrentIteration
GBLL ReleaseVersion
CurrentDate SETS "06 Mar 1998"
CurrentTime SETS "17:01:42"
CurrentDate SETS "03 Jun 1998"
CurrentTime SETS "15:21:00"
CurrentVersion SETS "13"
CurrentIteration SETS "0000"
CurrentIteration SETS "0004"
ReleaseVersion SETL True
END
***************************************************************************
* *
* Project: Ursula *
* *
* Module: Hourglass *
* *
* Created: Wed 15-Apr-98 By: Richard Leggett *
* *
* First version: 0.12 *
* *
* Copyright: (C) 1998, Acorn Computers Ltd., Cambridge, England. *
* *
***************************************************************************
---------------------------------------------------------------------------
Version 0.12 (Ben Avison)
Mon 7-Jul-97
- Bugfix: new hourglass colours are marked as pending until they are
implemented (at the next animation frame), so if the hourglass is
turned all the way off before then, the module can correctly determine
which pointer colours need redefining to correctly display the standard
pointer.
Fri 6-Mar-98
- Bugfixes:
* Killing the module before it had shown the hourglass used to remove
the pointer.
* If an hourglass with a long lead-in time is pending, and a (shorter
lead-in) second hourglass is started, the time that the animation
actually starts is now determined by the sooner of the two, rather
than always by the top-level hourglass' lead-in time.
* If something else changes the pointer number or colours while the
Hourglass is animating, the new values are remembered and put into
effect when the hourglass stops, overriding those that were active
when the hourglass started.
* Under certain circumstances, R10 could be corrupted on exit, leading
to data aborts being generated by the Wimp error box code. Fixing this
also means that Hourglass_Smash can call Hourglass_Off directly,
rather than having to issue Hourglass_Off as a SWI.
---------------------------------------------------------------------------
Version: 0.13 (Richard Leggett)
Wed 15-Apr-98
- Added Ursula service call table.
Wed 15-Apr-98
- Changes to allow easier changing of hourglass data:
* Added variable to keep track of number of frames.
* Some ADRs have to be changed to ADRLs to cope with new hourglass
data.
Tue 21-Apr-98
- Now stores/remembers colours 1-3 instead of just 1 and 3. This
means we can now have a three colour hourglass.
Wed 03-Jun-98
- Added MMoir's first attempt at some new sprites, plus my own
character defs.
......@@ -41,6 +41,8 @@ debugswientry SETL {FALSE}
debugdepth SETL {FALSE}
GBLL debugcurrent
debugcurrent SETL {FALSE}
GBLL ursula
ursula SETL {TRUE}
bignum * &3FFFFFFF ; A large number to put into PercentageDepth
......@@ -62,17 +64,14 @@ StartupDelay * 33
PixelsPerByte * 4
BytesPerLine * 6
HeightInPixels * 30
HeightInPixels * 32
DataSize * (BytesPerLine * HeightInPixels + 3):AND: :NOT: 3
PercX * 0
PercY * 21
PercY * 23
CharWidth * 8
CharHeight * 9
DefaultColour1 * &00FFFF00 ; Cyan
DefaultColour3 * &00FF0000 ; Blue
WaitForVSync * 19
SetPointer * 106
......@@ -80,6 +79,13 @@ NoPointer * 0
PointerOSWord * 21
WritePalette * 12
; Define number of frames and palette data
HourglassFrames * 8
DefaultColour1 * &fff6d5
DefaultColour2 * &0
DefaultColour3 * &ffa100
MySWIChunkBase * Module_SWISystemBase + HourglassSWI * Module_SWIChunkSize
ASSERT MySWIChunkBase = Hourglass_On
......@@ -91,15 +97,27 @@ HourglassDataEnd # 0
ReturnColours # 0 ; Colours to return to when switched fully off
ReturnColour1 # 4
[ ursula
ReturnColour2 # 4
]
ReturnColour3 # 4
NextHColours # 0 ; Colours to reassert at next frame update
NextHColour1 # 4
[ ursula
NextHColour2 # 4
]
NextHColour3 # 4
LastHColours # 0 ; Colours set at last frame update
LastHColour1 # 4
[ ursula
LastHColour2 # 4
]
LastHColour3 # 4
CurrentColours # 0 ; Colours actually in use
CurrentColour1 # 4
[ ursula
CurrentColour2 # 4
]
CurrentColour3 # 4
HourglassTimer # 4
HourglassDepth # 4
......@@ -239,6 +257,9 @@ OSWord15BlockData
DefaultColours
DCD DefaultColour1
[ ursula
DCD DefaultColour2
]
DCD DefaultColour3
FinalisationCode ROUT
......@@ -569,7 +590,7 @@ SetupPointer ROUT
STRB r0, NewPercentage
ADR r0, HourglassData
[ debug
[ debug :LOR: ursula
ADRL r1, HourglassShape
ADRL r2, HourglassShapeEnd
|
......@@ -606,11 +627,16 @@ SetupPointer ROUT
FillHourglass ROUT
LDRB r0, HourglassState
ADD r0, r0, #1 ; go to next state
[ ursula
TEQ r0, #HourglassFrames
|
TEQ r0, #6 ; keep in range 0..5
]
MOVEQ r0, #0
STRB r0, HourglassState
[ debug
[ debug :LOR: ursula
ADRL r1, DiffOffsetTable
|
ADR r1, DiffOffsetTable
......@@ -691,11 +717,13 @@ SetupPercentage ROUT
BHS %f1 ; turn it off
MOV r1, #10
DivRem r0, r2, r1, r14
[ debug
[ debug :LOR: ursula
ADRL r3, ChDefNumbers
|
ADR r3, ChDefNumbers
]
ASSERT CharHeight = 9
ADD r1, r0, r0, LSL #3 ; * 9
ADD r1, r3, r1, LSL #1
......@@ -711,7 +739,7 @@ SetupPercentage ROUT
Pull "pc"
1
ADR r0, HourglassData+(PercX/PixelsPerByte)+(PercY * BytesPerLine)
[ debug
[ debug :LOR: ursula
ADRL r1, ChDefSpace
|
ADR r1, ChDefSpace
......@@ -743,40 +771,47 @@ SetupCharLoop
BNE SetupCharLoop
Pull "r0-r2, pc"
[ ursula
; *****************************************************************************
;
; ProgramPointer - Call OS_Word to define pointer shape
;
ProgramPointer ROUT
Push "r0-r6, lr"
Push "r0-r9, lr"
LDRB r0, Block_PointerNumber
EOR r0, r0, #(3 :EOR: 4)
STRB r0, Block_PointerNumber
MOV r0, #PointerOSWord
ADR r1, OSWord15Block
ADRL r1, OSWord15Block
SWI XOS_Word ; reprogram our pointer
BL ReadPointerColours ; get CurrentColours
ADR r0, NextHColours
LDMIA r0, { r3, r4 }
LDMIA r0, { r4, r5, r6 }
ADR r0, CurrentColours
LDMIA r0, { r5, r6 }
LDMIA r0, { r7, r8, r9 }
TEQ r5, r3 ; set the colour(s)/number for the next frame
TEQEQ r6, r4 ; avoid reprogramming colours unless strictly necessary
TEQ r7, r4 ; set the colour(s)/number for the next frame
TEQEQ r8, r5 ; avoid reprogramming colours unless strictly necessary
TEQEQ r9, r6
MOVNE r0, #WaitForVSync ; at least one needs changing, so wait until VSync
SWINE XOS_Byte
MOV r0, #1
TEQ r5, r3
MOVNE r1, r3
TEQ r7, r4
MOVNE r1, r4
BLNE SetColour ; logical Colour 1
MOV r0, #2
TEQ r8, r5
MOVNE r1, r5
BLNE SetColour ; logical Colour 2
MOV r0, #3
TEQ r6, r4
MOVNE r1, r4
TEQ r9, r6
MOVNE r1, r6
BLNE SetColour ; logical Colour 3
MOV r0, #SetPointer
LDRB r1, Block_PointerNumber
......@@ -786,17 +821,21 @@ ProgramPointer ROUT
CMP r1, #3 ; if we weren't the last to set a colour/number,
STRLOB r1, ReturnPointer ; remember the current one for when we switch off
ADR r0, LastHColours
LDMIA r0, { r1, r2 }
TEQ r5, r1
STRNE r5, ReturnColour1
TEQ r6, r2
STRNE r6, ReturnColour3
LDMIA r0, { r1, r2, r3 }
TEQ r7, r1
STRNE r7, ReturnColour1
TEQ r8, r2
STRNE r8, ReturnColour2
TEQ r9, r3
STRNE r9, ReturnColour3
STMIA r0, { r3, r4 } ; LastHColours = NextHColours
STMIA r0, { r4, r5, r6 } ; LastHColours = NextHColours
Pull "r0-r6, pc"
Pull "r0-r9, pc"
LTORG
]
; *****************************************************************************
;
......@@ -820,6 +859,8 @@ SetColour ROUT
ADD sp, sp, #8 ; Trash stack frame
Pull "r0-r1, pc"
[ ursula
; *****************************************************************************
;
; InitialisePointerInfo - sets up colour, number etc information
......@@ -828,24 +869,25 @@ SetColour ROUT
;
; out: Registers preserved.
InitialisePointerInfo ENTRY "r0-r2"
InitialisePointerInfo ENTRY "r0-r3"
BL ReadPointerColours ; get CurrentColours
ADR r0, CurrentColours ; Return = Current
LDMIA r0, { r1, r2 }
LDMIA r0, { r1, r2, r3 }
ADR r0, ReturnColours
STMIA r0, { r1, r2 }
STMIA r0, { r1, r2, r3 }
MOV r0, #1
STRB r0, ReturnPointer ; mustn't read current pointer
; number here, it causes flicker
ADRL r0, DefaultColours ; NextH = Default
LDMIA r0, { r1, r2 }
LDMIA r0, { r1, r2, r3 }
ADR r0, NextHColours
STMIA r0, { r1, r2 }
STMIA r0, { r1, r2, r3 }
MOV r0, #-1 ; LastH = -1 (ie guaranteed != current)
STR r0, LastHColour1
STR r0, LastHColour2
STR r0, LastHColour3
MOV r0, #1
......@@ -856,7 +898,10 @@ InitialisePointerInfo ENTRY "r0-r2"
STRB r0, NewLEDs
EXIT
]
[ ursula
; *****************************************************************************
;
; RestorePointer - changes pointer number and colours back to the "off" values.
......@@ -865,7 +910,7 @@ InitialisePointerInfo ENTRY "r0-r2"
;
; out: Registers preserved.
RestorePointer ENTRY "r0-r4,r10-r11"
RestorePointer ENTRY "r0-r5,r9-r11"
BL ReadPointerColours ; get CurrentColours
MOV r0, #SetPointer ; restore old pointer iff it was most recently changed by us
......@@ -880,26 +925,36 @@ RestorePointer ENTRY "r0-r4,r10-r11"
; here is far better than having it
; during a pre-emptive read routine.
LDR r10, LastHColour1 ; restore old colour(s) iff they were most recently changed by us
LDR r9, LastHColour1 ; restore old colour(s) iff they were most recently changed by us
LDR r10, LastHColour2
LDR r11, LastHColour3
LDR r3, CurrentColour1
LDR r4, CurrentColour3
TEQ r3, r10
TEQNE r4, r11
LDR r4, CurrentColour2
LDR r5, CurrentColour3
TEQ r3, r9
TEQNE r4, r10
TEQNE r5, r11
MOVEQ r0, #WaitForVSync ; at least one needs changing, so wait until VSync
SWIEQ XOS_Byte ; if called R1, R2 trashed
MOV r0, #1
TEQ r3, r10
TEQ r3, r9
LDREQ r1, ReturnColour1
BLEQ SetColour ; logical Colour 1
MOV r0, #2
TEQ r4, r10
LDREQ r1, ReturnColour2
BLEQ SetColour ; logical Colour 2
MOV r0, #3
TEQ r4, r11
TEQ r5, r11
LDREQ r1, ReturnColour3
BLEQ SetColour ; logical Colour 3
EXIT
]
; *****************************************************************************
;
......@@ -918,6 +973,15 @@ ReadPointerColours ENTRY "r0-r3"
STRVC r2, CurrentColour1
Debug current, "Current colour 1 =", r2
[ ursula
MOV r0, #2
MOV r1, #25
SWI XOS_ReadPalette
MOVVC r2, r2, LSR #8
STRVC r2, CurrentColour2
Debug current, "Current colour 2 =", r2
]
MOV r0, #3
MOV r1, #25
SWI XOS_ReadPalette
......@@ -927,87 +991,118 @@ ReadPointerColours ENTRY "r0-r3"
EXIT
; *****************************************************************************
; Shape data
; ***************************************************************************
; Hourglass data
ALIGN
HourglassShape
DCB &00, &55, &55, &55, &55, &00
DCB &00, &55, &55, &55, &55, &00
DCB &00, &55, &55, &55, &55, &00
DCB &00, &FD, &FF, &FF, &7F, &00
DCB &00, &74, &55, &55, &1D, &00
DCB &00, &D0, &55, &55, &07, &00
DCB &00, &40, &57, &D5, &01, &00
DCB &00, &00, &5D, &75, &00, &00
DCB &00, &00, &74, &1D, &00, &00
DCB &00, &00, &D0, &07, &00, &00
DCB &00, &00, &D0, &07, &00, &00
DCB &00, &00, &F4, &1F, &00, &00
DCB &00, &00, &FD, &7F, &00, &00
DCB &00, &40, &FF, &FF, &01, &00
DCB &00, &D0, &FF, &FF, &07, &00
DCB &00, &F4, &FF, &FF, &1F, &00
DCB &00, &FD, &FF, &FF, &7F, &00
DCB &00, &55, &55, &55, &55, &00
DCB &00, &55, &55, &55, &55, &00
DCB &00, &55, &55, &55, &55, &00
DCB &00, &a8, &aa, &aa, &aa, &00
DCB &00, &f8, &ff, &ff, &bf, &00
DCB &00, &58, &55, &55, &95, &00
DCB &00, &58, &55, &55, &95, &00
DCB &00, &d8, &ff, &ff, &9f, &00
DCB &00, &d8, &ff, &ff, &9f, &00
DCB &00, &60, &ff, &ff, &27, &00
DCB &00, &60, &ff, &ff, &27, &00
DCB &00, &80, &fd, &ff, &09, &00
DCB &00, &00, &f6, &7f, &02, &00
DCB &00, &00, &d8, &9f, &00, &00
DCB &00, &00, &58, &95, &00, &00
DCB &00, &00, &56, &57, &02, &00
DCB &00, &80, &55, &55, &09, &00
DCB &00, &60, &55, &57, &25, &00
DCB &00, &60, &55, &55, &25, &00
DCB &00, &58, &55, &57, &95, &00
DCB &00, &58, &55, &55, &95, &00
DCB &00, &58, &55, &57, &95, &00
DCB &00, &58, &55, &57, &95, &00
DCB &00, &f8, &ff, &ff, &bf, &00
DCB &00, &a8, &aa, &aa, &aa, &00
ALIGN
HourglassShapeEnd
DiffOffsetTable
& ShapeDiffs0-DiffOffsetTable
& ShapeDiffs1-DiffOffsetTable
& ShapeDiffs2-DiffOffsetTable
& ShapeDiffs3-DiffOffsetTable
& ShapeDiffs4-DiffOffsetTable
& ShapeDiffs5-DiffOffsetTable
& ShapeDiffs0-DiffOffsetTable
& ShapeDiffs1-DiffOffsetTable
& ShapeDiffs2-DiffOffsetTable
& ShapeDiffs3-DiffOffsetTable
& ShapeDiffs4-DiffOffsetTable
& ShapeDiffs5-DiffOffsetTable
& ShapeDiffs6-DiffOffsetTable
& ShapeDiffs7-DiffOffsetTable
ShapeDiffs0
DCB &74,&19, &55,&1A, &55,&1B, &1D,&1C, &55,&20, &55,&21
DCB &57,&26, &D5,&27, &5D,&2C, &75,&2D, &74,&32, &1D,&33
DCB &F4,&44, &1F,&45, &FD,&4A, &7F,&4B, &FF,&50, &FF,&51
DCB &FF,&56, &FF,&57, &F4,&5B, &FF,&5C, &FF,&5D, &1F,&5E
DCB &00,&00, &00,&00
ShapeDiffs1
DCB &F4,&19, &FF,&1A, &FF,&1B, &1F,&1C, &7F,&5C, &FD,&5D
DCB &d5,&74, &5f,&75
DCB &00,&00, &00,&00
ShapeDiffs2
DCB &FF,&20, &FF,&21, &7F,&56, &FD,&57, &5F,&5C, &F5,&5D
DCB &58,&19, &55,&1a, &55,&1b, &95,&1c, &57,&69, &d5,&6e
DCB &5f,&6f, &f5,&74, &7f,&75, &7f,&75
DCB &00,&00, &00,&00
ShapeDiffs3
DCB &FF,&26, &FF,&27, &7F,&50, &FD,&51, &5F,&56, &F5,&57
DCB &57,&5C, &D5,&5D, &00,&00, &00,&00
DCB &58,&1f, &55,&20, &55,&21, &95,&22, &d5,&68, &5f,&69
DCB &f5,&6e, &7f,&6f, &fd,&74, &ff,&75
DCB &00,&00, &00,&00
ShapeDiffs4
DCB &FD,&2C, &7F,&2D, &7D,&4A, &7D,&4B, &5F,&50, &F5,&51
DCB &57,&56, &D5,&57, &55,&5C, &55,&5D, &00,&00, &00,&00
DCB &55,&26, &55,&27, &25,&28, &57,&5d, &d5,&62, &5f,&63
DCB &f5,&68, &7f,&69, &fd,&6e, &ff,&6f, &ff,&74, &97,&76
DCB &00,&00, &00,&00
ShapeDiffs5
DCB &F4,&32, &1F,&33, &74,&44, &1D,&45, &5D,&4A, &75,&4B
DCB &57,&50, &D5,&51, &55,&56, &55,&57, &74,&5B, &1D,&5E
DCB &55,&2c, &55,&2d, &25,&2e, &d5,&5c, &5f,&5d, &f5,&62
DCB &7f,&63, &fd,&68, &ff,&69, &ff,&6e, &97,&70, &d8,&73
DCB &9f,&76, &9f,&76
DCB &00,&00, &00,&00
ShapeDiffs6
DCB &55,&32, &55,&33, &55,&4b, &57,&51, &d5,&56, &5f,&57
DCB &f5,&5c, &7f,&5d, &fd,&62, &ff,&63, &ff,&68, &97,&6a
DCB &d8,&6d, &9f,&70
DCB &00,&00, &00,&00
ShapeDiffs7
DCB &56,&38, &55,&39, &58,&3e, &95,&3f, &d5,&50, &5f,&51
DCB &f5,&56, &7f,&57, &fd,&5c, &ff,&5d, &ff,&62, &97,&64
DCB &d8,&67, &9f,&6a
DCB &00,&00, &00,&00
ShapeDiffs0
DCB &d8,&19, &ff,&1a, &ff,&1b, &9f,&1c, &d8,&1f, &ff,&20
DCB &ff,&21, &9f,&22, &ff,&26, &ff,&27, &27,&28, &ff,&2c
DCB &ff,&2d, &27,&2e, &fd,&32, &ff,&33, &f6,&38, &7f,&39
DCB &d8,&3e, &9f,&3f, &57,&4b, &55,&50, &55,&51, &55,&56
DCB &57,&57, &55,&5c, &55,&5d, &55,&62, &57,&63, &95,&64
DCB &58,&67, &55,&68, &55,&69, &95,&6a, &58,&6d, &55,&6e
DCB &57,&6f, &95,&70, &58,&73, &55,&74, &57,&75, &95,&76
DCB &00,&00, &00,&00
; ***************************************************************************
; Character definitions
ALIGN
ChDefSpace
DCD 0, 0, 0, 0, 0
ChDefNumbers
= &55,&55,&F5,&5F,&7D,&7D,&7D,&7F,&FD,&7F,&FD,&7D,&7D,&7D,&F5,&5F,&55,&55
= &55,&55,&D5,&57,&F5,&57,&D5,&57,&D5,&57,&D5,&57,&D5,&57,&FD,&7F,&55,&55
= &55,&55,&F5,&5F,&7D,&7D,&55,&7D,&55,&5F,&D5,&57,&F5,&55,&FD,&7F,&55,&55
= &55,&55,&F5,&5F,&7D,&7D,&55,&7D,&D5,&5F,&55,&7D,&7D,&7D,&F5,&5F,&55,&55
= &55,&55,&55,&5F,&D5,&5F,&F5,&5F,&7D,&5F,&FD,&7F,&55,&5F,&55,&5F,&55,&55
= &55,&55,&FD,&7F,&7D,&55,&FD,&5F,&55,&7D,&55,&7D,&7D,&7D,&F5,&5F,&55,&55
= &55,&55,&D5,&5F,&F5,&55,&7D,&55,&FD,&5F,&7D,&7D,&7D,&7D,&F5,&5F,&55,&55
= &55,&55,&FD,&7F,&55,&7D,&55,&5F,&D5,&57,&F5,&55,&F5,&55,&F5,&55,&55,&55
= &55,&55,&F5,&5F,&7D,&7D,&7D,&7D,&F5,&5F,&7D,&7D,&7D,&7D,&F5,&5F,&55,&55
= &55,&55,&F5,&5F,&7D,&7D,&7D,&7D,&F5,&7F,&55,&7D,&55,&5F,&F5,&57,&55,&55
= &ff,&ff,&5f,&f5,&d7,&d7,&d7,&d7,&d7,&d7,&d7,&d7,&d7,&d7,&5f,&f5,&ff,&ff
= &ff,&ff,&7f,&fd,&5f,&fd,&7f,&fd,&7f,&fd,&7f,&fd,&7f,&fd,&7f,&fd,&ff,&ff
= &ff,&ff,&5f,&f5,&d7,&d7,&ff,&d7,&7f,&f5,&5f,&ff,&d7,&ff,&57,&d5,&ff,&ff
= &ff,&ff,&5f,&f5,&57,&d7,&ff,&d7,&ff,&f5,&ff,&d7,&57,&d7,&5f,&f5,&ff,&ff
= &ff,&ff,&7f,&f5,&5f,&f5,&d7,&f5,&d7,&f5,&57,&d5,&ff,&f5,&ff,&f5,&ff,&ff
= &ff,&ff,&57,&d5,&d7,&ff,&57,&f5,&ff,&d7,&ff,&d7,&d7,&d7,&5f,&f5,&ff,&ff
= &ff,&ff,&5f,&d5,&d7,&ff,&d7,&ff,&57,&f5,&d7,&d7,&d7,&d7,&5f,&f5,&ff,&ff
= &ff,&ff,&57,&d5,&ff,&f5,&7f,&fd,&7f,&fd,&5f,&ff,&5f,&ff,&5f,&ff,&ff,&ff
= &ff,&ff,&5f,&f5,&d7,&d7,&d7,&d7,&5f,&f5,&d7,&d7,&d7,&d7,&5f,&f5,&ff,&ff
= &ff,&ff,&5f,&f5,&d7,&d7,&d7,&d7,&5f,&d5,&ff,&d7,&ff,&d7,&5f,&f5,&ff,&ff
ChDefPercent
= &55,&55,&7D,&55,&7D,&7D,&55,&5F,&D5,&57,&F5,&55,&7D,&7D,&55,&7D,&55,&55
= &ff,&ff,&df,&df,&77,&f7,&77,&f7,&df,&dd,&7f,&77,&7f,&77,&df,&df,&ff,&ff
ALIGN
END
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment