floppy return STATE_READY even without image file and nothing gets written to image file even when dcpu writes to floppy.
This test code should test that B= STATE_READY
jsr detect_hardware
; init screen
set a, 0
set b, 0x8000
hwi [monitor]
; query floppy state
set a, 0
hwi [floppy]
; print state
add b, '0'
bor b, 0x7000
set [0x8000], b
:halt
set pc, halt
:floppy dat 0
:monitor dat 0
:keyboard dat 0
:clock dat 0
:detect_hardware
set j, 0xFFFF
hwn i
:hwloop
add j, 1
hwq j
ife j, i
set pc, pop
ife a, 0xf615
ife b, 0x7349
set [monitor], j
ife a, 0x7406
ife b, 0x30cf
set [keyboard], j
ife a, 0xb402
ife b, 0x12d0
set [clock], j
ife a, 0x24c5
ife b, 0x4fd5
set [floppy], j
set pc, hwloop
Windows (dunno about linux)
floppy return STATE_READY even without image file and nothing gets written to image file even when dcpu writes to floppy.
This test code should test that B= STATE_READY
jsr detect_hardware
; init screen set a, 0 set b, 0x8000 hwi [monitor]
; query floppy state set a, 0 hwi [floppy]
; print state add b, '0' bor b, 0x7000
set [0x8000], b
:halt set pc, halt
:floppy dat 0 :monitor dat 0 :keyboard dat 0 :clock dat 0
:detect_hardware set j, 0xFFFF hwn i :hwloop add j, 1 hwq j ife j, i set pc, pop ife a, 0xf615 ife b, 0x7349 set [monitor], j ife a, 0x7406 ife b, 0x30cf set [keyboard], j ife a, 0xb402 ife b, 0x12d0 set [clock], j ife a, 0x24c5 ife b, 0x4fd5 set [floppy], j set pc, hwloop