Skip to content

Commit

Permalink
Add orgams source dir for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Krusty/Benediction committed Nov 17, 2024
1 parent 1b93f00 commit 793320e
Show file tree
Hide file tree
Showing 339 changed files with 16,483 additions and 0 deletions.
Binary file added cpclib-emucontrol/tests/ORG/!UNIDOS!.NVM
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/-ORGDATA.LNK
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/-TODO.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/123.NRT
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/AAP.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/AAPAO.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/ANAL.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/ASSETE.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/ASSFG.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/B.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/BT.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/BT2.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/BUG11D.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/BUG16BFF.BIN
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/BUGASSE.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/BUGDBL.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/BUGLOAD.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/BUGTMP.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/BUN.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/BURN.TXT
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/BURNRSX.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CACHE.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CALLORG.JP
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CHCG.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CHECK
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CHECK.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CHECK.TXT
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CHUNGI.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CLIP.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/COCOPY-P.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/COCOPY.ROM
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/COCOPY.TST
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CONV.NRT
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CONV.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CPT.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CRULOGON.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CUE-B.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/CUE.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/DECEXP.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/DISP.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/DISPO.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/DISPQ.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/E.O
Binary file not shown.
4,448 changes: 4,448 additions & 0 deletions cpclib-emucontrol/tests/ORG/ED.TXT

Large diffs are not rendered by default.

Binary file added cpclib-emucontrol/tests/ORG/EDNRT.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/EMPTYNRT.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/EZRZ.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FAIL.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FARCALLA.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFB1/CH-BQ.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFB1/CHUNK-AD.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFB1/CHUNK-AE.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFB1/COCOPY-A.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFB1/ORG-ED.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFB1/ORG-EE.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBB/ASS-EL.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBB/ASSETO-A.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBB/FIND-W.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBB/IMPORT-W.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBB/IMPORT-X.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBB/IMPORT-Y.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBB/ORGFR.BAK
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBB/ORGFR.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBC/IMPORT-Z.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBC/IMPORTVW.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBD/ASS-EM.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBD/CACHE-8.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBD/CACHE-A.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBD/IMPORTAB.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBD/ORG-FU.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FFBD/ORG-FV.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FIELD.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FIELD9.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FIELDNRT.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FILENAME.JP
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FILENAME.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FIND.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/FOLLOW.BAS
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/GETPATH.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/GFX8.O
Binary file not shown.
32 changes: 32 additions & 0 deletions cpclib-emucontrol/tests/ORG/GHOST.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
db #00,#00,#00,#00,#00,#00,#00,#00
db #00,#00,#00,#00,#00,#00,#00,#00
db #00,#00,#00,#00,#00,#00,#01,#01
db #01,#01,#00,#00,#00,#00,#00,#00
db #00,#00,#00,#00,#01,#01,#01,#01
db #01,#01,#01,#01,#00,#00,#00,#00
db #00,#00,#00,#01,#01,#01,#01,#01
db #01,#01,#01,#01,#01,#00,#00,#00
db #00,#00,#01,#01,#01,#01,#01,#01
db #01,#01,#01,#01,#01,#01,#00,#00
db #00,#00,#01,#01,#03,#03,#01,#01
db #01,#01,#03,#03,#01,#01,#00,#00
db #00,#00,#01,#03,#03,#03,#03,#01
db #01,#03,#03,#03,#03,#01,#00,#00
db #00,#01,#01,#03,#03,#03,#03,#01
db #01,#03,#03,#03,#03,#01,#01,#00
db #00,#01,#01,#03,#02,#02,#03,#01
db #01,#03,#02,#02,#03,#01,#01,#00
db #00,#01,#01,#01,#02,#02,#01,#01
db #01,#01,#02,#02,#01,#01,#01,#00
db #00,#01,#01,#01,#01,#01,#01,#01
db #01,#01,#01,#01,#01,#01,#01,#00
db #00,#01,#01,#01,#01,#01,#01,#01
db #01,#01,#01,#01,#01,#01,#01,#00
db #00,#01,#01,#01,#00,#01,#01,#01
db #01,#01,#01,#00,#01,#01,#01,#00
db #00,#00,#01,#00,#00,#00,#01,#01
db #01,#01,#00,#00,#00,#01,#00,#00
db #00,#00,#00,#00,#00,#00,#00,#00
db #00,#00,#00,#00,#00,#00,#00,#00
db #00,#00,#00,#00,#00,#00,#00,#00
db #00,#00,#00,#00,#00,#00,#00,#00
Binary file added cpclib-emucontrol/tests/ORG/HANGLOAD.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/HISTRION.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/IM0.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/IO.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/IOTESTS.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/JPNRT.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/LIBSCR.I
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/LOG.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/LOGAMS.CPT
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/LOGAMS.LZ
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/LOGAMS.RAW
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/LOGAMS.WIN
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/LOGOK.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/LOGOROM.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/MAIN.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/MEMMAP.BAK
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/MEMMAP.I
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/MF2-ROM.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/MIRROR.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/MONIQUE.I
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/MSBXLSB.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/MULF.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/NO-EOF.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/NRT1.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/NRTDA.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/NRTIMP1.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/NRTORGUI.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/NRTTRAN2.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/ONELINE.TXT
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/ORGDY.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/ORGMAP.I
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/ORLG.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/OUT.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/PATCH.TXT
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/PRETEST.O
Binary file not shown.
227 changes: 227 additions & 0 deletions cpclib-emucontrol/tests/ORG/PRETEST6.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
inRom = 0 ; 1 to auto-install in rom
rom = &1B ; <- ROM pour ce module

