If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Rad Mobile

From The Cutting Room Floor
Jump to navigation Jump to search

Title Screen

Rad Mobile

Developer: Sega AM3
Publisher: Sega
Platform: Arcade (System 32)
Released internationally: June 23, 1991
Released in JP: January 1, 1991


SourceIcon.png This game has uncompiled source code.
CopyrightIcon.png This game has hidden developer credits.
GraphicsIcon.png This game has unused graphics.


Rad Mobile contains the first official appearance of Sonic the Hedgehog. Oh, and it just so happens to be a driving game.

Easter Egg

Sonic Flicky
RadMobileAC-SonicOrnament.gif RadMobileAC-FlickyOrnament.gif

Flicky, who had made numerous cameos in other Sega games before Sonic took her place, was seemingly an unused window ornament for over three decades. However, Flicky can be accessed via a code when beginning a race. To unlock Flicky, press and hold A, B and Start. If done correctly, you'll get Flicky in place of Sonic.

(Source: Rings of Saturn; @memory_fallen on Twitter)

Source Code Fragment

A piece of code related to booting up the game is present at 315A in epr-13686.bin. The last few lines of code were inexplicably moved to the top and a couple pieces of text went missing. As a result, what follows is a slight restoration of this code. The comments are encoded with Shift-JIS.

A translation follows below.

;-----------------------------------------------------------------------------
;O	*RAD MOBILE DELUXE CABINET MOVING CONTROL.			     O
;O			 CABINET DESIGN	BY	ASATA.HIRAI		     O
;O			MECHANIC DESIGN	BY	MASAO.YOSHIMOTO		     O
;O                                          AND NORIAKI.UEDA   		     O
;O			CABINET.PRODUCT	BY	MASAKI.MATSUNO 		     O
;O					    AND	FUTOSHI.ITOH		     O
;O			ELECTRIC DESIGN	BY	MASAYUKI.OSADA   	     O
;O                                          AND NOBUYUKI.KADOI               O
;O                    (HA)RDWARE DESIGN	BY	MASAYUKI.OSADA		     O
;O									     O
;O		MOTOR CONTROLER PROGRAM	BY	MASAYUKI.OSADA    	     O
;O		GAME		PROGRAM BY	AM R&D 3rd.		     O
;O									     O
;-----------------------------------------------------------------------------

MO        	ld	hl,clk_sfty2_l1
		inc	hl
and_sgm5:	push	hl
		ld	de,(dlt2_max)
		or	a
		sbc	hl,de
		pop	hl
		ld	de,0
		ld	(dlt2),de	
		ret	c
		ld	(dlt2_max),hl
		ld	(dlt2_max_d),hl
		ret

;///////////////////////////////////////////////;
;	積商ル-チン ゼア        ンプルより
;///////////////////////////////////////////////;
;
;	HL = HL * DE  ,  HL = HL / DE
;
;       SAMPLE 2-8 	by S.OOHIRA

MULT:   CALL	HOHL
        PUSH	BC
	LD	A,16            ;COUNTER SET
	LD	B,H             ;LOAD BC,HL
	LD	C,L
        0000
LOOP:	SRL	D               ;SRL	HL
	RR	E
	JR	NC,BCSHFT
	ADD	HL,BC
BCSHFT:
	SLA	C               ;SLA 	BC
	RL	B
	DEC	A
	JR	NZ,LOOP
SKIP:	POP	BC
	SRL	C               ;SIGN MINUS -> HL= -HL
	JR	NC,STOCK
;
	LD	A,H
	CPL          		;HL         L
	LD	H,A
	LD	A,L
	CPL
	LD	L,A
	INC	HL
;
STOCK:	LD	(0E000H),HL
	RET
;
;
;       HL = HL / DE      DE = HL MOV DE
;
;
DIV:	LD	A,E       	;IF DE=0 , NOT DIVISION
	OR	D
	RET	Z
;
	CALL	HOHL
	PUSH	BC
	LD	BC,0000
	PUSH	HL                    IX,HL
	POP	IX
	LD	A,16            ;COUNTER SET
DLOOP:	ADD	IX,IX         	;SLA	BCIX
	RL	C
	RL	B
	OR	A               ;CARRY OFF
	LD	H,B
	LD	L,C
	SBC	HL,DE
	JR 	C,CONT
	LD	B,H
	LD	C,L
	INC	IX
CONT:   DEC	A
	JR	NZ,DLOOP
	PUSH	IX                OAD HL,IX
	POP	HL
	LD	D,B             ;LOAD BC,DE
	LD	E,C
	JR	SKIP
