Skip to content

Commit 8fd1958

Browse files
committed
Retirado Logos: SEGA, SGDK del Titulo del juego, usando default_logo_sgdk interno de la ROM. Act. API SGDK update: Mar 6, 2022
1 parent bcae99a commit 8fd1958

15 files changed

Lines changed: 90 additions & 88 deletions

inc/global.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ u8 ScreenY; //27/29
99
u8 ScreenMY; //112/120
1010
u8 ScreenTY; //224/240
1111
s8 fixAlturaY; //-24/-32
12-
u8 ScreTile8; //0/8
1312

1413
u8 JoyType; //JOY_getJoypadType(JOY_1); //JOY_TYPE_PAD6
1514
u8 padraton; //JOY_getPortType(PORT_2);

res/Logos/logo_Sega.png

-681 Bytes
Binary file not shown.

res/Logos/sgdk_logo.png

-11.8 KB
Binary file not shown.

res/Titulo/sgdk.png

-718 Bytes
Binary file not shown.

res/logos.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#define _RES_LOGOS_H_
33

44
extern const Image disclaimer;
5-
extern const Image logosega;
65
extern const Image alicesim1;
76

87
#endif // _RES_LOGOS_H_

res/logos.res

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
IMAGE disclaimer "Logos/disclaimer.png" BEST
2-
IMAGE logosega "Logos/logo_Sega.png" BEST
32
IMAGE alicesim1 "Logos/AliceSim1.png" BEST

res/titulo.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
extern const Image titulo;
55
extern const Image titush;
66
extern const Image fondogr;
7-
extern const Image sgdk;
87

98
#endif // _RES_TITULO_H_

res/titulo.res

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
IMAGE titulo "Titulo/titulo.png" BEST
22
IMAGE titush "Titulo/titulo-shader.png" BEST
3-
IMAGE fondogr "Titulo/fondo.png" BEST
4-
IMAGE sgdk "Titulo/sgdk.png" BEST
3+
IMAGE fondogr "Titulo/fondo.png" BEST

src/boot/rom_head.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ __attribute__((externally_visible))
44
const ROMHeader rom_header = {
55
#if (ENABLE_BANK_SWITCH != 0)
66
"SEGA SSF ",
7+
#elif (MODULE_MEGAWIFI != 0)
8+
"SEGA MEGAWIFI ",
79
#else
810
"SEGA MEGA DRIVE ",
911
#endif
10-
"ALICESIM1 - 2021",
12+
"ALICESIM1 3/2022",
1113
"PENGUIN WORLD - ALPHA DEVOLOPER ",
1214
"PENGUIN WORLD - ALPHA DEVOLOPER ",
1315
"GM 00000000-00",
@@ -27,5 +29,5 @@ const ROMHeader rom_header = {
2729
0x0020FFFF,
2830
" ",
2931
"DEMONSTRATION PROGRAM ",
30-
"EUJ "
31-
};
32+
"JUE "
33+
};

src/boot/sega.s

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include "task_cst.h"
2+
13
.section .text.keepboot
24

35
*-------------------------------------------------------
@@ -17,7 +19,7 @@
1719

1820
_Start_Of_Rom:
1921
_Vecteurs_68K:
20-
dc.l 0x00000000 /* Stack address */
22+
dc.l __stack /* Stack address */
2123
dc.l _Entry_Point /* Program start address */
2224
dc.l _Bus_Error
2325
dc.l _Address_Error
@@ -32,18 +34,22 @@ _Vecteurs_68K:
3234
dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception
3335
dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception
3436
dc.l _Error_Exception, _Error_Exception, _Error_Exception, _Error_Exception
35-
dc.l _Error_Exception, _INT, _EXTINT, _INT
36-
dc.l _HINT
37+
dc.l _Error_Exception
38+
dc.l _INT
39+
dc.l _EXTINT
40+
dc.l _INT
41+
dc.l hintCaller
3742
dc.l _INT
3843
dc.l _VINT
3944
dc.l _INT
40-
dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT
45+
dc.l _trap_0 /* Resume supervisor task */
46+
dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT
4147
dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT
4248
dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT
4349
dc.l _INT,_INT,_INT,_INT,_INT,_INT,_INT,_INT
4450

4551
rom_header:
46-
.incbin "out/rom_head.bin", 0x10, 0x100
52+
.incbin "out/rom_head.bin", 0, 0x100
4753

