mirror of
https://github.com/stid/woz64.git
synced 2025-02-19 14:31:20 +00:00
Standardize indent
This commit is contained in:
parent
222326bb1a
commit
c8ba619d33
@ -51,7 +51,6 @@ toDebug: {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ========================================================
|
||||
// ////// DATA ////////////////////////////////////////////
|
||||
// ========================================================
|
||||
|
@ -145,7 +145,7 @@ cloneStart:
|
||||
// // Key here is in A
|
||||
// --------------------------------------------------------
|
||||
.pseudopc $1000 {
|
||||
ReadKeyb:
|
||||
ReadKeyb: {
|
||||
lda #<KeyMap1
|
||||
sta @SMC_Vec
|
||||
lda #>KeyMap1
|
||||
@ -170,17 +170,19 @@ ReadKeyb:
|
||||
|
||||
lda #cKeybW_Row1
|
||||
sta @SMC_Row + 1
|
||||
@SMC_Row: lda #0
|
||||
@SMC_Row:
|
||||
lda #0
|
||||
|
||||
sta CIA1_KeybWrite
|
||||
|
||||
@Loop_Debounce:
|
||||
@Loop_Debounce:
|
||||
lda CIA1_KeybRead
|
||||
cmp CIA1_KeybRead
|
||||
bne @Loop_Debounce
|
||||
|
||||
ldx #7
|
||||
@Loop_Col: lsr
|
||||
@Loop_Col:
|
||||
lsr
|
||||
bcs @NextKey
|
||||
sta @SMC_A + 1
|
||||
|
||||
@ -198,11 +200,14 @@ ReadKeyb:
|
||||
sta MemMap.KEYBOARD.SYS_Shflag
|
||||
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
|
||||
bpl @Loop_Col
|
||||
|
||||
@ -214,8 +219,10 @@ ReadKeyb:
|
||||
jmp @ProcKeyImg
|
||||
|
||||
// Handles the key repeat
|
||||
@Process: ldy MemMap.KEYBOARD.SYS_Sfdx
|
||||
@SMC_Key: lda $FFFF,Y
|
||||
@Process:
|
||||
ldy MemMap.KEYBOARD.SYS_Sfdx
|
||||
@SMC_Key:
|
||||
lda $FFFF,Y
|
||||
tax
|
||||
cpy MemMap.KEYBOARD.SYS_Lstx
|
||||
beq @SameKey
|
||||
@ -224,13 +231,15 @@ ReadKeyb:
|
||||
sty MemMap.KEYBOARD.SYS_Delay // Repeat delay counter
|
||||
bne @Cleanup
|
||||
|
||||
@SameKey: and #$7F
|
||||
@SameKey:
|
||||
and #$7F
|
||||
ldy MemMap.KEYBOARD.SYS_Delay
|
||||
beq @EndDelay
|
||||
dec MemMap.KEYBOARD.SYS_Delay
|
||||
bne @Exit
|
||||
|
||||
@EndDelay: dec MemMap.KEYBOARD.SYS_Kount
|
||||
@EndDelay:
|
||||
dec MemMap.KEYBOARD.SYS_Kount
|
||||
bne @Exit
|
||||
|
||||
ldy #$04
|
||||
@ -240,7 +249,8 @@ ReadKeyb:
|
||||
bpl @Exit
|
||||
|
||||
// Updates the previous key and shift storage
|
||||
@Cleanup: ldy MemMap.KEYBOARD.SYS_Sfdx
|
||||
@Cleanup:
|
||||
ldy MemMap.KEYBOARD.SYS_Sfdx
|
||||
sty MemMap.KEYBOARD.SYS_Lstx
|
||||
ldy MemMap.KEYBOARD.SYS_Shflag
|
||||
sty MemMap.KEYBOARD.SYS_Lstshf
|
||||
@ -256,28 +266,30 @@ ReadKeyb:
|
||||
inx
|
||||
stx MemMap.KEYBOARD.SYS_Ndx
|
||||
|
||||
@Exit: lda #$7F
|
||||
@Exit:
|
||||
lda #$7F
|
||||
sta CIA1_KeybWrite
|
||||
rts
|
||||
|
||||
@ProcKeyImg:
|
||||
@ProcKeyImg:
|
||||
lda MemMap.KEYBOARD.SYS_Shflag
|
||||
cmp #$03 // C= + SHIFT
|
||||
bne @SetDecodeTable
|
||||
cmp MemMap.KEYBOARD.SYS_Lstshf
|
||||
beq @Exit
|
||||
|
||||
@SetDecodeTable:
|
||||
@SetDecodeTable:
|
||||
asl
|
||||
cmp #8 // CONTROL
|
||||
bcc @Cont
|
||||
lda #$06
|
||||
@Cont: tax
|
||||
@Cont: tax
|
||||
lda KeyMapVec,X
|
||||
sta @SMC_Key + 1
|
||||
lda KeyMapVec + 1,X
|
||||
sta @SMC_Key + 2
|
||||
jmp @Process
|
||||
}
|
||||
|
||||
// --------------------------------------------------------
|
||||
// GetKey -
|
||||
@ -287,16 +299,21 @@ ReadKeyb:
|
||||
// Result:
|
||||
// A = Pressed key code or 0
|
||||
// --------------------------------------------------------
|
||||
GetKey: lda MemMap.KEYBOARD.SYS_Ndx
|
||||
GetKey: {
|
||||
|
||||
lda MemMap.KEYBOARD.SYS_Ndx
|
||||
bne @IsKey
|
||||
|
||||
@NoKey: lda #255 // Null
|
||||
@NoKey:
|
||||
lda #255 // Null
|
||||
sec
|
||||
rts
|
||||
|
||||
@IsKey: ldy MemMap.KEYBOARD.SYS_Keyd
|
||||
@IsKey:
|
||||
ldy MemMap.KEYBOARD.SYS_Keyd
|
||||
ldx #0
|
||||
@Loop: lda MemMap.KEYBOARD.SYS_Keyd + 1,X
|
||||
@Loop:
|
||||
lda MemMap.KEYBOARD.SYS_Keyd + 1,X
|
||||
sta MemMap.KEYBOARD.SYS_Keyd,X
|
||||
inx
|
||||
cpx MemMap.KEYBOARD.SYS_Ndx
|
||||
@ -305,7 +322,8 @@ GetKey: lda MemMap.KEYBOARD.SYS_Ndx
|
||||
tya
|
||||
clc
|
||||
rts
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
* = * "Keyboard Ram End"
|
||||
|
||||
|
@ -118,11 +118,13 @@ byteToHex: {
|
||||
pla //get msn & fall thru
|
||||
//
|
||||
// convert nybble to hex ascii equivalent...
|
||||
binhex1: cmp #$0a
|
||||
binhex1:
|
||||
cmp #$0a
|
||||
bcc binhex2 //in decimal range
|
||||
sbc #$09 //hex compensate
|
||||
rts
|
||||
binhex2: eor #%00110000 //finalize nybble
|
||||
binhex2:
|
||||
eor #%00110000 //finalize nybble
|
||||
rts //done
|
||||
}
|
||||
|
||||
|
20
main.asm
20
main.asm
@ -39,7 +39,7 @@
|
||||
//------------------------------------------------------------------------------------
|
||||
* = * "Kernel Start"
|
||||
|
||||
coldstart:
|
||||
coldstart: {
|
||||
ldx #$FF
|
||||
sei
|
||||
txs
|
||||
@ -50,17 +50,18 @@ coldstart:
|
||||
jsr INIT_IO // Init I/O
|
||||
jsr INIT_VID // Init video
|
||||
cli
|
||||
}
|
||||
|
||||
* = * "App Start"
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
start:
|
||||
start: {
|
||||
jsr initApp;
|
||||
jsr WozShell.start
|
||||
|
||||
loop:
|
||||
loop:
|
||||
lda #$FF
|
||||
Raster: cmp RASTER_LINE // Raster done?
|
||||
Raster:
|
||||
cmp RASTER_LINE // Raster done?
|
||||
bne Raster
|
||||
jsr Keyboard.ReadKeyb
|
||||
jsr Keyboard.GetKey
|
||||
@ -71,22 +72,23 @@ Raster: cmp RASTER_LINE // Raster done?
|
||||
|
||||
cmp #BS
|
||||
beq backspace
|
||||
inputChar:
|
||||
inputChar:
|
||||
jsr WozShell.push // Char in Buffer
|
||||
PrintChar()
|
||||
jmp loop
|
||||
backspace:
|
||||
backspace:
|
||||
jsr WozShell.backspace
|
||||
PrintChar()
|
||||
jmp loop
|
||||
|
||||
execute:
|
||||
execute:
|
||||
jsr WozShell.push // CR in Buffer
|
||||
jsr Screen.screenNewLine
|
||||
jsr WozShell.exec
|
||||
jsr Screen.screenNewLine
|
||||
jsr WozShell.clear
|
||||
jmp loop
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
initApp: {
|
||||
@ -118,8 +120,6 @@ initApp: {
|
||||
//------------------------------------------------------------------------------------
|
||||
* = * "Kernel Data"
|
||||
|
||||
|
||||
|
||||
* = $9FFF "EpromFiller"
|
||||
.byte 0
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
clear:
|
||||
init: {
|
||||
|
||||
lda #-1
|
||||
sta MemMap.SHELL.pos
|
||||
rts
|
||||
@ -83,19 +82,16 @@ stidExec: {
|
||||
|
||||
cmp #$56 // Z
|
||||
beq cmdZeroPageInfo
|
||||
|
||||
done:
|
||||
done:
|
||||
rts
|
||||
|
||||
// STID Commands
|
||||
cmdHelp:
|
||||
// STID Commands
|
||||
cmdHelp:
|
||||
PrintLine(helpString)
|
||||
jmp done
|
||||
|
||||
cmdReset:
|
||||
cmdReset:
|
||||
jmp $fce2 // SYS 64738
|
||||
|
||||
cmdZeroPageInfo:
|
||||
cmdZeroPageInfo:
|
||||
jsr Init.toDebug
|
||||
jmp done
|
||||
}
|
||||
@ -152,7 +148,8 @@ wozExec: {
|
||||
asl
|
||||
|
||||
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.H // Rotate into MSD's
|
||||
dex // Done 4 shifts?
|
||||
@ -163,7 +160,7 @@ wozExec: {
|
||||
NOTHEX: cpy MemMap.SHELL.YSAV //Was at least 1 hex digit given?
|
||||
bne !+ // No! Ignore all, start from scratch
|
||||
rts
|
||||
!:
|
||||
!:
|
||||
bit MemMap.SHELL.MODE //Test MODE byte
|
||||
bvc NOTSTOR // B6=0 is STOR, 1 is XAM or BLOCK XAM
|
||||
|
||||
@ -174,24 +171,26 @@ wozExec: {
|
||||
inc MemMap.SHELL.STL //Increment store index.
|
||||
bne NEXTITEM // No carry!
|
||||
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: jmp (MemMap.SHELL.XAML) // Run user's program
|
||||
RUN: jmp (MemMap.SHELL.XAML) // Run user's program
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// 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
|
||||
|
||||
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.XAML-1,X // and to 'XAM index'
|
||||
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.
|
||||
|
||||
NXTPRNT: bne PRDATA // NE means no address to print
|
||||
NXTPRNT:
|
||||
bne PRDATA // NE means no address to print
|
||||
lda #CR // Print CR first
|
||||
PrintChar()
|
||||
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
|
||||
PrintChar()
|
||||
|
||||
PRDATA: lda #' ' // Print space
|
||||
PRDATA: lda #' ' // Print space
|
||||
PrintChar()
|
||||
lda (MemMap.SHELL.XAML,X) // Get data from address (X=0)
|
||||
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
|
||||
cmp MemMap.SHELL.L
|
||||
lda MemMap.SHELL.XAMH
|
||||
@ -224,7 +225,8 @@ XAMNEXT: stx MemMap.SHELL.MODE // 0 -> MODE (XAM mode).
|
||||
bne MOD8CHK // No carry!
|
||||
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
|
||||
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)
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
PRBYTE: pha // Save A for LSD
|
||||
PRBYTE:
|
||||
pha // Save A for LSD
|
||||
lsr
|
||||
lsr
|
||||
lsr // MSD to LSD position
|
||||
@ -246,7 +249,7 @@ PRBYTE: pha // Save A for LSD
|
||||
// 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"
|
||||
cmp #'9'+1 // Is it a decimal digit?
|
||||
bcc !+ // Yes! output it
|
||||
|
Loading…
x
Reference in New Issue
Block a user