Skip to content

Commit

Permalink
Build system.
Browse files Browse the repository at this point in the history
  • Loading branch information
redcode committed Dec 28, 2023
1 parent 7701337 commit c5d3e14
Showing 1 changed file with 34 additions and 80 deletions.
114 changes: 34 additions & 80 deletions ext/z80/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,94 +4,48 @@
abort "missing header Z80.h" unless have_header 'Z80.h'
abort "missing library Z80" unless have_library 'Z80'

%w(
z80_power
z80_instant_reset
z80_int
z80_nmi
z80_execute
z80_run
).each do |function|
abort "missing #{function}()" unless have_func function
%w(power instant_reset int nmi execute run).each do |function|
abort "missing z80_#{function}()" unless have_func "z80_#{function}"
end

have_func 'z80_special_reset'

%w(
z80_break
z80_r
z80_refresh_address
z80_in_cycle
z80_out_cycle
).each do |function|
abort "missing #{function}()" unless have_func(function, 'Z80.h')
%w(break r refresh_address in_cycle out_cycle).each do |function|
abort "missing z80_#{function}()" unless have_func("z80_#{function}", 'Z80.h')
end

%w(
Z80_MAXIMUM_CYCLES
Z80_MAXIMUM_CYCLES_PER_STEP
Z80_MINIMUM_CYCLES_PER_STEP
Z80_HOOK
Z80_OPTION_OUT_VC_255
Z80_OPTION_LD_A_IR_BUG
Z80_OPTION_HALT_SKIP
Z80_OPTION_XQ
Z80_OPTION_IM0_RETX_NOTIFICATIONS
Z80_OPTION_YQ
Z80_MODEL_ZILOG_NMOS
Z80_MODEL_ZILOG_CMOS
Z80_MODEL_NEC_NMOS
Z80_MODEL_ST_CMOS
Z80_REQUEST_REJECT_NMI
Z80_REQUEST_NMI
Z80_REQUEST_INT
Z80_RESUME_HALT
Z80_RESUME_XY
Z80_RESUME_IM0_XY
Z80_MEMPTR
Z80_PC
Z80_SP
Z80_XY
Z80_IX
Z80_IY
Z80_AF
Z80_BC
Z80_DE
Z80_HL
Z80_AF_
Z80_BC_
Z80_DE_
Z80_HL_
Z80_MEMPTRH
Z80_MEMPTRL
Z80_PCH
Z80_PCL
Z80_SPH
Z80_SPL
Z80_XYH
Z80_XYL
Z80_IXH
Z80_IXL
Z80_IYH
Z80_IYL
Z80_A
Z80_F
Z80_B
Z80_C
Z80_D
Z80_E
Z80_H
Z80_L
Z80_A_
Z80_F_
Z80_B_
Z80_C_
Z80_D_
Z80_E_
Z80_H_
Z80_L_
MAXIMUM_CYCLES
MAXIMUM_CYCLES_PER_STEP
MINIMUM_CYCLES_PER_STEP

HOOK

OPTION_OUT_VC_255
OPTION_LD_A_IR_BUG
OPTION_HALT_SKIP
OPTION_XQ
OPTION_IM0_RETX_NOTIFICATIONS
OPTION_YQ

MODEL_ZILOG_NMOS
MODEL_ZILOG_CMOS
MODEL_NEC_NMOS
MODEL_ST_CMOS

REQUEST_REJECT_NMI
REQUEST_NMI
REQUEST_INT

RESUME_HALT
RESUME_XY
RESUME_IM0_XY

MEMPTR PC SP XY IX IY AF BC DE HL AF_ BC_ DE_ HL_
MEMPTRH MEMPTRL PCH PCL SPH SPL XYH XYL IXH IXL IYH IYL
A F B C D E H L A_ F_ B_ C_ D_ E_ H_ L_
).each do |macro|
abort "missing #{macro}" unless have_macro(macro, 'Z80.h')
abort "missing Z80_#{macro}" unless have_macro("Z80_#{macro}", 'Z80.h')
end

create_makefile "z80/z80"

0 comments on commit c5d3e14

Please sign in to comment.