Work is done on controls
This commit is contained in:
Antoine Vignau 2020-11-04 19:58:40 +01:00
parent b8822210c0
commit 25e9d669ed
5 changed files with 462 additions and 59 deletions

View File

@ -1,8 +1,22 @@
* *
* Genesys v1.2.4 * Genesys v1.2.4 -> V1.3.4
* Main program * Main program
* *
* (c) 1990-1991, SSSi
* (c) 2020, Brutal Deluxe Software
*
* v1.3.4 - AV 202010
* - Main program
* - new resource types added
* - Editor / Control
* - disassembly & re-assembly
* - existing controls support 6.0 and 6.0.1 bits
* - rectangle and thermometer controls support added
* - Editor / Versions
* - WIP (should be fun to understand how they communicate)
*
mx %00 mx %00
rel rel
lst off lst off
@ -324,8 +338,8 @@ L020363 DW $0000 ; version number
DW $0001 DW $0001
DW $0000 DW $0000
L020369 STR 'Shell v1.2.5' L020369 STR 'Shell v1.3.4'
L020376 STR 'v1.2.5' L020376 STR 'v1.3.4'
DB $00 DB $00
DB $00 DB $00
DB $00 DB $00
@ -1556,9 +1570,26 @@ L020F02 PEA $0000
SEC SEC
SBC L02105B SBC L02105B
PHA PHA
PEA $000E PEA $000E ; 14
_MoveTo _MoveTo
_DrawString _DrawString
pha
PushLong #copyBRUTAL
_StringWidth
pla
sta L02105B
lda #$154
sec
sbc L02105B
pha
pea $001a ; 26
_MoveTo
PushLong #copyBRUTAL
_DrawString
LDA $0B,S LDA $0B,S
ORA $0D,S ORA $0D,S
BNE L021034 BNE L021034
@ -1572,7 +1603,7 @@ L020F02 PEA $0000
SEC SEC
SBC L02105B SBC L02105B
PHA PHA
PEA $0026 PEA $0026 ; 38
_MoveTo _MoveTo
PEA ^L02105D PEA ^L02105D
PEA L02105D PEA L02105D
@ -1619,6 +1650,8 @@ L021046 PHD
CLC CLC
RTL RTL
copyBRUTAL str '(c) 2020, Brutal Deluxe'
L02105B DW $0000 L02105B DW $0000
L02105D ASC ' 0k free memory'00 L02105D ASC ' 0k free memory'00
L02106F DW $0000 ; event code L02106F DW $0000 ; event code

View File

