1
0
mirror of https://github.com/stid/woz64.git synced 2024-06-01 01:41:34 +00:00

Standardize indent

This commit is contained in:
stid 2020-01-12 17:24:10 -08:00
parent 222326bb1a
commit c8ba619d33
7 changed files with 538 additions and 516 deletions

View File

@ -51,7 +51,6 @@ toDebug: {
} }
// ======================================================== // ========================================================
// ////// DATA //////////////////////////////////////////// // ////// DATA ////////////////////////////////////////////
// ======================================================== // ========================================================

View File

@ -145,7 +145,7 @@ cloneStart:
// // Key here is in A // // Key here is in A
// -------------------------------------------------------- // --------------------------------------------------------
.pseudopc $1000 { .pseudopc $1000 {
ReadKeyb: ReadKeyb: {
lda #<KeyMap1 lda #<KeyMap1
sta @SMC_Vec sta @SMC_Vec
lda #>KeyMap1 lda #>KeyMap1
@ -170,17 +170,19 @@ ReadKeyb:
lda #cKeybW_Row1 lda #cKeybW_Row1
sta @SMC_Row + 1 sta @SMC_Row + 1
@SMC_Row: lda #0 @SMC_Row:
lda #0
sta CIA1_KeybWrite sta CIA1_KeybWrite
@Loop_Debounce: @Loop_Debounce:
lda CIA1_KeybRead lda CIA1_KeybRead
cmp CIA1_KeybRead cmp CIA1_KeybRead
bne @Loop_Debounce bne @Loop_Debounce
ldx #7 ldx #7
@Loop_Col: lsr @Loop_Col:
lsr
bcs @NextKey bcs @NextKey
sta @SMC_A + 1 sta @SMC_A + 1
@ -198,11 +200,14 @@ ReadKeyb:
sta MemMap.KEYBOARD.SYS_Shflag sta MemMap.KEYBOARD.SYS_Shflag
bpl @SMC_A bpl @SMC_A
@NotShift: sty MemMap.KEYBOARD.SYS_Sfdx @NotShift:
sty MemMap.KEYBOARD.SYS_Sfdx
@SMC_A: lda #0 @SMC_A:
lda #0
@NextKey: iny @NextKey:
iny
dex dex
bpl @Loop_Col bpl @Loop_Col
@ -214,8 +219,10 @@ ReadKeyb:
jmp @ProcKeyImg jmp @ProcKeyImg
// Handles the key repeat // Handles the key repeat
@Process: ldy MemMap.KEYBOARD.SYS_Sfdx @Process:
@SMC_Key: lda $FFFF,Y ldy MemMap.KEYBOARD.SYS_Sfdx
@SMC_Key:
lda $FFFF,Y
tax tax
cpy MemMap.KEYBOARD.SYS_Lstx cpy MemMap.KEYBOARD.SYS_Lstx
beq @SameKey beq @SameKey
@ -224,13 +231,15 @@ ReadKeyb:
sty MemMap.KEYBOARD.SYS_Delay // Repeat delay counter sty MemMap.KEYBOARD.SYS_Delay // Repeat delay counter
bne @Cleanup bne @Cleanup
@SameKey: and #$7F @SameKey:
and #$7F
ldy MemMap.KEYBOARD.SYS_Delay ldy MemMap.KEYBOARD.SYS_Delay
beq @EndDelay beq @EndDelay
dec MemMap.KEYBOARD.SYS_Delay dec MemMap.KEYBOARD.SYS_Delay
bne @Exit bne @Exit
@EndDelay: dec MemMap.KEYBOARD.SYS_Kount @EndDelay:
dec MemMap.KEYBOARD.SYS_Kount
bne @Exit bne @Exit
ldy #$04 ldy #$04
@ -240,7 +249,8 @@ ReadKeyb:
bpl @Exit bpl @Exit
// Updates the previous key and shift storage // Updates the previous key and shift storage
@Cleanup: ldy MemMap.KEYBOARD.SYS_Sfdx @Cleanup:
ldy MemMap.KEYBOARD.SYS_Sfdx
sty MemMap.KEYBOARD.SYS_Lstx sty MemMap.KEYBOARD.SYS_Lstx
ldy MemMap.KEYBOARD.SYS_Shflag ldy MemMap.KEYBOARD.SYS_Shflag
sty MemMap.KEYBOARD.SYS_Lstshf sty MemMap.KEYBOARD.SYS_Lstshf
@ -256,28 +266,30 @@ ReadKeyb:
inx inx
stx MemMap.KEYBOARD.SYS_Ndx stx MemMap.KEYBOARD.SYS_Ndx
@Exit: lda #$7F @Exit:
lda #$7F
sta CIA1_KeybWrite sta CIA1_KeybWrite
rts rts
@ProcKeyImg: @ProcKeyImg:
lda MemMap.KEYBOARD.SYS_Shflag lda MemMap.KEYBOARD.SYS_Shflag
cmp #$03 // C= + SHIFT cmp #$03 // C= + SHIFT
bne @SetDecodeTable bne @SetDecodeTable
cmp MemMap.KEYBOARD.SYS_Lstshf cmp MemMap.KEYBOARD.SYS_Lstshf
beq @Exit beq @Exit
@SetDecodeTable: @SetDecodeTable:
asl asl
cmp #8 // CONTROL cmp #8 // CONTROL
bcc @Cont bcc @Cont
lda #$06 lda #$06
@Cont: tax @Cont: tax
lda KeyMapVec,X lda KeyMapVec,X
sta @SMC_Key + 1 sta @SMC_Key + 1
lda KeyMapVec + 1,X lda KeyMapVec + 1,X
sta @SMC_Key + 2 sta @SMC_Key + 2
jmp @Process jmp @Process
}
// -------------------------------------------------------- // --------------------------------------------------------
// GetKey - // GetKey -
@ -287,16 +299,21 @@ ReadKeyb:
// Result: // Result:
// A = Pressed key code or 0 // A = Pressed key code or 0
// -------------------------------------------------------- // --------------------------------------------------------
GetKey: lda MemMap.KEYBOARD.SYS_Ndx GetKey: {
lda MemMap.KEYBOARD.SYS_Ndx
bne @IsKey bne @IsKey
@NoKey: lda #255 // Null @NoKey:
lda #255 // Null
sec sec
rts rts
@IsKey: ldy MemMap.KEYBOARD.SYS_Keyd @IsKey:
ldy MemMap.KEYBOARD.SYS_Keyd
ldx #0 ldx #0
@Loop: lda MemMap.KEYBOARD.SYS_Keyd + 1,X @Loop:
lda MemMap.KEYBOARD.SYS_Keyd + 1,X
sta MemMap.KEYBOARD.SYS_Keyd,X sta MemMap.KEYBOARD.SYS_Keyd,X
inx inx
cpx MemMap.KEYBOARD.SYS_Ndx cpx MemMap.KEYBOARD.SYS_Ndx
@ -305,7 +322,8 @@ GetKey: lda MemMap.KEYBOARD.SYS_Ndx
tya tya
clc clc
rts rts
}
}}
* = * "Keyboard Ram End" * = * "Keyboard Ram End"

