MOAR MACROS

This commit is contained in:
4am 2018-04-17 22:28:22 -04:00
parent 820d75fac2
commit 20444d6723
11 changed files with 29 additions and 26 deletions

View File

@ -122,9 +122,8 @@ SetInterpreterOptions
jsr okvs_as_boolean jsr okvs_as_boolean
beq SetInterpreterOptionsExceptForce40 beq SetInterpreterOptionsExceptForce40
lda #$CE lda #$CE
!byte $2C +HIDE_NEXT_2_BYTES
; execution falls through here ; execution falls through here
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; SetInterpreterOptionsExceptForce40 ; SetInterpreterOptionsExceptForce40
; set options struct based on global preferences store, except always specify ; set options struct based on global preferences store, except always specify
@ -143,7 +142,7 @@ SetInterpreterOptionsExceptForce40
jsr okvs_as_boolean jsr okvs_as_boolean
beq + beq +
lda #0 lda #0
!byte $2C +HIDE_NEXT_2_BYTES
+ lda #1 + lda #1
sta kOnBeyondCase sta kOnBeyondCase
@ -153,7 +152,7 @@ SetInterpreterOptionsExceptForce40
jsr okvs_as_boolean jsr okvs_as_boolean
beq + beq +
lda #1 lda #1
!byte $2C +HIDE_NEXT_2_BYTES
+ lda #0 + lda #0
sta kOnBeyondScriptToFile sta kOnBeyondScriptToFile
@ -163,7 +162,7 @@ SetInterpreterOptionsExceptForce40
jsr okvs_as_boolean jsr okvs_as_boolean
beq + beq +
lda #1 lda #1
!byte $2C +HIDE_NEXT_2_BYTES
+ lda #0 + lda #0
sta kOnBeyondAutoScript sta kOnBeyondAutoScript

View File

@ -53,3 +53,8 @@ PARAM = $00
sta .ptr sta .ptr
sty .ptr+1 sty .ptr+1
} }
; use BIT to swallow the following 2-byte opcode
!macro HIDE_NEXT_2_BYTES {
!byte $2C
}

View File

@ -89,7 +89,7 @@ ParseKeyValueText
and #1 and #1
sta gVal ; single-character values get converted to #$00 or #$01 in prefs store sta gVal ; single-character values get converted to #$00 or #$01 in prefs store
lda #0 lda #0
!byte $2C +HIDE_NEXT_2_BYTES
.useMaxLength .useMaxLength
lda #$FD ; SMC lda #$FD ; SMC
sta .appendMaxLength ; all other values get upgraded to max_length so we can update them in place sta .appendMaxLength ; all other values get upgraded to max_length so we can update them in place

View File

@ -94,11 +94,11 @@ LoadGameInfo
cmp #$26 ; '&' -> open-apple mousetext cmp #$26 ; '&' -> open-apple mousetext
beq .oa beq .oa
ora #$80 ; all other characters -> set high bit ora #$80 ; all other characters -> set high bit
!byte $2C +HIDE_NEXT_2_BYTES
.null lda #$00 .null lda #$00
!byte $2C +HIDE_NEXT_2_BYTES
.ca lda #$40 .ca lda #$40
!byte $2C +HIDE_NEXT_2_BYTES
.oa lda #$41 .oa lda #$41
sta ($FE),y sta ($FE),y
bra .convertSectionLoop bra .convertSectionLoop
@ -200,11 +200,11 @@ CheckForSavedGames
bne + bne +
lda auxtype lda auxtype
and #$0F and #$0F
!byte $2C +HIDE_NEXT_2_BYTES
+ lda #$FF ; no save slot + lda #$FF ; no save slot
sta gLastSavedGameSlot sta gLastSavedGameSlot
lda #1 lda #1
!byte $2C +HIDE_NEXT_2_BYTES
.no lda #0 .no lda #0
sta gHasSavedGames sta gHasSavedGames
rts rts

View File

@ -139,7 +139,7 @@ addGameToPrefs
addBooleanFromStore addBooleanFromStore
lda #$24 ; BIT opcode lda #$24 ; BIT opcode
!byte $2C +HIDE_NEXT_2_BYTES
addStringFromStore addStringFromStore
lda #$80 ; BRA opcode lda #$80 ; BRA opcode
sta .skipOverBooleanLogic sta .skipOverBooleanLogic

View File

