diff options
| -rw-r--r-- | main.asm | 5 | ||||
| -rw-r--r-- | ports.asm | 103 |
2 files changed, 97 insertions, 11 deletions
@@ -21,8 +21,8 @@ ;;; ;;; D0 = current instruction, scratch for macros ;;; D1 = scratch for instructions +;;; D2 = undefined ;;; -;;; D2 = emulated SP, PC SP high, PC low - both virtual addresses ;;; ;;; The following have their shadows in the top half of the register ;;; D3 = AF A is in the low byte, F in the high byte (yeah ... speed) @@ -404,6 +404,7 @@ emu_op_07: ; S2 T4 emu_op_08: ; S2 T4 ;; EX AF,AF' ;; No flags + ;; XXX AF swap d3 DONE @@ -2312,6 +2313,7 @@ emu_op_f0: emu_op_f1: ;; POP AF ;; SPEED this can be made faster ... + ;; XXX AF POPW d3 move.w d3,(flag_byte-flag_storage)(a3) move.b #$ff,(flag_valid-flag_storage)(a3) @@ -2343,6 +2345,7 @@ emu_op_f5: bsr flags_normalize LOHI d3 move.b flag_byte(pc),d3 + ;; XXX wrong HILO d3 PUSHW d3 DONE @@ -8,12 +8,6 @@ port_in: jmp (a0) rts -port_out: - ;; Fix this to work properly ... -; movea lut_ports_in(pc,d0),a0 - jmp (a0) - rts - lut_ports_in: dc.l port_in_00 dc.l port_in_01 @@ -272,6 +266,11 @@ lut_ports_in: dc.l port_in_fe dc.l port_in_ff +port_out: + movea lut_ports_out(pc,d0.w),a0 + jmp (a0) + rts + lut_ports_out: dc.l port_out_00 dc.l port_out_01 @@ -572,23 +571,107 @@ port_in_10: or.b p10_busy(pc),d1 rts -p10_increment: dc.b 0 ; $01 if in row mode - ; $00 if in column mode -p10_row: dc.b 0 ; $02 if in increment mode +p10_row: dc.b 0 ; $01 if in row mode - x + ; $00 if in column mode - y +p10_increment: dc.b 0 ; $02 if in increment mode ; $00 if in decrement mode p10_enabled: dc.b 0 ; $20 if screen is blanked p10_6bit: dc.b 0 ; $40 if in 8 bit mode, $00 if in 6 ; bit mode p10_busy: dc.b 0 ; always 0 - EVEN +p10_cur_row: dc.b 0 +p10_cur_col: dc.b 0 port_out_10: ;; LCD command + tst.b d1 + beq port_out_10_00 + subq.b #1,d1 + beq port_out_10_01 + subq.b #1,d1 + beq port_out_10_02 + subq.b #1,d1 + beq port_out_10_03 + subq.b #1,d1 + beq port_out_10_04 + subq.b #1,d1 + beq port_out_10_05 + subq.b #1,d1 + beq port_out_10_06 + subq.b #1,d1 + beq port_out_10_07 + addq.b #7,d1 + cmpi.b #$0b,d1 ; power supply enhancement + ble port_out_10_undef + cmpi.b #$13,d1 ; power supply level + ble port_out_10_undef + cmpi.b #$17,d1 ; undefined + ble port_out_10_undef + cmpi.b #$18,d1 ; cancel test mode + beq port_out_10_undef + cmpi.b #$1b,d1 ; undefined + beq port_out_10_undef + cmpi.b #$1f,d1 ; enter test mode + ble port_out_10_undef + cmpi.b #$3f,d1 ; set column + ble port_out_10_set_col + cmpi.b #$7f,d1 ; z-addressing + ble port_out_10_undef ; XXX? + cmpi.b #$df,d1 ; set row + ble port_out_10_set_row + ;; fallthrough: set contrast (unimplemented) + rts + ;; ... +port_out_10_00: ; 6-bit mode + move.b #$00,p10_6bit + rts +port_out_10_01: ; 8-bit mode + move.b #$40,p10_6bit + rts +port_out_10_02: ; screen off + move.b #$20,p10_enabled + rts +port_out_10_03: ; screen on + move.b #$00,p10_enabled + rts +port_out_10_04: ; x-- + move.b #$01,p10_row + move.b #$00,p10_increment + rts +port_out_10_05: ; x++ + move.b #$01,p10_row + move.b #$02,p10_increment + rts +port_out_10_06: ; y-- + move.b #$00,p10_row + move.b #$00,p10_increment + rts +port_out_10_07: ; y++ + move.b #$00,p10_row + move.b #$02,p10_increment + rts +port_out_10_undef: + rts +port_out_10_set_col: + sub.b #$20,d1 + move.b d1,p10_cur_col + rts +port_out_10_set_row: + sub.b #$80,d1 + move.b d1,p10_cur_row + rts + port_in_11: ;; LCD data + move.b LCD_MEM,d1 + rts + port_out_11: ;; LCD data + move.b d1,LCD_MEM + rts + port_in_12: port_out_12: port_in_13: |