View File

@ -118,11 +118,13 @@ byteToHex: {
pla //get msn & fall thru pla //get msn & fall thru
// //
// convert nybble to hex ascii equivalent... // convert nybble to hex ascii equivalent...
binhex1: cmp #$0a binhex1:
cmp #$0a
bcc binhex2 //in decimal range bcc binhex2 //in decimal range
sbc #$09 //hex compensate sbc #$09 //hex compensate
rts rts
binhex2: eor #%00110000 //finalize nybble binhex2:
eor #%00110000 //finalize nybble
rts //done rts //done
} }

View File

@ -39,7 +39,7 @@
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
* = * "Kernel Start" * = * "Kernel Start"
coldstart: coldstart: {
ldx #$FF ldx #$FF
sei sei
txs txs
@ -50,17 +50,18 @@ coldstart:
jsr INIT_IO // Init I/O jsr INIT_IO // Init I/O
jsr INIT_VID // Init video jsr INIT_VID // Init video
cli cli
}
* = * "App Start" * = * "App Start"
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
start: start: {
jsr initApp; jsr initApp;
jsr WozShell.start jsr WozShell.start
loop:
loop:
lda #$FF lda #$FF
Raster: cmp RASTER_LINE // Raster done? Raster:
cmp RASTER_LINE // Raster done?
bne Raster bne Raster
jsr Keyboard.ReadKeyb jsr Keyboard.ReadKeyb
jsr Keyboard.GetKey jsr Keyboard.GetKey
@ -71,22 +72,23 @@ Raster: cmp RASTER_LINE // Raster done?
cmp #BS cmp #BS
beq backspace beq backspace
inputChar: inputChar:
jsr WozShell.push // Char in Buffer jsr WozShell.push // Char in Buffer
PrintChar() PrintChar()
jmp loop jmp loop
backspace: backspace:
jsr WozShell.backspace jsr WozShell.backspace
PrintChar() PrintChar()
jmp loop jmp loop
execute: execute:
jsr WozShell.push // CR in Buffer jsr WozShell.push // CR in Buffer
jsr Screen.screenNewLine jsr Screen.screenNewLine
jsr WozShell.exec jsr WozShell.exec
jsr Screen.screenNewLine jsr Screen.screenNewLine
jsr WozShell.clear jsr WozShell.clear
jmp loop jmp loop
}
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
initApp: { initApp: {
@ -118,8 +120,6 @@ initApp: {
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
* = * "Kernel Data" * = * "Kernel Data"
* = $9FFF "EpromFiller" * = $9FFF "EpromFiller"
.byte 0 .byte 0

View File

@ -22,7 +22,6 @@
clear: clear:
init: { init: {
lda #-1 lda #-1
sta MemMap.SHELL.pos sta MemMap.SHELL.pos
rts rts
@ -83,19 +82,16 @@ stidExec: {
cmp #$56 // Z cmp #$56 // Z
beq cmdZeroPageInfo beq cmdZeroPageInfo
done:
done:
rts rts
// STID Commands
// STID Commands cmdHelp:
cmdHelp:
PrintLine(helpString) PrintLine(helpString)
jmp done jmp done
cmdReset:
cmdReset:
jmp $fce2 // SYS 64738 jmp $fce2 // SYS 64738
cmdZeroPageInfo: cmdZeroPageInfo:
jsr Init.toDebug jsr Init.toDebug
jmp done jmp done
} }
@ -152,7 +148,8 @@ wozExec: {
asl asl
ldx #4 // Shift count ldx #4 // Shift count
HEXSHIFT: asl // Hex digit left, MSB to carry HEXSHIFT:
asl // Hex digit left, MSB to carry
rol MemMap.SHELL.L // Rotate into LSD rol MemMap.SHELL.L // Rotate into LSD
rol MemMap.SHELL.H // Rotate into MSD's rol MemMap.SHELL.H // Rotate into MSD's
dex // Done 4 shifts? dex // Done 4 shifts?
@ -163,7 +160,7 @@ wozExec: {
NOTHEX: cpy MemMap.SHELL.YSAV //Was at least 1 hex digit given? NOTHEX: cpy MemMap.SHELL.YSAV //Was at least 1 hex digit given?
bne !+ // No! Ignore all, start from scratch bne !+ // No! Ignore all, start from scratch
rts rts
!: !:
bit MemMap.SHELL.MODE //Test MODE byte bit MemMap.SHELL.MODE //Test MODE byte
bvc NOTSTOR // B6=0 is STOR, 1 is XAM or BLOCK XAM bvc NOTSTOR // B6=0 is STOR, 1 is XAM or BLOCK XAM
@ -174,24 +171,26 @@ wozExec: {
inc MemMap.SHELL.STL //Increment store index. inc MemMap.SHELL.STL //Increment store index.
bne NEXTITEM // No carry! bne NEXTITEM // No carry!
inc MemMap.SHELL.STH // Add carry to 'store index' high inc MemMap.SHELL.STH // Add carry to 'store index' high
TONEXTITEM: jmp NEXTITEM //Get next command item. TONEXTITEM:
jmp NEXTITEM //Get next command item.
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// RUN user's program from last opened location // RUN user's program from last opened location
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
RUN: jmp (MemMap.SHELL.XAML) // Run user's program RUN: jmp (MemMap.SHELL.XAML) // Run user's program
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
// We're not in Store mode // We're not in Store mode
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
NOTSTOR: bmi XAMNEXT // B7 = 0 for XAM, 1 for BLOCK XAM NOTSTOR:
bmi XAMNEXT // B7 = 0 for XAM, 1 for BLOCK XAM
// We're in XAM mode now // We're in XAM mode now
ldx #2 // Copy 2 bytes ldx #2 // Copy 2 bytes
SETADR: lda MemMap.SHELL.L-1,X // Copy hex data to SETADR: lda MemMap.SHELL.L-1,X // Copy hex data to
sta MemMap.SHELL.STL-1,X // 'store index' sta MemMap.SHELL.STL-1,X // 'store index'
sta MemMap.SHELL.XAML-1,X // and to 'XAM index' sta MemMap.SHELL.XAML-1,X // and to 'XAM index'
dex // Next of 2 bytes dex // Next of 2 bytes
@ -199,7 +198,8 @@ SETADR: lda MemMap.SHELL.L-1,X // Copy hex data to
// Print address and data from this address, fall through next BNE. // Print address and data from this address, fall through next BNE.
NXTPRNT: bne PRDATA // NE means no address to print NXTPRNT:
bne PRDATA // NE means no address to print
lda #CR // Print CR first lda #CR // Print CR first
PrintChar() PrintChar()
lda MemMap.SHELL.XAMH // Output high-order byte of address lda MemMap.SHELL.XAMH // Output high-order byte of address
@ -209,11 +209,12 @@ NXTPRNT: bne PRDATA // NE means no address t
lda #':' // Print colon lda #':' // Print colon
PrintChar() PrintChar()
PRDATA: lda #' ' // Print space PRDATA: lda #' ' // Print space
PrintChar() PrintChar()
lda (MemMap.SHELL.XAML,X) // Get data from address (X=0) lda (MemMap.SHELL.XAML,X) // Get data from address (X=0)
jsr PRBYTE // Output it in hex format jsr PRBYTE // Output it in hex format
XAMNEXT: stx MemMap.SHELL.MODE // 0 -> MODE (XAM mode). XAMNEXT:
stx MemMap.SHELL.MODE // 0 -> MODE (XAM mode).
lda MemMap.SHELL.XAML // See if there's more to print lda MemMap.SHELL.XAML // See if there's more to print
cmp MemMap.SHELL.L cmp MemMap.SHELL.L
lda MemMap.SHELL.XAMH lda MemMap.SHELL.XAMH
@ -224,7 +225,8 @@ XAMNEXT: stx MemMap.SHELL.MODE // 0 -> MODE (XAM mode).
bne MOD8CHK // No carry! bne MOD8CHK // No carry!
inc MemMap.SHELL.XAMH inc MemMap.SHELL.XAMH
MOD8CHK: lda MemMap.SHELL.XAML // If address MOD 8 = 0 start new line MOD8CHK:
lda MemMap.SHELL.XAML // If address MOD 8 = 0 start new line
and #%00000111 and #%00000111
bpl NXTPRNT // Always taken. bpl NXTPRNT // Always taken.
@ -232,7 +234,8 @@ MOD8CHK: lda MemMap.SHELL.XAML // If address MOD 8 = 0
// Subroutine to print a byte in A in hex form (destructive) // Subroutine to print a byte in A in hex form (destructive)
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
PRBYTE: pha // Save A for LSD PRBYTE:
pha // Save A for LSD
lsr lsr
lsr lsr
lsr // MSD to LSD position lsr // MSD to LSD position
@ -246,7 +249,7 @@ PRBYTE: pha // Save A for LSD
// Subroutine to print a hexadecimal digit // Subroutine to print a hexadecimal digit
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
PRHEX: and #%00001111 // Mask LSD for hex print PRHEX: and #%00001111 // Mask LSD for hex print
ora #'0' // Add "0" ora #'0' // Add "0"
cmp #'9'+1 // Is it a decimal digit? cmp #'9'+1 // Is it a decimal digit?
bcc !+ // Yes! output it bcc !+ // Yes! output it