notaz.gp2x.de
/
megadrive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hexed: some more configurability
[megadrive.git]
/
hexed
/
hexed.s
diff --git
a/hexed/hexed.s
b/hexed/hexed.s
index
99d1c08
..
95a6930
100644
(file)
--- a/
hexed/hexed.s
+++ b/
hexed/hexed.s
@@
-31,7
+31,9
@@
.equ USE_VINT, 0
.equ COPY_TO_EXP, 1
.equ USE_VINT, 0
.equ COPY_TO_EXP, 1
-.equ RELOCATE_TO_RAM, 1
+.equ RELOCATE_TO_RAM, 0xff0100 /* addr or 0 to disable */
+.equ COPY_TEST_CODE, 0 /* addr or 0 to disable, copy only */
+.equ PC_TRANSFER, 0
.text
.globl main
.text
.globl main
@@
-149,7
+151,7
@@
.macro do_dpad bit op val
btst.l #\bit,d0
beq 0f
.macro do_dpad bit op val
btst.l #\bit,d0
beq 0f
- \op
.l
\val,a6
+ \op
\val,a6
bra dpad_end
0:
.endm
bra dpad_end
0:
.endm
@@
-203,7
+205,8
@@
sprite_data_end:
predef_addrs:
dc.l 0x000000, 0x200000, 0x400000, 0xa00000, 0xa10000
predef_addrs:
dc.l 0x000000, 0x200000, 0x400000, 0xa00000, 0xa10000
- dc.l 0xa11100, 0xa12000, 0xa13000, 0xa14000, 0xc00000
+ dc.l 0xa11100, 0xa12000, 0xa13000, 0xa14000, 0xa15100
+ dc.l 0xc00000
predef_addrs_end:
safe_addrs:
predef_addrs_end:
safe_addrs:
@@
-214,6
+217,10
@@
safe_addrs:
dc.l 0xa12000, 0xa120ff
dc.l 0xa13000, 0xa130ff
safe_addrs_end:
dc.l 0xa12000, 0xa120ff
dc.l 0xa13000, 0xa130ff
safe_addrs_end:
+ dc.l 0xa15100, 0xa1513f
+safe_addrs_end_32x:
+ dc.l 0xa15180, 0xa153ff
+safe_addrs_end_32x_vdp:
sizeof_bin:
dc.l _edata
sizeof_bin:
dc.l _edata
@@
-275,6
+282,7
@@
main:
tst.w (0xc00004).l
no_tmss:
tst.w (0xc00004).l
no_tmss:
+.if PC_TRANSFER
/* want to do early PC transfer (with RAM/VRAM intact and such)?
* also give time PC to see start condition */
move.l #0x2000,d0
/* want to do early PC transfer (with RAM/VRAM intact and such)?
* also give time PC to see start condition */
move.l #0x2000,d0
@@
-283,7
+291,6
@@
no_tmss:
move.l #0xa10005,a0
btst.b #5,(a0)
bne no_early_transfer
move.l #0xa10005,a0
btst.b #5,(a0)
bne no_early_transfer
-move.b #1,(0)
move.b #0x40,(0xa1000b).l /* port 2 ctrl */
move.b #0x00,(a0) /* port 2 data - start with TH low */
move.l #0x2000,d0
move.b #0x40,(0xa1000b).l /* port 2 ctrl */
move.b #0x00,(a0) /* port 2 data - start with TH low */
move.l #0x2000,d0
@@
-292,15
+299,14
@@
move.b #1,(0)
beq do_early_transfer
dbra d0,0b
beq do_early_transfer
dbra d0,0b
-move.b #2,(0)
move.b #0,(0xa1000b).l
bra no_early_transfer /* timeout */
do_early_transfer:
move.b #0,(0xa1000b).l
bra no_early_transfer /* timeout */
do_early_transfer:
-move.b #9,(0)
bsr do_transfer
no_early_transfer:
bsr do_transfer
no_early_transfer:
+.endif
.if COPY_TO_EXP
/* copy to expansion device if magic number is set */
.if COPY_TO_EXP
/* copy to expansion device if magic number is set */
@@
-326,34
+332,38
@@
no_early_transfer:
move.l d0,a0
/* copy, assume 8K size */
move.l d0,a0
/* copy, assume 8K size */
- move.l #
0xFF0100,a1
+ move.l #
RELOCATE_TO_RAM,a2
move.l (sizeof_bin,pc),d0
move.l (sizeof_bin,pc),d0
+ move.l a2, a1
lsr.l #3,d0
1:
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
dbra d0,1b
lsr.l #3,d0
1:
move.l (a0)+,(a1)+
move.l (a0)+,(a1)+
dbra d0,1b
+ lea (0f,pc),a0
+ move.l a0,d0
+ and.l #0x00ffff,d0
+ add.l d0,a2
+.endif
+
+.if COPY_TEST_CODE
/* copy test code */
lea (test_code,pc),a0
/* copy test code */
lea (test_code,pc),a0
- move.l #
0xffc000
,a1
+ move.l #
COPY_TEST_CODE
,a1
move.w #(test_code_end - test_code)/2-1,d0
1:
move.w (a0)+,(a1)+
dbra d0,1b
move.w #(test_code_end - test_code)/2-1,d0
1:
move.w (a0)+,(a1)+
dbra d0,1b
- lea (0f,pc),a0
- move.l a0,d0
- and.l #0x00ffff,d0
- add.l #0xFF0100,d0
- move.l d0,a0
-
/* patch test code */
/* patch test code */
- move.l #
0xffc000
,a1
+ move.l #
COPY_TEST_CODE
,a1
add.w #(test_code_ret_op-test_code+2),a1
add.w #(test_code_ret_op-test_code+2),a1
- move.l a0,(a1)
+ move.l a2,(a1)
+.endif
- jmp (a0)
+.if RELOCATE_TO_RAM
+ jmp (a2)
0:
.endif
0:
.endif
@@
-746,20
+756,20
@@
draw_status_bar:
btst.l #16+4,d0 /* A - scroll modifier */
beq input_noa
btst.l #16+4,d0 /* A - scroll modifier */
beq input_noa
- do_dpad 16+0, sub, #0x0800
- do_dpad 16+1, add, #0x0800
- do_dpad 16+10, sub, #0xd800
- do_dpad 16+11, add, #0xd800
+ do_dpad 16+0, sub
.l
, #0x0800
+ do_dpad 16+1, add
.l
, #0x0800
+ do_dpad 16+10, sub
.l
, #0xd800
+ do_dpad 16+11, add
.l
, #0xd800
input_noa:
moveq.l #0,d1
move.w d7,d1
lsr.w #7,d1
lsr.w #7,d1
input_noa:
moveq.l #0,d1
move.w d7,d1
lsr.w #7,d1
lsr.w #7,d1
- do_dpad 0, subq, #0x0008
- do_dpad 1, addq, #0x0008
- do_dpad 10, sub, d1
- do_dpad 11, add, d1
+ do_dpad 0, subq
.l
, #0x0008
+ do_dpad 1, addq
.l
, #0x0008
+ do_dpad 10, sub
.l
, d1
+ do_dpad 11, add
.l
, d1
dpad_end:
/* update addr */
dpad_end:
/* update addr */
@@
-1339,6
+1349,7
@@
mode_jmp_finish:
jmp (a0)
mode_transfer:
jmp (a0)
mode_transfer:
+.if PC_TRANSFER
move.b #0x40,(0xa1000b).l /* port 2 ctrl */
move.b #0x00,(0xa10005).l /* port 2 data - start with TH low */
move.b #0x40,(0xa1000b).l /* port 2 ctrl */
move.b #0x00,(0xa10005).l /* port 2 data - start with TH low */
@@
-1355,6
+1366,7
@@
wait_tl_low0:
menu_text txt_working, 13, 13, 0
bsr do_transfer
menu_text txt_working, 13, 13, 0
bsr do_transfer
+.endif
bra return_to_main
# go back to main mode
bra return_to_main
# go back to main mode
@@
-1402,6
+1414,19
@@
get_safety_mask:
lsr.l #8,d1
lea (safe_addrs,pc),a1
move.w #(safe_addrs_end - safe_addrs)/8-1,d2
lsr.l #8,d1
lea (safe_addrs,pc),a1
move.w #(safe_addrs_end - safe_addrs)/8-1,d2
+ cmp.l #0x4D415253,(0xa130ec) /* 'MARS' */
+ bne no_32x
+ move.w #(safe_addrs_end_32x - safe_addrs)/8-1,d2
+ move.w (0xa15100),d0
+ and.w #3,d0
+ cmp.w #3,d0 /* ADEN and nRES */
+ bne no_32x_vdp
+ btst.b #7,d0 /* FM */
+ bne no_32x_vdp
+ move.w #(safe_addrs_end_32x_vdp - safe_addrs)/8-1,d2
+no_32x_vdp:
+no_32x:
+
0:
move.l (a1)+,d0
cmp.l d0,d1
0:
move.l (a1)+,d0
cmp.l d0,d1
@@
-1620,12
+1645,14
@@
wait_vsync_poll:
rts
rts
+.if COPY_TEST_CODE
test_code:
nop
test_code_ret_op:
jmp 0x123456 /* will be patched */
test_code_end:
test_code:
nop
test_code_ret_op:
jmp 0x123456 /* will be patched */
test_code_end:
+.endif
#################################################
# #
#################################################
# #