mirror of https://github.com/stid/woz64.git
local
This commit is contained in:
parent
e32bd19b47
commit
c25178c435
|
@ -9,14 +9,16 @@
|
||||||
#import "../devices/keyboard.asm"
|
#import "../devices/keyboard.asm"
|
||||||
#import "../devices/video.asm"
|
#import "../devices/video.asm"
|
||||||
#import "../progs/woz_shell.asm"
|
#import "../progs/woz_shell.asm"
|
||||||
|
//#import "../progs/stid_shell.asm"
|
||||||
|
|
||||||
|
|
||||||
.filenamespace System
|
.filenamespace System
|
||||||
|
|
||||||
// ========================================================
|
// ========================================================
|
||||||
// ////// CONST ///////////////////////////////////////////
|
// ////// CONST ///////////////////////////////////////////
|
||||||
// ========================================================
|
// ========================================================
|
||||||
.const MAIN_COLOR = $03
|
.const MAIN_COLOR = $00
|
||||||
.const BORDER_COLOR = $05
|
.const BORDER_COLOR = $c
|
||||||
|
|
||||||
* = * "System Core"
|
* = * "System Core"
|
||||||
|
|
||||||
|
@ -30,12 +32,13 @@
|
||||||
// System Start
|
// System Start
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
start: {
|
start: {
|
||||||
VideoClearColorRam($00)
|
VideoClearColorRam($03)
|
||||||
VideoClear(' ')
|
VideoClear(' ')
|
||||||
VideoSetBorderColor(BORDER_COLOR)
|
VideoSetBorderColor(BORDER_COLOR)
|
||||||
VideoSetBackgroundColor(MAIN_COLOR)
|
VideoSetBackgroundColor(MAIN_COLOR)
|
||||||
// Start Main Program
|
// Start Main Program
|
||||||
jsr WozShell.start
|
jsr WozShell.start
|
||||||
|
//jsr StidShell.start
|
||||||
|
|
||||||
// TODO: Program exited here
|
// TODO: Program exited here
|
||||||
// We can ask program to set a ram param and let us know
|
// We can ask program to set a ram param and let us know
|
||||||
|
@ -60,6 +63,7 @@ init: {
|
||||||
jsr Keyboard.init
|
jsr Keyboard.init
|
||||||
|
|
||||||
jsr WozShell.init
|
jsr WozShell.init
|
||||||
|
//jsr StidShell.init
|
||||||
rts
|
rts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,6 +87,7 @@ toDebug: {
|
||||||
jsr Video.toDebug
|
jsr Video.toDebug
|
||||||
|
|
||||||
jsr WozShell.toDebug
|
jsr WozShell.toDebug
|
||||||
|
//jsr StidShell.toDebug
|
||||||
rts
|
rts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
// VideoClear -
|
// VideoClear -
|
||||||
// Fast clear screen characters mem.
|
// Fast clear screen characters mem.
|
||||||
|
|
|
@ -23,13 +23,11 @@
|
||||||
CursorRow: .byte 0 // Actual cursor row position
|
CursorRow: .byte 0 // Actual cursor row position
|
||||||
StatusBitsA: .byte 0 // Status Bits
|
StatusBitsA: .byte 0 // Status Bits
|
||||||
// Bit0: ScrollUpTriggred if ON
|
// Bit0: ScrollUpTriggred if ON
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.namespace MATH {
|
.namespace MATH {
|
||||||
factor1: .byte 0 // Factor 1 used in MUL ops
|
factor1: .byte 0 // Factor 1 used in MUL ops
|
||||||
factor2: .byte 0 // Factor 2 used in MUL ops
|
factor2: .byte 0 // Factor 2 used in MUL ops
|
||||||
|
|
||||||
result: .word 0 // 16 Bit math operation result
|
result: .word 0 // 16 Bit math operation result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +52,11 @@
|
||||||
size: .word 0
|
size: .word 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.namespace TIMERS {
|
||||||
|
counter: .byte 0 // Factor 1 used in MUL ops
|
||||||
|
}
|
||||||
|
|
||||||
.namespace MODULE {
|
.namespace MODULE {
|
||||||
versionPtr: .word 0
|
versionPtr: .word 0
|
||||||
}
|
}
|
||||||
|
@ -72,5 +75,12 @@
|
||||||
.label buffer = SHELL_BUFFER_ADDR // 256 bytes
|
.label buffer = SHELL_BUFFER_ADDR // 256 bytes
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.namespace STID_SHELL {
|
||||||
|
pos: .byte 0
|
||||||
|
mode: .byte 0
|
||||||
|
sAddr: .word 0
|
||||||
|
eAddr: .word 0
|
||||||
|
.label buffer = SHELL_BUFFER_ADDR // 256 bytes
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,29 +99,22 @@ printLine: {
|
||||||
// X = lns ascii char result
|
// X = lns ascii char result
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
byteToHex: {
|
byteToHex: {
|
||||||
pha //save byte
|
pha
|
||||||
and #%00001111 //extract lsn
|
jsr !+
|
||||||
tax //save it
|
tax
|
||||||
pla //recover byte
|
pla
|
||||||
lsr //extract...
|
|
||||||
lsr //msn
|
|
||||||
lsr
|
lsr
|
||||||
lsr
|
lsr
|
||||||
pha //save msn
|
lsr
|
||||||
txa //lsn
|
lsr
|
||||||
jsr binhex1 //generate ascii lsn
|
|
||||||
tax //save
|
!: and #$0f
|
||||||
pla //get msn & fall thru
|
cmp #$0a
|
||||||
//
|
bcc !+
|
||||||
// convert nybble to hex ascii equivalent...
|
adc #6
|
||||||
binhex1:
|
|
||||||
cmp #$0a
|
!: adc #'0'
|
||||||
bcc binhex2 //in decimal range
|
|
||||||
sbc #$09 //hex compensate
|
|
||||||
rts
|
rts
|
||||||
binhex2:
|
|
||||||
eor #%00110000 //finalize nybble
|
|
||||||
rts //done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
|
|
|
@ -0,0 +1,86 @@
|
||||||
|
|
||||||
|
#importonce
|
||||||
|
#import "../core/module.asm"
|
||||||
|
|
||||||
|
|
||||||
|
// ========================================================
|
||||||
|
// ////// MACROS //////////////////////////////////////////
|
||||||
|
// ========================================================
|
||||||
|
|
||||||
|
.filenamespace Timers
|
||||||
|
|
||||||
|
* = * "Timers Lib"
|
||||||
|
|
||||||
|
// ========================================================
|
||||||
|
// ////// METHODS /////////////////////////////////////////
|
||||||
|
// ========================================================
|
||||||
|
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// init -
|
||||||
|
// Module Init.
|
||||||
|
// --------------------------------------------------------
|
||||||
|
init: {
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// toDebug -
|
||||||
|
// Print debug info.
|
||||||
|
// --------------------------------------------------------
|
||||||
|
toDebug: {
|
||||||
|
ModuleToDebug(module_type, module_name, version)
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------------------------------------
|
||||||
|
// multiply -
|
||||||
|
// 8 Bit in to 16 Bit out Multiplier
|
||||||
|
//
|
||||||
|
// Parameters:
|
||||||
|
// MemMap.MATH.factor1 = 8 Bit Factor 1
|
||||||
|
// MemMap.MATH.factor2 = 8 Bit Factor 2
|
||||||
|
//
|
||||||
|
// Result
|
||||||
|
// MemMap.MATH.result = 16 bit result
|
||||||
|
// --------------------------------------------------------
|
||||||
|
delayOne: {
|
||||||
|
pha
|
||||||
|
lda #$00
|
||||||
|
sta MemMap.TIMERS.counter
|
||||||
|
loop1: lda #$fb // wait for vertical retrace
|
||||||
|
loop2: cmp $d012 // until it reaches 251th raster line ($fb)
|
||||||
|
bne loop2 // which is out of the inner screen area
|
||||||
|
inc MemMap.TIMERS.counter // increase frame counter
|
||||||
|
lda MemMap.TIMERS.counter // check if counter
|
||||||
|
cmp #$32 // reached 50
|
||||||
|
bne out // if not, pass the color changing routine
|
||||||
|
jmp exit
|
||||||
|
|
||||||
|
out:
|
||||||
|
lda $d012 // make sure we reached
|
||||||
|
loop3: cmp $d012 // the next raster line so next time we
|
||||||
|
beq loop3
|
||||||
|
jmp loop1 // jump to main loop
|
||||||
|
exit:
|
||||||
|
pla
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ========================================================
|
||||||
|
// ////// DATA ////////////////////////////////////////////
|
||||||
|
// ========================================================
|
||||||
|
|
||||||
|
* = * "Timers Lib Data"
|
||||||
|
module_type: .byte Module.TYPES.LIB
|
||||||
|
version: .byte 1, 0, 0
|
||||||
|
|
||||||
|
.encoding "screencode_mixed"
|
||||||
|
module_name:
|
||||||
|
.text "timers"
|
||||||
|
.byte 0
|
||||||
|
|
||||||
|
|
||||||
|
#import "../hardware/mem_map.asm"
|
||||||
|
|
6
main.asm
6
main.asm
|
@ -12,7 +12,11 @@
|
||||||
#import "./core/boot.asm"
|
#import "./core/boot.asm"
|
||||||
|
|
||||||
* = * "Kernel Data"
|
* = * "Kernel Data"
|
||||||
* = $9FFF "EpromFiller"
|
|
||||||
|
* = $9FFF "EpromFiller" // 8K Cartridge, $8000-$9FFF (ROML / ROMH).
|
||||||
|
// * = $BFFF "EpromFiller" // 16K Cartridge, $8000-$9FFF / $A000-$BFFF (ROML / ROMH).
|
||||||
|
// GAME = 0, EXROM = 0
|
||||||
|
// ROML/ROMH are read only, Basic ROM is overwritten by ROMH.
|
||||||
.byte 0
|
.byte 0
|
||||||
|
|
||||||
|
|
||||||
|
|
4
makefile
4
makefile
|
@ -15,3 +15,7 @@ eprom:
|
||||||
clean:
|
clean:
|
||||||
rm -Rf ./bin
|
rm -Rf ./bin
|
||||||
|
|
||||||
|
run:
|
||||||
|
java -jar ${KICKASS_BIN} -odir ${BUILD_PATH} -log ${BUILD_PATH}/buildlog.txt -showmem ./main.asm
|
||||||
|
cartconv -t normal -name "woz" -i ${BUILD_PATH}/main.prg -o ${BUILD_PATH}/woz.crt
|
||||||
|
x64sc ${BUILD_PATH}/woz.crt
|
||||||
|
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,195 @@
|
||||||
|
#importonce
|
||||||
|
#import "../core/pseudo.asm"
|
||||||
|
#import "../core/system.asm"
|
||||||
|
#import "../libs/print.asm"
|
||||||
|
#import "../core/module.asm"
|
||||||
|
#import "../hardware/vic.asm"
|
||||||
|
#import "../devices/keyboard.asm"
|
||||||
|
#import "../devices/video.asm"
|
||||||
|
#import "../hardware/mem_map.asm"
|
||||||
|
|
||||||
|
.filenamespace StidShell
|
||||||
|
|
||||||
|
* = * "StidShell Routines"
|
||||||
|
|
||||||
|
// ========================================================
|
||||||
|
// ////// CONSTANTS ///////////////////////////////////////
|
||||||
|
// ========================================================
|
||||||
|
|
||||||
|
.const R = $52
|
||||||
|
.const CR = $0d
|
||||||
|
.const BS = $14
|
||||||
|
|
||||||
|
.const MAX_CMD_BUFFER = 40
|
||||||
|
|
||||||
|
|
||||||
|
.namespace MODE {
|
||||||
|
.label MEMORY = $48
|
||||||
|
.label HELP = $4D
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ========================================================
|
||||||
|
// ////// METHODS /////////////////////////////////////////
|
||||||
|
// ========================================================
|
||||||
|
|
||||||
|
|
||||||
|
init: {
|
||||||
|
jsr StidShell.clear
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
start: {
|
||||||
|
PrintLine(lineString)
|
||||||
|
PrintLine(aboutString)
|
||||||
|
PrintLine(lineString)
|
||||||
|
jsr StidShell.printRegs
|
||||||
|
|
||||||
|
jmp StidShell.loop
|
||||||
|
}
|
||||||
|
|
||||||
|
clear: {
|
||||||
|
lda #-1
|
||||||
|
sta MemMap.STID_SHELL.pos
|
||||||
|
lda #0
|
||||||
|
sta MemMap.STID_SHELL.sAddr
|
||||||
|
sta MemMap.STID_SHELL.eAddr
|
||||||
|
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------------
|
||||||
|
loop: {
|
||||||
|
jsr Keyboard.waitForKey
|
||||||
|
|
||||||
|
cmp #CR
|
||||||
|
beq cr
|
||||||
|
|
||||||
|
cmp #BS
|
||||||
|
beq backspace
|
||||||
|
inputChar:
|
||||||
|
jsr StidShell.push // Char in Buffer
|
||||||
|
cpy #MAX_CMD_BUFFER
|
||||||
|
beq loop
|
||||||
|
PrintChar()
|
||||||
|
jmp loop
|
||||||
|
backspace:
|
||||||
|
jsr StidShell.backspace
|
||||||
|
PrintChar()
|
||||||
|
jmp loop
|
||||||
|
|
||||||
|
cr:
|
||||||
|
jsr StidShell.push // CR in Buffer
|
||||||
|
jsr Video.screenNewLine
|
||||||
|
jsr StidShell.exec
|
||||||
|
jsr Video.screenNewLine
|
||||||
|
jsr StidShell.clear
|
||||||
|
jmp loop
|
||||||
|
}
|
||||||
|
|
||||||
|
toDebug: {
|
||||||
|
ModuleToDebug(module_type, module_name, version)
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
push: {
|
||||||
|
ldy MemMap.STID_SHELL.pos
|
||||||
|
iny
|
||||||
|
cpy #MAX_CMD_BUFFER
|
||||||
|
beq done
|
||||||
|
sty MemMap.STID_SHELL.pos
|
||||||
|
sta MemMap.STID_SHELL.buffer, y
|
||||||
|
done:
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
backspace: {
|
||||||
|
ldy MemMap.STID_SHELL.pos
|
||||||
|
cpy #-1
|
||||||
|
beq done
|
||||||
|
dey
|
||||||
|
sty MemMap.STID_SHELL.pos
|
||||||
|
done:
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
exec: {
|
||||||
|
ldy #0
|
||||||
|
lda MemMap.STID_SHELL.buffer, y
|
||||||
|
|
||||||
|
sta MemMap.STID_SHELL.mode // Store as mode
|
||||||
|
|
||||||
|
cmp #StidShell.MODE.HELP // H
|
||||||
|
beq cmdHelp
|
||||||
|
|
||||||
|
cmp #StidShell.MODE.MEMORY // M
|
||||||
|
beq cmdMemory
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
cmdHelp:
|
||||||
|
rts
|
||||||
|
|
||||||
|
cmdMemory: {
|
||||||
|
loop:
|
||||||
|
iny
|
||||||
|
lda MemMap.STID_SHELL.buffer, y
|
||||||
|
cmp $20
|
||||||
|
beq loop
|
||||||
|
cmp #CR
|
||||||
|
beq done
|
||||||
|
|
||||||
|
|
||||||
|
done:
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
printRegs: {
|
||||||
|
PrintLine(regString)
|
||||||
|
lda $02
|
||||||
|
jsr Print.byteToHex
|
||||||
|
PrintChar()
|
||||||
|
txa
|
||||||
|
PrintChar()
|
||||||
|
lda $03
|
||||||
|
jsr Print.byteToHex
|
||||||
|
PrintChar()
|
||||||
|
txa
|
||||||
|
PrintChar()
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ========================================================
|
||||||
|
// ////// DATA ////////////////////////////////////////////
|
||||||
|
// ========================================================
|
||||||
|
|
||||||
|
* = * "StidShell Data"
|
||||||
|
module_type: .byte Module.TYPES.PROG
|
||||||
|
version: .byte 0, 0, 1
|
||||||
|
|
||||||
|
.encoding "screencode_mixed"
|
||||||
|
module_name:
|
||||||
|
.text "stid-shell"
|
||||||
|
.byte 0
|
||||||
|
|
||||||
|
aboutString:
|
||||||
|
.text "stid mon 0.0.1"
|
||||||
|
.byte Video.CR, 0
|
||||||
|
lineString:
|
||||||
|
.text "----------------------------------------"
|
||||||
|
.byte Video.CR, 0
|
||||||
|
|
||||||
|
regString:
|
||||||
|
.text " pc sr ac xr yr sp"
|
||||||
|
.byte Video.CR
|
||||||
|
.text "; "
|
||||||
|
.byte 0
|
||||||
|
|
||||||
|
|
||||||
|
#import "../hardware/mem_map.asm"
|
|
@ -2,13 +2,19 @@
|
||||||
#import "../core/pseudo.asm"
|
#import "../core/pseudo.asm"
|
||||||
#import "../core/system.asm"
|
#import "../core/system.asm"
|
||||||
#import "../libs/print.asm"
|
#import "../libs/print.asm"
|
||||||
|
#import "../libs/timers.asm"
|
||||||
#import "../core/module.asm"
|
#import "../core/module.asm"
|
||||||
#import "../hardware/vic.asm"
|
#import "../hardware/vic.asm"
|
||||||
#import "../devices/keyboard.asm"
|
#import "../devices/keyboard.asm"
|
||||||
|
#import "../devices/video.asm"
|
||||||
#import "../hardware/mem_map.asm"
|
#import "../hardware/mem_map.asm"
|
||||||
|
|
||||||
.filenamespace WozShell
|
.filenamespace WozShell
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* = * "WozShell Routines"
|
* = * "WozShell Routines"
|
||||||
|
|
||||||
// ========================================================
|
// ========================================================
|
||||||
|
@ -156,7 +162,12 @@ stidExec: {
|
||||||
beq cmdReset
|
beq cmdReset
|
||||||
|
|
||||||
cmp #$56 // V
|
cmp #$56 // V
|
||||||
beq cmdZeroPageInfo
|
beq cmdSysInfo
|
||||||
|
|
||||||
|
.break
|
||||||
|
cmp #$54 // T
|
||||||
|
beq cmdTest
|
||||||
|
|
||||||
done:
|
done:
|
||||||
rts
|
rts
|
||||||
// STID Commands
|
// STID Commands
|
||||||
|
@ -166,9 +177,48 @@ stidExec: {
|
||||||
cmdReset:
|
cmdReset:
|
||||||
jmp $fce2 // SYS 64738
|
jmp $fce2 // SYS 64738
|
||||||
|
|
||||||
cmdZeroPageInfo:
|
cmdSysInfo:
|
||||||
jsr System.toDebug
|
jsr System.toDebug
|
||||||
jmp done
|
jmp done
|
||||||
|
|
||||||
|
cmdTest: {
|
||||||
|
// TODO: Optizime for code size here
|
||||||
|
ldy #1
|
||||||
|
loop:
|
||||||
|
tya
|
||||||
|
jsr clearVideo
|
||||||
|
jsr clearColors
|
||||||
|
jsr Timers.delayOne
|
||||||
|
iny
|
||||||
|
bne loop
|
||||||
|
VideoClearColorRam($03)
|
||||||
|
|
||||||
|
jmp done
|
||||||
|
|
||||||
|
clearVideo: {
|
||||||
|
ldx #0
|
||||||
|
!loop:
|
||||||
|
sta $0400, x
|
||||||
|
sta $0400 + $100, x
|
||||||
|
sta $0400 + $200, x
|
||||||
|
sta $0400 + $300, x
|
||||||
|
inx
|
||||||
|
bne !loop-
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
|
||||||
|
clearColors: {
|
||||||
|
ldx #0
|
||||||
|
!loop:
|
||||||
|
sta $d800, x
|
||||||
|
sta $d800 + $100, x
|
||||||
|
sta $d800 + $200, x
|
||||||
|
sta $d800 + $300, x
|
||||||
|
inx
|
||||||
|
bne !loop-
|
||||||
|
rts
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -362,7 +412,7 @@ helpString:
|
||||||
.byte $8e, 0
|
.byte $8e, 0
|
||||||
|
|
||||||
aboutString:
|
aboutString:
|
||||||
.text "woz64 mon - v 1.5.0"
|
.text "woz64 mon - v 1.6.0"
|
||||||
.byte $8e, 0
|
.byte $8e, 0
|
||||||
lineString:
|
lineString:
|
||||||
.text "----------------------------------------"
|
.text "----------------------------------------"
|
||||||
|
|
Loading…
Reference in New Issue