@ -39,7 +39,7 @@ ResetPath
!zone { !zone {
AddToPathWithHighBit AddToPathWithHighBit
ldx #$80 ldx #$80
!byte $2C +HIDE_NEXT_2_BYTES
AddToPath AddToPath
ldx #0 ldx #0
stx .mask stx .mask

View File

@ -100,10 +100,10 @@ ClearPendingInput
!zone { !zone {
CreateRadio CreateRadio
ldx #WGCreateRadio ldx #WGCreateRadio
!byte $2C ; hide next 2 bytes +HIDE_NEXT_2_BYTES
CreateCheckbox CreateCheckbox
ldx #WGCreateCheckbox ldx #WGCreateCheckbox
!byte $2C ; hide next 2 bytes +HIDE_NEXT_2_BYTES
CreateButton CreateButton
ldx #WGCreateButton ldx #WGCreateButton
stx .type stx .type
@ -255,7 +255,7 @@ GetCheckedRadioButton
.max=*+1 .max=*+1
cmp #$FD ; SMC cmp #$FD ; SMC
bcc - bcc -
!byte $2C +HIDE_NEXT_2_BYTES
.found pla .found pla
clc clc
rts rts

View File

@ -46,7 +46,7 @@ PaintMain
stz gViewInUse+ID_VERSIONS stz gViewInUse+ID_VERSIONS
ldx #1 ; flag - clear screen before painting ldx #1 ; flag - clear screen before painting
stx gMainScreenPaintDirty stx gMainScreenPaintDirty
!byte $2C +HIDE_NEXT_2_BYTES
RepaintMainIfDirty RepaintMainIfDirty
ldx #0 ; flag - do not clear screen before painting ldx #0 ; flag - do not clear screen before painting
lda gMainScreenPaintDirty lda gMainScreenPaintDirty
@ -254,8 +254,7 @@ PaintInfoView
jsr CreateNullTerminatedString ; copies string to kNullTerminatedBuffer jsr CreateNullTerminatedString ; copies string to kNullTerminatedBuffer
+LDADDR kNullTerminatedBuffer ; now use that as the buffer to print the last line +LDADDR kNullTerminatedBuffer ; now use that as the buffer to print the last line
!byte $2C +HIDE_NEXT_2_BYTES
; execution falls through here
MultiPrint MultiPrint
stz SAVE ; VTAB, but 0-indexed stz SAVE ; VTAB, but 0-indexed
stx .printLineLength+1 stx .printLineLength+1

View File

@ -76,7 +76,7 @@ HandleKey
beq .handleScrollDown beq .handleScrollDown
.handleScrollUp .handleScrollUp
lda #$01 lda #$01
!byte $2C ; hide next LDA +HIDE_NEXT_2_BYTES
.handleScrollDown .handleScrollDown
lda #$FF lda #$FF
pha pha
@ -115,16 +115,16 @@ HandleKey
bra .xyzzyReset bra .xyzzyReset
.x .x
lda #1 lda #1
!byte $2C +HIDE_NEXT_2_BYTES
.y1 .y1
lda #2 lda #2
!byte $2C +HIDE_NEXT_2_BYTES
.z1 .z1
lda #3 lda #3
!byte $2C +HIDE_NEXT_2_BYTES
.z2 .z2
lda #4 lda #4
!byte $2C +HIDE_NEXT_2_BYTES
.xyzzyReset .xyzzyReset
lda #0 lda #0
.xyzzyStoreAndExit .xyzzyStoreAndExit

View File

@ -110,7 +110,7 @@ ResumeDialog
lda gLastSavedGameSlot ; initial checked radio button = last save slot + 1 lda gLastSavedGameSlot ; initial checked radio button = last save slot + 1
bmi + bmi +
inc inc
!byte $2C +HIDE_NEXT_2_BYTES
+ lda #ID_RESUME_NEWGAME ; if last save slot is invalid, just check 'new game' + lda #ID_RESUME_NEWGAME ; if last save slot is invalid, just check 'new game'
ldx #WGSelectView ldx #WGSelectView
jsr WeeGUI jsr WeeGUI

View File

@ -221,7 +221,7 @@ HandleVersionsKey
cpx iNumVersions ; find 'next' view ID (wrapping around to 1) cpx iNumVersions ; find 'next' view ID (wrapping around to 1)
bcs + bcs +
inx inx
!byte $2C +HIDE_NEXT_2_BYTES
+ ldx #1 + ldx #1
bra .gotNewID bra .gotNewID
.previous .previous