don't click here

Old Scene Homebrew Stuff

Discussion in 'Technical Discussion' started by Oerg866, Feb 13, 2011.

  1. Not sure if this is widely known but I was wondering how the old genesis homebrew and warez scene did their intros and hacks and stuff.

    I found the answer to that and yeah it's pretty interesting to see how they did it. Seems they knew more than we expected them to do, no? :)

    Code (Text):
    1. *
    2. *
    3. *        MEGA DRIVE hard initial program
    4. *
    5. *                1990 6/6
    6. *            R/D 5
    7. *
    8. *    ++++++++++++++++++++++++++++++++++++++++++++++++++
    9. *    +    status of MEGA_DRIVE on program_finished +
    10. *    ++++++++++++++++++++++++++++++++++++++++++++++++++
    11. *
    12. *    ****************** 68000 *******************
    13. *    --------- CAUTION -----------
    14. *    When program end
    15. *    * 68000  set RESET to Z80 ($A11100=0,$A11200=$000)
    16. *    * Z80 wait [ JP  (HL)  ] command ( HL=0000 )
    17. *
    18. *   *************************************************************
    19. *   *                                *
    20. *   *    ICD_END is GAME_PROGRAM start_address            *
    21. *   *      ICD_END = START+$100                    *
    22. *   *    this program size is just 256 byte.            *
    23. *   *                                *
    24. *   *************************************************************
    25. ;
    26. ;
    27. ;
    28. ;***************************************************
    29. ;**************** Attention ************************
    30. ;You have to set this program at your program start.
    31. ;Don't change this program.
    32. ;***************************************************
    33. ;program start
    34. START:
    35.         tst.l    $a10008          ; power on check cntl_A,cntl_B
    36.         bne.s    h_s              ; reset hot_start
    37.         tst.w    $a1000c          ; power on check cntl_C
    38. h_s:    bne.s    hot_start        ; reset hot_start
    39.   
    40. cold_start:                       ; power on (cold_start)
    41.         lea.l    reg_set(pc),a5   ; register set table
    42.         movem.w  (a5)+,d5-d7      ; d5/d6/d7
    43.         movem.l  (a5)+,a0-a4      ; a0-a5
    44.  
    45. security:                         ; ** a1=$a11100 **
    46.         move.b   -$10ff(a1),d0    ; -$1101(a1)=$a10000
    47.         andi.b   #$000f,d0        ; Ver.No check
    48.         beq.s    japan
    49.         move.l   #"SEGA",$2f00(a1)
    50.                                   ; security part move "SEGA"
    51. japan:                            ; $2F00(A1)=$A14000
    52. reg_ini:
    53.         move     (a4),d0          ; VDP STATUS DUMMY READ (D5=$8000)
    54.         moveq    #0,d0            ; D0 set   0
    55.         move.l   d0,a6            ; A6 $00000000
    56.         move.l   a6,usp           ; User Stack Pointer
    57.         moveq    #23,d1           ; D1 count VDP_command
    58. r_ini1:
    59.         move.b   (a5)+,d5         ; REG 0-23 SET (DMA FILL SET)
    60.         move.w   d5,(a4)          ;
    61.         add      d7,d5            ; d7=$100
    62.         dbra     d1,r_ini1
    63.  
    64. dma_fill:                         ; already set REG#18,19,23
    65.         move.l   (a5)+,(a4)       ; dma fill(VDP_VRAM CLEAR)
    66.         move     d0,(a3)          ; fill data set $0,$C00000
    67.  
    68. z80_clr:                          ; Z80 self_initial
    69.         move     d7,(a1)          ; Z80_BUSREQ ON
    70.         move     d7,(a2)          ; Z80_RESET  OFF
    71. z801:   btst    d0,(a1)           ; Z80_BGACK  CHECK ?
    72.         bne.s    z801
    73.         moveq    #37,d2           ; D2 is Z80_program's size
    74. z802:   move.b    (a5)+,(a0)+     ; move.B (z80_prg)+,($a00000)+
    75.         dbra    d2,z802
    76.         move    d0,(a2)           ; Z80_RESET  ON
    77.         move    d0,(a1)           ; Z80_BUSREQ OFF
    78.         move    d7,(a2)           ; Z80_RESET  OFF(Z80 start)
    79.  
    80. clr_wk:                           ; A6=$0 D0=$0 D6=$3FFF
    81. c_wk1:  move.l    d0,-(a6)        ; wrok ram clear
    82.         dbra     d6,c_wk1         ;
    83.  
    84. clr_col move.l    (a5)+,(a4)      ; VDP REG#1=04,#15=02
    85.         move.l    (a5)+,(a4)      ; a3=$c00000 a4=$c00004 d0=$0
    86.         moveq    #$1f,d3          ; d3 is color_ram's size/2(WORD)
    87. c_col1: move.l    d0,(a3)         ; vdp_color clear
    88.         dbra    d3,c_col1
    89.  
    90. clr_vsc:
    91.         move.l    (a5)+,(a4)      ; a3=$c00000 a4=$c00004 d0=$0
    92.         moveq    #19,d4           ; d4 count Vscroll_ram
    93. c_vsc1: move.l    d0,(a3)         ; vdp_vscroll clear
    94.         dbra    d4,c_vsc1
    95.  
    96. clr_psg:
    97.         moveq    #3,d5            ; d5 is byte_size of PSG init_DATA
    98. c_psg1: move.b    (a5)+,$11(a3)   ; PSG_SOUND clear
    99.         dbra    d5,c_psg1
    100.  
    101.         move    d0,(a2)           ; Z80 RESET
    102.         movem.l    (a6),d0-d7/a0-a6; register all initial
    103.         move    #$2700,sr         ;68000 register initial
    104. hot_start:
    105.         bra.s    chk_vdp          ;
    106. init_end:
    107.  
    108. reg_set:
    109.     dw    $008000,$003fff,$000100               ;d5/d6/d7
    110.     dl    $a00000,$a11100,$a11200,$c00000       ;a0-a3
    111.     dl    $c00004                               ;a4
    112.  
    113. vreg_dt:
    114.     db    $04,$14,$30,$3c,$07,$6c,$00,$00       ;VDP REG #0-7
    115.     db    $00,$00,$ff,$00,$81,$37,$00,$01       ;VDP_REG #8-15
    116.     db    $01,$00,$00,$ff,$ff,$00,$00,$80       ;VDP_REG #16-23
    117. dma_fill_data:
    118.     dl    $40000080                             ;dma fill(VDP_VRAM clear)
    119.  
    120. z80_prg:
    121.     DB    $AF           ;XOR    A
    122.     DB    $01,$D9,$1F   ;LD     BC,1FD9H
    123.     DB    $11,$27,$00   ;LD     DE,0027H
    124.     DB    $21,$26,$00   ;LD     HL,0026H
    125.     DB    $F9           ;LD     SP,HL
    126.     DB    $77           ;LD     (HL),A
    127.     DB    $ED,$B0       ;LDIR
    128.     DB    $DD,$E1       ;POP    IX
    129.     DB    $FD,$E1       ;POP    IY
    130.     DB    $ED,$47       ;LD     I,A
    131.     DB    $ED,$4F       ;LD     R,A
    132.     DB    $D1           ;POP    DE
    133.     DB    $E1           ;POP    HL
    134.     DB    $F1           ;POP    AF
    135.     DB    $08           ;EX     AF,AF'
    136.     DB    $D9           ;EXX
    137.     DB    $C1           ;POP    BC
    138.     DB    $D1           ;POP    DE
    139.     DB    $E1           ;POP    HL
    140.     DB    $F1           ;POP    AF
    141.     DB    $F9           ;LD     SP,HL
    142.     DB    $F3           ;DI
    143.     DB    $ED,$56       ;IM1
    144.     DB    $36,$E9       ;LD     (HL),$E9='JP (HL)'
    145.     DB    $E9           ;JP     (HL)
    146. new_reg_data:
    147.     dl    $81048f02     ;VDP REG#1=04,#15=02
    148. clr_col_data:
    149.     dl    $c0000000     ;color_ram address data
    150. clr_vsc_data:
    151.     dl    $40000010     ;v_scroll ram address data
    152.  
    153. psg_dat:
    154.     DB    $9F,$BF,$DF,$FF;PSG initial data
    155.  
    156. chk_vdp:
    157.     tst    $c00004
    158. ICD_END:
    159.  
    160. 

    edit: TABS fixed
     
  2. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    1
    0
    Writing my own MD/Genesis sound driver :D
    What exactly is this part of?
     
  3. SegaLoco

    SegaLoco

    W)(at did you say? Banned
    I recognize this. It's from Barry Leitch's sound source code collection. http://gilgalad.arc-nova.org/nes-source/Barry%20Leitch/ I found this quite a while back while searching for official copies of ICD_BLK4, I just didn't think it was worth bringing up/brought it up and nobody cared. Anyway, have fun with the code in there, it's actually official game code iirc. :P (Games use GEMS btw for Genesis, so no SMPS official source code :<)