;
;       HL = ABS(HL)  ,  DE = ABS(DE)
;       C=0 ・・・ HL*DE or HL/DE -> PLUS
;	C=1 ・・・ HL*DE or HL/DE -> MINUS
;
HOHL:	LD	C,0     	;SET PLUS SIGN
 	LD	A,H
	OR	A
	JP	P               ;IF HL >= 0 , GOTO HODE
	CPL          		;HL <- ABS HL
	LD	H,A
	LD	A,L
	CPL
	LD	L,A
	INC	HL
	INC	C               ;SET MINUS SIGN
HODE:   LD	A,D
	OR	A
	RET	P               ;IF DE >= 0 , RETURN
	CPL                     ;DE <- ABS DE
        
	LD	A,E
	CPL
	LD	E,A
	INC	DE
	LD	A,1
	XOR	C               ;C = SIGN * MINUS
	LD	C,A
	RET

;///////////////////////////////////////////////////
;	PPI 初期設定  			   /
;///////////////////////////////////////////////////

PPIINIT:        LD	A,1001010B	;RESET.
		LD	(PPI0_W),A

		LD	A,10001011B	;RESET.
		LD	(PPI1_W),A
		RET

;///////////////////////////////////////////////////
;	CTC  初期設定			   / 	
;///////////////////////////////////////////////////

CTCINIT:	LD	A,24H
                LD	(CTC0_W),A	;8253 CH0 MODE SET
 		LD	A,040H
 		LD	(CTC0_0),A	;4ms INTERUPT CLK
 
		ld	hl,clk_sfty1_l1
 		LD	A,l
 		LD	(CTC0_1),A	;SAFTY CLOCK 1
 		LD	A,H  
 		LD	(CTC0_1),A	;SAFTY CLOCK 1
 		LD	A,0b4H
 		LD	(CTC0_W),A	;8253 CH2 MODE SET  "
 		LD	A,l
 		LD	(CTC0_2),A	;SAFTY CLOCK 2
 		LD	A,h
 		LD	(CTC0_2),A	;SAFTY CLOCK 2

		LD	A,24H
		LD	(CTC1_W),A	;8253 CH0 MODE SET
		LD	A,1H
		LD	(CTC1_0),A	;8253 CH0 15KHz CLOCK

		LD	A,5AH
		LD	(CTC1_W),A	;8253 CH1 MODE SET
		LD	A,7FH
		LD	(CTC1_1),A	;POWER 127/255 SET

		LD	A,9AH
		LD	(CTC1_W),A	;8253 CH2 MODE SET
		LD	A,7FH
		LD	(CTC1_2),A	;POWER 127/255 SET
  		RET


;///////////////////////////////////////////////////
;	encoder 積分値 初期設定		           /
;///////////////////////////////////////////////////
		
ENCINIT:	LD	HL,(IENC0)	;レゾルバ0
		LD	A,H
		AND	00001111B
		LD	H,A
		LD	(ENC_0),HL
		LD	(ENC_0S),HL

 		LD	HL,(IENC1)	;レゾルバ1
 		LD	A,H
 		AND	00001111B
 		LD	H,A
		LD	(ENC_1),HL
                LD	(ENC_1S),HL
		RET

err_cabi:      	LD	HL,INP_0	;right limit sw on then o.c err cancel.
                BIT	0,(HL)

The below version is a translated version of the above (or at least, as best as can be done considering the missing data).

;-----------------------------------------------------------------------------
;O	*RAD MOBILE DELUXE CABINET MOVING CONTROL.			     O
;O			 CABINET DESIGN	BY	ASATA.HIRAI		     O
;O			MECHANIC DESIGN	BY	MASAO.YOSHIMOTO		     O
;O                                          AND NORIAKI.UEDA   		     O
;O			CABINET.PRODUCT	BY	MASAKI.MATSUNO 		     O
;O					    AND	FUTOSHI.ITOH		     O
;O			ELECTRIC DESIGN	BY	MASAYUKI.OSADA   	     O
;O                                          AND NOBUYUKI.KADOI               O
;O                    (HA)RDWARE DESIGN	BY	MASAYUKI.OSADA		     O
;O									     O
;O		MOTOR CONTROLER PROGRAM	BY	MASAYUKI.OSADA    	     O
;O		GAME		PROGRAM BY	AM R&D 3rd.		     O
;O									     O
;-----------------------------------------------------------------------------

MO        	ld	hl,clk_sfty2_l1
		inc	hl
and_sgm5:	push	hl
		ld	de,(dlt2_max)
		or	a
		sbc	hl,de
		pop	hl
		ld	de,0
		ld	(dlt2),de	
		ret	c
		ld	(dlt2_max),hl
		ld	(dlt2_max_d),hl
		ret

;///////////////////////////////////////////////;
;	Multiplication/division routine   Ze-    from    -mple
;///////////////////////////////////////////////;
;
;	HL = HL * DE  ,  HL = HL / DE
;
;       SAMPLE 2-8 	by S.OOHIRA

MULT:   CALL	HOHL
        PUSH	BC
	LD	A,16            ;COUNTER SET
	LD	B,H             ;LOAD BC,HL
	LD	C,L
        0000
