![Image](http://blockos.org/releases/pcengine/hardware/Pachinko/thumb/pachinko_back_00.jpg)
![Image](http://blockos.org/releases/pcengine/hardware/Pachinko/thumb/pachinko_back_01.jpg)
![Image](http://blockos.org/releases/pcengine/hardware/Pachinko/thumb/pachinko_back_02.jpg)
![Image](http://blockos.org/releases/pcengine/hardware/Pachinko/thumb/pachinko_in_00.jpg)
![Image](http://blockos.org/releases/pcengine/hardware/Pachinko/thumb/pachinko_in_01.jpg)
![Image](http://blockos.org/releases/pcengine/hardware/Pachinko/thumb/pachinko_in_02.jpg)
![Image](http://blockos.org/releases/pcengine/hardware/Pachinko/thumb/pachinko_pcb_00.jpg)
![Image](http://blockos.org/releases/pcengine/hardware/Pachinko/thumb/pachinko_pcb_01.jpg)
![Image](http://blockos.org/releases/pcengine/hardware/Pachinko/thumb/pachinko_pcb_02.jpg)
Code: Select all
.code
.bank 0
.org $edd3
joyread:
CLY
LDA #$01
STA joyport
LDA #$03
STA joyport
ledde_00:
LDA #$01
STA joyport
PHA
PLA
NOP
LDA $286b, Y
STA $2866, Y
LDA joyport
ASL A
ASL A
ASL A
ASL A
STA $286b, Y
STZ joyport
PHA
PLA
NOP
LDA joyport
AND #$0f
ORA $286b, Y
EOR #$ff
STA $286b, Y
EOR $2866, Y
AND $286b, Y
STA $2870, Y
INY
CPY #$05
BCC ledde_00
CLY
lee18_00:
LDA $2875
AND mask, Y
BEQ lee31_00
LDA $2870, Y
CMP #$04
BNE lee31_00
LDA $286b, Y
CMP #$0c
BNE lee31_00
JMP reset
lee31_00:
INY
CPY #$05
BCC lee18_00
RTS
mask:
.db $01, $02, $04, $08, $10
Code: Select all
[joyread]
filename=joyread.asm
type=code
bank=0
org=edd3
size=64
Code: Select all
[joyread]
logical=edd3
physical=000dd3
[ledde_00]
logical=edde
physical=000dde
[lee31_00]
logical=ee31
physical=000e31
[reset]
logical=e0f2
physical=0000f2
[lee18_00]
logical=ee18
physical=000e18
[joyport]
logical=1000
physical=001000
Code: Select all
.include "hudk.s"
.include "bcd.s"
font_vram_base = $2000
joy_txt_x = 9
joy_txt_y = 12
.code
main:
; load palette
stw #palette, <_si
jsr map_data
cla
ldy #$01
jsr vce_load_palette
; load font data and select palette
stw #font_vram_base, <_di
lda #.bank(font_8x8)
sta <_bl
stw #font_8x8, <_si
stw #(FONT_8x8_COUNT*8), <_cx
jsr font_load
lda #$00
jsr font_set_pal
; enable background display
vdc_reg #VDC_CR
vdc_data #(VDC_CR_BG_ENABLE | VDC_CR_VBLANK_ENABLE)
; set vsync vec
stz <irq_m
irq_on #INT_IRQ1
irq_enable_vec #VSYNC
irq_set_vec #VSYNC, #vsync_proc
cli
.loop:
jsr joyread
ldx #joy_txt_x
lda #joy_txt_y
jsr vdc_calc_addr
jsr vdc_set_write
cly
.txt
lda $286b, Y
jsr print_hex_u8
lda #' '
jsr print_char
iny
cpy #$05
bne .txt
stz irq_cnt
.wait:
lda irq_cnt
bne .wait
bra .loop
rts
vsync_proc:
timer_ack
rts
; Pachio-kun - Juuban Shoubu joypad routine
joyread:
CLY
LDA #$01
STA joyport
LDA #$03
STA joyport
ledde_00:
LDA #$01
STA joyport
PHA
PLA
NOP
LDA $286b, Y
STA $2866, Y
LDA joyport
ASL A
ASL A
ASL A
ASL A
STA $286b, Y
STZ joyport
PHA
PLA
NOP
LDA joyport
AND #$0f
ORA $286b, Y
EOR #$ff
STA $286b, Y
EOR $2866, Y
AND $286b, Y
STA $2870, Y
INY
CPY #$05
BCC ledde_00
CLY
lee18_00:
LDA $2875
AND mask, Y
BEQ lee31_00
LDA $2870, Y
CMP #$04
BNE lee31_00
LDA $286b, Y
CMP #$0c
BNE lee31_00
JMP _reset
lee31_00:
INY
CPY #$05
BCC lee18_00
RTS
mask:
.db $01, $02, $04, $08, $10
palette:
.dw $0000, $01ff, $0000, $0000, $0000, $0000, $0000, $0000
.dw $0000, $0000, $0000, $0000, $0000, $0000, $0000, $0000
.include "font.inc"