@ -10506,7 +10506,6 @@ rectNEXT6
ora 1,s ora 1,s
plx plx
sta [$00],y sta [$00],y
stal $300
rectNEXT7 rectNEXT7
@ -10593,7 +10592,7 @@ rectNEXT8
TCS TCS
RTL RTL
*--- Thermometer control template feedback (from the window to the resource) *--- Thermo control template feedback (from the window to the resource)
updateTHERMO updateTHERMO
TSC TSC
@ -10682,15 +10681,22 @@ updateTHERMO
pei $16 pei $16
_HLock _HLock
LDY #$0002 ; get its pointer
LDA [$16],Y
TAX
LDA [$16]
STA $00
STX $02
lda #8 ; pCount lda #8 ; pCount
sta [$00] sta [$00]
ldy #$1a ; penHeight ldy #$1a ; position of mercury
lda #1 lda #0
sta [$00],y sta [$00],y
ldy #$1c ; penWidth ldy #$1c ; scale
lda #2 lda #100
sta [$00],y sta [$00],y
thermo8OK thermo8OK
@ -10723,7 +10729,7 @@ thermoISINVISIBLE
thermoNEXT thermoNEXT
*--- The value word *--- The position of mercury word
pha pha
pha pha
@ -10788,7 +10794,7 @@ thermoNEXT
thermoNEXT2 thermoNEXT2
*--- The data word *--- The scale word
pha pha
pha pha
@ -10866,7 +10872,7 @@ thermoNEXT3
_GetCtlValue _GetCtlValue
pla pla
beq thermoNEXT4 beq thermoNEXT4
ldx #$0000 ; vertical ldx #$0000 ; vertical thermometer
bra thermoNEXT6 bra thermoNEXT6
thermoNEXT4 thermoNEXT4
@ -10876,20 +10882,23 @@ thermoNEXT4
PEA $0000 PEA $0000
PEA $0000 PEA $0000
pea $0000 pea $0000
pea $0009 pea $000a
_GetCtlHandleFromID _GetCtlHandleFromID
_GetCtlValue _GetCtlValue
pla pla
beq thermoNEXT5 beq thermoNEXT5
ldx #$0001 ; horizontal ldx #$0001 ; horizontal thermometer
bra thermoNEXT6
thermoNEXT5 thermoNEXT5
thermoNEXT6 thermoNEXT6
ldy #$12 ; save the control's appearance ldy #$12 ; save the control's appearance
txa phx
lda [$00],y
and #%11111111_11111100
ora 1,s
plx
sta [$00],y sta [$00],y
thermoNEXT7 thermoNEXT7
*--- The refCon *--- The refCon
@ -14786,7 +14795,7 @@ writeRECTANGLE
PLA PLA
STA L02758C+2 STA L02758C+2
LDA L02758C+2 * LDA L02758C+2
PHA PHA
LDA L02758C LDA L02758C
PHA PHA
@ -14895,7 +14904,7 @@ writeTHERMOMETER
PLA PLA
STA L02758C+2 STA L02758C+2
LDA L02758C+2 * LDA L02758C+2
PHA PHA
LDA L02758C LDA L02758C
PHA PHA
@ -14914,7 +14923,27 @@ writeTHERMOMETER
PLA PLA
STA L02758C+2 STA L02758C+2
PEA ^thermoTEMPLATE ; Line edit control template * LDA L02758C+2
PHA
LDA L02758C
PHA
_HUnlock
PEA $0000
PEA $001e
LDA L02758C+2
PHA
LDA L02758C
PHA
_SetHandleSize
LDA L02758C+2
PHA
LDA L02758C
PHA
_HLock
PEA ^thermoTEMPLATE ; Thermometer control template
PEA thermoTEMPLATE PEA thermoTEMPLATE
LDA L02758C+2 LDA L02758C+2
PHA PHA
@ -14931,12 +14960,14 @@ writeTHERMOMETER
LDA thermoID LDA thermoID
PHA PHA
_MarkResourceChange _MarkResourceChange
PEA $8004 PEA $8004
LDA thermoID+2 LDA thermoID+2
PHA PHA
LDA thermoID LDA thermoID
PHA PHA
_WriteResource _WriteResource
PEA $FFFF PEA $FFFF
PEA $8004 PEA $8004
LDA thermoID+2 LDA thermoID+2
@ -14958,11 +14989,11 @@ thermoID ADRL $00000000 ; ID
DW $0017 DW $0017
DW $0096 DW $0096
ADRL $87FF0002 ; procRef ADRL $87FF0002 ; procRef
DW $0000 ; flag DW $0001 ; flag
DW $1000 ; moreFlags DW $1000 ; moreFlags
ADRL $00000000 ; refCon ADRL $00000000 ; refCon
DW $0001 ; value DW $0000 ; value
DW $0002 ; data DW $0064 ; data
*--- Write an line edit resource *--- Write an line edit resource
@ -20332,7 +20363,7 @@ winTHERMOMETER
ADRL $00000000 ; window defproc ADRL $00000000 ; window defproc
ADRL $00000000 ; info bar defproc ADRL $00000000 ; info bar defproc
ADRL $00000000 ; content defproc ADRL $00000000 ; content defproc
DW 85 ; content rect - was 100 DW 70 ; content rect - was 100
DW 280 DW 280
DW 198 DW 198
DW 636 DW 636
@ -20349,48 +20380,228 @@ clrTHERMOMETER
titleTHERMOMETER str ' Thermometer ' titleTHERMOMETER str ' Thermometer '
ctlTHERMOMETER ctlTHERMOMETER
adrl theCHANGE adrl ctlTHERMO1
adrl theCANCEL adrl ctlTHERMO2
adrl ctlTHERMO3
adrl ctlTHERMO4
adrl ctlTHERMO5
adrl ctlTHERMO6
adrl ctlTHERMO7
adrl ctlTHERMO8
adrl ctlTHERMO9
adrl ctlTHERMOA ; no B control
adrl ctlTHERMOC
adrl ctlTHERMOD
adrl ctlTHERMOE
adrl ctlTHERMOF
adrl $0 adrl $0
theCHANGE ctlTHERMO1 DW $0009 ; pCount - Change button
DW $0009 ; pCount - Change button
ADRL $00000001 ; ID ADRL $00000001 ; ID
DW 85 ; rect - was 73 DW 104 ; rect - was 73
DW $00D0 DW $00D0
DW 101 ; was 86 DW 120 ; was 86
DW $012A DW $012A
ADRL $80000000 ; procRef ADRL $80000000 ; procRef
DW $0001 ; flag DW $0001 ; flag
DW $3000 ; moreFlags DW $3000 ; moreFlags
ADRL $00000000 ; refCon ADRL $00000000 ; refCon
ADRL strTCHANGE ; titleRef ADRL strTHERMO1 ; titleRef
ADRL $00000000 ; colorTableRef ADRL $00000000 ; colorTableRef
ASC 0D ; keyequivalent ASC 0D ; keyequivalent
ASC 0D ; 2nd key equivalent ASC 0D ; 2nd key equivalent
DW $0000 ; keyModifiers DW $0000 ; keyModifiers
DW $0000 ; keyCareBits DW $0000 ; keyCareBits
theCANCEL ctlTHERMO2 DW $0009 ; pCount - Cancel button
DW $0009 ; pCount - Cancel button
ADRL $00000002 ; ID ADRL $00000002 ; ID
DW 85 ; rect - was 73 DW 104 ; rect - was 73
DW $003C DW $003C
DW 101 ; was 86 DW 120 ; was 86
DW $0096 DW $0096
ADRL $80000000 ; procRef ADRL $80000000 ; procRef
DW $0000 ; flag DW $0000 ; flag
DW $3000 ; moreFlags DW $3000 ; moreFlags
ADRL $00000000 ; refCon ADRL $00000000 ; refCon
ADRL strTCANCEL ; titleRef ADRL strTHERMO2 ; titleRef
ADRL $00000000 ; colorTableRef ADRL $00000000 ; colorTableRef
ASC 1E ; keyequivalent ASC 1E ; keyequivalent
ASC 1E ; 2nd key equivalent ASC 1E ; 2nd key equivalent
DW $0000 ; keyModifiers DW $0000 ; keyModifiers
DW $0000 ; keyCareBits DW $0000 ; keyCareBits
strTCHANGE str 'Change' ctlTHERMO3 DW $0008 ; pCount - ID text
strTCANCEL str 'Cancel' ADRL $00000003 ; ID
DW 9 ; rect
DW 200
DW 18
DW 230
ADRL $81000000 ; procRef
DW $0000 ; flag
DW $1000 ; moreFlags
ADRL $00000000 ; refCon
ADRL strTHERMO3 ; textRef
DW $0002 ; textSize
ctlTHERMO4 DW $0008 ; pCount - ID value
ADRL $00000004 ; ID
DW 9 ; rect
DW 234
DW 18
DW 310
ADRL $81000000 ; procRef
DW $0000 ; flag
DW $1000 ; moreFlags
ADRL $00000000 ; refCon
ADRL L02BDAE ; textRef
DW $0008 ; textSize
ctlTHERMO5 DW $0008 ; pCount - Ref Con text
ADRL $00000005 ; ID
DW 25 ; rect
DW 24
DW 34
DW 100
ADRL $81000000 ; procRef
DW $0000 ; flag
DW $1000 ; moreFlags
ADRL $00000000 ; refCon
ADRL strTHERMO5 ; textRef
DW $0007 ; textSize
ctlTHERMO6 DW $0008 ; pCount - Ref Con value
ADRL $00000006 ; ID
DW 23 ; rect
DW 104
DW 36
DW 180
ADRL $83000000 ; procRef
DW $0000 ; flag
DW $7000 ; moreFlags
ADRL $00000000 ; refCon
DW $0008 ; maxSize
ADRL L02BAAD ; defaultRef
ctlTHERMO7 DW $0008 ; pCount - Invisible
ADRL $00000007 ; ID
DW 9 ; rect
DW 24
DW 18
DW 124
ADRL $82000000 ; procRef
DW $0000 ; flag
DW $1000 ; moreFlags
ADRL $00000000 ; refCon
ADRL strTHERMO7 ; titleRef
DW $0000 ; initialValue
ctlTHERMO8 DW $0008 ; pCount - Orientation
ADRL $00000008 ; ID
DW 43 ; rect
DW 24
DW 52
DW 124
ADRL $81000000 ; procRef
DW $0000 ; flag
DW $1000 ; moreFlags
ADRL $00000000 ; refCon
ADRL strTHERMO8 ; textRef
DW 11 ; textSize
ctlTHERMO9 DW $0008 ; pCount - Vertical
ADRL $0000009 ; ID
DW 43 ; rect
DW 130
DW 52
DW 270
ADRL $84000000 ; procRef
DW $0000 ; flag
DW $1000 ; moreFlags
ADRL $00000000 ; refCon
ADRL strTHERMO9 ; titleRef
DW $0000 ; initialValue
ctlTHERMOA DW $0008 ; pCount - Horizontal
ADRL $000000A ; ID
DW 54 ; rect
DW 130
DW 63
DW 270
ADRL $84000000 ; procRef
DW $0000 ; flag
DW $1000 ; moreFlags
ADRL $00000000 ; refCon
ADRL strTHERMOA ; titleRef
DW $0000 ; initialValue
ctlTHERMOC DW $0008 ; pCount - Position
ADRL $0000000C ; ID
DW 70 ; rect
DW 24
DW 79
DW 110
ADRL $81000000 ; procRef
DW $0000 ; flag
DW $1000 ; moreFlags
ADRL $00000000 ; refCon
ADRL strTHERMOC ; textRef
DW 8 ; textSize
ctlTHERMOD DW $0008 ; pCount - Position value
ADRL $0000000D ; ID
DW 68 ; rect
DW 114
DW 81
DW 162
ADRL $83000000 ; procRef
DW $0000 ; flag
DW $7000 ; moreFlags
ADRL $00000000 ; refCon
DW $0004 ; maxSize
ADRL strTHERMOD ; defaultRef
ctlTHERMOE DW $0008 ; pCount - Scale text
ADRL $0000000E ; ID
DW 86 ; rect
DW 24
DW 95
DW 110
ADRL $81000000 ; procRef
DW $0000 ; flag
DW $1000 ; moreFlags
ADRL $00000000 ; refCon
ADRL strTHERMOE ; textRef
DW 5 ; textSize
ctlTHERMOF DW $0008 ; pCount - Scale value
ADRL $0000000F ; ID
DW 84 ; rect
DW 114
DW 97
DW 162
ADRL $83000000 ; procRef
DW $0000 ; flag
DW $7000 ; moreFlags
ADRL $00000000 ; refCon
DW $0004 ; maxSize
ADRL strTHERMOF ; defaultRef
strTHERMO1 str 'Change'
strTHERMO2 str 'Cancel'
strTHERMO3 asc 'ID'
strTHERMO5 asc 'Ref Con'
strTHERMO7 str 'Invisible'
strTHERMO8 asc 'Orientation'
strTHERMO9 str 'Vertical'
strTHERMOA str 'Horizontal'
strTHERMOC asc 'Position'
strTHERMOD db $04
strTHERMOD2 ENT
asc '0001'
strTHERMOE asc 'Scale'
strTHERMOF db $04
strTHERMOF2 ENT
asc '0002'
*--- *---