LOOP:	SRL	D               ;SRL	HL
	RR	E
	JR	NC,BCSHFT
	ADD	HL,BC
BCSHFT:
	SLA	C               ;SLA 	BC
	RL	B
	DEC	A
	JR	NZ,LOOP
SKIP:	POP	BC
	SRL	C               ;SIGN MINUS -> HL= -HL
	JR	NC,STOCK
;
	LD	A,H
	CPL          		;HL         L
	LD	H,A
	LD	A,L
	CPL
	LD	L,A
	INC	HL
;
STOCK:	LD	(0E000H),HL
	RET
;
;
;       HL = HL / DE      DE = HL MOV DE
;
;
DIV:	LD	A,E       	;IF DE=0 , NOT DIVISION
	OR	D
	RET	Z
;
	CALL	HOHL
	PUSH	BC
	LD	BC,0000
	PUSH	HL                    IX,HL
	POP	IX
	LD	A,16            ;COUNTER SET
DLOOP:	ADD	IX,IX         	;SLA	BCIX
	RL	C
	RL	B
	OR	A               ;CARRY OFF
	LD	H,B
	LD	L,C
	SBC	HL,DE
	JR 	C,CONT
	LD	B,H
	LD	C,L
	INC	IX
CONT:   DEC	A
	JR	NZ,DLOOP
	PUSH	IX                OAD HL,IX
	POP	HL
	LD	D,B             ;LOAD BC,DE
	LD	E,C
	JR	SKIP
;
;       HL = ABS(HL)  ,  DE = ABS(DE)
;       C=0 ・・・ HL*DE or HL/DE -> PLUS
;	C=1 ・・・ HL*DE or HL/DE -> MINUS
;
HOHL:	LD	C,0     	;SET PLUS SIGN
 	LD	A,H
	OR	A
	JP	P               ;IF HL >= 0 , GOTO HODE
	CPL          		;HL <- ABS HL
	LD	H,A
	LD	A,L
	CPL
	LD	L,A
	INC	HL
	INC	C               ;SET MINUS SIGN
HODE:   LD	A,D
	OR	A
	RET	P               ;IF DE >= 0 , RETURN
	CPL                     ;DE <- ABS DE
        
	LD	A,E
	CPL
	LD	E,A
	INC	DE
	LD	A,1
	XOR	C               ;C = SIGN * MINUS
	LD	C,A
	RET

;///////////////////////////////////////////////////
;	PPI Initialization  			   /
;///////////////////////////////////////////////////

PPIINIT:        LD	A,1001010B	;RESET.
		LD	(PPI0_W),A

		LD	A,10001011B	;RESET.
		LD	(PPI1_W),A
		RET

;///////////////////////////////////////////////////
;	CTC  Initialization			   / 	
;///////////////////////////////////////////////////

CTCINIT:	LD	A,24H
                LD	(CTC0_W),A	;8253 CH0 MODE SET
 		LD	A,040H
 		LD	(CTC0_0),A	;4ms INTERUPT CLK
 
		ld	hl,clk_sfty1_l1
 		LD	A,l
 		LD	(CTC0_1),A	;SAFTY CLOCK 1
 		LD	A,H  
 		LD	(CTC0_1),A	;SAFTY CLOCK 1
 		LD	A,0b4H
 		LD	(CTC0_W),A	;8253 CH2 MODE SET  "
 		LD	A,l
 		LD	(CTC0_2),A	;SAFTY CLOCK 2
 		LD	A,h
 		LD	(CTC0_2),A	;SAFTY CLOCK 2

		LD	A,24H
		LD	(CTC1_W),A	;8253 CH0 MODE SET
		LD	A,1H
		LD	(CTC1_0),A	;8253 CH0 15KHz CLOCK

		LD	A,5AH
		LD	(CTC1_W),A	;8253 CH1 MODE SET
		LD	A,7FH
		LD	(CTC1_1),A	;POWER 127/255 SET

		LD	A,9AH
		LD	(CTC1_W),A	;8253 CH2 MODE SET
		LD	A,7FH
		LD	(CTC1_2),A	;POWER 127/255 SET
  		RET


;///////////////////////////////////////////////////
;	encoder Integer value initialization	   /
;///////////////////////////////////////////////////
		
ENCINIT:	LD	HL,(IENC0)	;Resolver0
		LD	A,H
		AND	00001111B
		LD	H,A
		LD	(ENC_0),HL
		LD	(ENC_0S),HL

 		LD	HL,(IENC1)	;Resolver1
 		LD	A,H
 		AND	00001111B
 		LD	H,A
		LD	(ENC_1),HL
                LD	(ENC_1S),HL
		RET

err_cabi:      	LD	HL,INP_0	;right limit sw on then o.c err cancel.
                BIT	0,(HL)

(Source: @rom_txt)