4854
_Entry_Point:
4955
move #0x2700,%sr
@@ -66,10 +72,13 @@ SkipJoyDetect:
6672
* Sega Security Code (SEGA)
6773
move.l #0x53454741,0x2f00(%a1)
6874
WrongVersion:
75+
* Read from the control port to cancel any pending read/write command
6976
move.w (%a4),%d0
70-
moveq #0x00,%d0
71-
movea.l %d0,%a6
72-
move %a6,%usp
77+
78+
* Configure a USER_STACK_LENGTH bytes user stack at bottom, and system stack on top of it
79+
move %sp, %usp
80+
sub #USER_STACK_LENGTH, %sp
81+
7382
move.w %d7,(%a1)
7483
move.w %d7,(%a2)
7584

@@ -226,36 +235,60 @@ _EXTINT:
226235
movem.l (%sp)+,%d0-%d1/%a0-%a1
227236
rte
228237

229-
_HINT:
230-
movem.l %d0-%d1/%a0-%a1,-(%sp)
231-
move.l hintCB, %a0
232-
jsr (%a0)
233-
movem.l (%sp)+,%d0-%d1/%a0-%a1
234-
rte
235-
236238
_VINT:
239+
btst #5, (%sp) /* Skip context switch if not in user task */
240+
bne.s no_user_task
241+
242+
tst.w task_lock
243+
bne.s 1f
244+
move.w #0, -(%sp) /* TSK_superPend() will return 0 */
245+
bra.s unlock /* If lock == 0, supervisor task is not locked */
246+
247+
1:
248+
bcs.s no_user_task /* If lock < 0, super is locked with infinite wait */
249+
subq.w #1, task_lock /* Locked with wait, subtract 1 to the frame count */
250+
bne.s no_user_task /* And do not unlock if we did not reach 0 */
251+
move.w #1, -(%sp) /* TSK_superPend() will return 1 */
252+
253+
unlock:
254+
/* Save bg task registers (excepting a7, that is stored in usp) */
255+
move.l %a0, task_regs
256+
lea (task_regs + UTSK_REGS_LEN), %a0
257+
movem.l %d0-%d7/%a1-%a6, -(%a0)
258+
259+
move.w (%sp)+, %d0 /* Load return value previously pushed to stack */
260+
261+
move.w (%sp)+, task_sr /* Pop user task sr and pc, and save them, */
262+
move.l (%sp)+, task_pc /* so they can be restored later. */
263+
movem.l (%sp)+, %d2-%d7/%a2-%a6 /* Restore non clobberable registers */
264+
265+
no_user_task:
266+
/* At this point, we always have in the stack the SR and PC of the task */
267+
/* we want to jump after processing the interrupt, that might be the */
268+
/* point where we came from (if there is no context switch) or the */
269+
/* supervisor task (if we unlocked it). */
270+
237271
movem.l %d0-%d1/%a0-%a1,-(%sp)
238272
ori.w #0x0001, intTrace /* in V-Int */
239273
addq.l #1, vtimer /* increment frame counter (more a vint counter) */
240274
btst #3, VBlankProcess+1 /* PROCESS_XGM_TASK ? (use VBlankProcess+1 as btst is a byte operation) */
241-
beq.s _no_xgm_task
275+
beq.s no_xgm_task
242276

243277
jsr XGM_doVBlankProcess /* do XGM vblank task */
244278

245-
_no_xgm_task:
279+
no_xgm_task:
246280
btst #1, VBlankProcess+1 /* PROCESS_BITMAP_TASK ? (use VBlankProcess+1 as btst is a byte operation) */
247-
beq.s _no_bmp_task
281+
beq.s no_bmp_task
248282

249283
jsr BMP_doVBlankProcess /* do BMP vblank task */
250284

251-
_no_bmp_task:
285+
no_bmp_task:
252286
move.l vintCB, %a0 /* load user callback */
253287
jsr (%a0) /* call user callback */
254288
andi.w #0xFFFE, intTrace /* out V-Int */
255289
movem.l (%sp)+,%d0-%d1/%a0-%a1
256290
rte
257291

258-
259292
*------------------------------------------------
260293
*
261294
* Copyright (c) 1988 by Sozobon, Limited. Author: Johann Ruegg

0 commit comments

Comments
 (0)