mirror of
https://github.com/stid/woz64.git
synced 2024-06-06 06:29:27 +00:00
Fine tune
This commit is contained in:
parent
fb06c63b35
commit
b0c99aa2fa
2
hex.asm
2
hex.asm
|
@ -1,5 +1,4 @@
|
||||||
#importonce
|
#importonce
|
||||||
#import "mem_map.asm"
|
|
||||||
.filenamespace Hex
|
.filenamespace Hex
|
||||||
|
|
||||||
* = * "Hex Routines"
|
* = * "Hex Routines"
|
||||||
|
@ -37,3 +36,4 @@ binhex1: cmp #$0a
|
||||||
binhex2: eor #%00110000 //finalize nybble
|
binhex2: eor #%00110000 //finalize nybble
|
||||||
rts //done
|
rts //done
|
||||||
|
|
||||||
|
#import "mem_map.asm"
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// Advanced Version of Keyb Input routine
|
// Advanced Version of Keyb Input routine
|
||||||
#importonce
|
#importonce
|
||||||
.filenamespace Keyboard2
|
.filenamespace Keyboard2
|
||||||
#import "mem_map.asm"
|
|
||||||
#import "memory.asm"
|
#import "memory.asm"
|
||||||
|
|
||||||
.const CIA1_KeybWrite = $DC00
|
.const CIA1_KeybWrite = $DC00
|
||||||
|
@ -10,6 +9,7 @@
|
||||||
.const cSYS_DelayValue = 32
|
.const cSYS_DelayValue = 32
|
||||||
.const cKeybW_Row1 = $FE
|
.const cKeybW_Row1 = $FE
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
init: {
|
init: {
|
||||||
lda #64
|
lda #64
|
||||||
sta MemMap.KEYB2.SYS_Lstx
|
sta MemMap.KEYB2.SYS_Lstx
|
||||||
|
@ -90,6 +90,7 @@ KeyMap4:
|
||||||
|
|
||||||
cloneStart:
|
cloneStart:
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
.pseudopc $1000 {
|
.pseudopc $1000 {
|
||||||
ReadKeyb:
|
ReadKeyb:
|
||||||
lda #<KeyMap1
|
lda #<KeyMap1
|
||||||
|
@ -225,7 +226,7 @@ ReadKeyb:
|
||||||
sta @SMC_Key + 2
|
sta @SMC_Key + 2
|
||||||
jmp @Process
|
jmp @Process
|
||||||
|
|
||||||
// --------------------------
|
//------------------------------------------------------------------------------------
|
||||||
GetKey: lda MemMap.KEYB2.SYS_Ndx
|
GetKey: lda MemMap.KEYB2.SYS_Ndx
|
||||||
bne @IsKey
|
bne @IsKey
|
||||||
|
|
||||||
|
@ -251,3 +252,6 @@ GetKey: lda MemMap.KEYB2.SYS_Ndx
|
||||||
* = * "Keyb: cloneEnd"
|
* = * "Keyb: cloneEnd"
|
||||||
|
|
||||||
cloneEnd:
|
cloneEnd:
|
||||||
|
|
||||||
|
|
||||||
|
#import "mem_map.asm"
|
||||||
|
|
24
main.asm
24
main.asm
|
@ -1,4 +1,5 @@
|
||||||
BasicUpstart2(start)
|
//BasicUpstart2(start)
|
||||||
|
#import "mem_map.asm"
|
||||||
|
|
||||||
* = $8000 "Main"
|
* = $8000 "Main"
|
||||||
|
|
||||||
|
@ -17,7 +18,6 @@ BasicUpstart2(start)
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
#import "screen.asm"
|
#import "screen.asm"
|
||||||
#import "keyb2.asm"
|
#import "keyb2.asm"
|
||||||
#import "hex.asm"
|
|
||||||
#import "shell.asm"
|
#import "shell.asm"
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
|
@ -73,7 +73,18 @@ cr:
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------
|
||||||
initApp: {
|
initApp: {
|
||||||
// Disable Basic
|
|
||||||
|
sei
|
||||||
|
lda #$7f
|
||||||
|
sta $dc0d // disable timer interrupts which can be generated by the two CIA chips
|
||||||
|
sta $dd0d // the kernal uses such an interrupt to flash the cursor and scan the keyboard, so we better
|
||||||
|
// stop it.
|
||||||
|
|
||||||
|
lda $dc0d // by reading this two registers we negate any pending CIA irqs.
|
||||||
|
lda $dd0d // if we don't do this, a pending CIA irq might occur after we finish setting up our irq.
|
||||||
|
// we don't want that to happen.
|
||||||
|
|
||||||
|
// Disable 0e TIMER
|
||||||
lda #254
|
lda #254
|
||||||
and $dc0e
|
and $dc0e
|
||||||
sta $dc0e
|
sta $dc0e
|
||||||
|
@ -85,6 +96,7 @@ initApp: {
|
||||||
jsr Screen.init
|
jsr Screen.init
|
||||||
jsr Keyboard2.init
|
jsr Keyboard2.init
|
||||||
jsr Shell.init
|
jsr Shell.init
|
||||||
|
cli
|
||||||
rts
|
rts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,8 +112,12 @@ hoax: {
|
||||||
|
|
||||||
.encoding "screencode_mixed"
|
.encoding "screencode_mixed"
|
||||||
|
|
||||||
|
version: .byte 00
|
||||||
|
revision: .byte 01
|
||||||
|
minor: .byte 05
|
||||||
|
|
||||||
testString:
|
testString:
|
||||||
.text "woz64 mon - v 0.1.5a"
|
.text "woz64 mon - v 0.1.5"
|
||||||
.byte $8e
|
.byte $8e
|
||||||
.text "----------------------------------------"
|
.text "----------------------------------------"
|
||||||
.byte $8e, 0
|
.byte $8e, 0
|
||||||
|
|
3
math.asm
3
math.asm
|
@ -1,7 +1,6 @@
|
||||||
#importonce
|
#importonce
|
||||||
.filenamespace Math
|
.filenamespace Math
|
||||||
|
|
||||||
#import "mem_map.asm"
|
|
||||||
|
|
||||||
* = * "Math Routines"
|
* = * "Math Routines"
|
||||||
|
|
||||||
|
@ -34,3 +33,5 @@ multiply: {
|
||||||
cli
|
cli
|
||||||
rts
|
rts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#import "mem_map.asm"
|
||||||
|
|
72
mem_map.asm
72
mem_map.asm
|
@ -1,57 +1,55 @@
|
||||||
.filenamespace MemMap
|
.filenamespace MemMap
|
||||||
#importonce
|
#importonce
|
||||||
|
|
||||||
.const ZPAGE_BASE = $2
|
*=$2 "ZERO PAGE" virtual
|
||||||
|
|
||||||
|
|
||||||
.namespace SCREEN {
|
.namespace SCREEN {
|
||||||
.label TempVideoPointer = ZPAGE_BASE // 2 bytes
|
TempVideoPointer: .word 0
|
||||||
.label TempStringPointer = ZPAGE_BASE+2 // 2 bytes
|
TempStringPointer: .word 0
|
||||||
.label CursorCol = ZPAGE_BASE+4 // 1 byte
|
CursorCol: .byte 0
|
||||||
.label CursorRow = ZPAGE_BASE+5 // 1 byte
|
CursorRow: .byte 0
|
||||||
.label tempY = ZPAGE_BASE+6 // 1 byte
|
tempY: .byte 0
|
||||||
.label tempX = ZPAGE_BASE+7 // 1 byte
|
tempX: .byte 0
|
||||||
.label PrintPetCharY = ZPAGE_BASE+8 // 1 byte
|
PrintPetCharY: .byte 0
|
||||||
.label PrintPetCharX = ZPAGE_BASE+9 // 1 byte
|
PrintPetCharX: .byte 0
|
||||||
.label ScrollUpTriggered = ZPAGE_BASE+10 // 1 byte
|
ScrollUpTriggered: .byte 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.namespace MATH {
|
.namespace MATH {
|
||||||
.label factor1 = ZPAGE_BASE+11 // 1 byte
|
factor1: .byte 0
|
||||||
.label factor2 = ZPAGE_BASE+12 // 1 byte
|
factor2: .byte 0
|
||||||
.label result = ZPAGE_BASE+13 // 2 bytes
|
result: .word 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.namespace KEYB2 {
|
.namespace KEYB2 {
|
||||||
.label KeyR = ZPAGE_BASE+37 // 1 bytes
|
KeyR: .byte 0
|
||||||
.label SYS_Keyd = ZPAGE_BASE+38 // 10 bytes
|
SYS_Keyd: .fill $10,0
|
||||||
.label SYS_Ndx = ZPAGE_BASE+48 // 1 bytes
|
SYS_Ndx: .byte 0
|
||||||
.label SYS_Xmax = ZPAGE_BASE+49 // 1 bytes
|
SYS_Xmax: .byte 0
|
||||||
.label SYS_Shflag = ZPAGE_BASE+50 // 1 bytes
|
SYS_Shflag: .byte 0
|
||||||
.label SYS_Sfdx = ZPAGE_BASE+51 // 1 bytes
|
SYS_Sfdx: .byte 0
|
||||||
.label SYS_Lstx = ZPAGE_BASE+52 // 1 bytes
|
SYS_Lstx: .byte 0
|
||||||
.label SYS_Delay = ZPAGE_BASE+53 // 1 bytes
|
SYS_Delay: .byte 0
|
||||||
.label SYS_Kount = ZPAGE_BASE+54 // 1 bytes
|
SYS_Kount: .byte 0
|
||||||
.label SYS_Lstshf = ZPAGE_BASE+55 // 1 bytes
|
SYS_Lstshf: .byte 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.namespace MEMORY {
|
.namespace MEMORY {
|
||||||
.label from = ZPAGE_BASE+56 // 2 bytes
|
from: .word 0
|
||||||
.label dest = ZPAGE_BASE+58 // 2 bytes
|
dest: .word 0
|
||||||
.label size = ZPAGE_BASE+60 // 2 bytes
|
size: .word 0
|
||||||
}
|
}
|
||||||
|
|
||||||
.namespace SHELL {
|
.namespace SHELL {
|
||||||
.label pos = ZPAGE_BASE+62 // 1 bytes
|
pos: .byte 0
|
||||||
.label MODE = ZPAGE_BASE+63 // 1 bytes
|
MODE: .byte 0
|
||||||
.label L = ZPAGE_BASE+64 // 1 bytes
|
L: .byte 0
|
||||||
.label H = ZPAGE_BASE+65 // 1 bytes
|
H: .byte 0
|
||||||
.label YSAV = ZPAGE_BASE+66 // 1 bytes
|
YSAV: .byte 0
|
||||||
.label STL = ZPAGE_BASE+67 // 1 bytes
|
STL: .byte 0
|
||||||
.label STH = ZPAGE_BASE+68 // 1 bytes
|
STH: .byte 0
|
||||||
.label XAML = ZPAGE_BASE+69 // 1 bytes
|
XAML: .byte 0
|
||||||
.label XAMH = ZPAGE_BASE+70 // 1 bytes
|
XAMH: .byte 0
|
||||||
|
|
||||||
.label buffer = $3000 // 256 bytes
|
.label buffer = $3000 // 256 bytes
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,4 @@
|
||||||
#importonce
|
#importonce
|
||||||
#import "mem_map.asm"
|
|
||||||
|
|
||||||
* = * "Memory Routines"
|
* = * "Memory Routines"
|
||||||
|
|
||||||
|
@ -54,3 +53,5 @@ md3: lda (MemMap.MEMORY.from),y // move the remaining bytes
|
||||||
cli
|
cli
|
||||||
md4: rts
|
md4: rts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#import "mem_map.asm"
|
||||||
|
|
22
screen.asm
22
screen.asm
|
@ -1,6 +1,5 @@
|
||||||
#importonce
|
#importonce
|
||||||
#import "math.asm"
|
#import "math.asm"
|
||||||
#import "mem_map.asm"
|
|
||||||
#import "memory.asm"
|
#import "memory.asm"
|
||||||
|
|
||||||
// -----------------------
|
// -----------------------
|
||||||
|
@ -90,10 +89,8 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// -----------------------
|
|
||||||
// CODE
|
|
||||||
// -----------------------
|
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
init: {
|
init: {
|
||||||
lda #$00
|
lda #$00
|
||||||
sta MemMap.SCREEN.CursorCol
|
sta MemMap.SCREEN.CursorCol
|
||||||
|
@ -101,21 +98,24 @@ init: {
|
||||||
rts
|
rts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
scrollUp: {
|
scrollUp: {
|
||||||
pha
|
pha
|
||||||
clone(VIDEO_ADDR+40, VIDEO_ADDR+(COLUMN_NUM*(ROWS_NUM)), VIDEO_ADDR)
|
clone(VIDEO_ADDR+40, VIDEO_ADDR+(COLUMN_NUM*(ROWS_NUM)), VIDEO_ADDR)
|
||||||
|
|
||||||
|
// clear last line
|
||||||
lda #32
|
lda #32
|
||||||
ldx #00
|
ldx #40
|
||||||
!:
|
!:
|
||||||
sta VIDEO_ADDR+(COLUMN_NUM*(ROWS_NUM-1)), x
|
sta VIDEO_ADDR+(COLUMN_NUM*(ROWS_NUM-1)), x
|
||||||
inx
|
dex
|
||||||
cpx #40
|
|
||||||
bne !-
|
bne !-
|
||||||
dec MemMap.SCREEN.CursorRow
|
dec MemMap.SCREEN.CursorRow
|
||||||
pla
|
pla
|
||||||
rts
|
rts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
printPetChar: {
|
printPetChar: {
|
||||||
pha
|
pha
|
||||||
stx MemMap.SCREEN.PrintPetCharX
|
stx MemMap.SCREEN.PrintPetCharX
|
||||||
|
@ -128,9 +128,9 @@ printPetChar: {
|
||||||
rts
|
rts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
printChar: {
|
printChar: {
|
||||||
stx MemMap.SCREEN.tempX
|
stx MemMap.SCREEN.tempX
|
||||||
// New Line
|
|
||||||
cmp #CR
|
cmp #CR
|
||||||
bne.r !+
|
bne.r !+
|
||||||
jsr screenNewLine
|
jsr screenNewLine
|
||||||
|
@ -188,7 +188,7 @@ printChar: {
|
||||||
dec MemMap.SCREEN.TempVideoPointer+1
|
dec MemMap.SCREEN.TempVideoPointer+1
|
||||||
!:
|
!:
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
noScrollTriggered:
|
noScrollTriggered:
|
||||||
noEndOfLine:
|
noEndOfLine:
|
||||||
pla
|
pla
|
||||||
|
@ -238,6 +238,7 @@ print: {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
screenNewLine: {
|
screenNewLine: {
|
||||||
pha
|
pha
|
||||||
lda #0
|
lda #0
|
||||||
|
@ -249,7 +250,6 @@ screenNewLine: {
|
||||||
lda #1 // Yes - Scroll up
|
lda #1 // Yes - Scroll up
|
||||||
sta MemMap.SCREEN.ScrollUpTriggered
|
sta MemMap.SCREEN.ScrollUpTriggered
|
||||||
jmp done
|
jmp done
|
||||||
|
|
||||||
noScrollUp:
|
noScrollUp:
|
||||||
lda #0
|
lda #0
|
||||||
sta MemMap.SCREEN.ScrollUpTriggered
|
sta MemMap.SCREEN.ScrollUpTriggered
|
||||||
|
@ -322,3 +322,5 @@ petToScreen: {
|
||||||
convDone:
|
convDone:
|
||||||
rts
|
rts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#import "mem_map.asm"
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#importonce
|
#importonce
|
||||||
.filenamespace Shell
|
.filenamespace Shell
|
||||||
|
|
||||||
#import "mem_map.asm"
|
|
||||||
#import "screen.asm"
|
#import "screen.asm"
|
||||||
|
|
||||||
* = * "Shell Routines"
|
* = * "Shell Routines"
|
||||||
|
@ -9,6 +8,7 @@
|
||||||
.const CR = $0d
|
.const CR = $0d
|
||||||
.const R = $52
|
.const R = $52
|
||||||
|
|
||||||
|
|
||||||
clear:
|
clear:
|
||||||
init: {
|
init: {
|
||||||
lda #-1
|
lda #-1
|
||||||
|
@ -193,3 +193,5 @@ PRHEX: and #%00001111 // Mask LSD for hex prin
|
||||||
rts
|
rts
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#import "mem_map.asm"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user