vprette, on Thu Feb 9, 2012 6:06 AM, said:
If R0 is not equal to 1 and its not equal to 2 then the code will "fall through" to the code at label @@2B. You need to add some code before @@2B if you want to do something else.
Posted Thu Feb 9, 2012 6:15 AM
vprette, on Thu Feb 9, 2012 6:06 AM, said:
Posted Thu Feb 9, 2012 6:58 AM
vprette, on Thu Feb 9, 2012 6:06 AM, said:
D_DISC PROC
BEGIN
; handle "next page"
MVI PAGESTEP, R0
; IF (R0 = 1) THEN GOTO LEVEL_2B
CMPI #1, R0
BEQ @@2B
; ELSEIF (R0 = 2) THEN GOTO LEVEL_7B
CMPI #2, R0
BEQ @@7B
; ELSE
; Do whatever you need to do when all cases failed.
RETURN ;return della procedura D_DISC
@@2B:
INC PAGESTEP, R4
CALL LEVEL_2B
RETURN
@@7B:
INC PAGESTEP, R4
CALL LEVEL_7B
RETURN
ENDP
Posted Thu Feb 9, 2012 7:46 AM
Edited by vprette, Thu Feb 9, 2012 8:01 AM.
Posted Thu Feb 9, 2012 7:55 AM
vprette, on Thu Feb 9, 2012 7:46 AM, said:
D_DISC PROC
BEGIN
MVI PAGESTEP, R0
SWITCH R0, @@swt_tbl
; ON 0, 1, 2...
@@swt_tbl: DECLE @@case1, @@case2, @@case3
@@case1:
; R0 = 0
RETURN
@@case2:
; R0 = 1
RETURN
@@case3:
; R0 = 2
RETURN
ENDP
D_DISC PROC
BEGIN
MVI PAGESTEP, R0
CMPI #3, R0 ; Accept values below 3
BGE @@else ;
SWITCH R0, @@swt_tbl
; ON 0, 1, 2...
@@swt_tbl: DECLE @@case1, @@case2, @@case3
@@case1:
; R0 = 0
RETURN
@@case2:
; R0 = 1
RETURN
@@case3:
; R0 = 2
@@else: RETURN
ENDP
Posted Thu Feb 9, 2012 9:01 AM
Edited by vprette, Thu Feb 9, 2012 9:48 AM.
Posted Thu Feb 9, 2012 10:31 AM
vprette, on Thu Feb 9, 2012 9:01 AM, said:
Posted Fri Feb 10, 2012 5:10 AM
MVI PSG0.chan_enable, R0 ; \
MVO@ R0, GAME_INFO.PsgState ; |_ Mute all PSG channels
MVII #$3F, R0 ; | (saving their status).
MVO R0, PSG0.chan_enable ; /
MVI GAME_INFO.PsgState, R0 ; \_ Unmute all PSG channels
MVO R0, PSG0.chan_enable ; /
Posted Fri Feb 10, 2012 5:21 AM
Edited by vprette, Fri Feb 10, 2012 5:43 AM.
Posted Fri Feb 10, 2012 6:05 AM
Posted Fri Feb 10, 2012 6:33 AM
catsfolly, on Fri Feb 10, 2012 6:05 AM, said:
Posted Fri Feb 10, 2012 6:35 AM
Posted Fri Feb 10, 2012 7:01 AM
Edited by DZ-Jay, Fri Feb 10, 2012 7:03 AM.
Posted Fri Feb 10, 2012 1:15 PM
GroovyBee, on Fri Feb 10, 2012 6:35 AM, said:
DICT PROC[/font]
@@Welcome S16 "Welcome"
@@to S16 "to"
@@Colossal S16 "Colossal"
@@Cave_ S16 "Cave."
ENDP
MSG PROC
@@intro DECLE DICT.Welcome, DICT.to, DICT.Colossal, DICT.Cave_, 0
ENDP
That encoding took up 15 words (if I counted correctly). The original phrase took 27 bytes (including terminating NUL), so there's a modest increase here, since there was no reuse. I say modest increase because 15 words is 30 bytes. But the moment you reuse a word, you start gaining. (Side note: S16 is my macro for encoding packed strings, with two bytes per word.)
DZ-Jay, on Fri Feb 10, 2012 7:01 AM, said:
Edited by intvnut, Fri Feb 10, 2012 1:29 PM.
Posted Fri Feb 10, 2012 1:26 PM
Posted Fri Feb 10, 2012 1:50 PM
intvnut, on Fri Feb 10, 2012 1:15 PM, said:
GroovyBee, on Fri Feb 10, 2012 6:35 AM, said:
DICT PROC[/font] @@Welcome S16 "Welcome" @@to S16 "to" @@Colossal S16 "Colossal" @@Cave_ S16 "Cave." ENDP MSG PROC @@intro DECLE DICT.Welcome, DICT.to, DICT.Colossal, DICT.Cave_, 0 ENDPThat encoding took up 15 words (if I counted correctly). The original phrase took 27 bytes (including terminating NUL), so there's a modest increase here, since there was no reuse. I say modest increase because 15 words is 30 bytes. But the moment you reuse a word, you start gaining. (Side note: S16 is my macro for encoding packed strings, with two bytes per word.)
DZ-Jay, on Fri Feb 10, 2012 7:01 AM, said:
intvnut, on Fri Feb 10, 2012 1:15 PM, said:
GroovyBee, on Fri Feb 10, 2012 6:35 AM, said:
DICT PROC[/font] @@Welcome S16 "Welcome" @@to S16 "to" @@Colossal S16 "Colossal" @@Cave_ S16 "Cave." ENDP MSG PROC @@intro DECLE DICT.Welcome, DICT.to, DICT.Colossal, DICT.Cave_, 0 ENDPThat encoding took up 15 words (if I counted correctly). The original phrase took 27 bytes (including terminating NUL), so there's a modest increase here, since there was no reuse. I say modest increase because 15 words is 30 bytes. But the moment you reuse a word, you start gaining. (Side note: S16 is my macro for encoding packed strings, with two bytes per word.)
DZ-Jay, on Fri Feb 10, 2012 7:01 AM, said:
Posted Fri Feb 10, 2012 1:52 PM
intvnut, on Fri Feb 10, 2012 1:26 PM, said:
Posted Fri Feb 10, 2012 3:19 PM
Edited by vprette, Fri Feb 10, 2012 3:21 PM.
Posted Fri Feb 10, 2012 3:35 PM
Posted Fri Feb 10, 2012 3:37 PM
Quote
C:\build.sh
C:\run.sh -d
batchfiles.zip 1.35K
7 downloads
Posted Fri Feb 10, 2012 3:41 PM
GroovyBee, on Fri Feb 10, 2012 3:35 PM, said:
ROMSEG 2
Posted Fri Feb 10, 2012 3:44 PM
vprette, on Fri Feb 10, 2012 3:19 PM, said:
Posted Fri Feb 10, 2012 3:47 PM
DZ-Jay, on Fri Feb 10, 2012 3:37 PM, said:
Quote
C:\build.sh
C:\run.sh -d
batchfiles.zip 1.35K
7 downloadsPosted Fri Feb 10, 2012 3:47 PM
vprette, on Fri Feb 10, 2012 3:47 PM, said:
DZ-Jay, on Fri Feb 10, 2012 3:37 PM, said:
Quote
C:\build.sh
C:\run.sh -d
batchfiles.zip 1.35K
7 downloadsEdited by DZ-Jay, Fri Feb 10, 2012 3:49 PM.
0 members, 1 guests, 0 anonymous users