main_rom = &0A ; ORGAMS.ROM
ext_rom = &1A ; ORGEXT.ROM
bk_dev = &C7 ; Temporary orgams instance will use c4-c7

nrt_buf = &0F00

ORG &1000
IF inRom:ENT burn
ELSE:ENT start
END

; ---- In ORGAMS.ROM aka main_rom (use regular call) ---------------

setup_custom = &E839 ; Trust me on this

; ---- In ORGEXT.ROM (use CALL_ORG to call those routines) ---------

org = &C008
; --- For nrt ---
org_init = org
org_get_lines# = org+3
org_get_line = org+6
org_set_line = org+9 ; out: hl trashed!
org_insert_line = org+12 ; out: hl post nt string.
org_delete_line = org+15
org_load = org+18
org_save = org+21

org_assemble = org+27

; --- Handy aliases -------------------------------------------------

fail = &BE00 ; Breakpoint on failures
kl_rom_select = &B90F

; --- Helpers -------------------------------------------------------

MACRO CALL_ORG rout
IF rom - ext_rom
push hl:ld hl,rout:jp _call_org
ELSE
; Ext rom already connected.
call rout
END
ENDM


MACRO INSERT_LINE num,string
ld de,num
ld hl,string
CALL_ORG(org_insert_line)
call nc,fail ; Should return Carry (success)
ENDM

MACRO CHECK_HL_EQ val
push de
ld de,val
call _check_hl_eq
pop de
ENDM

_check_hl_eq
or a:sbc hl,de:add hl,de:call nz,fail ; Break if <>
ret

MACRO CHECK_DE_EQ val
push hl
ld hl,val
call _check_de_eq
pop hl
ENDM

_check_de_eq
; NB: same routine than _check_hl_eq, but right name for stack trace.
or a:sbc hl,de:add hl,de:call nz,fail ; Break if <>
ret



MACRO CHECK_NB_LINES total
CALL_ORG(org_get_lines#)
ld hl,total
or a:sbc hl,de:add hl,de:call nz,fail ; Break if <>
ENDM

MACRO CHECK_LINE num,string
ld de,num
ld hl,nrt_buf
CALL_ORG(org_get_line):call nc,fail
ld hl,nrt_buf
ld de,string
call compare_string
ENDM

nrt_set_source
; IN: hl: lines (NT strings) + 0 at the end.
ld de,1
nsc_lp
push de
CALL_ORG(org_insert_line):call nc,&BE00
pop de
inc de
ld a,(hl)
or a
jr nz,nsc_lp
ret

compare_sized
; In: HL & DE = zones to compare
; B = size
; Return if OK, break otherwise
ld a,(de):cp (hl):call nz,fail
inc de:inc hl
djnz compare_sized
ret

compare_string
; Compare nt string
; In: HL & DE = strings to compare
; Return if OK, break otherwise
ld a,(de):cp (hl):call nz,fail
or a:ret z
inc de:inc hl
jr compare_string


_call_org
; Swith to ext rom, call ORG_* routine, switch back.

ld (_call_+1),hl
pop hl

push af:push bc
ld c,ext_rom:call kl_rom_select
pop bc:pop af

_call_ call 0

push af:push bc
ld c,rom:call kl_rom_select
pop bc:pop af
ret

; -------------------------------------------------------------------

;====
start
;====
ld a,bk_dev
call nrt_setup
jp tests

nrt_setup
; IN: A = bk_dev
push af

ld c,main_rom:call kl_rom_select

; -- Check this is Orgams ROM. If fail: correct main_rom
ld hl,(&C004)
ld de,signature
ld b,signature_
call compare_sized

; -- Setup Orgams (install in bank etc...)
pop af:call setup_custom

; -- Work rom --
ld c,rom:call kl_rom_select

; -- Cold start
CALL_ORG(org_init)
ret

signature BYTE "Orgams"
signature_ = $ - signature

;====
tests
;====
call test_insert_line
call test_source_assemble
; Your tests here
ret

test_insert_line
;---------------

; Reset. So tests don't impact each other.
CALL_ORG(org_init)

; Code under test.
INSERT_LINE(1,dummy_line)

; Checks.
CHECK_NB_LINES(1)
CHECK_LINE(1,dummy_line) ; check we get the line back
; CHECK_LINE(2,dummy_line) ; uncomment me to trigger failure
ret

dummy_line BYTE "Sid",0


test_source_assemble
;-------------------
CALL_ORG(org_init)

ld hl,source_nrt
call nrt_set_source

ld de,nrt_buf ; dest
ld bc,&1234 ; pc
CALL_ORG(org_assemble)

ld hl,(nrt_buf)
CHECK_HL_EQ(&3412)
ret

source_nrt
BYTE "macro rword n:byte n/&100,n and &ff:endm",0
BYTE "rword $",0
BYTE 0

�
Binary file added cpclib-emucontrol/tests/ORG/PROF.NRT
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/PROF.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/PROFMON.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/PROFORG.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/PSG.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/R.BAS
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/ROMMAP.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/RSX.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/RUN.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SAVEBIN.NRT
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SAVEBIN.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SAVEDBIG.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SAVER.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SCAN.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SCR-LO.NRT
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SCR-LO.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SCR-LO3.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SCREEN.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SEAHEX.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SEAHEX2.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/SEARCH.O
Binary file not shown.
Binary file added cpclib-emucontrol/tests/ORG/STATUS.O
Binary file not shown.
Loading

0 comments on commit 793320e

Please sign in to comment.