View File

@ -2318,7 +2318,7 @@ rectAPPEAR
TCS TCS
RTL RTL
*--- *--- AV 202010
doTHERMOMETER ENT doTHERMOMETER ENT
TSC TSC
@ -2329,46 +2329,158 @@ doTHERMOMETER ENT
INC INC
TCD TCD
PHA PHA
LDA #$0001 pea #$0001
PHA
_SetResourceFileDepth _SetResourceFileDepth
STA L02C957 STA L02C957
PLA PLA
STA $1E STA $1E
PHA PHA
PHA PHA
LDA #$8004 pea #$8004
PHA pei $25
LDX $25 pei $23
LDA $23
PHX
PHA
_LoadResource _LoadResource
STA L02C957 STA L02C957
PLA PLA
STA $16 STA $16
PLA PLA
STA $18 STA $18
LDA L02C957 LDA L02C957 ; check error
PHA
LDA #$2401
PHA PHA
pea #$2401
JSL L020419 JSL L020419
PHA PHA
LDA $1E pei $1E
PHA
_SetResourceFileDepth _SetResourceFileDepth
STA L02C957 STA L02C957
PLA PLA
STA $1E STA $1E
LDX $18
LDA $16 pei $18
PHX pei $16
PHA
_HLock _HLock
STA L02C957 STA L02C957
* ... * Get the data
LDY #$0002 ; get the pointer
LDA [$16],Y
TAX
LDA [$16]
STA $00
STX $02
* Get the number of parms (we handle 8 parms max)
lda [$00]
cmp #8
bcs okTHERMO ; if >=8, do nothing
pei $18
pei $16
_HUnlock
pea $0000 ; make it $1e bytes long
pea $001e
pei $18
pei $16
_SetHandleSize
pei $18 ; lock it
pei $16
_HLock
LDY #$0002 ; get the pointer
LDA [$16],Y
TAX
LDA [$16]
STA $00
STX $02
lda #8 ; New nb of parms now
sta [$00]
ldy #$1a ; initial value for position
lda #0
sta [$00],y
ldy #$1c ; initial value for scale
lda #100
sta [$00],y
okTHERMO
LDY #$0004 ; get its ID
LDA [$00],Y
pha
LDY #$0002
LDA [$00],Y
pha
LDX #^L02BDAD
LDA #L02BDAD
PHX
PHA
JSL L030000
LDY #$0018 ; get the refcon
LDA [$00],Y
pha
LDY #$0016
LDA [$00],Y
pha
LDX #^L02BAAD
LDA #L02BAAD
PHX
PHA
JSL L030000
ldy #$1a ; get penWidth
lda [$00],y
pha
PushLong #strTHERMOD2
PushWord #4
_Int2Hex
ldy #$1c ; get penHeight
lda [$00],y
pha
PushLong #strTHERMOF2
PushWord #4
_Int2Hex
*--- Reset all controls (and we'll change the value afterwards)
* lda #$0000 ; invisible
* pha
* pha
* pha
* pha
* pha
* pha
* pea $0007
* _GetCtlHandleFromID
* _SetCtlValue
lda #$0000 ; vertical
pha
pha
pha
pha
pha
pha
pea $0009
_GetCtlHandleFromID
_SetCtlValue
lda #$0000 ; horizontal
pha
pha
pha
pha
pha
pha
pea $000a
_GetCtlHandleFromID
_SetCtlValue
*---
JSL showTHERMOMETER ; do window JSL showTHERMOMETER ; do window
PHA PHA
@ -2380,6 +2492,8 @@ doTHERMOMETER ENT
PLA PLA
STA L02B9AB STA L02B9AB
*--- Update some flags
LDY #$0002 LDY #$0002
LDA [$16],Y LDA [$16],Y
TAX TAX
@ -2387,6 +2501,49 @@ doTHERMOMETER ENT
STA $00 STA $00
STX $02 STX $02
*--- Control's visibility
ldy #$12
lda [$00],y
and #%00000000_10000000
beq thermoVISIBLE
lda #$0001
pha
pha
pha
pea $0000
pea $0000
pea $0000
pea $0007
_GetCtlHandleFromID
_SetCtlValue
thermoVISIBLE
*--- Control's appearance
ldy #$12
lda [$00],y
and #%00000000_00000001
clc
adc #9 ; because control 9 is radio button vertical
tax
lda #$0001
pha
pha
pha
pea $0000
pea $0000
pea $0000
phx ; <= the control to activate
_GetCtlHandleFromID
_SetCtlValue
*---
PHA PHA
LDA #$0001 LDA #$0001
PHA PHA

View File

@ -8,6 +8,8 @@
ext showTHERMOMETER ext showTHERMOMETER
ext strRECTD2 ext strRECTD2
ext strRECTF2 ext strRECTF2
ext strTHERMOD2
ext strTHERMOF2
EXT L02C5F5 EXT L02C5F5
EXT L020419 EXT L020419
EXT L02892D EXT L02892D

Binary file not shown.